fsevents 1.0.15 → 1.1.1
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/fsevents.js +3 -0
- package/install.js +7 -0
- package/lib/binding/Release/node-v48-darwin-x64/fse.node +0 -0
- package/node_modules/abbrev/abbrev.js +0 -1
- package/node_modules/abbrev/package.json +32 -21
- package/node_modules/ansi-regex/index.js +1 -1
- package/node_modules/ansi-regex/package.json +61 -42
- package/node_modules/ansi-regex/readme.md +10 -2
- package/node_modules/ansi-styles/package.json +27 -19
- package/node_modules/aproba/README.md +33 -3
- package/node_modules/aproba/index.js +71 -30
- package/node_modules/aproba/package.json +30 -22
- package/node_modules/are-we-there-yet/package.json +14 -6
- package/node_modules/asn1/package.json +16 -8
- package/node_modules/assert-plus/package.json +16 -8
- package/node_modules/{node-uuid/LICENSE.md → asynckit/LICENSE} +1 -1
- package/node_modules/asynckit/README.md +233 -0
- package/node_modules/asynckit/bench.js +76 -0
- package/node_modules/asynckit/index.js +6 -0
- package/node_modules/asynckit/lib/abort.js +29 -0
- package/node_modules/asynckit/lib/async.js +34 -0
- package/node_modules/asynckit/lib/defer.js +26 -0
- package/node_modules/asynckit/lib/iterate.js +75 -0
- package/node_modules/asynckit/lib/readable_asynckit.js +91 -0
- package/node_modules/asynckit/lib/readable_parallel.js +25 -0
- package/node_modules/asynckit/lib/readable_serial.js +25 -0
- package/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
- package/node_modules/asynckit/lib/state.js +37 -0
- package/node_modules/asynckit/lib/streamify.js +141 -0
- package/node_modules/asynckit/lib/terminator.js +29 -0
- package/node_modules/asynckit/package.json +126 -0
- package/node_modules/asynckit/parallel.js +43 -0
- package/node_modules/asynckit/serial.js +17 -0
- package/node_modules/asynckit/serialOrdered.js +75 -0
- package/node_modules/asynckit/stream.js +21 -0
- package/node_modules/aws-sign2/package.json +15 -7
- package/node_modules/aws4/README.md +9 -0
- package/node_modules/aws4/aws4.js +21 -7
- package/node_modules/aws4/package.json +62 -54
- package/node_modules/balanced-match/package.json +27 -19
- package/node_modules/bcrypt-pbkdf/README.md +39 -0
- package/node_modules/bcrypt-pbkdf/index.js +556 -0
- package/node_modules/bcrypt-pbkdf/package.json +84 -0
- package/node_modules/block-stream/package.json +15 -7
- package/node_modules/boom/package.json +14 -6
- package/node_modules/brace-expansion/index.js +10 -0
- package/node_modules/brace-expansion/package.json +35 -27
- package/node_modules/buffer-shims/package.json +16 -7
- package/node_modules/caseless/package.json +18 -10
- package/node_modules/chalk/package.json +30 -22
- package/node_modules/code-point-at/index.js +3 -4
- package/node_modules/code-point-at/package.json +40 -30
- package/node_modules/code-point-at/readme.md +2 -4
- package/node_modules/combined-stream/package.json +15 -7
- package/node_modules/commander/package.json +16 -8
- package/node_modules/concat-map/package.json +30 -22
- package/node_modules/console-control-strings/package.json +15 -7
- package/node_modules/core-util-is/package.json +22 -14
- package/node_modules/cryptiles/package.json +14 -6
- package/node_modules/dashdash/CHANGES.md +364 -0
- package/node_modules/dashdash/LICENSE.txt +24 -0
- package/node_modules/dashdash/etc/dashdash.bash_completion.in +4 -3
- package/node_modules/dashdash/node_modules/assert-plus/package.json +16 -8
- package/node_modules/dashdash/package.json +33 -24
- package/node_modules/debug/package.json +20 -12
- package/node_modules/deep-extend/package.json +23 -15
- package/node_modules/delayed-stream/package.json +15 -7
- package/node_modules/delegates/package.json +14 -6
- package/node_modules/ecc-jsbn/package.json +17 -9
- package/node_modules/escape-string-regexp/package.json +20 -12
- package/node_modules/extend/package.json +16 -8
- package/node_modules/extsprintf/package.json +14 -6
- package/node_modules/forever-agent/package.json +15 -7
- package/node_modules/form-data/README.md +7 -8
- package/node_modules/form-data/lib/browser.js +1 -1
- package/node_modules/form-data/lib/form_data.js +101 -72
- package/node_modules/form-data/lib/populate.js +6 -5
- package/node_modules/form-data/package.json +68 -52
- package/node_modules/fs.realpath/package.json +19 -11
- package/node_modules/fstream/package.json +15 -7
- package/node_modules/fstream-ignore/package.json +15 -7
- package/node_modules/gauge/CHANGELOG.md +24 -0
- package/node_modules/gauge/README.md +4 -0
- package/node_modules/gauge/index.js +16 -9
- package/node_modules/gauge/package.json +37 -29
- package/node_modules/generate-function/package.json +16 -8
- package/node_modules/generate-object-property/package.json +14 -6
- package/node_modules/getpass/node_modules/assert-plus/package.json +16 -8
- package/node_modules/getpass/package.json +16 -8
- package/node_modules/glob/README.md +3 -0
- package/node_modules/glob/common.js +6 -1
- package/node_modules/glob/glob.js +23 -14
- package/node_modules/glob/package.json +29 -21
- package/node_modules/glob/sync.js +29 -11
- package/node_modules/graceful-fs/README.md +1 -1
- package/node_modules/graceful-fs/graceful-fs.js +23 -14
- package/node_modules/graceful-fs/package.json +35 -27
- package/node_modules/graceful-fs/polyfills.js +99 -21
- package/node_modules/graceful-readlink/package.json +14 -6
- package/node_modules/har-validator/package.json +16 -8
- package/node_modules/has-ansi/package.json +29 -21
- package/node_modules/has-unicode/package.json +18 -10
- package/node_modules/hawk/package.json +18 -10
- package/node_modules/hoek/package.json +14 -6
- package/node_modules/http-signature/package.json +14 -6
- package/node_modules/inflight/inflight.js +22 -12
- package/node_modules/inflight/package.json +28 -20
- package/node_modules/inherits/inherits.js +7 -1
- package/node_modules/inherits/package.json +41 -21
- package/node_modules/ini/package.json +15 -7
- package/node_modules/is-fullwidth-code-point/package.json +27 -19
- package/node_modules/is-my-json-valid/index.js +10 -0
- package/node_modules/is-my-json-valid/package.json +36 -20
- package/node_modules/is-my-json-valid/test/misc.js +24 -0
- package/node_modules/is-property/package.json +19 -11
- package/node_modules/is-typedarray/package.json +16 -8
- package/node_modules/isarray/package.json +28 -20
- package/node_modules/isstream/package.json +19 -11
- package/node_modules/jodid25519/package.json +18 -10
- package/node_modules/jsbn/index.js +8 -9
- package/node_modules/jsbn/package.json +30 -18
- package/node_modules/json-schema/lib/links.js +17 -3
- package/node_modules/json-schema/lib/validate.js +18 -5
- package/node_modules/json-schema/package.json +32 -18
- package/node_modules/json-stringify-safe/package.json +18 -10
- package/node_modules/{async/LICENSE → jsonpointer/LICENSE.md} +3 -1
- package/node_modules/jsonpointer/README.md +17 -10
- package/node_modules/jsonpointer/jsonpointer.js +73 -56
- package/node_modules/jsonpointer/package.json +47 -26
- package/node_modules/jsprim/CHANGES.md +4 -0
- package/node_modules/jsprim/package.json +25 -17
- package/node_modules/mime-db/HISTORY.md +50 -0
- package/node_modules/mime-db/db.json +126 -2
- package/node_modules/mime-db/package.json +43 -30
- package/node_modules/mime-types/HISTORY.md +19 -0
- package/node_modules/mime-types/index.js +8 -8
- package/node_modules/mime-types/package.json +32 -19
- package/node_modules/minimatch/minimatch.js +19 -20
- package/node_modules/minimatch/package.json +25 -17
- package/node_modules/minimist/package.json +24 -16
- package/node_modules/mkdirp/package.json +21 -13
- package/node_modules/ms/package.json +14 -6
- package/node_modules/node-pre-gyp/CHANGELOG.md +20 -0
- package/node_modules/node-pre-gyp/README.md +574 -0
- package/node_modules/node-pre-gyp/appveyor.yml +19 -9
- package/node_modules/node-pre-gyp/lib/install.js +31 -7
- package/node_modules/node-pre-gyp/lib/node-pre-gyp.js +3 -1
- package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +140 -0
- package/node_modules/node-pre-gyp/package.json +52 -48
- package/node_modules/nopt/package.json +19 -11
- package/node_modules/npmlog/CHANGELOG.md +9 -0
- package/node_modules/npmlog/README.md +7 -1
- package/node_modules/npmlog/log.js +12 -8
- package/node_modules/npmlog/package.json +30 -22
- package/node_modules/number-is-nan/package.json +39 -30
- package/node_modules/number-is-nan/readme.md +1 -3
- package/node_modules/oauth-sign/package.json +15 -7
- package/node_modules/object-assign/index.js +11 -4
- package/node_modules/object-assign/package.json +42 -30
- package/node_modules/object-assign/readme.md +8 -3
- package/node_modules/once/README.md +28 -0
- package/node_modules/once/once.js +21 -0
- package/node_modules/once/package.json +31 -20
- package/node_modules/path-is-absolute/index.js +5 -5
- package/node_modules/path-is-absolute/package.json +45 -31
- package/node_modules/path-is-absolute/readme.md +19 -11
- package/node_modules/pinkie/package.json +18 -10
- package/node_modules/pinkie-promise/package.json +18 -10
- package/node_modules/process-nextick-args/package.json +16 -8
- package/node_modules/punycode/LICENSE-MIT.txt +20 -0
- package/node_modules/punycode/README.md +176 -0
- package/node_modules/punycode/package.json +127 -0
- package/node_modules/punycode/punycode.js +533 -0
- package/node_modules/qs/.eslintrc +15 -15
- package/node_modules/qs/CHANGELOG.md +36 -0
- package/node_modules/qs/README.md +431 -0
- package/node_modules/qs/dist/qs.js +167 -67
- package/node_modules/qs/lib/formats.js +18 -0
- package/node_modules/qs/lib/index.js +6 -4
- package/node_modules/qs/lib/parse.js +31 -32
- package/node_modules/qs/lib/stringify.js +83 -20
- package/node_modules/qs/lib/utils.js +23 -7
- package/node_modules/qs/package.json +40 -30
- package/node_modules/qs/test/.eslintrc +10 -0
- package/node_modules/qs/test/index.js +2 -0
- package/node_modules/qs/test/parse.js +108 -47
- package/node_modules/qs/test/stringify.js +261 -28
- package/node_modules/qs/test/utils.js +13 -0
- package/node_modules/rc/node_modules/minimist/package.json +24 -16
- package/node_modules/rc/package.json +35 -23
- package/node_modules/readable-stream/.npmignore +1 -0
- package/node_modules/readable-stream/.travis.yml +2 -7
- package/node_modules/readable-stream/README.md +6 -2
- package/node_modules/readable-stream/lib/_stream_readable.js +158 -110
- package/node_modules/readable-stream/lib/_stream_transform.js +7 -5
- package/node_modules/readable-stream/lib/_stream_writable.js +35 -7
- package/node_modules/readable-stream/lib/internal/streams/BufferList.js +64 -0
- package/node_modules/readable-stream/package.json +34 -26
- package/node_modules/request/CHANGELOG.md +49 -18
- package/node_modules/request/README.md +3 -2
- package/node_modules/request/index.js +2 -3
- package/node_modules/request/lib/auth.js +1 -1
- package/node_modules/request/lib/helpers.js +4 -13
- package/node_modules/request/lib/multipart.js +1 -1
- package/node_modules/request/lib/oauth.js +1 -1
- package/node_modules/request/lib/redirect.js +5 -1
- package/node_modules/request/package.json +50 -31
- package/node_modules/request/request.js +84 -43
- package/node_modules/rimraf/package.json +28 -20
- package/node_modules/rimraf/rimraf.js +2 -2
- package/node_modules/semver/README.md +4 -0
- package/node_modules/semver/package.json +27 -19
- package/node_modules/semver/semver.js +14 -5
- package/node_modules/set-blocking/package.json +21 -13
- package/node_modules/signal-exit/CHANGELOG.md +10 -0
- package/node_modules/signal-exit/LICENSE.txt +2 -0
- package/node_modules/signal-exit/index.js +9 -0
- package/node_modules/signal-exit/package.json +32 -24
- package/node_modules/signal-exit/signals.js +5 -4
- package/node_modules/sntp/package.json +16 -8
- package/node_modules/sshpk/README.md +214 -3
- package/node_modules/sshpk/bin/sshpk-conv +6 -0
- package/node_modules/sshpk/lib/certificate.js +291 -0
- package/node_modules/sshpk/lib/errors.js +14 -1
- package/node_modules/sshpk/lib/fingerprint.js +28 -7
- package/node_modules/sshpk/lib/formats/openssh-cert.js +289 -0
- package/node_modules/sshpk/lib/formats/pem.js +2 -2
- package/node_modules/sshpk/lib/formats/pkcs8.js +2 -7
- package/node_modules/sshpk/lib/formats/ssh-private.js +140 -17
- package/node_modules/sshpk/lib/formats/x509-pem.js +77 -0
- package/node_modules/sshpk/lib/formats/x509.js +484 -0
- package/node_modules/sshpk/lib/identity.js +277 -0
- package/node_modules/sshpk/lib/index.js +13 -1
- package/node_modules/sshpk/lib/key.js +1 -0
- package/node_modules/sshpk/lib/signature.js +14 -6
- package/node_modules/sshpk/lib/ssh-buffer.js +24 -0
- package/node_modules/sshpk/lib/utils.js +43 -1
- package/node_modules/sshpk/node_modules/assert-plus/package.json +16 -8
- package/node_modules/sshpk/package.json +32 -22
- package/node_modules/string-width/index.js +5 -0
- package/node_modules/string-width/package.json +49 -36
- package/node_modules/string-width/readme.md +4 -3
- package/node_modules/string_decoder/package.json +19 -11
- package/node_modules/stringstream/package.json +18 -10
- package/node_modules/strip-ansi/package.json +29 -21
- package/node_modules/strip-json-comments/index.js +70 -0
- package/node_modules/strip-json-comments/package.json +49 -43
- package/node_modules/strip-json-comments/readme.md +12 -28
- package/node_modules/supports-color/package.json +26 -18
- package/node_modules/tar/package.json +19 -11
- package/node_modules/tar-pack/README.md +4 -1
- package/node_modules/tar-pack/index.js +17 -12
- package/node_modules/tar-pack/node_modules/once/LICENSE +15 -0
- package/node_modules/tar-pack/node_modules/once/README.md +51 -0
- package/node_modules/tar-pack/node_modules/once/once.js +21 -0
- package/node_modules/tar-pack/node_modules/once/package.json +96 -0
- package/node_modules/tar-pack/node_modules/readable-stream/.npmignore +8 -0
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/.travis.yml +4 -7
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/LICENSE +0 -0
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/README.md +2 -2
- package/node_modules/tar-pack/node_modules/readable-stream/doc/stream.md +2015 -0
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +0 -0
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/duplex.js +0 -0
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/lib/_stream_duplex.js +0 -0
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/lib/_stream_passthrough.js +0 -0
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/lib/_stream_readable.js +164 -107
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/lib/_stream_transform.js +3 -3
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/lib/_stream_writable.js +25 -15
- package/node_modules/tar-pack/node_modules/readable-stream/lib/internal/streams/BufferList.js +64 -0
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/package.json +50 -30
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/passthrough.js +0 -0
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/readable.js +4 -0
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/transform.js +0 -0
- package/node_modules/{bl → tar-pack}/node_modules/readable-stream/writable.js +0 -0
- package/node_modules/tar-pack/package.json +39 -22
- package/node_modules/tar-pack/test/index.js +43 -1
- package/node_modules/tough-cookie/README.md +17 -3
- package/node_modules/tough-cookie/lib/cookie.js +6 -12
- package/node_modules/tough-cookie/package.json +50 -35
- package/node_modules/tunnel-agent/package.json +15 -7
- package/node_modules/tweetnacl/AUTHORS.md +28 -0
- package/node_modules/tweetnacl/CHANGELOG.md +93 -0
- package/node_modules/tweetnacl/LICENSE +24 -0
- package/node_modules/tweetnacl/PULL_REQUEST_TEMPLATE.md +20 -0
- package/node_modules/tweetnacl/README.md +57 -61
- package/node_modules/tweetnacl/nacl-fast.js +22 -52
- package/node_modules/tweetnacl/nacl-fast.min.js +2 -2
- package/node_modules/tweetnacl/nacl.d.ts +98 -0
- package/node_modules/tweetnacl/nacl.js +21 -51
- package/node_modules/tweetnacl/nacl.min.js +1 -1
- package/node_modules/tweetnacl/package.json +47 -46
- package/node_modules/uid-number/package.json +15 -7
- package/node_modules/util-deprecate/package.json +21 -13
- package/node_modules/uuid/.npmignore +8 -0
- package/node_modules/uuid/.travis.yml +5 -0
- package/node_modules/uuid/AUTHORS +5 -0
- package/node_modules/uuid/HISTORY.md +28 -0
- package/node_modules/uuid/LICENSE.md +21 -0
- package/node_modules/uuid/README.md +132 -0
- package/node_modules/{node-uuid → uuid}/bin/uuid +0 -0
- package/node_modules/uuid/index.js +8 -0
- package/node_modules/uuid/lib/bytesToUuid.js +23 -0
- package/node_modules/uuid/lib/rng-browser.js +33 -0
- package/node_modules/uuid/lib/rng.js +10 -0
- package/node_modules/uuid/package.json +122 -0
- package/node_modules/uuid/test/mocha.opts +3 -0
- package/node_modules/uuid/test/test.js +96 -0
- package/node_modules/uuid/v1.js +103 -0
- package/node_modules/uuid/v4.js +29 -0
- package/node_modules/verror/package.json +14 -6
- package/node_modules/wide-align/package.json +19 -11
- package/node_modules/wrappy/package.json +17 -8
- package/node_modules/xtend/package.json +29 -21
- package/package.json +2 -2
- package/node_modules/async/CHANGELOG.md +0 -125
- package/node_modules/async/README.md +0 -1877
- package/node_modules/async/dist/async.js +0 -1265
- package/node_modules/async/dist/async.min.js +0 -2
- package/node_modules/async/lib/async.js +0 -1265
- package/node_modules/async/package.json +0 -149
- package/node_modules/bl/.jshintrc +0 -59
- package/node_modules/bl/.npmignore +0 -1
- package/node_modules/bl/.travis.yml +0 -13
- package/node_modules/bl/LICENSE.md +0 -13
- package/node_modules/bl/README.md +0 -200
- package/node_modules/bl/bl.js +0 -243
- package/node_modules/bl/node_modules/readable-stream/.npmignore +0 -5
- package/node_modules/bl/node_modules/readable-stream/.zuul.yml +0 -1
- package/node_modules/bl/node_modules/readable-stream/doc/stream.markdown +0 -1760
- package/node_modules/bl/package.json +0 -96
- package/node_modules/bl/test/test.js +0 -640
- package/node_modules/form-data/.dockerignore +0 -7
- package/node_modules/form-data/.editorconfig +0 -10
- package/node_modules/form-data/.eslintignore +0 -1
- package/node_modules/form-data/.eslintrc +0 -64
- package/node_modules/form-data/wercker.yml +0 -36
- package/node_modules/gauge/CHANGELOG.md~ +0 -123
- package/node_modules/gauge/README.md~ +0 -393
- package/node_modules/has-color/index.js +0 -32
- package/node_modules/has-color/package.json +0 -97
- package/node_modules/has-color/readme.md +0 -30
- package/node_modules/inherits/test.js +0 -25
- package/node_modules/jsonpointer/.travis.yml +0 -10
- package/node_modules/jsonpointer/test.js +0 -98
- package/node_modules/node-uuid/.npmignore +0 -4
- package/node_modules/node-uuid/README.md +0 -254
- package/node_modules/node-uuid/benchmark/README.md +0 -53
- package/node_modules/node-uuid/benchmark/bench.gnu +0 -174
- package/node_modules/node-uuid/benchmark/bench.sh +0 -34
- package/node_modules/node-uuid/benchmark/benchmark-native.c +0 -34
- package/node_modules/node-uuid/benchmark/benchmark.js +0 -84
- package/node_modules/node-uuid/bower.json +0 -23
- package/node_modules/node-uuid/component.json +0 -25
- package/node_modules/node-uuid/package.json +0 -105
- package/node_modules/node-uuid/test/compare_v1.js +0 -63
- package/node_modules/node-uuid/test/test.html +0 -17
- package/node_modules/node-uuid/test/test.js +0 -231
- package/node_modules/node-uuid/uuid.js +0 -272
- package/node_modules/npmlog/CHANGELOG.md~ +0 -31
- package/node_modules/qs/.jscs.json +0 -176
- package/node_modules/qs/CONTRIBUTING.md +0 -1
- package/node_modules/readable-stream/doc/stream.md +0 -1772
- package/node_modules/request/.eslintrc +0 -45
- package/node_modules/request/.npmignore +0 -6
- package/node_modules/request/.travis.yml +0 -21
- package/node_modules/request/CONTRIBUTING.md +0 -81
- package/node_modules/request/codecov.yml +0 -2
- package/node_modules/strip-json-comments/cli.js +0 -41
- package/node_modules/strip-json-comments/strip-json-comments.js +0 -73
package/fsevents.js
CHANGED
@@ -6,6 +6,9 @@
|
|
6
6
|
/* jshint node:true */
|
7
7
|
'use strict';
|
8
8
|
|
9
|
+
if (process.platform !== 'darwin')
|
10
|
+
throw new Error('Module \'fsevents\' is not compatible with platform \'' + process.platform + '\'');
|
11
|
+
|
9
12
|
var path = require('path');
|
10
13
|
var binary = require('node-pre-gyp');
|
11
14
|
var Native = require(binary.find(path.join(__dirname, 'package.json')));
|
package/install.js
ADDED
Binary file
|
@@ -1,31 +1,39 @@
|
|
1
1
|
{
|
2
2
|
"_args": [
|
3
3
|
[
|
4
|
-
|
4
|
+
{
|
5
|
+
"raw": "abbrev@1",
|
6
|
+
"scope": null,
|
7
|
+
"escapedName": "abbrev",
|
8
|
+
"name": "abbrev",
|
9
|
+
"rawSpec": "1",
|
10
|
+
"spec": ">=1.0.0 <2.0.0",
|
11
|
+
"type": "range"
|
12
|
+
},
|
5
13
|
"/Users/eshanker/Code/fsevents/node_modules/nopt"
|
6
14
|
]
|
7
15
|
],
|
8
16
|
"_from": "abbrev@>=1.0.0 <2.0.0",
|
9
|
-
"_id": "abbrev@1.0
|
17
|
+
"_id": "abbrev@1.1.0",
|
10
18
|
"_inCache": true,
|
11
|
-
"_installable": true,
|
12
19
|
"_location": "/abbrev",
|
13
|
-
"_nodeVersion": "
|
20
|
+
"_nodeVersion": "8.0.0-pre",
|
14
21
|
"_npmOperationalInternal": {
|
15
|
-
"host": "packages-
|
16
|
-
"tmp": "tmp/abbrev-1.0.
|
22
|
+
"host": "packages-12-west.internal.npmjs.com",
|
23
|
+
"tmp": "tmp/abbrev-1.1.0.tgz_1487054000015_0.9229173036292195"
|
17
24
|
},
|
18
25
|
"_npmUser": {
|
19
|
-
"
|
20
|
-
"
|
26
|
+
"name": "isaacs",
|
27
|
+
"email": "i@izs.me"
|
21
28
|
},
|
22
|
-
"_npmVersion": "3.
|
29
|
+
"_npmVersion": "4.3.0",
|
23
30
|
"_phantomChildren": {},
|
24
31
|
"_requested": {
|
25
|
-
"name": "abbrev",
|
26
32
|
"raw": "abbrev@1",
|
27
|
-
"rawSpec": "1",
|
28
33
|
"scope": null,
|
34
|
+
"escapedName": "abbrev",
|
35
|
+
"name": "abbrev",
|
36
|
+
"rawSpec": "1",
|
29
37
|
"spec": ">=1.0.0 <2.0.0",
|
30
38
|
"type": "range"
|
31
39
|
},
|
@@ -33,14 +41,14 @@
|
|
33
41
|
"/nopt",
|
34
42
|
"/tap/nopt"
|
35
43
|
],
|
36
|
-
"_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.
|
37
|
-
"_shasum": "
|
44
|
+
"_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz",
|
45
|
+
"_shasum": "d0554c2256636e2f56e7c2e5ad183f859428d81f",
|
38
46
|
"_shrinkwrap": null,
|
39
47
|
"_spec": "abbrev@1",
|
40
48
|
"_where": "/Users/eshanker/Code/fsevents/node_modules/nopt",
|
41
49
|
"author": {
|
42
|
-
"
|
43
|
-
"
|
50
|
+
"name": "Isaac Z. Schlueter",
|
51
|
+
"email": "i@izs.me"
|
44
52
|
},
|
45
53
|
"bugs": {
|
46
54
|
"url": "https://github.com/isaacs/abbrev-js/issues"
|
@@ -48,17 +56,17 @@
|
|
48
56
|
"dependencies": {},
|
49
57
|
"description": "Like ruby's abbrev module, but in js",
|
50
58
|
"devDependencies": {
|
51
|
-
"tap": "^
|
59
|
+
"tap": "^10.1"
|
52
60
|
},
|
53
61
|
"directories": {},
|
54
62
|
"dist": {
|
55
|
-
"shasum": "
|
56
|
-
"tarball": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.
|
63
|
+
"shasum": "d0554c2256636e2f56e7c2e5ad183f859428d81f",
|
64
|
+
"tarball": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz"
|
57
65
|
},
|
58
66
|
"files": [
|
59
67
|
"abbrev.js"
|
60
68
|
],
|
61
|
-
"gitHead": "
|
69
|
+
"gitHead": "7136d4d95449dc44115d4f78b80ec907724f64e0",
|
62
70
|
"homepage": "https://github.com/isaacs/abbrev-js#readme",
|
63
71
|
"license": "ISC",
|
64
72
|
"main": "abbrev.js",
|
@@ -76,7 +84,10 @@
|
|
76
84
|
"url": "git+ssh://git@github.com/isaacs/abbrev-js.git"
|
77
85
|
},
|
78
86
|
"scripts": {
|
79
|
-
"
|
87
|
+
"postpublish": "git push origin --all; git push origin --tags",
|
88
|
+
"postversion": "npm publish",
|
89
|
+
"preversion": "npm test",
|
90
|
+
"test": "tap test.js --100"
|
80
91
|
},
|
81
|
-
"version": "1.0
|
92
|
+
"version": "1.1.0"
|
82
93
|
}
|
@@ -1,27 +1,39 @@
|
|
1
1
|
{
|
2
2
|
"_args": [
|
3
3
|
[
|
4
|
-
|
4
|
+
{
|
5
|
+
"raw": "ansi-regex@^2.0.0",
|
6
|
+
"scope": null,
|
7
|
+
"escapedName": "ansi-regex",
|
8
|
+
"name": "ansi-regex",
|
9
|
+
"rawSpec": "^2.0.0",
|
10
|
+
"spec": ">=2.0.0 <3.0.0",
|
11
|
+
"type": "range"
|
12
|
+
},
|
5
13
|
"/Users/eshanker/Code/fsevents/node_modules/strip-ansi"
|
6
14
|
]
|
7
15
|
],
|
8
16
|
"_from": "ansi-regex@>=2.0.0 <3.0.0",
|
9
|
-
"_id": "ansi-regex@2.
|
17
|
+
"_id": "ansi-regex@2.1.1",
|
10
18
|
"_inCache": true,
|
11
|
-
"_installable": true,
|
12
19
|
"_location": "/ansi-regex",
|
13
|
-
"_nodeVersion": "0.
|
20
|
+
"_nodeVersion": "0.10.32",
|
21
|
+
"_npmOperationalInternal": {
|
22
|
+
"host": "packages-18-east.internal.npmjs.com",
|
23
|
+
"tmp": "tmp/ansi-regex-2.1.1.tgz_1484363378013_0.4482989883981645"
|
24
|
+
},
|
14
25
|
"_npmUser": {
|
15
|
-
"
|
16
|
-
"
|
26
|
+
"name": "qix",
|
27
|
+
"email": "i.am.qix@gmail.com"
|
17
28
|
},
|
18
|
-
"_npmVersion": "2.
|
29
|
+
"_npmVersion": "2.14.2",
|
19
30
|
"_phantomChildren": {},
|
20
31
|
"_requested": {
|
21
|
-
"name": "ansi-regex",
|
22
32
|
"raw": "ansi-regex@^2.0.0",
|
23
|
-
"rawSpec": "^2.0.0",
|
24
33
|
"scope": null,
|
34
|
+
"escapedName": "ansi-regex",
|
35
|
+
"name": "ansi-regex",
|
36
|
+
"rawSpec": "^2.0.0",
|
25
37
|
"spec": ">=2.0.0 <3.0.0",
|
26
38
|
"type": "range"
|
27
39
|
},
|
@@ -29,28 +41,29 @@
|
|
29
41
|
"/has-ansi",
|
30
42
|
"/strip-ansi"
|
31
43
|
],
|
32
|
-
"_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.
|
33
|
-
"_shasum": "
|
44
|
+
"_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
|
45
|
+
"_shasum": "c3b33ab5ee360d86e0e628f0468ae7ef27d654df",
|
34
46
|
"_shrinkwrap": null,
|
35
47
|
"_spec": "ansi-regex@^2.0.0",
|
36
48
|
"_where": "/Users/eshanker/Code/fsevents/node_modules/strip-ansi",
|
37
49
|
"author": {
|
38
|
-
"email": "sindresorhus@gmail.com",
|
39
50
|
"name": "Sindre Sorhus",
|
51
|
+
"email": "sindresorhus@gmail.com",
|
40
52
|
"url": "sindresorhus.com"
|
41
53
|
},
|
42
54
|
"bugs": {
|
43
|
-
"url": "https://github.com/
|
55
|
+
"url": "https://github.com/chalk/ansi-regex/issues"
|
44
56
|
},
|
45
57
|
"dependencies": {},
|
46
58
|
"description": "Regular expression for matching ANSI escape codes",
|
47
59
|
"devDependencies": {
|
48
|
-
"
|
60
|
+
"ava": "0.17.0",
|
61
|
+
"xo": "0.16.0"
|
49
62
|
},
|
50
63
|
"directories": {},
|
51
64
|
"dist": {
|
52
|
-
"shasum": "
|
53
|
-
"tarball": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.
|
65
|
+
"shasum": "c3b33ab5ee360d86e0e628f0468ae7ef27d654df",
|
66
|
+
"tarball": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz"
|
54
67
|
},
|
55
68
|
"engines": {
|
56
69
|
"node": ">=0.10.0"
|
@@ -58,44 +71,44 @@
|
|
58
71
|
"files": [
|
59
72
|
"index.js"
|
60
73
|
],
|
61
|
-
"gitHead": "
|
62
|
-
"homepage": "https://github.com/
|
74
|
+
"gitHead": "7c908e7b4eb6cd82bfe1295e33fdf6d166c7ed85",
|
75
|
+
"homepage": "https://github.com/chalk/ansi-regex#readme",
|
63
76
|
"keywords": [
|
64
|
-
"256",
|
65
77
|
"ansi",
|
66
|
-
"
|
78
|
+
"styles",
|
67
79
|
"color",
|
68
|
-
"colors",
|
69
80
|
"colour",
|
70
|
-
"
|
81
|
+
"colors",
|
82
|
+
"terminal",
|
71
83
|
"console",
|
84
|
+
"cli",
|
85
|
+
"string",
|
86
|
+
"tty",
|
72
87
|
"escape",
|
73
|
-
"find",
|
74
88
|
"formatting",
|
75
|
-
"match",
|
76
|
-
"pattern",
|
77
|
-
"re",
|
78
|
-
"regex",
|
79
|
-
"regexp",
|
80
89
|
"rgb",
|
90
|
+
"256",
|
81
91
|
"shell",
|
82
|
-
"
|
83
|
-
"
|
84
|
-
"terminal",
|
85
|
-
"test",
|
92
|
+
"xterm",
|
93
|
+
"command-line",
|
86
94
|
"text",
|
87
|
-
"
|
88
|
-
"
|
95
|
+
"regex",
|
96
|
+
"regexp",
|
97
|
+
"re",
|
98
|
+
"match",
|
99
|
+
"test",
|
100
|
+
"find",
|
101
|
+
"pattern"
|
89
102
|
],
|
90
103
|
"license": "MIT",
|
91
104
|
"maintainers": [
|
92
105
|
{
|
93
|
-
"name": "
|
94
|
-
"email": "
|
106
|
+
"name": "qix",
|
107
|
+
"email": "i.am.qix@gmail.com"
|
95
108
|
},
|
96
109
|
{
|
97
|
-
"name": "
|
98
|
-
"email": "
|
110
|
+
"name": "sindresorhus",
|
111
|
+
"email": "sindresorhus@gmail.com"
|
99
112
|
}
|
100
113
|
],
|
101
114
|
"name": "ansi-regex",
|
@@ -103,11 +116,17 @@
|
|
103
116
|
"readme": "ERROR: No README data found!",
|
104
117
|
"repository": {
|
105
118
|
"type": "git",
|
106
|
-
"url": "git+https://github.com/
|
119
|
+
"url": "git+https://github.com/chalk/ansi-regex.git"
|
107
120
|
},
|
108
121
|
"scripts": {
|
109
|
-
"test": "
|
110
|
-
"view-supported": "node
|
122
|
+
"test": "xo && ava --verbose",
|
123
|
+
"view-supported": "node fixtures/view-codes.js"
|
111
124
|
},
|
112
|
-
"version": "2.
|
125
|
+
"version": "2.1.1",
|
126
|
+
"xo": {
|
127
|
+
"rules": {
|
128
|
+
"guard-for-in": 0,
|
129
|
+
"no-loop-func": 0
|
130
|
+
}
|
131
|
+
}
|
113
132
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# ansi-regex [](https://travis-ci.org/chalk/ansi-regex)
|
2
2
|
|
3
3
|
> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
|
4
4
|
|
@@ -13,7 +13,7 @@ $ npm install --save ansi-regex
|
|
13
13
|
## Usage
|
14
14
|
|
15
15
|
```js
|
16
|
-
|
16
|
+
const ansiRegex = require('ansi-regex');
|
17
17
|
|
18
18
|
ansiRegex().test('\u001b[4mcake\u001b[0m');
|
19
19
|
//=> true
|
@@ -25,6 +25,14 @@ ansiRegex().test('cake');
|
|
25
25
|
//=> ['\u001b[4m', '\u001b[0m']
|
26
26
|
```
|
27
27
|
|
28
|
+
## FAQ
|
29
|
+
|
30
|
+
### Why do you test for codes not in the ECMA 48 standard?
|
31
|
+
|
32
|
+
Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. If I recall correctly, we test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them.
|
33
|
+
|
34
|
+
On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out.
|
35
|
+
|
28
36
|
|
29
37
|
## License
|
30
38
|
|
@@ -1,14 +1,21 @@
|
|
1
1
|
{
|
2
2
|
"_args": [
|
3
3
|
[
|
4
|
-
|
4
|
+
{
|
5
|
+
"raw": "ansi-styles@^2.2.1",
|
6
|
+
"scope": null,
|
7
|
+
"escapedName": "ansi-styles",
|
8
|
+
"name": "ansi-styles",
|
9
|
+
"rawSpec": "^2.2.1",
|
10
|
+
"spec": ">=2.2.1 <3.0.0",
|
11
|
+
"type": "range"
|
12
|
+
},
|
5
13
|
"/Users/eshanker/Code/fsevents/node_modules/chalk"
|
6
14
|
]
|
7
15
|
],
|
8
16
|
"_from": "ansi-styles@>=2.2.1 <3.0.0",
|
9
17
|
"_id": "ansi-styles@2.2.1",
|
10
18
|
"_inCache": true,
|
11
|
-
"_installable": true,
|
12
19
|
"_location": "/ansi-styles",
|
13
20
|
"_nodeVersion": "4.3.0",
|
14
21
|
"_npmOperationalInternal": {
|
@@ -16,16 +23,17 @@
|
|
16
23
|
"tmp": "tmp/ansi-styles-2.2.1.tgz_1459197317833_0.9694824463222176"
|
17
24
|
},
|
18
25
|
"_npmUser": {
|
19
|
-
"
|
20
|
-
"
|
26
|
+
"name": "sindresorhus",
|
27
|
+
"email": "sindresorhus@gmail.com"
|
21
28
|
},
|
22
29
|
"_npmVersion": "3.8.3",
|
23
30
|
"_phantomChildren": {},
|
24
31
|
"_requested": {
|
25
|
-
"name": "ansi-styles",
|
26
32
|
"raw": "ansi-styles@^2.2.1",
|
27
|
-
"rawSpec": "^2.2.1",
|
28
33
|
"scope": null,
|
34
|
+
"escapedName": "ansi-styles",
|
35
|
+
"name": "ansi-styles",
|
36
|
+
"rawSpec": "^2.2.1",
|
29
37
|
"spec": ">=2.2.1 <3.0.0",
|
30
38
|
"type": "range"
|
31
39
|
},
|
@@ -38,8 +46,8 @@
|
|
38
46
|
"_spec": "ansi-styles@^2.2.1",
|
39
47
|
"_where": "/Users/eshanker/Code/fsevents/node_modules/chalk",
|
40
48
|
"author": {
|
41
|
-
"email": "sindresorhus@gmail.com",
|
42
49
|
"name": "Sindre Sorhus",
|
50
|
+
"email": "sindresorhus@gmail.com",
|
43
51
|
"url": "sindresorhus.com"
|
44
52
|
},
|
45
53
|
"bugs": {
|
@@ -64,26 +72,26 @@
|
|
64
72
|
"gitHead": "95c59b23be760108b6530ca1c89477c21b258032",
|
65
73
|
"homepage": "https://github.com/chalk/ansi-styles#readme",
|
66
74
|
"keywords": [
|
67
|
-
"256",
|
68
75
|
"ansi",
|
69
|
-
"
|
76
|
+
"styles",
|
70
77
|
"color",
|
71
|
-
"colors",
|
72
78
|
"colour",
|
73
|
-
"
|
79
|
+
"colors",
|
80
|
+
"terminal",
|
74
81
|
"console",
|
82
|
+
"cli",
|
83
|
+
"string",
|
84
|
+
"tty",
|
75
85
|
"escape",
|
76
86
|
"formatting",
|
77
|
-
"log",
|
78
|
-
"logging",
|
79
87
|
"rgb",
|
88
|
+
"256",
|
80
89
|
"shell",
|
81
|
-
"
|
82
|
-
"
|
83
|
-
"
|
84
|
-
"
|
85
|
-
"
|
86
|
-
"xterm"
|
90
|
+
"xterm",
|
91
|
+
"log",
|
92
|
+
"logging",
|
93
|
+
"command-line",
|
94
|
+
"text"
|
87
95
|
],
|
88
96
|
"license": "MIT",
|
89
97
|
"maintainers": [
|
@@ -29,7 +29,8 @@ N | typeof == number
|
|
29
29
|
F | typeof == function
|
30
30
|
O | typeof == object and not type A and not type E
|
31
31
|
B | typeof == boolean
|
32
|
-
E | instanceof Error OR null
|
32
|
+
E | instanceof Error OR null **(special: see below)**
|
33
|
+
Z | == null
|
33
34
|
|
34
35
|
Validation failures throw one of three exception types, distinguished by a
|
35
36
|
`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`.
|
@@ -37,8 +38,37 @@ Validation failures throw one of three exception types, distinguished by a
|
|
37
38
|
If you pass in an invalid type then it will throw with a code of
|
38
39
|
`EUNKNOWNTYPE`.
|
39
40
|
|
40
|
-
If an error argument is found and is not null then the remaining
|
41
|
-
|
41
|
+
If an **error** argument is found and is not null then the remaining
|
42
|
+
arguments are optional. That is, if you say `ESO` then that's like using a
|
43
|
+
non-magical `E` in: `E|ESO|ZSO`.
|
44
|
+
|
45
|
+
### But I have optional arguments?!
|
46
|
+
|
47
|
+
You can provide more than one signature by separating them with pipes `|`.
|
48
|
+
If any signature matches the arguments then they'll be considered valid.
|
49
|
+
|
50
|
+
So for example, say you wanted to write a signature for
|
51
|
+
`fs.createWriteStream`. The docs for it describe it thusly:
|
52
|
+
|
53
|
+
```
|
54
|
+
fs.createWriteStream(path[, options])
|
55
|
+
```
|
56
|
+
|
57
|
+
This would be a signature of `SO|S`. That is, a string and and object, or
|
58
|
+
just a string.
|
59
|
+
|
60
|
+
Now, if you read the full `fs` docs, you'll see that actually path can ALSO
|
61
|
+
be a buffer. And options can be a string, that is:
|
62
|
+
```
|
63
|
+
path <String> | <Buffer>
|
64
|
+
options <String> | <Object>
|
65
|
+
```
|
66
|
+
|
67
|
+
To reproduce this you have to fully enumerate all of the possible
|
68
|
+
combinations and that implies a signature of `SO|SS|OO|OS|S|O`. The
|
69
|
+
awkwardness is a feature: It reminds you of the complexity you're adding to
|
70
|
+
your API when you do this sort of thing.
|
71
|
+
|
42
72
|
|
43
73
|
### Why this exists
|
44
74
|
|
@@ -1,36 +1,64 @@
|
|
1
1
|
'use strict'
|
2
2
|
|
3
3
|
function isArguments (thingy) {
|
4
|
-
return typeof thingy === 'object' && thingy.hasOwnProperty('callee')
|
4
|
+
return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee')
|
5
5
|
}
|
6
6
|
|
7
7
|
var types = {
|
8
|
-
'*':
|
9
|
-
A:
|
10
|
-
S:
|
11
|
-
N:
|
12
|
-
F:
|
13
|
-
O:
|
14
|
-
B:
|
15
|
-
E:
|
16
|
-
}
|
17
|
-
|
18
|
-
|
19
|
-
|
8
|
+
'*': {label: 'any', check: function () { return true }},
|
9
|
+
A: {label: 'array', check: function (thingy) { return Array.isArray(thingy) || isArguments(thingy) }},
|
10
|
+
S: {label: 'string', check: function (thingy) { return typeof thingy === 'string' }},
|
11
|
+
N: {label: 'number', check: function (thingy) { return typeof thingy === 'number' }},
|
12
|
+
F: {label: 'function', check: function (thingy) { return typeof thingy === 'function' }},
|
13
|
+
O: {label: 'object', check: function (thingy) { return typeof thingy === 'object' && thingy != null && !types.A.check(thingy) && !types.E.check(thingy) }},
|
14
|
+
B: {label: 'boolean', check: function (thingy) { return typeof thingy === 'boolean' }},
|
15
|
+
E: {label: 'error', check: function (thingy) { return thingy instanceof Error }},
|
16
|
+
Z: {label: 'null', check: function (thingy) { return thingy == null }}
|
17
|
+
}
|
18
|
+
|
19
|
+
var validate = module.exports = function (rawSchemas, args) {
|
20
|
+
if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length)
|
21
|
+
if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas')
|
20
22
|
if (!args) throw missingRequiredArg(1, 'args')
|
21
|
-
if (!types.S
|
22
|
-
if (!types.A
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
var
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
23
|
+
if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas)
|
24
|
+
if (!types.A.check(args)) throw invalidType(1, ['array'], args)
|
25
|
+
var schemas = rawSchemas.split('|')
|
26
|
+
var arity = {}
|
27
|
+
function addSchema (schema) {
|
28
|
+
var group = arity[schema.length] = arity[schema.length] || []
|
29
|
+
if (group.indexOf(schema) === -1) group.push(schema)
|
30
|
+
}
|
31
|
+
schemas.forEach(function (schema) {
|
32
|
+
for (var ii = 0; ii < schema.length; ++ii) {
|
33
|
+
var type = schema[ii]
|
34
|
+
if (!types[type]) throw unknownType(ii, type)
|
35
|
+
}
|
36
|
+
if (/E.*E/.test(schema)) throw moreThanOneError(schema)
|
37
|
+
addSchema(schema)
|
38
|
+
if (/E/.test(schema)) {
|
39
|
+
addSchema(schema.replace(/E.*$/, 'E'))
|
40
|
+
addSchema(schema.replace(/E/, 'Z'))
|
41
|
+
if (schema.length === 1) addSchema('')
|
42
|
+
}
|
43
|
+
})
|
44
|
+
var matching = arity[args.length]
|
45
|
+
if (!matching) {
|
46
|
+
throw wrongNumberOfArgs(Object.keys(arity), args.length)
|
47
|
+
}
|
48
|
+
for (var ii = 0; ii < args.length; ++ii) {
|
49
|
+
var newMatching = matching.filter(function (schema) {
|
50
|
+
var type = schema[ii]
|
51
|
+
var typeCheck = types[type].check
|
52
|
+
return typeCheck(args[ii])
|
53
|
+
})
|
54
|
+
if (!newMatching.length) {
|
55
|
+
var labels = matching.map(function (schema) {
|
56
|
+
return types[schema[ii]].label
|
57
|
+
}).filter(function (schema) { return schema != null })
|
58
|
+
throw invalidType(ii, labels, args[ii])
|
59
|
+
}
|
60
|
+
matching = newMatching
|
32
61
|
}
|
33
|
-
if (schema.length < args.length) throw tooManyArgs(schema.length, args.length)
|
34
62
|
}
|
35
63
|
|
36
64
|
function missingRequiredArg (num) {
|
@@ -41,17 +69,30 @@ function unknownType (num, type) {
|
|
41
69
|
return newException('EUNKNOWNTYPE', 'Unknown type ' + type + ' in argument #' + (num + 1))
|
42
70
|
}
|
43
71
|
|
44
|
-
function invalidType (num,
|
72
|
+
function invalidType (num, expectedTypes, value) {
|
45
73
|
var valueType
|
46
74
|
Object.keys(types).forEach(function (typeCode) {
|
47
|
-
if (types[typeCode]
|
75
|
+
if (types[typeCode].check(value)) valueType = types[typeCode].label
|
48
76
|
})
|
49
77
|
return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' +
|
50
|
-
|
78
|
+
englishList(expectedTypes) + ' but got ' + valueType)
|
79
|
+
}
|
80
|
+
|
81
|
+
function englishList (list) {
|
82
|
+
return list.join(', ').replace(/, ([^,]+)$/, ' or $1')
|
83
|
+
}
|
84
|
+
|
85
|
+
function wrongNumberOfArgs (expected, got) {
|
86
|
+
var english = englishList(expected)
|
87
|
+
var args = expected.every(function (ex) { return ex.length === 1 })
|
88
|
+
? 'argument'
|
89
|
+
: 'arguments'
|
90
|
+
return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got)
|
51
91
|
}
|
52
92
|
|
53
|
-
function
|
54
|
-
return newException('
|
93
|
+
function moreThanOneError (schema) {
|
94
|
+
return newException('ETOOMANYERRORTYPES',
|
95
|
+
'Only one error type per argument signature is allowed, more than one found in "' + schema + '"')
|
55
96
|
}
|
56
97
|
|
57
98
|
function newException (code, msg) {
|