@@ -149,17 +149,17 @@ describe("updateValueAtPath", () => {
149
149
} ) ;
150
150
151
151
test ( "initializes an empty object when input is null/undefined and path starts with a string" , ( ) => {
152
- expect ( updateValueAtPath ( null as any , [ "foo" ] , "bar" ) ) . toEqual ( {
152
+ expect ( updateValueAtPath ( null , [ "foo" ] , "bar" ) ) . toEqual ( {
153
153
foo : "bar" ,
154
154
} ) ;
155
- expect ( updateValueAtPath ( undefined as any , [ "foo" ] , "bar" ) ) . toEqual ( {
155
+ expect ( updateValueAtPath ( undefined , [ "foo" ] , "bar" ) ) . toEqual ( {
156
156
foo : "bar" ,
157
157
} ) ;
158
158
} ) ;
159
159
160
160
test ( "initializes an empty array when input is null/undefined and path starts with a number" , ( ) => {
161
- expect ( updateValueAtPath ( null as any , [ "0" ] , "bar" ) ) . toEqual ( [ "bar" ] ) ;
162
- expect ( updateValueAtPath ( undefined as any , [ "0" ] , "bar" ) ) . toEqual ( [ "bar" ] ) ;
161
+ expect ( updateValueAtPath ( null , [ "0" ] , "bar" ) ) . toEqual ( [ "bar" ] ) ;
162
+ expect ( updateValueAtPath ( undefined , [ "0" ] , "bar" ) ) . toEqual ( [ "bar" ] ) ;
163
163
} ) ;
164
164
165
165
// Object update tests
@@ -293,10 +293,8 @@ describe("getValueAtPath", () => {
293
293
} ) ;
294
294
295
295
test ( "returns default value when input is null/undefined" , ( ) => {
296
- expect ( getValueAtPath ( null as any , [ "foo" ] , "default" ) ) . toBe ( "default" ) ;
297
- expect ( getValueAtPath ( undefined as any , [ "foo" ] , "default" ) ) . toBe (
298
- "default" ,
299
- ) ;
296
+ expect ( getValueAtPath ( null , [ "foo" ] , "default" ) ) . toBe ( "default" ) ;
297
+ expect ( getValueAtPath ( undefined , [ "foo" ] , "default" ) ) . toBe ( "default" ) ;
300
298
} ) ;
301
299
302
300
test ( "handles array indices correctly" , ( ) => {
0 commit comments