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
When I type check({ a: 1, b: 2 }, Type.Object, it will suggest properties (a or b) and require both a and b properties.
But now I call check() with object { a: 1, b: 2 }, I want it will suggest properties (a or b) and require only a or b.
I fix function to
exportfunctioncheck<TextendsRecord<string,any>>(object: T,type: TObject<{[KinkeyofT]?: TString}>// throw error Type 'undefined' is not assignable to type 'TSchema'){console.log(object,type);}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have the function
When I type
check({ a: 1, b: 2 }, Type.Object
, it will suggest properties (a or b) and require botha
andb
properties.But now I call
check()
with object{ a: 1, b: 2 }
, I want it will suggest properties (a or b) and require onlya
orb
.I fix function to
How do I resolve it?
Beta Was this translation helpful? Give feedback.
All reactions