js.spec
js.spec copied to clipboard
clojure.spec for Javascript
Have you considered porting to Deno? Deno just hit 1.0; and I think this would be a well received tool. Thoughts?
``` const {spec, valid} = require('js.spec'); const dateRange = spec.map("dateRange", { startsFrom: spec.int, endsBefore: spec.int, }); const taskParams = spec.map("taskParams", { timezone: spec.string, dateRange, condition: spec.options, }); /* const schema...
One of the great features of `clojure.spec` is the ability of merging specs, because they are essentially data (ok macros are still in the way, but nothing is perfect). At...
Given js.spec is a node module, nobody is going to `` it into a browser directly. Instead they will use their own packaging toolchain to do so like browserfy or...
I'm using map() to spec classes that have fields but I am getting rejected because it eventually uses lodash's `isPlainObject()` does not like my class instance. I tracked it down...
Hello again, just logging here a potential improvement of the error message for `s.spec.number`. I have: ```javascript const school = s.spec.map("schoolSpec", { city: s.string }); const friend = s.spec.map("friendSpec", {...
Just opening this PR now to get some feedback. A quick question: what name did you want to use for `*` - I'm leaning towards `zeroOrMore` but that is quite...
js-spec.online has no docs for these two regex methods. They are exported from `spec` so they should be documented.
The docs for "or" look like this: or (name, ...specs) nr > 1000 })``` Perhaps or should be: or(name, {key1: spec, key2: spec...})