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
Hi, I'm working on a project, an SDK that can mainly integrated with React App, but we provided the vanilla JS feature and this is where AJV comes in, We want to validate the type of props/parameters that will be passed when the sdk is bundled into JS.
Main Problem: How to define a schema for a function property?
I've looked enough for some time to find a solution or sample for an object with function parameters, all I see is adding a keyword called "instanceof" and verifying if the property is an instance of a Function
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
-
Hi, I'm working on a project, an SDK that can mainly integrated with React App, but we provided the vanilla JS feature and this is where AJV comes in, We want to validate the type of props/parameters that will be passed when the sdk is bundled into JS.
Main Problem: How to define a schema for a function property?
I've looked enough for some time to find a solution or sample for an object with function parameters, all I see is adding a keyword called "instanceof" and verifying if the property is an instance of a Function
It just doesn't work. I tried to use the AJV's example here and just added a function property to test on a minimal code:
and it just returns
Can someone help me please?
Beta Was this translation helpful? Give feedback.
All reactions