3 ms·
I made a very similar library but based on `json-schema`: https://github.com/franciscop/json-ok https://github.com/franciscop/json-ok import ok from 'json-
by franciscop 7y ago
I made a very similar library but based on `json-schema`: https://github.com/franciscop/json-ok https://github.com/franciscop/json-ok
import ok from 'json-ok';
ok(24, { type: "number" });
// No issue
ok(24, { type: "string" });
// throws ValidationError: is not of a type(s) string
I wanted to use `ok-json` as a tongue-in-cheek name, but apparently since there is already a library called `okjson` npm didn't allow me to use it.