epuber-stylus-source 0.54.8 → 0.56.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/vendor/{History.md → Changelog.md} +50 -0
- data/vendor/Readme.md +37 -23
- data/vendor/bin/stylus +1 -2
- data/vendor/lib/convert/css.js +1 -1
- data/vendor/lib/functions/acos.js +20 -0
- data/vendor/lib/functions/asin.js +21 -0
- data/vendor/lib/functions/atan.js +21 -0
- data/vendor/lib/functions/convert-angle.js +19 -0
- data/vendor/lib/functions/index.js +3 -0
- data/vendor/lib/functions/url.js +5 -5
- data/vendor/lib/lexer.js +1 -1
- data/vendor/lib/middleware.js +1 -2
- data/vendor/lib/visitor/compiler.js +2 -2
- data/vendor/lib/visitor/deps-resolver.js +3 -0
- data/vendor/node_modules/{cliui/node_modules/ansi-regex → ansi-regex}/index.d.ts +0 -0
- data/vendor/node_modules/ansi-regex/index.js +4 -4
- data/vendor/node_modules/ansi-regex/package.json +53 -51
- data/vendor/node_modules/ansi-regex/readme.md +35 -3
- data/vendor/node_modules/assertion-error/History.md +24 -0
- data/vendor/node_modules/{mkdirp/LICENSE → assertion-error/README.md} +22 -2
- data/vendor/node_modules/assertion-error/index.d.ts +11 -0
- data/vendor/node_modules/assertion-error/index.js +116 -0
- data/vendor/node_modules/assertion-error/package.json +29 -0
- data/vendor/node_modules/camelcase/index.d.ts +5 -3
- data/vendor/node_modules/camelcase/index.js +40 -18
- data/vendor/node_modules/camelcase/package.json +1 -1
- data/vendor/node_modules/camelcase/readme.md +21 -5
- data/vendor/node_modules/chai/CODEOWNERS +1 -0
- data/vendor/node_modules/chai/CODE_OF_CONDUCT.md +58 -0
- data/vendor/node_modules/chai/CONTRIBUTING.md +218 -0
- data/vendor/node_modules/chai/History.md +1059 -0
- data/vendor/node_modules/{should-type-adaptors → chai}/LICENSE +1 -1
- data/vendor/node_modules/chai/README.md +212 -0
- data/vendor/node_modules/chai/ReleaseNotes.md +737 -0
- data/vendor/node_modules/chai/bower.json +26 -0
- data/vendor/node_modules/chai/chai.js +11464 -0
- data/vendor/node_modules/chai/index.js +1 -0
- data/vendor/node_modules/chai/index.mjs +14 -0
- data/vendor/node_modules/chai/karma.conf.js +34 -0
- data/vendor/node_modules/chai/karma.sauce.js +41 -0
- data/vendor/node_modules/chai/lib/chai/assertion.js +175 -0
- data/vendor/node_modules/chai/lib/chai/config.js +94 -0
- data/vendor/node_modules/chai/lib/chai/core/assertions.js +3853 -0
- data/vendor/node_modules/chai/lib/chai/interface/assert.js +3113 -0
- data/vendor/node_modules/chai/lib/chai/interface/expect.js +47 -0
- data/vendor/node_modules/chai/lib/chai/interface/should.js +219 -0
- data/vendor/node_modules/chai/lib/chai/utils/addChainableMethod.js +152 -0
- data/vendor/node_modules/chai/lib/chai/utils/addLengthGuard.js +60 -0
- data/vendor/node_modules/chai/lib/chai/utils/addMethod.js +68 -0
- data/vendor/node_modules/chai/lib/chai/utils/addProperty.js +72 -0
- data/vendor/node_modules/chai/lib/chai/utils/compareByInspect.js +31 -0
- data/vendor/node_modules/chai/lib/chai/utils/expectTypes.js +51 -0
- data/vendor/node_modules/chai/lib/chai/utils/flag.js +33 -0
- data/vendor/node_modules/chai/lib/chai/utils/getActual.js +20 -0
- data/vendor/node_modules/chai/lib/chai/utils/getEnumerableProperties.js +26 -0
- data/vendor/node_modules/chai/lib/chai/utils/getMessage.js +50 -0
- data/vendor/node_modules/chai/lib/chai/utils/getOperator.js +55 -0
- data/vendor/node_modules/chai/lib/chai/utils/getOwnEnumerableProperties.js +29 -0
- data/vendor/node_modules/chai/lib/chai/utils/getOwnEnumerablePropertySymbols.js +27 -0
- data/vendor/node_modules/chai/lib/chai/utils/getProperties.js +36 -0
- data/vendor/node_modules/chai/lib/chai/utils/index.js +178 -0
- data/vendor/node_modules/chai/lib/chai/utils/inspect.js +33 -0
- data/vendor/node_modules/chai/lib/chai/utils/isNaN.js +26 -0
- data/vendor/node_modules/chai/lib/chai/utils/isProxyEnabled.js +24 -0
- data/vendor/node_modules/chai/lib/chai/utils/objDisplay.js +50 -0
- data/vendor/node_modules/chai/lib/chai/utils/overwriteChainableMethod.js +69 -0
- data/vendor/node_modules/chai/lib/chai/utils/overwriteMethod.js +92 -0
- data/vendor/node_modules/chai/lib/chai/utils/overwriteProperty.js +92 -0
- data/vendor/node_modules/chai/lib/chai/utils/proxify.js +147 -0
- data/vendor/node_modules/chai/lib/chai/utils/test.js +28 -0
- data/vendor/node_modules/chai/lib/chai/utils/transferFlags.js +45 -0
- data/vendor/node_modules/chai/lib/chai.js +92 -0
- data/vendor/node_modules/chai/package.json +63 -0
- data/vendor/node_modules/chai/register-assert.js +1 -0
- data/vendor/node_modules/chai/register-expect.js +1 -0
- data/vendor/node_modules/chai/register-should.js +1 -0
- data/vendor/node_modules/chai/sauce.browsers.js +106 -0
- data/vendor/node_modules/chalk/package.json +1 -1
- data/vendor/node_modules/chalk/readme.md +7 -1
- data/vendor/node_modules/{source-map-url → check-error}/LICENSE +1 -3
- data/vendor/node_modules/check-error/README.md +207 -0
- data/vendor/node_modules/check-error/check-error.js +176 -0
- data/vendor/node_modules/check-error/index.js +172 -0
- data/vendor/node_modules/check-error/package.json +85 -0
- data/vendor/node_modules/chokidar/README.md +5 -4
- data/vendor/node_modules/chokidar/index.js +7 -1
- data/vendor/node_modules/chokidar/lib/constants.js +2 -0
- data/vendor/node_modules/chokidar/lib/fsevents-handler.js +2 -1
- data/vendor/node_modules/chokidar/lib/nodefs-handler.js +9 -1
- data/vendor/node_modules/chokidar/package.json +15 -8
- data/vendor/node_modules/chokidar/types/index.d.ts +4 -3
- data/vendor/node_modules/css/lib/stringify/source-map-support.js +10 -3
- data/vendor/node_modules/css/package.json +8 -9
- data/vendor/node_modules/debug/LICENSE +10 -9
- data/vendor/node_modules/debug/README.md +116 -3
- data/vendor/node_modules/debug/package.json +35 -19
- data/vendor/node_modules/debug/src/browser.js +194 -120
- data/vendor/node_modules/debug/src/common.js +274 -0
- data/vendor/node_modules/debug/src/index.js +4 -4
- data/vendor/node_modules/debug/src/node.js +174 -97
- data/vendor/node_modules/{resolve-url → deep-eql}/LICENSE +1 -3
- data/vendor/node_modules/deep-eql/README.md +116 -0
- data/vendor/node_modules/deep-eql/deep-eql.js +833 -0
- data/vendor/node_modules/deep-eql/index.js +455 -0
- data/vendor/node_modules/deep-eql/package.json +90 -0
- data/vendor/node_modules/{urix → get-func-name}/LICENSE +1 -3
- data/vendor/node_modules/get-func-name/README.md +123 -0
- data/vendor/node_modules/get-func-name/get-func-name.js +48 -0
- data/vendor/node_modules/get-func-name/index.js +44 -0
- data/vendor/node_modules/get-func-name/package.json +85 -0
- data/vendor/node_modules/glob/README.md +3 -0
- data/vendor/node_modules/glob/common.js +2 -0
- data/vendor/node_modules/glob/glob.js +4 -5
- data/vendor/node_modules/glob/package.json +2 -1
- data/vendor/node_modules/glob/sync.js +4 -5
- data/vendor/node_modules/{cliui/node_modules/is-fullwidth-code-point → is-fullwidth-code-point}/index.d.ts +0 -0
- data/vendor/node_modules/is-fullwidth-code-point/index.js +25 -21
- data/vendor/node_modules/is-fullwidth-code-point/license +4 -16
- data/vendor/node_modules/is-fullwidth-code-point/package.json +40 -43
- data/vendor/node_modules/is-fullwidth-code-point/readme.md +6 -6
- data/vendor/node_modules/is-glob/README.md +1 -1
- data/vendor/node_modules/is-glob/index.js +126 -24
- data/vendor/node_modules/is-glob/package.json +2 -2
- data/vendor/node_modules/is-unicode-supported/index.d.ts +14 -0
- data/vendor/node_modules/is-unicode-supported/index.js +13 -0
- data/vendor/node_modules/{cliui/node_modules/string-width → is-unicode-supported}/license +1 -1
- data/vendor/node_modules/is-unicode-supported/package.json +41 -0
- data/vendor/node_modules/is-unicode-supported/readme.md +35 -0
- data/vendor/node_modules/js-yaml/CHANGELOG.md +13 -0
- data/vendor/node_modules/js-yaml/README.md +1 -1
- data/vendor/node_modules/js-yaml/dist/js-yaml.js +90 -70
- data/vendor/node_modules/js-yaml/dist/js-yaml.min.js +2 -2
- data/vendor/node_modules/js-yaml/dist/js-yaml.mjs +84 -65
- data/vendor/node_modules/js-yaml/index.js +17 -0
- data/vendor/node_modules/js-yaml/lib/schema.js +9 -9
- data/vendor/node_modules/js-yaml/lib/type.js +1 -0
- data/vendor/node_modules/js-yaml/package.json +1 -1
- data/vendor/node_modules/jscoverage/node_modules/ms/index.js +152 -0
- data/vendor/node_modules/{should-format/LICENSE → jscoverage/node_modules/ms/license.md} +1 -2
- data/vendor/node_modules/jscoverage/node_modules/ms/package.json +37 -0
- data/vendor/node_modules/jscoverage/node_modules/ms/readme.md +51 -0
- data/vendor/node_modules/log-symbols/index.d.ts +2 -2
- data/vendor/node_modules/log-symbols/index.js +3 -4
- data/vendor/node_modules/log-symbols/package.json +7 -5
- data/vendor/node_modules/log-symbols/readme.md +3 -3
- data/vendor/node_modules/loupe/CHANGELOG.md +5 -0
- data/vendor/node_modules/{cliui/node_modules/strip-ansi/license → loupe/LICENSE} +2 -2
- data/vendor/node_modules/loupe/README.md +63 -0
- data/vendor/node_modules/loupe/index.js +195 -0
- data/vendor/node_modules/loupe/lib/arguments.js +7 -0
- data/vendor/node_modules/loupe/lib/array.js +20 -0
- data/vendor/node_modules/loupe/lib/bigint.js +7 -0
- data/vendor/node_modules/loupe/lib/class.js +18 -0
- data/vendor/node_modules/loupe/lib/date.js +8 -0
- data/vendor/node_modules/loupe/lib/error.js +34 -0
- data/vendor/node_modules/loupe/lib/function.js +10 -0
- data/vendor/node_modules/loupe/lib/helpers.js +177 -0
- data/vendor/node_modules/loupe/lib/html.js +40 -0
- data/vendor/node_modules/loupe/lib/map.js +27 -0
- data/vendor/node_modules/loupe/lib/number.js +18 -0
- data/vendor/node_modules/loupe/lib/object.js +31 -0
- data/vendor/node_modules/loupe/lib/promise.js +16 -0
- data/vendor/node_modules/loupe/lib/regexp.js +8 -0
- data/vendor/node_modules/loupe/lib/set.js +16 -0
- data/vendor/node_modules/loupe/lib/string.js +29 -0
- data/vendor/node_modules/loupe/lib/symbol.js +6 -0
- data/vendor/node_modules/loupe/lib/typedarray.js +45 -0
- data/vendor/node_modules/loupe/loupe.js +852 -0
- data/vendor/node_modules/loupe/package.json +141 -0
- data/vendor/node_modules/minimatch/README.md +22 -1
- data/vendor/node_modules/minimatch/minimatch.js +93 -69
- data/vendor/node_modules/minimatch/package.json +6 -3
- data/vendor/node_modules/mocha/LICENSE +1 -1
- data/vendor/node_modules/mocha/README.md +1 -1
- data/vendor/node_modules/mocha/bin/mocha +18 -27
- data/vendor/node_modules/mocha/browser-entry.js +27 -20
- data/vendor/node_modules/mocha/lib/browser/growl.js +5 -5
- data/vendor/node_modules/mocha/lib/browser/parse-query.js +1 -1
- data/vendor/node_modules/mocha/lib/browser/progress.js +6 -6
- data/vendor/node_modules/mocha/lib/cli/cli.js +3 -2
- data/vendor/node_modules/mocha/lib/cli/config.js +7 -12
- data/vendor/node_modules/mocha/lib/cli/lookup-files.js +2 -8
- data/vendor/node_modules/mocha/lib/cli/node-flags.js +2 -5
- data/vendor/node_modules/mocha/lib/cli/one-and-dones.js +1 -2
- data/vendor/node_modules/mocha/lib/cli/run-helpers.js +15 -15
- data/vendor/node_modules/mocha/lib/cli/run-option-metadata.js +4 -0
- data/vendor/node_modules/mocha/lib/cli/run.js +13 -1
- data/vendor/node_modules/mocha/lib/cli/watch-run.js +3 -6
- data/vendor/node_modules/mocha/lib/context.js +5 -5
- data/vendor/node_modules/mocha/lib/errors.js +3 -3
- data/vendor/node_modules/mocha/lib/hook.js +9 -3
- data/vendor/node_modules/mocha/lib/interfaces/bdd.js +23 -20
- data/vendor/node_modules/mocha/lib/interfaces/common.js +7 -7
- data/vendor/node_modules/mocha/lib/interfaces/exports.js +1 -1
- data/vendor/node_modules/mocha/lib/interfaces/qunit.js +7 -7
- data/vendor/node_modules/mocha/lib/interfaces/tdd.js +9 -9
- data/vendor/node_modules/mocha/lib/mocha.js +105 -99
- data/vendor/node_modules/mocha/lib/nodejs/buffered-worker-pool.js +17 -1
- data/vendor/node_modules/mocha/lib/nodejs/esm-utils.js +124 -0
- data/vendor/node_modules/mocha/lib/reporters/base.js +49 -35
- data/vendor/node_modules/mocha/lib/reporters/doc.js +4 -4
- data/vendor/node_modules/mocha/lib/reporters/dot.js +5 -5
- data/vendor/node_modules/mocha/lib/reporters/html.js +12 -12
- data/vendor/node_modules/mocha/lib/reporters/json-stream.js +4 -4
- data/vendor/node_modules/mocha/lib/reporters/json.js +35 -10
- data/vendor/node_modules/mocha/lib/reporters/landing.js +5 -5
- data/vendor/node_modules/mocha/lib/reporters/list.js +5 -5
- data/vendor/node_modules/mocha/lib/reporters/markdown.js +5 -5
- data/vendor/node_modules/mocha/lib/reporters/min.js +1 -1
- data/vendor/node_modules/mocha/lib/reporters/nyan.js +16 -16
- data/vendor/node_modules/mocha/lib/reporters/progress.js +3 -3
- data/vendor/node_modules/mocha/lib/reporters/spec.js +6 -6
- data/vendor/node_modules/mocha/lib/reporters/tap.js +17 -17
- data/vendor/node_modules/mocha/lib/reporters/xunit.js +9 -9
- data/vendor/node_modules/mocha/lib/runnable.js +21 -21
- data/vendor/node_modules/mocha/lib/runner.js +63 -61
- data/vendor/node_modules/mocha/lib/stats-collector.js +7 -7
- data/vendor/node_modules/mocha/lib/suite.js +46 -75
- data/vendor/node_modules/mocha/lib/test.js +5 -5
- data/vendor/node_modules/mocha/lib/utils.js +19 -114
- data/vendor/node_modules/mocha/mocha-es2018.js +19794 -0
- data/vendor/node_modules/mocha/mocha.js +8059 -6920
- data/vendor/node_modules/mocha/mocha.js.map +1 -1
- data/vendor/node_modules/mocha/node_modules/debug/LICENSE +10 -9
- data/vendor/node_modules/mocha/node_modules/debug/README.md +24 -1
- data/vendor/node_modules/mocha/node_modules/debug/package.json +6 -6
- data/vendor/node_modules/mocha/node_modules/debug/src/common.js +15 -2
- data/vendor/node_modules/{semver → mocha/node_modules/minimatch}/LICENSE +1 -1
- data/vendor/node_modules/mocha/node_modules/minimatch/README.md +230 -0
- data/vendor/node_modules/mocha/node_modules/minimatch/minimatch.js +908 -0
- data/vendor/node_modules/mocha/node_modules/minimatch/package.json +31 -0
- data/vendor/node_modules/mocha/package.json +66 -65
- data/vendor/node_modules/ms/index.js +29 -19
- data/vendor/node_modules/ms/package.json +6 -6
- data/vendor/node_modules/ms/readme.md +18 -9
- data/vendor/node_modules/nanoid/README.md +9 -473
- data/vendor/node_modules/nanoid/async/index.browser.cjs +34 -0
- data/vendor/node_modules/nanoid/async/index.browser.js +7 -43
- data/vendor/node_modules/nanoid/async/index.cjs +5 -41
- data/vendor/node_modules/nanoid/async/index.d.ts +7 -7
- data/vendor/node_modules/nanoid/async/index.js +5 -41
- data/vendor/node_modules/nanoid/async/index.native.js +5 -36
- data/vendor/node_modules/nanoid/async/package.json +2 -1
- data/vendor/node_modules/nanoid/bin/nanoid.cjs +52 -2
- data/vendor/node_modules/nanoid/index.browser.cjs +37 -0
- data/vendor/node_modules/nanoid/index.browser.js +5 -73
- data/vendor/node_modules/nanoid/index.cjs +14 -49
- data/vendor/node_modules/nanoid/index.d.ts +9 -6
- data/vendor/node_modules/nanoid/index.js +14 -49
- data/vendor/node_modules/nanoid/non-secure/index.cjs +3 -12
- data/vendor/node_modules/nanoid/non-secure/index.d.ts +8 -5
- data/vendor/node_modules/nanoid/non-secure/index.js +3 -12
- data/vendor/node_modules/nanoid/package.json +14 -10
- data/vendor/node_modules/nanoid/url-alphabet/index.cjs +1 -4
- data/vendor/node_modules/nanoid/url-alphabet/index.js +1 -4
- data/vendor/node_modules/pathval/CHANGELOG.md +18 -0
- data/vendor/node_modules/pathval/LICENSE +16 -0
- data/vendor/node_modules/pathval/README.md +147 -0
- data/vendor/node_modules/pathval/index.js +301 -0
- data/vendor/node_modules/pathval/package.json +80 -0
- data/vendor/node_modules/pathval/pathval.js +1 -0
- data/vendor/node_modules/picomatch/CHANGELOG.md +16 -0
- data/vendor/node_modules/picomatch/README.md +34 -17
- data/vendor/node_modules/picomatch/lib/parse.js +19 -6
- data/vendor/node_modules/picomatch/lib/picomatch.js +34 -31
- data/vendor/node_modules/picomatch/lib/scan.js +8 -2
- data/vendor/node_modules/picomatch/package.json +1 -1
- data/vendor/node_modules/readdirp/index.js +11 -6
- data/vendor/node_modules/readdirp/package.json +1 -1
- data/vendor/node_modules/serialize-javascript/README.md +2 -4
- data/vendor/node_modules/serialize-javascript/index.js +11 -2
- data/vendor/node_modules/serialize-javascript/package.json +2 -2
- data/vendor/node_modules/source-map-resolve/LICENSE +1 -1
- data/vendor/node_modules/source-map-resolve/changelog.md +6 -0
- data/vendor/node_modules/source-map-resolve/{lib/source-map-resolve-node.js → index.js} +48 -13
- data/vendor/node_modules/source-map-resolve/package.json +7 -14
- data/vendor/node_modules/source-map-resolve/readme.md +1 -39
- data/vendor/node_modules/{cliui/node_modules/string-width → string-width}/index.d.ts +0 -0
- data/vendor/node_modules/string-width/index.js +16 -5
- data/vendor/node_modules/string-width/package.json +11 -10
- data/vendor/node_modules/string-width/readme.md +15 -7
- data/vendor/node_modules/{cliui/node_modules/strip-ansi → strip-ansi}/index.d.ts +0 -0
- data/vendor/node_modules/strip-ansi/index.js +1 -1
- data/vendor/node_modules/strip-ansi/package.json +52 -50
- data/vendor/node_modules/strip-ansi/readme.md +12 -5
- data/vendor/node_modules/{fsevents → type-detect}/LICENSE +1 -4
- data/vendor/node_modules/type-detect/README.md +228 -0
- data/vendor/node_modules/type-detect/index.js +378 -0
- data/vendor/node_modules/type-detect/package.json +1 -0
- data/vendor/node_modules/type-detect/type-detect.js +388 -0
- data/vendor/node_modules/workerpool/HISTORY.md +42 -0
- data/vendor/node_modules/workerpool/README.md +11 -1
- data/vendor/node_modules/workerpool/dist/worker.js +9 -42
- data/vendor/node_modules/workerpool/dist/worker.js.map +1 -1
- data/vendor/node_modules/workerpool/dist/workerpool.js +117 -74
- data/vendor/node_modules/workerpool/dist/workerpool.js.map +1 -1
- data/vendor/node_modules/workerpool/dist/workerpool.min.js +1 -1
- data/vendor/node_modules/workerpool/dist/workerpool.min.js.LICENSE.txt +3 -3
- data/vendor/node_modules/workerpool/dist/workerpool.min.js.map +1 -1
- data/vendor/node_modules/workerpool/package.json +11 -11
- data/vendor/node_modules/workerpool/src/Pool.js +29 -4
- data/vendor/node_modules/workerpool/src/WorkerHandler.js +17 -4
- data/vendor/node_modules/workerpool/src/generated/embeddedWorker.js +1 -1
- data/vendor/node_modules/workerpool/src/header.js +1 -1
- data/vendor/node_modules/workerpool/src/types.js +2 -1
- data/vendor/package-lock.json +401 -664
- data/vendor/package.json +7 -9
- metadata +139 -175
- data/vendor/node_modules/cliui/node_modules/ansi-regex/index.js +0 -10
- data/vendor/node_modules/cliui/node_modules/ansi-regex/license +0 -9
- data/vendor/node_modules/cliui/node_modules/ansi-regex/package.json +0 -55
- data/vendor/node_modules/cliui/node_modules/ansi-regex/readme.md +0 -78
- data/vendor/node_modules/cliui/node_modules/is-fullwidth-code-point/index.js +0 -50
- data/vendor/node_modules/cliui/node_modules/is-fullwidth-code-point/license +0 -9
- data/vendor/node_modules/cliui/node_modules/is-fullwidth-code-point/package.json +0 -42
- data/vendor/node_modules/cliui/node_modules/is-fullwidth-code-point/readme.md +0 -39
- data/vendor/node_modules/cliui/node_modules/string-width/index.js +0 -47
- data/vendor/node_modules/cliui/node_modules/string-width/package.json +0 -56
- data/vendor/node_modules/cliui/node_modules/string-width/readme.md +0 -50
- data/vendor/node_modules/cliui/node_modules/strip-ansi/index.js +0 -4
- data/vendor/node_modules/cliui/node_modules/strip-ansi/package.json +0 -54
- data/vendor/node_modules/cliui/node_modules/strip-ansi/readme.md +0 -46
- data/vendor/node_modules/css-parse/Readme.md +0 -15
- data/vendor/node_modules/css-parse/index.js +0 -1
- data/vendor/node_modules/css-parse/package.json +0 -23
- data/vendor/node_modules/debug/CHANGELOG.md +0 -395
- data/vendor/node_modules/debug/Makefile +0 -58
- data/vendor/node_modules/debug/karma.conf.js +0 -70
- data/vendor/node_modules/debug/node.js +0 -1
- data/vendor/node_modules/debug/src/debug.js +0 -225
- data/vendor/node_modules/fsevents/README.md +0 -83
- data/vendor/node_modules/fsevents/fsevents.d.ts +0 -46
- data/vendor/node_modules/fsevents/fsevents.js +0 -82
- data/vendor/node_modules/fsevents/fsevents.node +0 -0
- data/vendor/node_modules/fsevents/package.json +0 -62
- data/vendor/node_modules/glob/changelog.md +0 -67
- data/vendor/node_modules/mkdirp/CHANGELOG.md +0 -15
- data/vendor/node_modules/mkdirp/bin/cmd.js +0 -68
- data/vendor/node_modules/mkdirp/index.js +0 -31
- data/vendor/node_modules/mkdirp/lib/find-made.js +0 -29
- data/vendor/node_modules/mkdirp/lib/mkdirp-manual.js +0 -64
- data/vendor/node_modules/mkdirp/lib/mkdirp-native.js +0 -39
- data/vendor/node_modules/mkdirp/lib/opts-arg.js +0 -23
- data/vendor/node_modules/mkdirp/lib/path-arg.js +0 -29
- data/vendor/node_modules/mkdirp/lib/use-native.js +0 -10
- data/vendor/node_modules/mkdirp/package.json +0 -44
- data/vendor/node_modules/mkdirp/readme.markdown +0 -266
- data/vendor/node_modules/mocha/CHANGELOG.md +0 -931
- data/vendor/node_modules/mocha/lib/esm-utils.js +0 -58
- data/vendor/node_modules/mocha/node_modules/glob/LICENSE +0 -21
- data/vendor/node_modules/mocha/node_modules/glob/README.md +0 -375
- data/vendor/node_modules/mocha/node_modules/glob/changelog.md +0 -67
- data/vendor/node_modules/mocha/node_modules/glob/common.js +0 -240
- data/vendor/node_modules/mocha/node_modules/glob/glob.js +0 -790
- data/vendor/node_modules/mocha/node_modules/glob/package.json +0 -46
- data/vendor/node_modules/mocha/node_modules/glob/sync.js +0 -486
- data/vendor/node_modules/nanoid/CHANGELOG.md +0 -241
- data/vendor/node_modules/nanoid/index.dev.js +0 -105
- data/vendor/node_modules/nanoid/index.prod.js +0 -105
- data/vendor/node_modules/resolve-url/bower.json +0 -15
- data/vendor/node_modules/resolve-url/changelog.md +0 -15
- data/vendor/node_modules/resolve-url/component.json +0 -15
- data/vendor/node_modules/resolve-url/package.json +0 -34
- data/vendor/node_modules/resolve-url/readme.md +0 -83
- data/vendor/node_modules/resolve-url/resolve-url.js +0 -47
- data/vendor/node_modules/resolve-url/test/resolve-url.js +0 -70
- data/vendor/node_modules/semver/CHANGELOG.md +0 -70
- data/vendor/node_modules/semver/README.md +0 -443
- data/vendor/node_modules/semver/bin/semver.js +0 -174
- data/vendor/node_modules/semver/package.json +0 -28
- data/vendor/node_modules/semver/range.bnf +0 -16
- data/vendor/node_modules/semver/semver.js +0 -1596
- data/vendor/node_modules/should/CONTRIBUTING.md +0 -14
- data/vendor/node_modules/should/History.md +0 -554
- data/vendor/node_modules/should/LICENSE +0 -20
- data/vendor/node_modules/should/Readme.md +0 -223
- data/vendor/node_modules/should/as-function.js +0 -2935
- data/vendor/node_modules/should/cjs/should.js +0 -2962
- data/vendor/node_modules/should/es6/should.js +0 -2958
- data/vendor/node_modules/should/package.json +0 -51
- data/vendor/node_modules/should/should.d.ts +0 -243
- data/vendor/node_modules/should/should.js +0 -4371
- data/vendor/node_modules/should-equal/LICENSE +0 -21
- data/vendor/node_modules/should-equal/README.md +0 -24
- data/vendor/node_modules/should-equal/cjs/should-equal.js +0 -333
- data/vendor/node_modules/should-equal/es6/should-equal.js +0 -329
- data/vendor/node_modules/should-equal/package.json +0 -38
- data/vendor/node_modules/should-format/README.md +0 -6
- data/vendor/node_modules/should-format/cjs/should-format.js +0 -532
- data/vendor/node_modules/should-format/es6/should-format.js +0 -528
- data/vendor/node_modules/should-format/package.json +0 -44
- data/vendor/node_modules/should-type/LICENSE +0 -22
- data/vendor/node_modules/should-type/README.md +0 -4
- data/vendor/node_modules/should-type/cjs/should-type.js +0 -263
- data/vendor/node_modules/should-type/es6/should-type.js +0 -261
- data/vendor/node_modules/should-type/package.json +0 -38
- data/vendor/node_modules/should-type-adaptors/README.md +0 -1
- data/vendor/node_modules/should-type-adaptors/cjs/should-type-adaptors.js +0 -288
- data/vendor/node_modules/should-type-adaptors/es6/should-type-adaptors.js +0 -272
- data/vendor/node_modules/should-type-adaptors/package.json +0 -43
- data/vendor/node_modules/should-util/LICENSE +0 -21
- data/vendor/node_modules/should-util/README.md +0 -2
- data/vendor/node_modules/should-util/cjs/should-util.js +0 -50
- data/vendor/node_modules/should-util/es6/should-util.js +0 -42
- data/vendor/node_modules/should-util/package.json +0 -40
- data/vendor/node_modules/source-map-resolve/lib/decode-uri-component.js +0 -8
- data/vendor/node_modules/source-map-resolve/lib/resolve-url.js +0 -9
- data/vendor/node_modules/source-map-resolve/source-map-resolve.js +0 -348
- data/vendor/node_modules/source-map-url/changelog.md +0 -57
- data/vendor/node_modules/source-map-url/package.json +0 -39
- data/vendor/node_modules/source-map-url/readme.md +0 -97
- data/vendor/node_modules/source-map-url/source-map-url.js +0 -57
- data/vendor/node_modules/urix/index.js +0 -17
- data/vendor/node_modules/urix/package.json +0 -25
- data/vendor/node_modules/urix/readme.md +0 -46
- data/vendor/node_modules/urix/test/index.js +0 -43
- data/vendor/node_modules/wide-align/LICENSE +0 -14
- data/vendor/node_modules/wide-align/README.md +0 -47
- data/vendor/node_modules/wide-align/align.js +0 -65
- data/vendor/node_modules/wide-align/package.json +0 -33
- data/vendor/node_modules/wrap-ansi/node_modules/ansi-regex/index.d.ts +0 -37
- data/vendor/node_modules/wrap-ansi/node_modules/ansi-regex/index.js +0 -10
- data/vendor/node_modules/wrap-ansi/node_modules/ansi-regex/license +0 -9
- data/vendor/node_modules/wrap-ansi/node_modules/ansi-regex/package.json +0 -55
- data/vendor/node_modules/wrap-ansi/node_modules/ansi-regex/readme.md +0 -78
- data/vendor/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/index.d.ts +0 -17
- data/vendor/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/index.js +0 -50
- data/vendor/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/license +0 -9
- data/vendor/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/package.json +0 -42
- data/vendor/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/readme.md +0 -39
- data/vendor/node_modules/wrap-ansi/node_modules/string-width/index.d.ts +0 -29
- data/vendor/node_modules/wrap-ansi/node_modules/string-width/index.js +0 -47
- data/vendor/node_modules/wrap-ansi/node_modules/string-width/license +0 -9
- data/vendor/node_modules/wrap-ansi/node_modules/string-width/package.json +0 -56
- data/vendor/node_modules/wrap-ansi/node_modules/string-width/readme.md +0 -50
- data/vendor/node_modules/wrap-ansi/node_modules/strip-ansi/index.d.ts +0 -17
- data/vendor/node_modules/wrap-ansi/node_modules/strip-ansi/index.js +0 -4
- data/vendor/node_modules/wrap-ansi/node_modules/strip-ansi/license +0 -9
- data/vendor/node_modules/wrap-ansi/node_modules/strip-ansi/package.json +0 -54
- data/vendor/node_modules/wrap-ansi/node_modules/strip-ansi/readme.md +0 -46
- data/vendor/node_modules/yargs/node_modules/ansi-regex/index.d.ts +0 -37
- data/vendor/node_modules/yargs/node_modules/ansi-regex/index.js +0 -10
- data/vendor/node_modules/yargs/node_modules/ansi-regex/license +0 -9
- data/vendor/node_modules/yargs/node_modules/ansi-regex/package.json +0 -55
- data/vendor/node_modules/yargs/node_modules/ansi-regex/readme.md +0 -78
- data/vendor/node_modules/yargs/node_modules/is-fullwidth-code-point/index.d.ts +0 -17
- data/vendor/node_modules/yargs/node_modules/is-fullwidth-code-point/index.js +0 -50
- data/vendor/node_modules/yargs/node_modules/is-fullwidth-code-point/license +0 -9
- data/vendor/node_modules/yargs/node_modules/is-fullwidth-code-point/package.json +0 -42
- data/vendor/node_modules/yargs/node_modules/is-fullwidth-code-point/readme.md +0 -39
- data/vendor/node_modules/yargs/node_modules/string-width/index.d.ts +0 -29
- data/vendor/node_modules/yargs/node_modules/string-width/index.js +0 -47
- data/vendor/node_modules/yargs/node_modules/string-width/license +0 -9
- data/vendor/node_modules/yargs/node_modules/string-width/package.json +0 -56
- data/vendor/node_modules/yargs/node_modules/string-width/readme.md +0 -50
- data/vendor/node_modules/yargs/node_modules/strip-ansi/index.d.ts +0 -17
- data/vendor/node_modules/yargs/node_modules/strip-ansi/index.js +0 -4
- data/vendor/node_modules/yargs/node_modules/strip-ansi/license +0 -9
- data/vendor/node_modules/yargs/node_modules/strip-ansi/package.json +0 -54
- data/vendor/node_modules/yargs/node_modules/strip-ansi/readme.md +0 -46
- data/vendor/test.js +0 -31
@@ -0,0 +1,106 @@
|
|
1
|
+
|
2
|
+
/*!
|
3
|
+
* Chrome
|
4
|
+
*/
|
5
|
+
|
6
|
+
exports['SL_Chrome'] = {
|
7
|
+
base: 'SauceLabs'
|
8
|
+
, browserName: 'chrome'
|
9
|
+
};
|
10
|
+
|
11
|
+
/*!
|
12
|
+
* Firefox
|
13
|
+
*/
|
14
|
+
|
15
|
+
exports['SL_Firefox'] = {
|
16
|
+
base: 'SauceLabs'
|
17
|
+
, browserName: 'firefox'
|
18
|
+
};
|
19
|
+
|
20
|
+
exports['SL_Firefox_ESR'] = {
|
21
|
+
base: 'SauceLabs'
|
22
|
+
, browserName: 'firefox'
|
23
|
+
, version: 38
|
24
|
+
};
|
25
|
+
|
26
|
+
/*!
|
27
|
+
* Internet Explorer
|
28
|
+
*/
|
29
|
+
|
30
|
+
exports['SL_IE'] = {
|
31
|
+
base: 'SauceLabs'
|
32
|
+
, browserName: 'internet explorer'
|
33
|
+
};
|
34
|
+
|
35
|
+
/*!
|
36
|
+
* TODO: fails because of Uint8Array support
|
37
|
+
*
|
38
|
+
exports['SL_IE_Old'] = {
|
39
|
+
base: 'SauceLabs'
|
40
|
+
, browserName: 'internet explorer'
|
41
|
+
, version: 10
|
42
|
+
};
|
43
|
+
*/
|
44
|
+
|
45
|
+
exports['SL_Edge'] = {
|
46
|
+
base: 'SauceLabs'
|
47
|
+
, browserName: 'microsoftedge'
|
48
|
+
};
|
49
|
+
|
50
|
+
/*!
|
51
|
+
* Safari
|
52
|
+
*/
|
53
|
+
|
54
|
+
exports['SL_Safari'] = {
|
55
|
+
base: 'SauceLabs'
|
56
|
+
, browserName: 'safari'
|
57
|
+
, platform: 'Mac 10.11'
|
58
|
+
};
|
59
|
+
|
60
|
+
/*!
|
61
|
+
* iPhone
|
62
|
+
*/
|
63
|
+
|
64
|
+
/*!
|
65
|
+
* TODO: These take forever to boot or shut down. Causes timeout.
|
66
|
+
*
|
67
|
+
|
68
|
+
exports['SL_iPhone_6'] = {
|
69
|
+
base: 'SauceLabs'
|
70
|
+
, browserName: 'iphone'
|
71
|
+
, platform: 'Mac 10.8'
|
72
|
+
, version: '6'
|
73
|
+
};
|
74
|
+
|
75
|
+
exports['SL_iPhone_5-1'] = {
|
76
|
+
base: 'SauceLabs'
|
77
|
+
, browserName: 'iphone'
|
78
|
+
, platform: 'Mac 10.8'
|
79
|
+
, version: '5.1'
|
80
|
+
};
|
81
|
+
|
82
|
+
exports['SL_iPhone_5'] = {
|
83
|
+
base: 'SauceLabs'
|
84
|
+
, browserName: 'iphone'
|
85
|
+
, platform: 'Mac 10.6'
|
86
|
+
, version: '5'
|
87
|
+
};
|
88
|
+
|
89
|
+
*/
|
90
|
+
|
91
|
+
/*!
|
92
|
+
* Android
|
93
|
+
*/
|
94
|
+
|
95
|
+
/*!
|
96
|
+
* TODO: fails because of error serialization
|
97
|
+
*
|
98
|
+
|
99
|
+
exports['SL_Android_4'] = {
|
100
|
+
base: 'SauceLabs'
|
101
|
+
, browserName: 'android'
|
102
|
+
, platform: 'Linux'
|
103
|
+
, version: '4'
|
104
|
+
};
|
105
|
+
|
106
|
+
*/
|
@@ -33,7 +33,7 @@
|
|
33
33
|
<br>
|
34
34
|
<br>
|
35
35
|
<a href="https://retool.com/?utm_campaign=sindresorhus">
|
36
|
-
<img src="https://sindresorhus.com/assets/thanks/retool-logo.svg" width="
|
36
|
+
<img src="https://sindresorhus.com/assets/thanks/retool-logo.svg" width="230"/>
|
37
37
|
</a>
|
38
38
|
<br>
|
39
39
|
<br>
|
@@ -48,6 +48,12 @@
|
|
48
48
|
<span>and avoiding access controls. Keep your team and servers in sync with Doppler.</span>
|
49
49
|
</div>
|
50
50
|
</a>
|
51
|
+
<br>
|
52
|
+
<a href="https://uibakery.io/?utm_source=chalk&utm_medium=sponsor&utm_campaign=github">
|
53
|
+
<div>
|
54
|
+
<img src="https://sindresorhus.com/assets/thanks/uibakery-logo.jpg" width="270" alt="UI Bakery">
|
55
|
+
</div>
|
56
|
+
</a>
|
51
57
|
</p>
|
52
58
|
</div>
|
53
59
|
|
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
Copyright (c) 2014 Simon Lydell
|
1
|
+
Copyright (c) 2013 Jake Luer <jake@alogicalparadox.com> (http://alogicalparadox.com)
|
4
2
|
|
5
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
4
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -0,0 +1,207 @@
|
|
1
|
+
<h1 align=center>
|
2
|
+
<a href="http://chaijs.com" title="Chai Documentation">
|
3
|
+
<img alt="ChaiJS" src="http://chaijs.com/img/chai-logo.png"/> check-error
|
4
|
+
</a>
|
5
|
+
</h1>
|
6
|
+
|
7
|
+
<p align=center>
|
8
|
+
Error comparison and information related utility for <a href="http://nodejs.org">node</a> and the browser.
|
9
|
+
</p>
|
10
|
+
|
11
|
+
<p align=center>
|
12
|
+
<a href="./LICENSE">
|
13
|
+
<img
|
14
|
+
alt="license:mit"
|
15
|
+
src="https://img.shields.io/badge/license-mit-green.svg?style=flat-square"
|
16
|
+
/>
|
17
|
+
</a>
|
18
|
+
<a href="https://github.com/chaijs/check-error/releases">
|
19
|
+
<img
|
20
|
+
alt="tag:?"
|
21
|
+
src="https://img.shields.io/github/tag/chaijs/check-error.svg?style=flat-square"
|
22
|
+
/>
|
23
|
+
</a>
|
24
|
+
<a href="https://travis-ci.org/chaijs/check-error">
|
25
|
+
<img
|
26
|
+
alt="build:?"
|
27
|
+
src="https://img.shields.io/travis/chaijs/check-error/master.svg?style=flat-square"
|
28
|
+
/>
|
29
|
+
</a>
|
30
|
+
<a href="https://coveralls.io/r/chaijs/check-error">
|
31
|
+
<img
|
32
|
+
alt="coverage:?"
|
33
|
+
src="https://img.shields.io/coveralls/chaijs/check-error/master.svg?style=flat-square"
|
34
|
+
/>
|
35
|
+
</a>
|
36
|
+
<a href="https://www.npmjs.com/packages/check-error">
|
37
|
+
<img
|
38
|
+
alt="npm:?"
|
39
|
+
src="https://img.shields.io/npm/v/check-error.svg?style=flat-square"
|
40
|
+
/>
|
41
|
+
</a>
|
42
|
+
<a href="https://www.npmjs.com/packages/check-error">
|
43
|
+
<img
|
44
|
+
alt="dependencies:?"
|
45
|
+
src="https://img.shields.io/npm/dm/check-error.svg?style=flat-square"
|
46
|
+
/>
|
47
|
+
</a>
|
48
|
+
<a href="">
|
49
|
+
<img
|
50
|
+
alt="devDependencies:?"
|
51
|
+
src="https://img.shields.io/david/chaijs/check-error.svg?style=flat-square"
|
52
|
+
/>
|
53
|
+
</a>
|
54
|
+
<br/>
|
55
|
+
<a href="https://saucelabs.com/u/chaijs-check-error">
|
56
|
+
<img
|
57
|
+
alt="Selenium Test Status"
|
58
|
+
src="https://saucelabs.com/browser-matrix/chaijs-check-error.svg"
|
59
|
+
/>
|
60
|
+
</a>
|
61
|
+
<br>
|
62
|
+
<a href="https://chai-slack.herokuapp.com/">
|
63
|
+
<img
|
64
|
+
alt="Join the Slack chat"
|
65
|
+
src="https://img.shields.io/badge/slack-join%20chat-E2206F.svg?style=flat-square"
|
66
|
+
/>
|
67
|
+
</a>
|
68
|
+
<a href="https://gitter.im/chaijs/chai">
|
69
|
+
<img
|
70
|
+
alt="Join the Gitter chat"
|
71
|
+
src="https://img.shields.io/badge/gitter-join%20chat-D0104D.svg?style=flat-square"
|
72
|
+
/>
|
73
|
+
</a>
|
74
|
+
</p>
|
75
|
+
|
76
|
+
## What is Check-Error?
|
77
|
+
|
78
|
+
Check-Error is a module which you can use to retrieve an Error's information such as its `message` or `constructor` name and also to check whether two Errors are compatible based on their messages, constructors or even instances.
|
79
|
+
|
80
|
+
## Installation
|
81
|
+
|
82
|
+
### Node.js
|
83
|
+
|
84
|
+
`check-error` is available on [npm](http://npmjs.org). To install it, type:
|
85
|
+
|
86
|
+
$ npm install check-error
|
87
|
+
|
88
|
+
### Browsers
|
89
|
+
|
90
|
+
You can also use it within the browser; install via npm and use the `check-error.js` file found within the download. For example:
|
91
|
+
|
92
|
+
```html
|
93
|
+
<script src="./node_modules/check-error/check-error.js"></script>
|
94
|
+
```
|
95
|
+
|
96
|
+
## Usage
|
97
|
+
|
98
|
+
The primary export of `check-error` is an object which has the following methods:
|
99
|
+
|
100
|
+
* `compatibleInstance(err, errorLike)` - Checks if an error is compatible with another `errorLike` object. If `errorLike` is an error instance we do a strict comparison, otherwise we return `false` by default, because instances of objects can only be compatible if they're both error instances.
|
101
|
+
* `compatibleConstructor(err, errorLike)` - Checks if an error's constructor is compatible with another `errorLike` object. If `err` has the same constructor as `errorLike` or if `err` is an instance of `errorLike`.
|
102
|
+
* `compatibleMessage(err, errMatcher)` - Checks if an error message is compatible with an `errMatcher` RegExp or String (we check if the message contains the String).
|
103
|
+
* `getConstructorName(errorLike)` - Retrieves the name of a constructor, an error's constructor or `errorLike` itself if it's not an error instance or constructor.
|
104
|
+
* `getMessage(err)` - Retrieves the message of an error or `err` itself if it's a String. If `err` or `err.message` is undefined we return an empty String.
|
105
|
+
|
106
|
+
```js
|
107
|
+
var checkError = require('check-error');
|
108
|
+
```
|
109
|
+
|
110
|
+
#### .compatibleInstance(err, errorLike)
|
111
|
+
|
112
|
+
```js
|
113
|
+
var checkError = require('check-error');
|
114
|
+
|
115
|
+
var funcThatThrows = function() { throw new TypeError('I am a TypeError') };
|
116
|
+
var caughtErr;
|
117
|
+
|
118
|
+
try {
|
119
|
+
funcThatThrows();
|
120
|
+
} catch(e) {
|
121
|
+
caughtErr = e;
|
122
|
+
}
|
123
|
+
|
124
|
+
var sameInstance = caughtErr;
|
125
|
+
|
126
|
+
checkError.compatibleInstance(caughtErr, sameInstance); // true
|
127
|
+
checkError.compatibleInstance(caughtErr, new TypeError('Another error')); // false
|
128
|
+
```
|
129
|
+
|
130
|
+
#### .compatibleConstructor(err, errorLike)
|
131
|
+
|
132
|
+
```js
|
133
|
+
var checkError = require('check-error');
|
134
|
+
|
135
|
+
var funcThatThrows = function() { throw new TypeError('I am a TypeError') };
|
136
|
+
var caughtErr;
|
137
|
+
|
138
|
+
try {
|
139
|
+
funcThatThrows();
|
140
|
+
} catch(e) {
|
141
|
+
caughtErr = e;
|
142
|
+
}
|
143
|
+
|
144
|
+
checkError.compatibleConstructor(caughtErr, Error); // true
|
145
|
+
checkError.compatibleConstructor(caughtErr, TypeError); // true
|
146
|
+
checkError.compatibleConstructor(caughtErr, RangeError); // false
|
147
|
+
```
|
148
|
+
|
149
|
+
#### .compatibleMessage(err, errMatcher)
|
150
|
+
|
151
|
+
```js
|
152
|
+
var checkError = require('check-error');
|
153
|
+
|
154
|
+
var funcThatThrows = function() { throw new TypeError('I am a TypeError') };
|
155
|
+
var caughtErr;
|
156
|
+
|
157
|
+
try {
|
158
|
+
funcThatThrows();
|
159
|
+
} catch(e) {
|
160
|
+
caughtErr = e;
|
161
|
+
}
|
162
|
+
|
163
|
+
var sameInstance = caughtErr;
|
164
|
+
|
165
|
+
checkError.compatibleMessage(caughtErr, /TypeError$/); // true
|
166
|
+
checkError.compatibleMessage(caughtErr, 'I am a'); // true
|
167
|
+
checkError.compatibleMessage(caughtErr, /unicorn/); // false
|
168
|
+
checkError.compatibleMessage(caughtErr, 'I do not exist'); // false
|
169
|
+
```
|
170
|
+
|
171
|
+
#### .getConstructorName(errorLike)
|
172
|
+
|
173
|
+
```js
|
174
|
+
var checkError = require('check-error');
|
175
|
+
|
176
|
+
var funcThatThrows = function() { throw new TypeError('I am a TypeError') };
|
177
|
+
var caughtErr;
|
178
|
+
|
179
|
+
try {
|
180
|
+
funcThatThrows();
|
181
|
+
} catch(e) {
|
182
|
+
caughtErr = e;
|
183
|
+
}
|
184
|
+
|
185
|
+
var sameInstance = caughtErr;
|
186
|
+
|
187
|
+
checkError.getConstructorName(caughtErr) // 'TypeError'
|
188
|
+
```
|
189
|
+
|
190
|
+
#### .getMessage(err)
|
191
|
+
|
192
|
+
```js
|
193
|
+
var checkError = require('check-error');
|
194
|
+
|
195
|
+
var funcThatThrows = function() { throw new TypeError('I am a TypeError') };
|
196
|
+
var caughtErr;
|
197
|
+
|
198
|
+
try {
|
199
|
+
funcThatThrows();
|
200
|
+
} catch(e) {
|
201
|
+
caughtErr = e;
|
202
|
+
}
|
203
|
+
|
204
|
+
var sameInstance = caughtErr;
|
205
|
+
|
206
|
+
checkError.getMessage(caughtErr) // 'I am a TypeError'
|
207
|
+
```
|
@@ -0,0 +1,176 @@
|
|
1
|
+
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.checkError = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
2
|
+
'use strict';
|
3
|
+
|
4
|
+
/* !
|
5
|
+
* Chai - checkError utility
|
6
|
+
* Copyright(c) 2012-2016 Jake Luer <jake@alogicalparadox.com>
|
7
|
+
* MIT Licensed
|
8
|
+
*/
|
9
|
+
|
10
|
+
/**
|
11
|
+
* ### .checkError
|
12
|
+
*
|
13
|
+
* Checks that an error conforms to a given set of criteria and/or retrieves information about it.
|
14
|
+
*
|
15
|
+
* @api public
|
16
|
+
*/
|
17
|
+
|
18
|
+
/**
|
19
|
+
* ### .compatibleInstance(thrown, errorLike)
|
20
|
+
*
|
21
|
+
* Checks if two instances are compatible (strict equal).
|
22
|
+
* Returns false if errorLike is not an instance of Error, because instances
|
23
|
+
* can only be compatible if they're both error instances.
|
24
|
+
*
|
25
|
+
* @name compatibleInstance
|
26
|
+
* @param {Error} thrown error
|
27
|
+
* @param {Error|ErrorConstructor} errorLike object to compare against
|
28
|
+
* @namespace Utils
|
29
|
+
* @api public
|
30
|
+
*/
|
31
|
+
|
32
|
+
function compatibleInstance(thrown, errorLike) {
|
33
|
+
return errorLike instanceof Error && thrown === errorLike;
|
34
|
+
}
|
35
|
+
|
36
|
+
/**
|
37
|
+
* ### .compatibleConstructor(thrown, errorLike)
|
38
|
+
*
|
39
|
+
* Checks if two constructors are compatible.
|
40
|
+
* This function can receive either an error constructor or
|
41
|
+
* an error instance as the `errorLike` argument.
|
42
|
+
* Constructors are compatible if they're the same or if one is
|
43
|
+
* an instance of another.
|
44
|
+
*
|
45
|
+
* @name compatibleConstructor
|
46
|
+
* @param {Error} thrown error
|
47
|
+
* @param {Error|ErrorConstructor} errorLike object to compare against
|
48
|
+
* @namespace Utils
|
49
|
+
* @api public
|
50
|
+
*/
|
51
|
+
|
52
|
+
function compatibleConstructor(thrown, errorLike) {
|
53
|
+
if (errorLike instanceof Error) {
|
54
|
+
// If `errorLike` is an instance of any error we compare their constructors
|
55
|
+
return thrown.constructor === errorLike.constructor || thrown instanceof errorLike.constructor;
|
56
|
+
} else if (errorLike.prototype instanceof Error || errorLike === Error) {
|
57
|
+
// If `errorLike` is a constructor that inherits from Error, we compare `thrown` to `errorLike` directly
|
58
|
+
return thrown.constructor === errorLike || thrown instanceof errorLike;
|
59
|
+
}
|
60
|
+
|
61
|
+
return false;
|
62
|
+
}
|
63
|
+
|
64
|
+
/**
|
65
|
+
* ### .compatibleMessage(thrown, errMatcher)
|
66
|
+
*
|
67
|
+
* Checks if an error's message is compatible with a matcher (String or RegExp).
|
68
|
+
* If the message contains the String or passes the RegExp test,
|
69
|
+
* it is considered compatible.
|
70
|
+
*
|
71
|
+
* @name compatibleMessage
|
72
|
+
* @param {Error} thrown error
|
73
|
+
* @param {String|RegExp} errMatcher to look for into the message
|
74
|
+
* @namespace Utils
|
75
|
+
* @api public
|
76
|
+
*/
|
77
|
+
|
78
|
+
function compatibleMessage(thrown, errMatcher) {
|
79
|
+
var comparisonString = typeof thrown === 'string' ? thrown : thrown.message;
|
80
|
+
if (errMatcher instanceof RegExp) {
|
81
|
+
return errMatcher.test(comparisonString);
|
82
|
+
} else if (typeof errMatcher === 'string') {
|
83
|
+
return comparisonString.indexOf(errMatcher) !== -1; // eslint-disable-line no-magic-numbers
|
84
|
+
}
|
85
|
+
|
86
|
+
return false;
|
87
|
+
}
|
88
|
+
|
89
|
+
/**
|
90
|
+
* ### .getFunctionName(constructorFn)
|
91
|
+
*
|
92
|
+
* Returns the name of a function.
|
93
|
+
* This also includes a polyfill function if `constructorFn.name` is not defined.
|
94
|
+
*
|
95
|
+
* @name getFunctionName
|
96
|
+
* @param {Function} constructorFn
|
97
|
+
* @namespace Utils
|
98
|
+
* @api private
|
99
|
+
*/
|
100
|
+
|
101
|
+
var functionNameMatch = /\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\(\/]+)/;
|
102
|
+
function getFunctionName(constructorFn) {
|
103
|
+
var name = '';
|
104
|
+
if (typeof constructorFn.name === 'undefined') {
|
105
|
+
// Here we run a polyfill if constructorFn.name is not defined
|
106
|
+
var match = String(constructorFn).match(functionNameMatch);
|
107
|
+
if (match) {
|
108
|
+
name = match[1];
|
109
|
+
}
|
110
|
+
} else {
|
111
|
+
name = constructorFn.name;
|
112
|
+
}
|
113
|
+
|
114
|
+
return name;
|
115
|
+
}
|
116
|
+
|
117
|
+
/**
|
118
|
+
* ### .getConstructorName(errorLike)
|
119
|
+
*
|
120
|
+
* Gets the constructor name for an Error instance or constructor itself.
|
121
|
+
*
|
122
|
+
* @name getConstructorName
|
123
|
+
* @param {Error|ErrorConstructor} errorLike
|
124
|
+
* @namespace Utils
|
125
|
+
* @api public
|
126
|
+
*/
|
127
|
+
|
128
|
+
function getConstructorName(errorLike) {
|
129
|
+
var constructorName = errorLike;
|
130
|
+
if (errorLike instanceof Error) {
|
131
|
+
constructorName = getFunctionName(errorLike.constructor);
|
132
|
+
} else if (typeof errorLike === 'function') {
|
133
|
+
// If `err` is not an instance of Error it is an error constructor itself or another function.
|
134
|
+
// If we've got a common function we get its name, otherwise we may need to create a new instance
|
135
|
+
// of the error just in case it's a poorly-constructed error. Please see chaijs/chai/issues/45 to know more.
|
136
|
+
constructorName = getFunctionName(errorLike).trim() ||
|
137
|
+
getFunctionName(new errorLike()); // eslint-disable-line new-cap
|
138
|
+
}
|
139
|
+
|
140
|
+
return constructorName;
|
141
|
+
}
|
142
|
+
|
143
|
+
/**
|
144
|
+
* ### .getMessage(errorLike)
|
145
|
+
*
|
146
|
+
* Gets the error message from an error.
|
147
|
+
* If `err` is a String itself, we return it.
|
148
|
+
* If the error has no message, we return an empty string.
|
149
|
+
*
|
150
|
+
* @name getMessage
|
151
|
+
* @param {Error|String} errorLike
|
152
|
+
* @namespace Utils
|
153
|
+
* @api public
|
154
|
+
*/
|
155
|
+
|
156
|
+
function getMessage(errorLike) {
|
157
|
+
var msg = '';
|
158
|
+
if (errorLike && errorLike.message) {
|
159
|
+
msg = errorLike.message;
|
160
|
+
} else if (typeof errorLike === 'string') {
|
161
|
+
msg = errorLike;
|
162
|
+
}
|
163
|
+
|
164
|
+
return msg;
|
165
|
+
}
|
166
|
+
|
167
|
+
module.exports = {
|
168
|
+
compatibleInstance: compatibleInstance,
|
169
|
+
compatibleConstructor: compatibleConstructor,
|
170
|
+
compatibleMessage: compatibleMessage,
|
171
|
+
getMessage: getMessage,
|
172
|
+
getConstructorName: getConstructorName,
|
173
|
+
};
|
174
|
+
|
175
|
+
},{}]},{},[1])(1)
|
176
|
+
});
|
@@ -0,0 +1,172 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
/* !
|
4
|
+
* Chai - checkError utility
|
5
|
+
* Copyright(c) 2012-2016 Jake Luer <jake@alogicalparadox.com>
|
6
|
+
* MIT Licensed
|
7
|
+
*/
|
8
|
+
|
9
|
+
/**
|
10
|
+
* ### .checkError
|
11
|
+
*
|
12
|
+
* Checks that an error conforms to a given set of criteria and/or retrieves information about it.
|
13
|
+
*
|
14
|
+
* @api public
|
15
|
+
*/
|
16
|
+
|
17
|
+
/**
|
18
|
+
* ### .compatibleInstance(thrown, errorLike)
|
19
|
+
*
|
20
|
+
* Checks if two instances are compatible (strict equal).
|
21
|
+
* Returns false if errorLike is not an instance of Error, because instances
|
22
|
+
* can only be compatible if they're both error instances.
|
23
|
+
*
|
24
|
+
* @name compatibleInstance
|
25
|
+
* @param {Error} thrown error
|
26
|
+
* @param {Error|ErrorConstructor} errorLike object to compare against
|
27
|
+
* @namespace Utils
|
28
|
+
* @api public
|
29
|
+
*/
|
30
|
+
|
31
|
+
function compatibleInstance(thrown, errorLike) {
|
32
|
+
return errorLike instanceof Error && thrown === errorLike;
|
33
|
+
}
|
34
|
+
|
35
|
+
/**
|
36
|
+
* ### .compatibleConstructor(thrown, errorLike)
|
37
|
+
*
|
38
|
+
* Checks if two constructors are compatible.
|
39
|
+
* This function can receive either an error constructor or
|
40
|
+
* an error instance as the `errorLike` argument.
|
41
|
+
* Constructors are compatible if they're the same or if one is
|
42
|
+
* an instance of another.
|
43
|
+
*
|
44
|
+
* @name compatibleConstructor
|
45
|
+
* @param {Error} thrown error
|
46
|
+
* @param {Error|ErrorConstructor} errorLike object to compare against
|
47
|
+
* @namespace Utils
|
48
|
+
* @api public
|
49
|
+
*/
|
50
|
+
|
51
|
+
function compatibleConstructor(thrown, errorLike) {
|
52
|
+
if (errorLike instanceof Error) {
|
53
|
+
// If `errorLike` is an instance of any error we compare their constructors
|
54
|
+
return thrown.constructor === errorLike.constructor || thrown instanceof errorLike.constructor;
|
55
|
+
} else if (errorLike.prototype instanceof Error || errorLike === Error) {
|
56
|
+
// If `errorLike` is a constructor that inherits from Error, we compare `thrown` to `errorLike` directly
|
57
|
+
return thrown.constructor === errorLike || thrown instanceof errorLike;
|
58
|
+
}
|
59
|
+
|
60
|
+
return false;
|
61
|
+
}
|
62
|
+
|
63
|
+
/**
|
64
|
+
* ### .compatibleMessage(thrown, errMatcher)
|
65
|
+
*
|
66
|
+
* Checks if an error's message is compatible with a matcher (String or RegExp).
|
67
|
+
* If the message contains the String or passes the RegExp test,
|
68
|
+
* it is considered compatible.
|
69
|
+
*
|
70
|
+
* @name compatibleMessage
|
71
|
+
* @param {Error} thrown error
|
72
|
+
* @param {String|RegExp} errMatcher to look for into the message
|
73
|
+
* @namespace Utils
|
74
|
+
* @api public
|
75
|
+
*/
|
76
|
+
|
77
|
+
function compatibleMessage(thrown, errMatcher) {
|
78
|
+
var comparisonString = typeof thrown === 'string' ? thrown : thrown.message;
|
79
|
+
if (errMatcher instanceof RegExp) {
|
80
|
+
return errMatcher.test(comparisonString);
|
81
|
+
} else if (typeof errMatcher === 'string') {
|
82
|
+
return comparisonString.indexOf(errMatcher) !== -1; // eslint-disable-line no-magic-numbers
|
83
|
+
}
|
84
|
+
|
85
|
+
return false;
|
86
|
+
}
|
87
|
+
|
88
|
+
/**
|
89
|
+
* ### .getFunctionName(constructorFn)
|
90
|
+
*
|
91
|
+
* Returns the name of a function.
|
92
|
+
* This also includes a polyfill function if `constructorFn.name` is not defined.
|
93
|
+
*
|
94
|
+
* @name getFunctionName
|
95
|
+
* @param {Function} constructorFn
|
96
|
+
* @namespace Utils
|
97
|
+
* @api private
|
98
|
+
*/
|
99
|
+
|
100
|
+
var functionNameMatch = /\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\(\/]+)/;
|
101
|
+
function getFunctionName(constructorFn) {
|
102
|
+
var name = '';
|
103
|
+
if (typeof constructorFn.name === 'undefined') {
|
104
|
+
// Here we run a polyfill if constructorFn.name is not defined
|
105
|
+
var match = String(constructorFn).match(functionNameMatch);
|
106
|
+
if (match) {
|
107
|
+
name = match[1];
|
108
|
+
}
|
109
|
+
} else {
|
110
|
+
name = constructorFn.name;
|
111
|
+
}
|
112
|
+
|
113
|
+
return name;
|
114
|
+
}
|
115
|
+
|
116
|
+
/**
|
117
|
+
* ### .getConstructorName(errorLike)
|
118
|
+
*
|
119
|
+
* Gets the constructor name for an Error instance or constructor itself.
|
120
|
+
*
|
121
|
+
* @name getConstructorName
|
122
|
+
* @param {Error|ErrorConstructor} errorLike
|
123
|
+
* @namespace Utils
|
124
|
+
* @api public
|
125
|
+
*/
|
126
|
+
|
127
|
+
function getConstructorName(errorLike) {
|
128
|
+
var constructorName = errorLike;
|
129
|
+
if (errorLike instanceof Error) {
|
130
|
+
constructorName = getFunctionName(errorLike.constructor);
|
131
|
+
} else if (typeof errorLike === 'function') {
|
132
|
+
// If `err` is not an instance of Error it is an error constructor itself or another function.
|
133
|
+
// If we've got a common function we get its name, otherwise we may need to create a new instance
|
134
|
+
// of the error just in case it's a poorly-constructed error. Please see chaijs/chai/issues/45 to know more.
|
135
|
+
constructorName = getFunctionName(errorLike).trim() ||
|
136
|
+
getFunctionName(new errorLike()); // eslint-disable-line new-cap
|
137
|
+
}
|
138
|
+
|
139
|
+
return constructorName;
|
140
|
+
}
|
141
|
+
|
142
|
+
/**
|
143
|
+
* ### .getMessage(errorLike)
|
144
|
+
*
|
145
|
+
* Gets the error message from an error.
|
146
|
+
* If `err` is a String itself, we return it.
|
147
|
+
* If the error has no message, we return an empty string.
|
148
|
+
*
|
149
|
+
* @name getMessage
|
150
|
+
* @param {Error|String} errorLike
|
151
|
+
* @namespace Utils
|
152
|
+
* @api public
|
153
|
+
*/
|
154
|
+
|
155
|
+
function getMessage(errorLike) {
|
156
|
+
var msg = '';
|
157
|
+
if (errorLike && errorLike.message) {
|
158
|
+
msg = errorLike.message;
|
159
|
+
} else if (typeof errorLike === 'string') {
|
160
|
+
msg = errorLike;
|
161
|
+
}
|
162
|
+
|
163
|
+
return msg;
|
164
|
+
}
|
165
|
+
|
166
|
+
module.exports = {
|
167
|
+
compatibleInstance: compatibleInstance,
|
168
|
+
compatibleConstructor: compatibleConstructor,
|
169
|
+
compatibleMessage: compatibleMessage,
|
170
|
+
getMessage: getMessage,
|
171
|
+
getConstructorName: getConstructorName,
|
172
|
+
};
|