StickyCube / ok-js

Javascript object property utility library
0 stars 0 forks source link

Add array list handling to check functions where compatible #4

Open KrezerJ opened 7 years ago

KrezerJ commented 7 years ago

If a programmer wants to check if a value is a number OR a string, a simple array could be passed to the check function.

Example: var it = ok.check(person, 'phone'); it.is.typeof(['string','number']);

Notes: typeof and kindof would support this. I'm not sure about equals. That would almost work better as additional function parameters.

KrezerJ commented 7 years ago

pulling value from arguments would be a better source for the OR type multiple entry. I assume AND can already be accomplished by chaining assertions.