fsevents 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of fsevents might be problematic. Click here for more details.
- package/Readme.md +12 -13
- package/node_modules/ansi/package.json +1 -2
- package/node_modules/are-we-there-yet/package.json +1 -2
- package/node_modules/asn1/.travis.yml +4 -0
- package/node_modules/asn1/lib/ber/reader.js +27 -33
- package/node_modules/asn1/lib/ber/writer.js +10 -11
- package/node_modules/asn1/package.json +21 -19
- package/node_modules/asn1/tst/ber/reader.test.js +36 -0
- package/node_modules/asn1/tst/ber/writer.test.js +74 -0
- package/node_modules/assert-plus/package.json +1 -0
- package/node_modules/{ctype → bl/node_modules/readable-stream/node_modules/core-util-is}/LICENSE +1 -6
- package/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js +11 -11
- package/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json +17 -12
- package/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/test.js +68 -0
- package/node_modules/boom/package.json +1 -1
- package/node_modules/commander/package.json +1 -1
- package/node_modules/core-util-is/LICENSE +19 -0
- package/node_modules/core-util-is/lib/util.js +11 -11
- package/node_modules/core-util-is/package.json +17 -12
- package/node_modules/core-util-is/test.js +68 -0
- package/node_modules/dashdash/README.md +508 -0
- package/node_modules/dashdash/lib/dashdash.js +813 -0
- package/node_modules/dashdash/package.json +87 -0
- package/node_modules/deep-extend/LICENSE +1 -1
- package/node_modules/deep-extend/README.md +89 -52
- package/node_modules/deep-extend/index.js +1 -90
- package/node_modules/deep-extend/lib/deep-extend.js +144 -0
- package/node_modules/deep-extend/package.json +47 -16
- package/node_modules/deep-extend/test/index.spec.js +168 -5
- package/node_modules/delegates/package.json +1 -2
- package/node_modules/ecc-jsbn/.npmignore +15 -0
- package/node_modules/ecc-jsbn/LICENSE +21 -0
- package/node_modules/ecc-jsbn/README.md +8 -0
- package/node_modules/ecc-jsbn/index.js +57 -0
- package/node_modules/ecc-jsbn/lib/LICENSE-jsbn +40 -0
- package/node_modules/ecc-jsbn/lib/ec.js +561 -0
- package/node_modules/ecc-jsbn/lib/sec.js +170 -0
- package/node_modules/ecc-jsbn/package.json +63 -0
- package/node_modules/ecc-jsbn/test.js +14 -0
- package/node_modules/extsprintf/.gitmodules +6 -0
- package/node_modules/{path-is-absolute/license → extsprintf/LICENSE} +2 -4
- package/node_modules/extsprintf/Makefile +23 -0
- package/node_modules/extsprintf/Makefile.deps +39 -0
- package/node_modules/extsprintf/Makefile.targ +285 -0
- package/node_modules/extsprintf/README.md +39 -0
- package/node_modules/extsprintf/examples/simple.js +2 -0
- package/node_modules/{ctype/tools/jsl.conf → extsprintf/jsl.node.conf} +71 -63
- package/node_modules/extsprintf/lib/extsprintf.js +166 -0
- package/node_modules/extsprintf/package.json +48 -0
- package/node_modules/fstream/package.json +1 -2
- package/node_modules/{balanced-match → fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match}/package.json +4 -22
- package/node_modules/{concat-map → fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map}/package.json +3 -21
- package/node_modules/{brace-expansion → fstream-ignore/node_modules/minimatch/node_modules/brace-expansion}/package.json +4 -23
- package/node_modules/fstream-ignore/node_modules/minimatch/package.json +4 -24
- package/node_modules/fstream-ignore/package.json +1 -2
- package/node_modules/gauge/package.json +1 -2
- package/node_modules/har-validator/package.json +15 -15
- package/node_modules/has-unicode/package.json +1 -2
- package/node_modules/hawk/dist/client.js +340 -0
- package/node_modules/hawk/lib/browser.js +14 -20
- package/node_modules/hawk/package.json +10 -10
- package/node_modules/hawk/test/browser.js +134 -101
- package/node_modules/hawk/test/index.js +61 -61
- package/node_modules/hawk/test/server.js +72 -84
- package/node_modules/hawk/test/uri.js +52 -63
- package/node_modules/http-signature/CHANGES.md +39 -0
- package/node_modules/http-signature/http_signing.md +16 -17
- package/node_modules/http-signature/lib/index.js +6 -4
- package/node_modules/http-signature/lib/parser.js +43 -29
- package/node_modules/http-signature/lib/signer.js +290 -74
- package/node_modules/http-signature/lib/utils.js +112 -0
- package/node_modules/http-signature/lib/verify.js +47 -15
- package/node_modules/http-signature/package.json +20 -14
- package/node_modules/is-my-json-valid/index.js +16 -14
- package/node_modules/is-my-json-valid/package.json +16 -12
- package/node_modules/is-typedarray/LICENSE.md +18 -0
- package/node_modules/is-typedarray/README.md +16 -0
- package/node_modules/is-typedarray/index.js +41 -0
- package/node_modules/is-typedarray/package.json +63 -0
- package/node_modules/is-typedarray/test.js +34 -0
- package/node_modules/jodid25519/.npmignore +11 -0
- package/node_modules/jodid25519/.travis.yml +7 -0
- package/node_modules/jodid25519/AUTHORS.md +3 -0
- package/node_modules/jodid25519/LICENSE +23 -0
- package/node_modules/jodid25519/README.md +51 -0
- package/node_modules/jodid25519/almond.0 +42 -0
- package/node_modules/jodid25519/almond.1 +13 -0
- package/node_modules/jodid25519/index.js +35 -0
- package/node_modules/jodid25519/jsdoc.json +19 -0
- package/node_modules/jodid25519/lib/core.js +481 -0
- package/node_modules/jodid25519/lib/curve255.js +221 -0
- package/node_modules/jodid25519/lib/dh.js +111 -0
- package/node_modules/jodid25519/lib/eddsa.js +573 -0
- package/node_modules/jodid25519/lib/utils.js +198 -0
- package/node_modules/jodid25519/package.json +77 -0
- package/node_modules/jsbn/.npmignore +2 -0
- package/node_modules/jsbn/LICENSE +40 -0
- package/node_modules/jsbn/README.md +175 -0
- package/node_modules/jsbn/example.html +12 -0
- package/node_modules/jsbn/example.js +3 -0
- package/node_modules/jsbn/index.js +1358 -0
- package/node_modules/jsbn/package.json +60 -0
- package/node_modules/json-schema/README.md +5 -0
- package/node_modules/json-schema/draft-00/hyper-schema +68 -0
- package/node_modules/json-schema/draft-00/json-ref +26 -0
- package/node_modules/json-schema/draft-00/links +33 -0
- package/node_modules/json-schema/draft-00/schema +155 -0
- package/node_modules/json-schema/draft-01/hyper-schema +68 -0
- package/node_modules/json-schema/draft-01/json-ref +26 -0
- package/node_modules/json-schema/draft-01/links +33 -0
- package/node_modules/json-schema/draft-01/schema +155 -0
- package/node_modules/json-schema/draft-02/hyper-schema +68 -0
- package/node_modules/json-schema/draft-02/json-ref +26 -0
- package/node_modules/json-schema/draft-02/links +35 -0
- package/node_modules/json-schema/draft-02/schema +166 -0
- package/node_modules/json-schema/draft-03/examples/address +20 -0
- package/node_modules/json-schema/draft-03/examples/calendar +53 -0
- package/node_modules/json-schema/draft-03/examples/card +105 -0
- package/node_modules/json-schema/draft-03/examples/geo +8 -0
- package/node_modules/json-schema/draft-03/examples/interfaces +23 -0
- package/node_modules/json-schema/draft-03/hyper-schema +60 -0
- package/node_modules/json-schema/draft-03/json-ref +26 -0
- package/node_modules/json-schema/draft-03/links +35 -0
- package/node_modules/json-schema/draft-03/schema +174 -0
- package/node_modules/json-schema/draft-04/hyper-schema +60 -0
- package/node_modules/json-schema/draft-04/links +41 -0
- package/node_modules/json-schema/draft-04/schema +189 -0
- package/node_modules/json-schema/draft-zyp-json-schema-03.xml +1120 -0
- package/node_modules/json-schema/draft-zyp-json-schema-04.xml +1072 -0
- package/node_modules/json-schema/lib/links.js +52 -0
- package/node_modules/json-schema/lib/validate.js +260 -0
- package/node_modules/json-schema/package.json +67 -0
- package/node_modules/json-schema/test/tests.js +95 -0
- package/node_modules/jsprim/CHANGES.md +30 -0
- package/node_modules/jsprim/LICENSE +19 -0
- package/node_modules/jsprim/README.md +228 -0
- package/node_modules/jsprim/lib/jsprim.js +478 -0
- package/node_modules/jsprim/package.json +54 -0
- package/node_modules/lodash._basetostring/package.json +1 -2
- package/node_modules/lodash._createpadding/package.json +1 -2
- package/node_modules/lodash.pad/package.json +1 -2
- package/node_modules/lodash.padleft/package.json +1 -2
- package/node_modules/lodash.padright/package.json +1 -2
- package/node_modules/lodash.repeat/package.json +1 -2
- package/node_modules/node-pre-gyp/CHANGELOG.md +8 -0
- package/node_modules/node-pre-gyp/README.md +570 -0
- package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +4 -0
- package/node_modules/node-pre-gyp/node_modules/nopt/lib/nopt.js +2 -1
- package/node_modules/{abbrev → node-pre-gyp/node_modules/nopt/node_modules/abbrev}/package.json +30 -37
- package/node_modules/node-pre-gyp/node_modules/nopt/package.json +37 -57
- package/node_modules/node-pre-gyp/node_modules/nopt/test/basic.js +22 -0
- package/node_modules/node-pre-gyp/package.json +17 -17
- package/node_modules/node-uuid/.npmignore +2 -0
- package/node_modules/node-uuid/README.md +12 -1
- package/node_modules/node-uuid/bower.json +1 -1
- package/node_modules/node-uuid/component.json +11 -4
- package/node_modules/node-uuid/package.json +25 -12
- package/node_modules/node-uuid/test/test.js +3 -0
- package/node_modules/node-uuid/uuid.js +70 -45
- package/node_modules/npmlog/.travis.yml +14 -0
- package/node_modules/npmlog/log.js +3 -0
- package/node_modules/npmlog/package.json +23 -20
- package/node_modules/npmlog/test/basic.js +8 -1
- package/node_modules/once/package.json +2 -3
- package/node_modules/pinkie/index.js +23 -7
- package/node_modules/pinkie/package.json +22 -15
- package/node_modules/pinkie/readme.md +17 -9
- package/node_modules/pinkie-promise/package.json +16 -14
- package/node_modules/pinkie-promise/readme.md +5 -3
- package/node_modules/rc/README.md +1 -1
- package/node_modules/rc/index.js +1 -1
- package/node_modules/rc/node_modules/minimist/package.json +1 -1
- package/node_modules/rc/package.json +12 -12
- package/node_modules/request/.eslintrc +1 -1
- package/node_modules/request/.travis.yml +4 -4
- package/node_modules/request/CHANGELOG.md +25 -0
- package/node_modules/request/README.md +12 -13
- package/node_modules/request/lib/har.js +84 -75
- package/node_modules/request/lib/redirect.js +2 -3
- package/node_modules/request/lib/tunnel.js +13 -18
- package/node_modules/request/package.json +17 -16
- package/node_modules/request/request.js +16 -59
- package/node_modules/rimraf/README.md +7 -2
- package/node_modules/{wrappy → rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy}/package.json +5 -25
- package/node_modules/{inflight → rimraf/node_modules/glob/node_modules/inflight}/package.json +5 -25
- package/node_modules/rimraf/node_modules/glob/node_modules/inherits/LICENSE +16 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/inherits/README.md +42 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/inherits/inherits.js +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/inherits/inherits_browser.js +23 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/inherits/package.json +58 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/inherits/test.js +25 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +3 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +122 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +8 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +191 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +2 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml +3 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md +21 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +6 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +80 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +5 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +38 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +79 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +56 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml +4 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE +18 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown +62 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js +6 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js +13 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +90 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js +39 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +81 -0
- package/node_modules/rimraf/node_modules/{minimatch → glob/node_modules/minimatch}/package.json +3 -21
- package/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/README.md +36 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/package.json +58 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js +51 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js +33 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/once/package.json +70 -0
- package/node_modules/{path-is-absolute → rimraf/node_modules/glob/node_modules/path-is-absolute}/package.json +4 -22
- package/node_modules/rimraf/node_modules/glob/package.json +2 -20
- package/node_modules/rimraf/package.json +10 -10
- package/node_modules/semver/README.md +25 -1
- package/node_modules/semver/package.json +10 -10
- package/node_modules/semver/range.bnf +16 -0
- package/node_modules/semver/semver.js +0 -12
- package/node_modules/sshpk/.npmignore +8 -0
- package/node_modules/sshpk/.travis.yml +11 -0
- package/node_modules/sshpk/LICENSE +18 -0
- package/node_modules/sshpk/README.md +436 -0
- package/node_modules/sshpk/bin/sshpk-conv +183 -0
- package/node_modules/sshpk/lib/algs.js +168 -0
- package/node_modules/sshpk/lib/dhe.js +312 -0
- package/node_modules/sshpk/lib/ed-compat.js +94 -0
- package/node_modules/sshpk/lib/errors.js +58 -0
- package/node_modules/sshpk/lib/fingerprint.js +140 -0
- package/node_modules/sshpk/lib/formats/auto.js +73 -0
- package/node_modules/sshpk/lib/formats/pem.js +152 -0
- package/node_modules/sshpk/lib/formats/pkcs1.js +320 -0
- package/node_modules/sshpk/lib/formats/pkcs8.js +510 -0
- package/node_modules/sshpk/lib/formats/rfc4253.js +145 -0
- package/node_modules/sshpk/lib/formats/ssh-private.js +138 -0
- package/node_modules/sshpk/lib/formats/ssh.js +114 -0
- package/node_modules/sshpk/lib/index.js +25 -0
- package/node_modules/sshpk/lib/key.js +260 -0
- package/node_modules/sshpk/lib/private-key.js +224 -0
- package/node_modules/sshpk/lib/signature.js +237 -0
- package/node_modules/sshpk/lib/ssh-buffer.js +123 -0
- package/node_modules/sshpk/lib/utils.js +207 -0
- package/node_modules/sshpk/node_modules/assert-plus/AUTHORS +6 -0
- package/node_modules/sshpk/node_modules/assert-plus/CHANGES.md +8 -0
- package/node_modules/sshpk/node_modules/assert-plus/README.md +155 -0
- package/node_modules/sshpk/node_modules/assert-plus/assert.js +206 -0
- package/node_modules/sshpk/node_modules/assert-plus/package.json +88 -0
- package/node_modules/sshpk/package.json +92 -0
- package/node_modules/strip-json-comments/cli.js +2 -2
- package/node_modules/strip-json-comments/package.json +13 -12
- package/node_modules/strip-json-comments/readme.md +11 -5
- package/node_modules/strip-json-comments/strip-json-comments.js +16 -7
- package/node_modules/tar/package.json +1 -2
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/core-util-is/LICENSE +19 -0
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/core-util-is/lib/util.js +11 -11
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/core-util-is/package.json +17 -12
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/core-util-is/test.js +68 -0
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/inherits/package.json +1 -1
- package/node_modules/tar-pack/node_modules/rimraf/package.json +1 -2
- package/node_modules/tar-pack/package.json +1 -2
- package/node_modules/tough-cookie/lib/cookie.js +1 -1
- package/node_modules/tough-cookie/package.json +7 -7
- package/node_modules/tweetnacl/.npmignore +4 -0
- package/node_modules/tweetnacl/CHANGELOG.md +128 -0
- package/node_modules/tweetnacl/README.md +463 -0
- package/node_modules/tweetnacl/nacl-fast.js +2418 -0
- package/node_modules/tweetnacl/nacl-fast.min.js +2 -0
- package/node_modules/tweetnacl/nacl.js +1205 -0
- package/node_modules/tweetnacl/nacl.min.js +1 -0
- package/node_modules/tweetnacl/package.json +101 -0
- package/node_modules/uid-number/package.json +2 -3
- package/node_modules/verror/.gitmodules +0 -0
- package/node_modules/verror/LICENSE +19 -0
- package/node_modules/verror/Makefile +35 -0
- package/node_modules/verror/Makefile.targ +285 -0
- package/node_modules/verror/README.md +120 -0
- package/node_modules/verror/examples/levels-verror.js +36 -0
- package/node_modules/verror/examples/levels-werror.js +34 -0
- package/node_modules/verror/examples/varargs.js +6 -0
- package/node_modules/verror/examples/verror.js +13 -0
- package/node_modules/verror/examples/werror.js +14 -0
- package/node_modules/verror/jsl.node.conf +139 -0
- package/node_modules/verror/lib/verror.js +157 -0
- package/node_modules/verror/package.json +51 -0
- package/node_modules/verror/tests/tst.inherit.js +100 -0
- package/node_modules/verror/tests/tst.verror.js +156 -0
- package/node_modules/verror/tests/tst.werror.js +179 -0
- package/package.json +3 -3
- package/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js +0 -106
- package/node_modules/core-util-is/util.js +0 -106
- package/node_modules/ctype/.npmignore +0 -1
- package/node_modules/ctype/CHANGELOG +0 -78
- package/node_modules/ctype/README +0 -82
- package/node_modules/ctype/README.old +0 -298
- package/node_modules/ctype/ctf.js +0 -245
- package/node_modules/ctype/ctio.js +0 -1485
- package/node_modules/ctype/ctype.js +0 -944
- package/node_modules/ctype/man/man3ctype/ctio.3ctype +0 -241
- package/node_modules/ctype/package.json +0 -51
- package/node_modules/ctype/tools/jsstyle +0 -839
- package/node_modules/http-signature/lib/util.js +0 -306
- package/node_modules/inflight/node_modules/once/package.json +0 -86
- package/node_modules/inflight/node_modules/once/test/once.js +0 -23
- package/node_modules/rimraf/node_modules/glob/LICENSE +0 -15
- package/node_modules/rimraf/node_modules/minimatch/LICENSE +0 -15
- package/node_modules/rimraf/node_modules/once/LICENSE +0 -15
- package/node_modules/rimraf/node_modules/once/README.md +0 -51
- package/node_modules/rimraf/node_modules/once/once.js +0 -21
- package/node_modules/rimraf/node_modules/once/package.json +0 -84
- package/node_modules/rimraf/node_modules/once/test/once.js +0 -23
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/core-util-is/util.js +0 -106
- package/node_modules/wrappy/LICENSE +0 -15
- /package/node_modules/{brace-expansion → fstream-ignore/node_modules/minimatch/node_modules/brace-expansion}/.npmignore +0 -0
- /package/node_modules/{brace-expansion → fstream-ignore/node_modules/minimatch/node_modules/brace-expansion}/README.md +0 -0
- /package/node_modules/{brace-expansion → fstream-ignore/node_modules/minimatch/node_modules/brace-expansion}/example.js +0 -0
- /package/node_modules/{brace-expansion → fstream-ignore/node_modules/minimatch/node_modules/brace-expansion}/index.js +0 -0
- /package/node_modules/{balanced-match → fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match}/.npmignore +0 -0
- /package/node_modules/{balanced-match → fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match}/.travis.yml +0 -0
- /package/node_modules/{balanced-match → fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match}/LICENSE.md +0 -0
- /package/node_modules/{balanced-match → fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match}/Makefile +0 -0
- /package/node_modules/{balanced-match → fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match}/README.md +0 -0
- /package/node_modules/{balanced-match → fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match}/example.js +0 -0
- /package/node_modules/{balanced-match → fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match}/index.js +0 -0
- /package/node_modules/{balanced-match → fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match}/test/balanced.js +0 -0
- /package/node_modules/{concat-map → fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map}/.travis.yml +0 -0
- /package/node_modules/{concat-map → fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map}/LICENSE +0 -0
- /package/node_modules/{concat-map → fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map}/README.markdown +0 -0
- /package/node_modules/{concat-map → fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map}/example/map.js +0 -0
- /package/node_modules/{concat-map → fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map}/index.js +0 -0
- /package/node_modules/{concat-map → fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map}/test/map.js +0 -0
- /package/node_modules/{abbrev → node-pre-gyp/node_modules/nopt/node_modules/abbrev}/.npmignore +0 -0
- /package/node_modules/{abbrev → node-pre-gyp/node_modules/nopt/node_modules/abbrev}/.travis.yml +0 -0
- /package/node_modules/{abbrev → node-pre-gyp/node_modules/nopt/node_modules/abbrev}/CONTRIBUTING.md +0 -0
- /package/node_modules/{abbrev → node-pre-gyp/node_modules/nopt/node_modules/abbrev}/LICENSE +0 -0
- /package/node_modules/{abbrev → node-pre-gyp/node_modules/nopt/node_modules/abbrev}/README.md +0 -0
- /package/node_modules/{abbrev → node-pre-gyp/node_modules/nopt/node_modules/abbrev}/abbrev.js +0 -0
- /package/node_modules/{abbrev → node-pre-gyp/node_modules/nopt/node_modules/abbrev}/test.js +0 -0
- /package/node_modules/{inflight → rimraf/node_modules/glob/node_modules/inflight}/.eslintrc +0 -0
- /package/node_modules/{inflight → rimraf/node_modules/glob/node_modules/inflight}/LICENSE +0 -0
- /package/node_modules/{inflight → rimraf/node_modules/glob/node_modules/inflight}/README.md +0 -0
- /package/node_modules/{inflight → rimraf/node_modules/glob/node_modules/inflight}/inflight.js +0 -0
- /package/node_modules/{fstream-ignore/node_modules/minimatch → rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy}/LICENSE +0 -0
- /package/node_modules/{wrappy → rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy}/README.md +0 -0
- /package/node_modules/{wrappy → rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy}/test/basic.js +0 -0
- /package/node_modules/{wrappy → rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy}/wrappy.js +0 -0
- /package/node_modules/{inflight → rimraf/node_modules/glob/node_modules/inflight}/test.js +0 -0
- /package/node_modules/rimraf/node_modules/{minimatch → glob/node_modules/minimatch}/README.md +0 -0
- /package/node_modules/rimraf/node_modules/{minimatch → glob/node_modules/minimatch}/minimatch.js +0 -0
- /package/node_modules/{inflight → rimraf/node_modules/glob}/node_modules/once/README.md +0 -0
- /package/node_modules/{inflight/node_modules/once → rimraf/node_modules/glob/node_modules/once/node_modules/wrappy}/LICENSE +0 -0
- /package/node_modules/{inflight → rimraf/node_modules/glob}/node_modules/once/once.js +0 -0
- /package/node_modules/{path-is-absolute → rimraf/node_modules/glob/node_modules/path-is-absolute}/index.js +0 -0
- /package/node_modules/{path-is-absolute → rimraf/node_modules/glob/node_modules/path-is-absolute}/readme.md +0 -0
- /package/node_modules/{deep-extend → verror}/.npmignore +0 -0
@@ -0,0 +1,52 @@
|
|
1
|
+
/**
|
2
|
+
* JSON Schema link handler
|
3
|
+
* Copyright (c) 2007 Kris Zyp SitePen (www.sitepen.com)
|
4
|
+
* Licensed under the MIT (MIT-LICENSE.txt) license.
|
5
|
+
*/
|
6
|
+
({define:typeof define!="undefined"?define:function(deps, factory){module.exports = factory();}}).
|
7
|
+
define([], function(){
|
8
|
+
var exports = {};
|
9
|
+
exports.cacheLinks = true;
|
10
|
+
exports.getLink = function(relation, instance, schema){
|
11
|
+
// gets the URI of the link for the given relation based on the instance and schema
|
12
|
+
// for example:
|
13
|
+
// getLink(
|
14
|
+
// "brother",
|
15
|
+
// {"brother_id":33},
|
16
|
+
// {links:[{rel:"brother", href:"Brother/{brother_id}"}]}) ->
|
17
|
+
// "Brother/33"
|
18
|
+
var links = schema.__linkTemplates;
|
19
|
+
if(!links){
|
20
|
+
links = {};
|
21
|
+
var schemaLinks = schema.links;
|
22
|
+
if(schemaLinks && schemaLinks instanceof Array){
|
23
|
+
schemaLinks.forEach(function(link){
|
24
|
+
/* // TODO: allow for multiple same-name relations
|
25
|
+
if(links[link.rel]){
|
26
|
+
if(!(links[link.rel] instanceof Array)){
|
27
|
+
links[link.rel] = [links[link.rel]];
|
28
|
+
}
|
29
|
+
}*/
|
30
|
+
links[link.rel] = link.href;
|
31
|
+
});
|
32
|
+
}
|
33
|
+
if(exports.cacheLinks){
|
34
|
+
schema.__linkTemplates = links;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
var linkTemplate = links[relation];
|
38
|
+
return linkTemplate && exports.substitute(linkTemplate, instance);
|
39
|
+
};
|
40
|
+
|
41
|
+
exports.substitute = function(linkTemplate, instance){
|
42
|
+
return linkTemplate.replace(/\{([^\}]*)\}/g, function(t, property){
|
43
|
+
var value = instance[decodeURIComponent(property)];
|
44
|
+
if(value instanceof Array){
|
45
|
+
// the value is an array, it should produce a URI like /Table/(4,5,8) and store.get() should handle that as an array of values
|
46
|
+
return '(' + value.join(',') + ')';
|
47
|
+
}
|
48
|
+
return value;
|
49
|
+
});
|
50
|
+
};
|
51
|
+
return exports;
|
52
|
+
});
|
@@ -0,0 +1,260 @@
|
|
1
|
+
/**
|
2
|
+
* JSONSchema Validator - Validates JavaScript objects using JSON Schemas
|
3
|
+
* (http://www.json.com/json-schema-proposal/)
|
4
|
+
*
|
5
|
+
* Copyright (c) 2007 Kris Zyp SitePen (www.sitepen.com)
|
6
|
+
* Licensed under the MIT (MIT-LICENSE.txt) license.
|
7
|
+
To use the validator call the validate function with an instance object and an optional schema object.
|
8
|
+
If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating),
|
9
|
+
that schema will be used to validate and the schema parameter is not necessary (if both exist,
|
10
|
+
both validations will occur).
|
11
|
+
The validate method will return an array of validation errors. If there are no errors, then an
|
12
|
+
empty list will be returned. A validation error will have two properties:
|
13
|
+
"property" which indicates which property had the error
|
14
|
+
"message" which indicates what the error was
|
15
|
+
*/
|
16
|
+
({define:typeof define!="undefined"?define:function(deps, factory){module.exports = factory();}}).
|
17
|
+
define([], function(){
|
18
|
+
var exports = validate;
|
19
|
+
// setup primitive classes to be JSON Schema types
|
20
|
+
exports.Integer = {type:"integer"};
|
21
|
+
var primitiveConstructors = {
|
22
|
+
String: String,
|
23
|
+
Boolean: Boolean,
|
24
|
+
Number: Number,
|
25
|
+
Object: Object,
|
26
|
+
Array: Array,
|
27
|
+
Date: Date
|
28
|
+
}
|
29
|
+
exports.validate = validate;
|
30
|
+
function validate(/*Any*/instance,/*Object*/schema) {
|
31
|
+
// Summary:
|
32
|
+
// To use the validator call JSONSchema.validate with an instance object and an optional schema object.
|
33
|
+
// If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating),
|
34
|
+
// that schema will be used to validate and the schema parameter is not necessary (if both exist,
|
35
|
+
// both validations will occur).
|
36
|
+
// The validate method will return an object with two properties:
|
37
|
+
// valid: A boolean indicating if the instance is valid by the schema
|
38
|
+
// errors: An array of validation errors. If there are no errors, then an
|
39
|
+
// empty list will be returned. A validation error will have two properties:
|
40
|
+
// property: which indicates which property had the error
|
41
|
+
// message: which indicates what the error was
|
42
|
+
//
|
43
|
+
return validate(instance, schema, {changing: false});//, coerce: false, existingOnly: false});
|
44
|
+
};
|
45
|
+
exports.checkPropertyChange = function(/*Any*/value,/*Object*/schema, /*String*/property) {
|
46
|
+
// Summary:
|
47
|
+
// The checkPropertyChange method will check to see if an value can legally be in property with the given schema
|
48
|
+
// This is slightly different than the validate method in that it will fail if the schema is readonly and it will
|
49
|
+
// not check for self-validation, it is assumed that the passed in value is already internally valid.
|
50
|
+
// The checkPropertyChange method will return the same object type as validate, see JSONSchema.validate for
|
51
|
+
// information.
|
52
|
+
//
|
53
|
+
return validate(value, schema, {changing: property || "property"});
|
54
|
+
};
|
55
|
+
var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*Object*/options) {
|
56
|
+
|
57
|
+
if (!options) options = {};
|
58
|
+
var _changing = options.changing;
|
59
|
+
|
60
|
+
function getType(schema){
|
61
|
+
return schema.type || (primitiveConstructors[schema.name] == schema && schema.name.toLowerCase());
|
62
|
+
}
|
63
|
+
var errors = [];
|
64
|
+
// validate a value against a property definition
|
65
|
+
function checkProp(value, schema, path,i){
|
66
|
+
|
67
|
+
var l;
|
68
|
+
path += path ? typeof i == 'number' ? '[' + i + ']' : typeof i == 'undefined' ? '' : '.' + i : i;
|
69
|
+
function addError(message){
|
70
|
+
errors.push({property:path,message:message});
|
71
|
+
}
|
72
|
+
|
73
|
+
if((typeof schema != 'object' || schema instanceof Array) && (path || typeof schema != 'function') && !(schema && getType(schema))){
|
74
|
+
if(typeof schema == 'function'){
|
75
|
+
if(!(value instanceof schema)){
|
76
|
+
addError("is not an instance of the class/constructor " + schema.name);
|
77
|
+
}
|
78
|
+
}else if(schema){
|
79
|
+
addError("Invalid schema/property definition " + schema);
|
80
|
+
}
|
81
|
+
return null;
|
82
|
+
}
|
83
|
+
if(_changing && schema.readonly){
|
84
|
+
addError("is a readonly field, it can not be changed");
|
85
|
+
}
|
86
|
+
if(schema['extends']){ // if it extends another schema, it must pass that schema as well
|
87
|
+
checkProp(value,schema['extends'],path,i);
|
88
|
+
}
|
89
|
+
// validate a value against a type definition
|
90
|
+
function checkType(type,value){
|
91
|
+
if(type){
|
92
|
+
if(typeof type == 'string' && type != 'any' &&
|
93
|
+
(type == 'null' ? value !== null : typeof value != type) &&
|
94
|
+
!(value instanceof Array && type == 'array') &&
|
95
|
+
!(value instanceof Date && type == 'date') &&
|
96
|
+
!(type == 'integer' && value%1===0)){
|
97
|
+
return [{property:path,message:(typeof value) + " value found, but a " + type + " is required"}];
|
98
|
+
}
|
99
|
+
if(type instanceof Array){
|
100
|
+
var unionErrors=[];
|
101
|
+
for(var j = 0; j < type.length; j++){ // a union type
|
102
|
+
if(!(unionErrors=checkType(type[j],value)).length){
|
103
|
+
break;
|
104
|
+
}
|
105
|
+
}
|
106
|
+
if(unionErrors.length){
|
107
|
+
return unionErrors;
|
108
|
+
}
|
109
|
+
}else if(typeof type == 'object'){
|
110
|
+
var priorErrors = errors;
|
111
|
+
errors = [];
|
112
|
+
checkProp(value,type,path);
|
113
|
+
var theseErrors = errors;
|
114
|
+
errors = priorErrors;
|
115
|
+
return theseErrors;
|
116
|
+
}
|
117
|
+
}
|
118
|
+
return [];
|
119
|
+
}
|
120
|
+
if(value === undefined){
|
121
|
+
if(schema.required){
|
122
|
+
addError("is missing and it is required");
|
123
|
+
}
|
124
|
+
}else{
|
125
|
+
errors = errors.concat(checkType(getType(schema),value));
|
126
|
+
if(schema.disallow && !checkType(schema.disallow,value).length){
|
127
|
+
addError(" disallowed value was matched");
|
128
|
+
}
|
129
|
+
if(value !== null){
|
130
|
+
if(value instanceof Array){
|
131
|
+
if(schema.items){
|
132
|
+
var itemsIsArray = schema.items instanceof Array;
|
133
|
+
var propDef = schema.items;
|
134
|
+
for (i = 0, l = value.length; i < l; i += 1) {
|
135
|
+
if (itemsIsArray)
|
136
|
+
propDef = schema.items[i];
|
137
|
+
if (options.coerce)
|
138
|
+
value[i] = options.coerce(value[i], propDef);
|
139
|
+
errors.concat(checkProp(value[i],propDef,path,i));
|
140
|
+
}
|
141
|
+
}
|
142
|
+
if(schema.minItems && value.length < schema.minItems){
|
143
|
+
addError("There must be a minimum of " + schema.minItems + " in the array");
|
144
|
+
}
|
145
|
+
if(schema.maxItems && value.length > schema.maxItems){
|
146
|
+
addError("There must be a maximum of " + schema.maxItems + " in the array");
|
147
|
+
}
|
148
|
+
}else if(schema.properties || schema.additionalProperties){
|
149
|
+
errors.concat(checkObj(value, schema.properties, path, schema.additionalProperties));
|
150
|
+
}
|
151
|
+
if(schema.pattern && typeof value == 'string' && !value.match(schema.pattern)){
|
152
|
+
addError("does not match the regex pattern " + schema.pattern);
|
153
|
+
}
|
154
|
+
if(schema.maxLength && typeof value == 'string' && value.length > schema.maxLength){
|
155
|
+
addError("may only be " + schema.maxLength + " characters long");
|
156
|
+
}
|
157
|
+
if(schema.minLength && typeof value == 'string' && value.length < schema.minLength){
|
158
|
+
addError("must be at least " + schema.minLength + " characters long");
|
159
|
+
}
|
160
|
+
if(typeof schema.minimum !== undefined && typeof value == typeof schema.minimum &&
|
161
|
+
schema.minimum > value){
|
162
|
+
addError("must have a minimum value of " + schema.minimum);
|
163
|
+
}
|
164
|
+
if(typeof schema.maximum !== undefined && typeof value == typeof schema.maximum &&
|
165
|
+
schema.maximum < value){
|
166
|
+
addError("must have a maximum value of " + schema.maximum);
|
167
|
+
}
|
168
|
+
if(schema['enum']){
|
169
|
+
var enumer = schema['enum'];
|
170
|
+
l = enumer.length;
|
171
|
+
var found;
|
172
|
+
for(var j = 0; j < l; j++){
|
173
|
+
if(enumer[j]===value){
|
174
|
+
found=1;
|
175
|
+
break;
|
176
|
+
}
|
177
|
+
}
|
178
|
+
if(!found){
|
179
|
+
addError("does not have a value in the enumeration " + enumer.join(", "));
|
180
|
+
}
|
181
|
+
}
|
182
|
+
if(typeof schema.maxDecimal == 'number' &&
|
183
|
+
(value.toString().match(new RegExp("\\.[0-9]{" + (schema.maxDecimal + 1) + ",}")))){
|
184
|
+
addError("may only have " + schema.maxDecimal + " digits of decimal places");
|
185
|
+
}
|
186
|
+
}
|
187
|
+
}
|
188
|
+
return null;
|
189
|
+
}
|
190
|
+
// validate an object against a schema
|
191
|
+
function checkObj(instance,objTypeDef,path,additionalProp){
|
192
|
+
|
193
|
+
if(typeof objTypeDef =='object'){
|
194
|
+
if(typeof instance != 'object' || instance instanceof Array){
|
195
|
+
errors.push({property:path,message:"an object is required"});
|
196
|
+
}
|
197
|
+
|
198
|
+
for(var i in objTypeDef){
|
199
|
+
if(objTypeDef.hasOwnProperty(i)){
|
200
|
+
var value = instance[i];
|
201
|
+
// skip _not_ specified properties
|
202
|
+
if (value === undefined && options.existingOnly) continue;
|
203
|
+
var propDef = objTypeDef[i];
|
204
|
+
// set default
|
205
|
+
if(value === undefined && propDef["default"]){
|
206
|
+
value = instance[i] = propDef["default"];
|
207
|
+
}
|
208
|
+
if(options.coerce && i in instance){
|
209
|
+
value = instance[i] = options.coerce(value, propDef);
|
210
|
+
}
|
211
|
+
checkProp(value,propDef,path,i);
|
212
|
+
}
|
213
|
+
}
|
214
|
+
}
|
215
|
+
for(i in instance){
|
216
|
+
if(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){
|
217
|
+
if (options.filter) {
|
218
|
+
delete instance[i];
|
219
|
+
continue;
|
220
|
+
} else {
|
221
|
+
errors.push({property:path,message:(typeof value) + "The property " + i +
|
222
|
+
" is not defined in the schema and the schema does not allow additional properties"});
|
223
|
+
}
|
224
|
+
}
|
225
|
+
var requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;
|
226
|
+
if(requires && !(requires in instance)){
|
227
|
+
errors.push({property:path,message:"the presence of the property " + i + " requires that " + requires + " also be present"});
|
228
|
+
}
|
229
|
+
value = instance[i];
|
230
|
+
if(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){
|
231
|
+
if(options.coerce){
|
232
|
+
value = instance[i] = options.coerce(value, additionalProp);
|
233
|
+
}
|
234
|
+
checkProp(value,additionalProp,path,i);
|
235
|
+
}
|
236
|
+
if(!_changing && value && value.$schema){
|
237
|
+
errors = errors.concat(checkProp(value,value.$schema,path,i));
|
238
|
+
}
|
239
|
+
}
|
240
|
+
return errors;
|
241
|
+
}
|
242
|
+
if(schema){
|
243
|
+
checkProp(instance,schema,'',_changing || '');
|
244
|
+
}
|
245
|
+
if(!_changing && instance && instance.$schema){
|
246
|
+
checkProp(instance,instance.$schema,'','');
|
247
|
+
}
|
248
|
+
return {valid:!errors.length,errors:errors};
|
249
|
+
};
|
250
|
+
exports.mustBeValid = function(result){
|
251
|
+
// summary:
|
252
|
+
// This checks to ensure that the result is valid and will throw an appropriate error message if it is not
|
253
|
+
// result: the result returned from checkPropertyChange or validate
|
254
|
+
if(!result.valid){
|
255
|
+
throw new TypeError(result.errors.map(function(error){return "for property " + error.property + ': ' + error.message;}).join(", \n"));
|
256
|
+
}
|
257
|
+
}
|
258
|
+
|
259
|
+
return exports;
|
260
|
+
});
|
@@ -0,0 +1,67 @@
|
|
1
|
+
{
|
2
|
+
"_from": "json-schema@0.2.2",
|
3
|
+
"_id": "json-schema@0.2.2",
|
4
|
+
"_location": "/json-schema",
|
5
|
+
"_npmUser": {
|
6
|
+
"email": "kriszyp@gmail.com",
|
7
|
+
"name": "kriszyp"
|
8
|
+
},
|
9
|
+
"_npmVersion": "1.1.59",
|
10
|
+
"_phantomChildren": {},
|
11
|
+
"_requiredBy": [
|
12
|
+
"/jsprim"
|
13
|
+
],
|
14
|
+
"_resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.2.tgz",
|
15
|
+
"_shasum": "50354f19f603917c695f70b85afa77c3b0f23506",
|
16
|
+
"author": {
|
17
|
+
"name": "Kris Zyp"
|
18
|
+
},
|
19
|
+
"bugs": {
|
20
|
+
"url": "https://github.com/kriszyp/json-schema/issues"
|
21
|
+
},
|
22
|
+
"dependencies": {},
|
23
|
+
"description": "JSON Schema validation and specifications",
|
24
|
+
"devDependencies": {
|
25
|
+
"vows": "*"
|
26
|
+
},
|
27
|
+
"directories": {
|
28
|
+
"lib": "./lib"
|
29
|
+
},
|
30
|
+
"dist": {
|
31
|
+
"shasum": "50354f19f603917c695f70b85afa77c3b0f23506",
|
32
|
+
"tarball": "http://registry.npmjs.org/json-schema/-/json-schema-0.2.2.tgz"
|
33
|
+
},
|
34
|
+
"homepage": "https://github.com/kriszyp/json-schema",
|
35
|
+
"keywords": [
|
36
|
+
"json",
|
37
|
+
"schema"
|
38
|
+
],
|
39
|
+
"licenses": [
|
40
|
+
{
|
41
|
+
"type": "AFLv2.1",
|
42
|
+
"url": "http://trac.dojotoolkit.org/browser/dojo/trunk/LICENSE#L43"
|
43
|
+
},
|
44
|
+
{
|
45
|
+
"type": "BSD",
|
46
|
+
"url": "http://trac.dojotoolkit.org/browser/dojo/trunk/LICENSE#L13"
|
47
|
+
}
|
48
|
+
],
|
49
|
+
"main": "./lib/validate.js",
|
50
|
+
"maintainers": [
|
51
|
+
{
|
52
|
+
"name": "kriszyp",
|
53
|
+
"email": "kriszyp@gmail.com"
|
54
|
+
}
|
55
|
+
],
|
56
|
+
"name": "json-schema",
|
57
|
+
"optionalDependencies": {},
|
58
|
+
"readme": "JSON Schema is a repository for the JSON Schema specification, reference schemas and a CommonJS implementation of JSON Schema (not the only JavaScript implementation of JSON Schema, JSV is another excellent JavaScript validator).\r\n\r\nCode is licensed under the AFL or BSD license as part of the Persevere \r\nproject which is administered under the Dojo foundation,\r\nand all contributions require a Dojo CLA.",
|
59
|
+
"repository": {
|
60
|
+
"type": "git",
|
61
|
+
"url": "git+ssh://git@github.com/kriszyp/json-schema.git"
|
62
|
+
},
|
63
|
+
"scripts": {
|
64
|
+
"test": "echo TESTS DISABLED vows --spec test/*.js"
|
65
|
+
},
|
66
|
+
"version": "0.2.2"
|
67
|
+
}
|
@@ -0,0 +1,95 @@
|
|
1
|
+
var assert = require('assert');
|
2
|
+
var vows = require('vows');
|
3
|
+
var path = require('path');
|
4
|
+
var fs = require('fs');
|
5
|
+
|
6
|
+
var validate = require('../lib/validate').validate;
|
7
|
+
|
8
|
+
|
9
|
+
var revision = 'draft-03';
|
10
|
+
var schemaRoot = path.join(__dirname, '..', revision);
|
11
|
+
var schemaNames = ['schema', 'hyper-schema', 'links', 'json-ref' ];
|
12
|
+
var schemas = {};
|
13
|
+
|
14
|
+
schemaNames.forEach(function(name) {
|
15
|
+
var file = path.join(schemaRoot, name);
|
16
|
+
schemas[name] = loadSchema(file);
|
17
|
+
});
|
18
|
+
|
19
|
+
schemaNames.forEach(function(name) {
|
20
|
+
var s, n = name+'-nsd', f = path.join(schemaRoot, name);
|
21
|
+
schemas[n] = loadSchema(f);
|
22
|
+
s = schemas[n];
|
23
|
+
delete s['$schema'];
|
24
|
+
});
|
25
|
+
|
26
|
+
function loadSchema(path) {
|
27
|
+
var data = fs.readFileSync(path, 'utf-8');
|
28
|
+
var schema = JSON.parse(data);
|
29
|
+
return schema;
|
30
|
+
}
|
31
|
+
|
32
|
+
function resultIsValid() {
|
33
|
+
return function(result) {
|
34
|
+
assert.isObject(result);
|
35
|
+
//assert.isBoolean(result.valid);
|
36
|
+
assert.equal(typeof(result.valid), 'boolean');
|
37
|
+
assert.isArray(result.errors);
|
38
|
+
for (var i = 0; i < result.errors.length; i++) {
|
39
|
+
assert.notEqual(result.errors[i], null, 'errors['+i+'] is null');
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
function assertValidates(doc, schema) {
|
45
|
+
var context = {};
|
46
|
+
|
47
|
+
context[': validate('+doc+', '+schema+')'] = {
|
48
|
+
topic: validate(schemas[doc], schemas[schema]),
|
49
|
+
'returns valid result': resultIsValid(),
|
50
|
+
'with valid=true': function(result) { assert.equal(result.valid, true); },
|
51
|
+
'and no errors': function(result) {
|
52
|
+
// XXX work-around for bug in vows: [null] chokes it
|
53
|
+
if (result.errors[0] == null) assert.fail('(errors contains null)');
|
54
|
+
assert.length(result.errors, 0);
|
55
|
+
}
|
56
|
+
};
|
57
|
+
|
58
|
+
return context;
|
59
|
+
}
|
60
|
+
|
61
|
+
function assertSelfValidates(doc) {
|
62
|
+
var context = {};
|
63
|
+
|
64
|
+
context[': validate('+doc+')'] = {
|
65
|
+
topic: validate(schemas[doc]),
|
66
|
+
'returns valid result': resultIsValid(),
|
67
|
+
'with valid=true': function(result) { assert.equal(result.valid, true); },
|
68
|
+
'and no errors': function(result) { assert.length(result.errors, 0); }
|
69
|
+
};
|
70
|
+
|
71
|
+
return context;
|
72
|
+
}
|
73
|
+
|
74
|
+
var suite = vows.describe('JSON Schema').addBatch({
|
75
|
+
'Core-NSD self-validates': assertSelfValidates('schema-nsd'),
|
76
|
+
'Core-NSD/Core-NSD': assertValidates('schema-nsd', 'schema-nsd'),
|
77
|
+
'Core-NSD/Core': assertValidates('schema-nsd', 'schema'),
|
78
|
+
|
79
|
+
'Core self-validates': assertSelfValidates('schema'),
|
80
|
+
'Core/Core': assertValidates('schema', 'schema'),
|
81
|
+
|
82
|
+
'Hyper-NSD self-validates': assertSelfValidates('hyper-schema-nsd'),
|
83
|
+
'Hyper self-validates': assertSelfValidates('hyper-schema'),
|
84
|
+
'Hyper/Hyper': assertValidates('hyper-schema', 'hyper-schema'),
|
85
|
+
'Hyper/Core': assertValidates('hyper-schema', 'schema'),
|
86
|
+
|
87
|
+
'Links-NSD self-validates': assertSelfValidates('links-nsd'),
|
88
|
+
'Links self-validates': assertSelfValidates('links'),
|
89
|
+
'Links/Hyper': assertValidates('links', 'hyper-schema'),
|
90
|
+
'Links/Core': assertValidates('links', 'schema'),
|
91
|
+
|
92
|
+
'Json-Ref self-validates': assertSelfValidates('json-ref'),
|
93
|
+
'Json-Ref/Hyper': assertValidates('json-ref', 'hyper-schema'),
|
94
|
+
'Json-Ref/Core': assertValidates('json-ref', 'schema')
|
95
|
+
}).export(module);
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## not yet released
|
4
|
+
|
5
|
+
None yet.
|
6
|
+
|
7
|
+
## v1.2.2 (2015-10-15)
|
8
|
+
|
9
|
+
* #11 NPM package shouldn't include any code that does `require('JSV')`
|
10
|
+
* #12 jsl.node.conf missing definition for "module"
|
11
|
+
|
12
|
+
## v1.2.1 (2015-10-14)
|
13
|
+
|
14
|
+
* #8 odd date parsing behaviour
|
15
|
+
|
16
|
+
## v1.2.0 (2015-10-13)
|
17
|
+
|
18
|
+
* #9 want function for returning RFC1123 dates
|
19
|
+
|
20
|
+
## v1.1.0 (2015-09-02)
|
21
|
+
|
22
|
+
* #6 a new suite of hrtime manipulation routines: `hrtimeAdd()`,
|
23
|
+
`hrtimeAccum()`, `hrtimeNanosec()`, `hrtimeMicrosec()` and
|
24
|
+
`hrtimeMillisec()`.
|
25
|
+
|
26
|
+
## v1.0.0 (2015-09-01)
|
27
|
+
|
28
|
+
First tracked release. Includes everything in previous releases, plus:
|
29
|
+
|
30
|
+
* #4 want function for merging objects
|
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2012, Joyent, Inc. All rights reserved.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE
|