File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ describe('transform', () => {
103103 assert . equal ( result , expected ) ;
104104 } ) ;
105105
106+
106107 it ( 'should handle storage with url handle' , ( ) => {
107108 const storeAlias = 'https://test.com/file.js' ;
108109
@@ -181,6 +182,13 @@ describe('transform', () => {
181182 assert . equal ( result , `${ cdnUrl } /store=filename:test.jpg,path:"test/path"/fakelink` )
182183 } ) ;
183184
185+ it ( 'should handle upper cased path' , ( ) => {
186+ const options = { filename : 'test.jpg' , path : 'tEsT/path' } ;
187+ const result = transform ( url , { store : options } ) ;
188+
189+ assert . equal ( result , `${ cdnUrl } /store=filename:test.jpg,path:"tEsT/path"/fakelink` )
190+ } ) ;
191+
184192
185193 describe ( 'blackwhite' , ( ) => {
186194 it ( 'should construct valid parameters' , ( ) => {
Original file line number Diff line number Diff line change @@ -494,11 +494,12 @@ const escapeValue = (value: any): any => {
494494 * @param options Transformation options
495495 */
496496export const transform = ( session : Session , url : string , options : TransformOptions = { } ) : string => {
497- options = toSnakeCase ( valuesToLowerCase ( options ) ) ;
497+ options = toSnakeCase ( options ) ;
498498
499499 const validate = getValidator ( TransformSchema ) ;
500500
501- if ( ! validate ( options ) ) {
501+ // use lower case only for validation
502+ if ( ! validate ( valuesToLowerCase ( JSON . parse ( JSON . stringify ( options ) ) ) ) ) {
502503 throw new FilestackError ( 'Validation error' , validate . errors ) ;
503504 }
504505
You can’t perform that action at this time.
0 commit comments