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
The types type the key and value arguments as keys and values of the passed root object, but when passing { deep: true }, my understanding is these could be deeply nested keys and values (i.e. key: string and value: unknown)
The text was updated successfully, but these errors were encountered:
constinput={foo: {bar: 'baz'},hello: 'world'}constoutput=mapObject(input,(key,value)=>// args with `{deep: true}` shouldn't use `keyof`. In this case `keyof input` is `'"foo" | "hello"'`// @ts-expect-errorkey==='bar' ? mapObjectSkip : [key,value],{deep: true},)expect(output).toStrictEqual({foo: {},hello: 'world'})
Without the expect-error:
This condition will always return 'false' since the types '"foo" | "hello"' and '"bar"' have no overlap.
The types type the
key
andvalue
arguments as keys and values of the passed root object, but when passing{ deep: true }
, my understanding is these could be deeply nested keys and values (i.e.key: string
andvalue: unknown
)The text was updated successfully, but these errors were encountered: