You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 8, 2021. It is now read-only.
it('should return undefined on non existing optional field',()=>{
33
+
constresult=get(inputOptionalsMissing,it=>it!.b!.nested)// Here is wrong typings, it's string | null | undefined, where is should be only string | undefined
34
+
expect(result).toBeUndefined()
35
+
})
36
+
it('should return defaultValue on non existing optional field',()=>{
constresult3=get(inputOptionalsMissing,it=>it!.b!.nested)// Here is wrong typings, it's string | null | undefined, where is should be only string | undefined
it('should return undefined and default value in case of null (different from _.get)',function(){
64
+
constinputWithNull: InputType={
65
+
a: 'Value',
66
+
b: {
67
+
nested: null,
68
+
},
69
+
}
70
+
constdefaultedNull=get(// Here is wrong typings, it's string | null, but it says string
71
+
inputOptionalsMissing,
72
+
it=>it!.b!.nested,
73
+
null,
74
+
)
75
+
expect(defaultedNull).toBe(null)
76
+
77
+
constundefinedFromNullValue=get(inputWithNull,it=>it!.b!.nested)// Here is wrong typings, it's string | null | undefined, where is should be only string | undefined
0 commit comments