fsevents 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fsevents might be problematic. Click here for more details.
- package/node_modules/ansi/History.md +7 -0
- package/node_modules/ansi/LICENSE +24 -0
- package/node_modules/ansi/lib/ansi.js +2 -2
- package/node_modules/ansi/package.json +15 -10
- package/node_modules/ansi-regex/package.json +1 -0
- package/node_modules/ansi-styles/package.json +1 -0
- package/node_modules/are-we-there-yet/.npmignore +2 -0
- package/node_modules/are-we-there-yet/index.js +20 -18
- package/node_modules/are-we-there-yet/package.json +15 -13
- package/node_modules/asn1/package.json +3 -1
- package/node_modules/assert-plus/README.md +50 -21
- package/node_modules/assert-plus/assert.js +168 -207
- package/node_modules/assert-plus/package.json +55 -15
- package/node_modules/async/README.md +86 -4
- package/node_modules/async/dist/async.js +4 -3
- package/node_modules/async/dist/async.min.js +1 -1
- package/node_modules/async/lib/async.js +4 -3
- package/node_modules/async/package.json +10 -10
- package/node_modules/aws-sign2/package.json +1 -0
- package/node_modules/aws4/.npmignore +3 -0
- package/node_modules/aws4/.tern-port +1 -0
- package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match → aws4}/.travis.yml +2 -0
- package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md → aws4/LICENSE} +1 -3
- package/node_modules/aws4/README.md +510 -0
- package/node_modules/aws4/aws4.js +313 -0
- package/node_modules/aws4/example.js +372 -0
- package/node_modules/aws4/node_modules/lru-cache/.npmignore +1 -0
- package/node_modules/aws4/node_modules/lru-cache/.travis.yml +8 -0
- package/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS +14 -0
- package/node_modules/aws4/node_modules/lru-cache/README.md +137 -0
- package/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js +334 -0
- package/node_modules/aws4/node_modules/lru-cache/package.json +66 -0
- package/node_modules/aws4/node_modules/lru-cache/test/basic.js +396 -0
- package/node_modules/aws4/node_modules/lru-cache/test/foreach.js +120 -0
- package/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js +51 -0
- package/node_modules/aws4/node_modules/lru-cache/test/serialize.js +216 -0
- package/node_modules/aws4/package.json +113 -0
- package/node_modules/bl/.travis.yml +5 -6
- package/node_modules/bl/bl.js +5 -0
- package/node_modules/bl/package.json +16 -13
- package/node_modules/bl/test/test.js +554 -6
- package/node_modules/block-stream/package.json +1 -0
- package/node_modules/boom/package.json +1 -0
- package/node_modules/caseless/package.json +1 -0
- package/node_modules/chalk/package.json +1 -0
- package/node_modules/combined-stream/package.json +1 -0
- package/node_modules/commander/package.json +1 -0
- package/node_modules/core-util-is/package.json +2 -2
- package/node_modules/cryptiles/package.json +1 -0
- package/node_modules/dashdash/README.md +70 -7
- package/node_modules/dashdash/etc/dashdash.bash_completion.in +388 -0
- package/node_modules/dashdash/lib/dashdash.js +202 -2
- package/node_modules/dashdash/package.json +12 -9
- package/node_modules/debug/.jshintrc +3 -0
- package/node_modules/debug/.npmignore +6 -0
- package/node_modules/debug/History.md +195 -0
- package/node_modules/debug/Makefile +36 -0
- package/node_modules/debug/Readme.md +86 -13
- package/node_modules/debug/bower.json +28 -0
- package/node_modules/debug/browser.js +168 -0
- package/node_modules/debug/component.json +19 -0
- package/node_modules/debug/debug.js +132 -72
- package/node_modules/debug/node.js +209 -0
- package/node_modules/debug/package.json +32 -22
- package/node_modules/deep-extend/README.md +51 -50
- package/node_modules/deep-extend/package.json +14 -16
- package/node_modules/delayed-stream/package.json +1 -0
- package/node_modules/delegates/History.md +6 -0
- package/node_modules/delegates/License +20 -0
- package/node_modules/delegates/package.json +17 -13
- package/node_modules/ecc-jsbn/package.json +3 -1
- package/node_modules/escape-string-regexp/package.json +2 -2
- package/node_modules/extend/package.json +1 -0
- package/node_modules/extsprintf/package.json +4 -2
- package/node_modules/forever-agent/package.json +1 -0
- package/node_modules/form-data/package.json +1 -0
- package/node_modules/fstream/package.json +1 -0
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +1 -0
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +1 -0
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json +1 -0
- package/node_modules/fstream-ignore/node_modules/minimatch/package.json +1 -0
- package/node_modules/fstream-ignore/package.json +3 -1
- package/node_modules/gauge/package.json +14 -12
- package/node_modules/gauge/progress-bar.js +4 -5
- package/node_modules/gauge/test/progress-bar.js +1 -1
- package/node_modules/generate-function/package.json +1 -0
- package/node_modules/generate-object-property/package.json +1 -0
- package/node_modules/graceful-fs/README.md +17 -0
- package/node_modules/graceful-fs/graceful-fs.js +2 -0
- package/node_modules/graceful-fs/package.json +16 -11
- package/node_modules/graceful-readlink/package.json +1 -0
- package/node_modules/har-validator/README.md +45 -122
- package/node_modules/har-validator/package.json +16 -16
- package/node_modules/has-ansi/package.json +1 -0
- package/node_modules/has-unicode/README.md +6 -3
- package/node_modules/has-unicode/index.js +7 -3
- package/node_modules/has-unicode/package.json +15 -13
- package/node_modules/has-unicode/test/index.js +1 -1
- package/node_modules/hawk/README.md +634 -634
- package/node_modules/hawk/bower.json +24 -24
- package/node_modules/hawk/component.json +18 -18
- package/node_modules/hawk/dist/client.js +343 -340
- package/node_modules/hawk/example/usage.js +78 -78
- package/node_modules/hawk/lib/browser.js +637 -637
- package/node_modules/hawk/lib/client.js +369 -369
- package/node_modules/hawk/lib/crypto.js +126 -126
- package/node_modules/hawk/lib/index.js +15 -15
- package/node_modules/hawk/lib/server.js +548 -540
- package/node_modules/hawk/lib/utils.js +184 -164
- package/node_modules/hawk/package.json +9 -8
- package/node_modules/hawk/test/browser.js +1492 -1492
- package/node_modules/hawk/test/client.js +440 -440
- package/node_modules/hawk/test/crypto.js +70 -70
- package/node_modules/hawk/test/index.js +378 -378
- package/node_modules/hawk/test/readme.js +95 -95
- package/node_modules/hawk/test/server.js +1329 -1302
- package/node_modules/hawk/test/uri.js +838 -838
- package/node_modules/hawk/test/utils.js +149 -121
- package/node_modules/hoek/package.json +1 -0
- package/node_modules/http-signature/CHANGES.md +7 -0
- package/node_modules/http-signature/http_signing.md +71 -3
- package/node_modules/http-signature/lib/signer.js +5 -0
- package/node_modules/http-signature/package.json +13 -11
- package/node_modules/ini/package.json +3 -1
- package/node_modules/is-my-json-valid/formats.js +1 -1
- package/node_modules/is-my-json-valid/package.json +11 -10
- package/node_modules/is-property/package.json +1 -0
- package/node_modules/is-typedarray/package.json +3 -1
- package/node_modules/isarray/package.json +2 -2
- package/node_modules/isstream/package.json +1 -0
- package/node_modules/jodid25519/package.json +3 -1
- package/node_modules/jsbn/package.json +3 -1
- package/node_modules/json-schema/package.json +2 -1
- package/node_modules/json-stringify-safe/package.json +1 -0
- package/node_modules/jsonpointer/package.json +1 -0
- package/node_modules/jsprim/package.json +3 -1
- package/node_modules/lodash._basetostring/package.json +4 -4
- package/node_modules/lodash._createpadding/package.json +3 -2
- package/node_modules/lodash._root/LICENSE +22 -0
- package/node_modules/lodash._root/README.md +18 -0
- package/node_modules/lodash._root/index.js +53 -0
- package/node_modules/lodash._root/package.json +77 -0
- package/node_modules/lodash.pad/LICENSE +2 -2
- package/node_modules/lodash.pad/README.md +4 -6
- package/node_modules/lodash.pad/index.js +347 -15
- package/node_modules/lodash.pad/package.json +20 -34
- package/node_modules/lodash.padleft/package.json +3 -1
- package/node_modules/lodash.padright/package.json +3 -1
- package/node_modules/lodash.repeat/LICENSE +2 -2
- package/node_modules/lodash.repeat/README.md +4 -6
- package/node_modules/lodash.repeat/index.js +262 -11
- package/node_modules/lodash.repeat/package.json +21 -34
- package/node_modules/mime-db/package.json +2 -2
- package/node_modules/mime-types/package.json +2 -2
- package/node_modules/ms/.npmignore +5 -0
- package/node_modules/{deep-extend → ms}/LICENSE +2 -2
- package/node_modules/ms/README.md +35 -0
- package/node_modules/ms/index.js +125 -0
- package/node_modules/ms/package.json +56 -0
- package/node_modules/node-pre-gyp/CHANGELOG.md +8 -0
- package/node_modules/node-pre-gyp/LICENSE +27 -0
- package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +36 -0
- package/node_modules/node-pre-gyp/package.json +23 -22
- package/node_modules/node-uuid/package.json +1 -0
- package/node_modules/npmlog/package.json +18 -16
- package/node_modules/oauth-sign/index.js +2 -0
- package/node_modules/oauth-sign/package.json +10 -9
- package/node_modules/once/README.md +18 -0
- package/node_modules/once/once.js +8 -6
- package/node_modules/once/package.json +20 -12
- package/node_modules/pinkie/index.js +3 -3
- package/node_modules/pinkie/package.json +10 -9
- package/node_modules/pinkie/readme.md +1 -1
- package/node_modules/pinkie-promise/package.json +1 -0
- package/node_modules/process-nextick-args/package.json +2 -2
- package/node_modules/qs/.eslintrc +17 -0
- package/node_modules/qs/.travis.yml +66 -5
- package/node_modules/qs/CHANGELOG.md +86 -75
- package/node_modules/qs/README.md +85 -81
- package/node_modules/qs/bower.json +1 -1
- package/node_modules/qs/component.json +1 -1
- package/node_modules/qs/dist/qs.js +108 -177
- package/node_modules/qs/lib/index.js +1 -7
- package/node_modules/qs/lib/parse.js +26 -49
- package/node_modules/qs/lib/stringify.js +22 -46
- package/node_modules/qs/lib/utils.js +45 -73
- package/node_modules/qs/package.json +51 -28
- package/node_modules/qs/test/index.js +5 -0
- package/node_modules/qs/test/parse.js +236 -321
- package/node_modules/qs/test/stringify.js +139 -197
- package/node_modules/qs/test/utils.js +6 -25
- package/node_modules/rc/node_modules/minimist/package.json +1 -0
- package/node_modules/rc/package.json +1 -0
- package/node_modules/readable-stream/package.json +1 -0
- package/node_modules/request/CHANGELOG.md +16 -1
- package/node_modules/request/README.md +1 -1
- package/node_modules/request/lib/har.js +3 -2
- package/node_modules/request/lib/multipart.js +3 -0
- package/node_modules/request/lib/tunnel.js +0 -2
- package/node_modules/request/package.json +20 -17
- package/node_modules/request/request.js +50 -26
- package/node_modules/rimraf/README.md +1 -1
- package/node_modules/rimraf/node_modules/glob/README.md +2 -2
- package/node_modules/rimraf/node_modules/glob/glob.js +14 -1
- package/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/inflight/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/inherits/package.json +2 -1
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/once/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/package.json +11 -11
- package/node_modules/rimraf/package.json +13 -12
- package/node_modules/semver/package.json +3 -1
- package/node_modules/sntp/package.json +1 -0
- package/node_modules/sshpk/.npmignore +1 -0
- package/node_modules/sshpk/bin/sshpk-sign +176 -0
- package/node_modules/sshpk/bin/sshpk-verify +166 -0
- package/node_modules/sshpk/lib/ed-compat.js +2 -0
- package/node_modules/sshpk/lib/key.js +6 -0
- package/node_modules/sshpk/man/man1/sshpk-conv.1 +135 -0
- package/node_modules/sshpk/man/man1/sshpk-sign.1 +81 -0
- package/node_modules/sshpk/man/man1/sshpk-verify.1 +68 -0
- package/node_modules/sshpk/package.json +18 -9
- package/node_modules/string_decoder/package.json +2 -2
- package/node_modules/stringstream/package.json +1 -0
- package/node_modules/strip-ansi/package.json +1 -0
- package/node_modules/strip-json-comments/package.json +1 -0
- package/node_modules/supports-color/package.json +1 -0
- package/node_modules/tar/package.json +1 -0
- package/node_modules/tar-pack/README.md +2 -2
- package/node_modules/tar-pack/package.json +25 -26
- package/node_modules/tough-cookie/package.json +1 -0
- package/node_modules/tunnel-agent/package.json +1 -0
- package/node_modules/tweetnacl/README.md +1 -1
- package/node_modules/tweetnacl/package.json +13 -11
- package/node_modules/uid-number/package.json +14 -13
- package/node_modules/uid-number/uid-number.js +9 -4
- package/node_modules/util-deprecate/package.json +2 -2
- package/node_modules/verror/package.json +1 -0
- package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy → wrappy}/package.json +3 -2
- package/node_modules/xtend/package.json +1 -0
- package/package.json +2 -2
- package/node_modules/are-we-there-yet/README.md~ +0 -183
- package/node_modules/bl/test/basic-test.js +0 -541
- package/node_modules/bl/test/sauce.js +0 -38
- package/node_modules/debug/index.js +0 -5
- package/node_modules/debug/lib/debug.js +0 -147
- package/node_modules/deep-extend/test/index.spec.js +0 -220
- package/node_modules/deep-extend/test/mocha.opts +0 -1
- package/node_modules/gauge/README.md~ +0 -161
- package/node_modules/has-unicode/README.md~ +0 -4
- package/node_modules/once/LICENSE +0 -27
- package/node_modules/once/test/once.js +0 -18
- package/node_modules/sshpk/node_modules/assert-plus/README.md +0 -155
- package/node_modules/sshpk/node_modules/assert-plus/assert.js +0 -206
- package/node_modules/sshpk/node_modules/assert-plus/package.json +0 -88
- package/node_modules/tar-pack/node_modules/rimraf/README.md +0 -43
- package/node_modules/tar-pack/node_modules/rimraf/bin.js +0 -40
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/README.md +0 -359
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/common.js +0 -226
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/glob.js +0 -752
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/.eslintrc +0 -17
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/README.md +0 -37
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/inflight.js +0 -44
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json +0 -58
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/package.json +0 -67
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/test.js +0 -97
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/LICENSE +0 -16
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/README.md +0 -42
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/inherits.js +0 -1
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/inherits_browser.js +0 -23
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/package.json +0 -58
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/test.js +0 -25
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/README.md +0 -216
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/minimatch.js +0 -912
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +0 -3
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +0 -122
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +0 -8
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +0 -191
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +0 -2
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +0 -6
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +0 -89
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +0 -5
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +0 -50
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +0 -79
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +0 -84
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml +0 -4
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE +0 -18
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown +0 -62
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js +0 -6
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js +0 -13
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +0 -90
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js +0 -39
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +0 -81
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/package.json +0 -66
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/README.md +0 -51
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/LICENSE +0 -15
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/README.md +0 -36
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js +0 -51
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js +0 -33
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/once.js +0 -21
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/package.json +0 -70
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/index.js +0 -20
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/package.json +0 -78
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/readme.md +0 -51
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/package.json +0 -79
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/sync.js +0 -460
- package/node_modules/tar-pack/node_modules/rimraf/package.json +0 -69
- package/node_modules/tar-pack/node_modules/rimraf/rimraf.js +0 -333
- package/node_modules/uid-number/LICENCE +0 -25
- /package/node_modules/{sshpk/node_modules/assert-plus → assert-plus}/AUTHORS +0 -0
- /package/node_modules/{sshpk/node_modules/assert-plus → assert-plus}/CHANGES.md +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf → aws4/node_modules/lru-cache}/LICENSE +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight → uid-number}/LICENSE +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy → wrappy}/LICENSE +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy → wrappy}/README.md +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy → wrappy}/test/basic.js +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy → wrappy}/wrappy.js +0 -0
@@ -1,478 +1,393 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
var
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
it('parses a simple string', function (done) {
|
25
|
-
|
26
|
-
expect(Qs.parse('0=foo')).to.deep.equal({ '0': 'foo' });
|
27
|
-
expect(Qs.parse('foo=c++')).to.deep.equal({ foo: 'c ' });
|
28
|
-
expect(Qs.parse('a[>=]=23')).to.deep.equal({ a: { '>=': '23' } });
|
29
|
-
expect(Qs.parse('a[<=>]==23')).to.deep.equal({ a: { '<=>': '=23' } });
|
30
|
-
expect(Qs.parse('a[==]=23')).to.deep.equal({ a: { '==': '23' } });
|
31
|
-
expect(Qs.parse('foo', { strictNullHandling: true })).to.deep.equal({ foo: null });
|
32
|
-
expect(Qs.parse('foo' )).to.deep.equal({ foo: '' });
|
33
|
-
expect(Qs.parse('foo=')).to.deep.equal({ foo: '' });
|
34
|
-
expect(Qs.parse('foo=bar')).to.deep.equal({ foo: 'bar' });
|
35
|
-
expect(Qs.parse(' foo = bar = baz ')).to.deep.equal({ ' foo ': ' bar = baz ' });
|
36
|
-
expect(Qs.parse('foo=bar=baz')).to.deep.equal({ foo: 'bar=baz' });
|
37
|
-
expect(Qs.parse('foo=bar&bar=baz')).to.deep.equal({ foo: 'bar', bar: 'baz' });
|
38
|
-
expect(Qs.parse('foo2=bar2&baz2=')).to.deep.equal({ foo2: 'bar2', baz2: '' });
|
39
|
-
expect(Qs.parse('foo=bar&baz', { strictNullHandling: true })).to.deep.equal({ foo: 'bar', baz: null });
|
40
|
-
expect(Qs.parse('foo=bar&baz')).to.deep.equal({ foo: 'bar', baz: '' });
|
41
|
-
expect(Qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World')).to.deep.equal({
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var test = require('tape');
|
4
|
+
var qs = require('../');
|
5
|
+
|
6
|
+
test('parse()', function (t) {
|
7
|
+
t.test('parses a simple string', function (st) {
|
8
|
+
st.deepEqual(qs.parse('0=foo'), { '0': 'foo' });
|
9
|
+
st.deepEqual(qs.parse('foo=c++'), { foo: 'c ' });
|
10
|
+
st.deepEqual(qs.parse('a[>=]=23'), { a: { '>=': '23' } });
|
11
|
+
st.deepEqual(qs.parse('a[<=>]==23'), { a: { '<=>': '=23' } });
|
12
|
+
st.deepEqual(qs.parse('a[==]=23'), { a: { '==': '23' } });
|
13
|
+
st.deepEqual(qs.parse('foo', { strictNullHandling: true }), { foo: null });
|
14
|
+
st.deepEqual(qs.parse('foo'), { foo: '' });
|
15
|
+
st.deepEqual(qs.parse('foo='), { foo: '' });
|
16
|
+
st.deepEqual(qs.parse('foo=bar'), { foo: 'bar' });
|
17
|
+
st.deepEqual(qs.parse(' foo = bar = baz '), { ' foo ': ' bar = baz ' });
|
18
|
+
st.deepEqual(qs.parse('foo=bar=baz'), { foo: 'bar=baz' });
|
19
|
+
st.deepEqual(qs.parse('foo=bar&bar=baz'), { foo: 'bar', bar: 'baz' });
|
20
|
+
st.deepEqual(qs.parse('foo2=bar2&baz2='), { foo2: 'bar2', baz2: '' });
|
21
|
+
st.deepEqual(qs.parse('foo=bar&baz', { strictNullHandling: true }), { foo: 'bar', baz: null });
|
22
|
+
st.deepEqual(qs.parse('foo=bar&baz'), { foo: 'bar', baz: '' });
|
23
|
+
st.deepEqual(qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World'), {
|
42
24
|
cht: 'p3',
|
43
25
|
chd: 't:60,40',
|
44
26
|
chs: '250x100',
|
45
27
|
chl: 'Hello|World'
|
46
28
|
});
|
47
|
-
|
29
|
+
st.end();
|
48
30
|
});
|
49
31
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
done();
|
32
|
+
t.test('allows enabling dot notation', function (st) {
|
33
|
+
st.deepEqual(qs.parse('a.b=c'), { 'a.b': 'c' });
|
34
|
+
st.deepEqual(qs.parse('a.b=c', { allowDots: true }), { a: { b: 'c' } });
|
35
|
+
st.end();
|
55
36
|
});
|
56
37
|
|
57
|
-
|
38
|
+
t.deepEqual(qs.parse('a[b]=c'), { a: { b: 'c' } }, 'parses a single nested string');
|
39
|
+
t.deepEqual(qs.parse('a[b][c]=d'), { a: { b: { c: 'd' } } }, 'parses a double nested string');
|
40
|
+
t.deepEqual(
|
41
|
+
qs.parse('a[b][c][d][e][f][g][h]=i'),
|
42
|
+
{ a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } },
|
43
|
+
'defaults to a depth of 5'
|
44
|
+
);
|
58
45
|
|
59
|
-
|
60
|
-
|
46
|
+
t.test('only parses one level when depth = 1', function (st) {
|
47
|
+
st.deepEqual(qs.parse('a[b][c]=d', { depth: 1 }), { a: { b: { '[c]': 'd' } } });
|
48
|
+
st.deepEqual(qs.parse('a[b][c][d]=e', { depth: 1 }), { a: { b: { '[c][d]': 'e' } } });
|
49
|
+
st.end();
|
61
50
|
});
|
62
51
|
|
63
|
-
|
52
|
+
t.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }, 'parses a simple array');
|
64
53
|
|
65
|
-
|
66
|
-
|
54
|
+
t.test('parses an explicit array', function (st) {
|
55
|
+
st.deepEqual(qs.parse('a[]=b'), { a: ['b'] });
|
56
|
+
st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] });
|
57
|
+
st.deepEqual(qs.parse('a[]=b&a[]=c&a[]=d'), { a: ['b', 'c', 'd'] });
|
58
|
+
st.end();
|
67
59
|
});
|
68
60
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
61
|
+
t.test('parses a mix of simple and explicit arrays', function (st) {
|
62
|
+
st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] });
|
63
|
+
st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] });
|
64
|
+
st.deepEqual(qs.parse('a[0]=b&a=c'), { a: ['b', 'c'] });
|
65
|
+
st.deepEqual(qs.parse('a=b&a[0]=c'), { a: ['b', 'c'] });
|
66
|
+
st.deepEqual(qs.parse('a[1]=b&a=c'), { a: ['b', 'c'] });
|
67
|
+
st.deepEqual(qs.parse('a=b&a[1]=c'), { a: ['b', 'c'] });
|
68
|
+
st.end();
|
73
69
|
});
|
74
70
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
done();
|
71
|
+
t.test('parses a nested array', function (st) {
|
72
|
+
st.deepEqual(qs.parse('a[b][]=c&a[b][]=d'), { a: { b: ['c', 'd'] } });
|
73
|
+
st.deepEqual(qs.parse('a[>=]=25'), { a: { '>=': '25' } });
|
74
|
+
st.end();
|
80
75
|
});
|
81
76
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
77
|
+
t.test('allows to specify array indices', function (st) {
|
78
|
+
st.deepEqual(qs.parse('a[1]=c&a[0]=b&a[2]=d'), { a: ['b', 'c', 'd'] });
|
79
|
+
st.deepEqual(qs.parse('a[1]=c&a[0]=b'), { a: ['b', 'c'] });
|
80
|
+
st.deepEqual(qs.parse('a[1]=c'), { a: ['c'] });
|
81
|
+
st.end();
|
86
82
|
});
|
87
83
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
expect(Qs.parse('a[]=b&a[]=c&a[]=d')).to.deep.equal({ a: ['b', 'c', 'd'] });
|
93
|
-
done();
|
84
|
+
t.test('limits specific array indices to 20', function (st) {
|
85
|
+
st.deepEqual(qs.parse('a[20]=a'), { a: ['a'] });
|
86
|
+
st.deepEqual(qs.parse('a[21]=a'), { a: { '21': 'a' } });
|
87
|
+
st.end();
|
94
88
|
});
|
95
89
|
|
96
|
-
|
90
|
+
t.deepEqual(qs.parse('a[12b]=c'), { a: { '12b': 'c' } }, 'supports keys that begin with a number');
|
97
91
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
expect(Qs.parse('a=b&a[0]=c')).to.deep.equal({ a: ['b', 'c'] });
|
102
|
-
expect(Qs.parse('a[1]=b&a=c')).to.deep.equal({ a: ['b', 'c'] });
|
103
|
-
expect(Qs.parse('a=b&a[1]=c')).to.deep.equal({ a: ['b', 'c'] });
|
104
|
-
done();
|
92
|
+
t.test('supports encoded = signs', function (st) {
|
93
|
+
st.deepEqual(qs.parse('he%3Dllo=th%3Dere'), { 'he=llo': 'th=ere' });
|
94
|
+
st.end();
|
105
95
|
});
|
106
96
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
done();
|
112
|
-
});
|
113
|
-
|
114
|
-
it('allows to specify array indices', function (done) {
|
115
|
-
|
116
|
-
expect(Qs.parse('a[1]=c&a[0]=b&a[2]=d')).to.deep.equal({ a: ['b', 'c', 'd'] });
|
117
|
-
expect(Qs.parse('a[1]=c&a[0]=b')).to.deep.equal({ a: ['b', 'c'] });
|
118
|
-
expect(Qs.parse('a[1]=c')).to.deep.equal({ a: ['c'] });
|
119
|
-
done();
|
120
|
-
});
|
121
|
-
|
122
|
-
it('limits specific array indices to 20', function (done) {
|
123
|
-
|
124
|
-
expect(Qs.parse('a[20]=a')).to.deep.equal({ a: ['a'] });
|
125
|
-
expect(Qs.parse('a[21]=a')).to.deep.equal({ a: { '21': 'a' } });
|
126
|
-
done();
|
127
|
-
});
|
128
|
-
|
129
|
-
it('supports keys that begin with a number', function (done) {
|
130
|
-
|
131
|
-
expect(Qs.parse('a[12b]=c')).to.deep.equal({ a: { '12b': 'c' } });
|
132
|
-
done();
|
133
|
-
});
|
134
|
-
|
135
|
-
it('supports encoded = signs', function (done) {
|
136
|
-
|
137
|
-
expect(Qs.parse('he%3Dllo=th%3Dere')).to.deep.equal({ 'he=llo': 'th=ere' });
|
138
|
-
done();
|
139
|
-
});
|
140
|
-
|
141
|
-
it('is ok with url encoded strings', function (done) {
|
142
|
-
|
143
|
-
expect(Qs.parse('a[b%20c]=d')).to.deep.equal({ a: { 'b c': 'd' } });
|
144
|
-
expect(Qs.parse('a[b]=c%20d')).to.deep.equal({ a: { b: 'c d' } });
|
145
|
-
done();
|
146
|
-
});
|
147
|
-
|
148
|
-
it('allows brackets in the value', function (done) {
|
149
|
-
|
150
|
-
expect(Qs.parse('pets=["tobi"]')).to.deep.equal({ pets: '["tobi"]' });
|
151
|
-
expect(Qs.parse('operators=[">=", "<="]')).to.deep.equal({ operators: '[">=", "<="]' });
|
152
|
-
done();
|
97
|
+
t.test('is ok with url encoded strings', function (st) {
|
98
|
+
st.deepEqual(qs.parse('a[b%20c]=d'), { a: { 'b c': 'd' } });
|
99
|
+
st.deepEqual(qs.parse('a[b]=c%20d'), { a: { b: 'c d' } });
|
100
|
+
st.end();
|
153
101
|
});
|
154
102
|
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
expect(Qs.parse(undefined)).to.deep.equal({});
|
160
|
-
done();
|
103
|
+
t.test('allows brackets in the value', function (st) {
|
104
|
+
st.deepEqual(qs.parse('pets=["tobi"]'), { pets: '["tobi"]' });
|
105
|
+
st.deepEqual(qs.parse('operators=[">=", "<="]'), { operators: '[">=", "<="]' });
|
106
|
+
st.end();
|
161
107
|
});
|
162
108
|
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
expect(Qs.parse('foo[]=bar&foo[bad]=baz')).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } });
|
169
|
-
expect(Qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar', '1': 'foo' } });
|
170
|
-
expect(Qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb')).to.deep.equal({ foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] });
|
171
|
-
expect(Qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c')).to.deep.equal({ a: { '0': 'b', t: 'u', c: true } });
|
172
|
-
expect(Qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y')).to.deep.equal({ a: { '0': 'b', '1': 'c', x: 'y' } });
|
173
|
-
done();
|
109
|
+
t.test('allows empty values', function (st) {
|
110
|
+
st.deepEqual(qs.parse(''), {});
|
111
|
+
st.deepEqual(qs.parse(null), {});
|
112
|
+
st.deepEqual(qs.parse(undefined), {});
|
113
|
+
st.end();
|
174
114
|
});
|
175
115
|
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
expect(Qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true })).to.deep.equal({ foo: { bad: 'baz', '0': 'bar', '1': 'foo' } });
|
187
|
-
expect(Qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true })).to.deep.equal({ foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] });
|
188
|
-
done();
|
116
|
+
t.test('transforms arrays to objects', function (st) {
|
117
|
+
st.deepEqual(qs.parse('foo[0]=bar&foo[bad]=baz'), { foo: { '0': 'bar', bad: 'baz' } });
|
118
|
+
st.deepEqual(qs.parse('foo[bad]=baz&foo[0]=bar'), { foo: { bad: 'baz', '0': 'bar' } });
|
119
|
+
st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar'), { foo: { bad: 'baz', '0': 'bar' } });
|
120
|
+
st.deepEqual(qs.parse('foo[]=bar&foo[bad]=baz'), { foo: { '0': 'bar', bad: 'baz' } });
|
121
|
+
st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo'), { foo: { bad: 'baz', '0': 'bar', '1': 'foo' } });
|
122
|
+
st.deepEqual(qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb'), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] });
|
123
|
+
st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c'), { a: { '0': 'b', t: 'u', c: true } });
|
124
|
+
st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y'), { a: { '0': 'b', '1': 'c', x: 'y' } });
|
125
|
+
st.end();
|
189
126
|
});
|
190
127
|
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
128
|
+
t.test('transforms arrays to objects (dot notation)', function (st) {
|
129
|
+
st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: 'baz' } });
|
130
|
+
st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } });
|
131
|
+
st.deepEqual(qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } });
|
132
|
+
st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15'], bar: '2' }] });
|
133
|
+
st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15', '16'], bar: '2' }] });
|
134
|
+
st.deepEqual(qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true }), { foo: { bad: 'baz', '0': 'bar' } });
|
135
|
+
st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true }), { foo: { bad: 'baz', '0': 'bar' } });
|
136
|
+
st.deepEqual(qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true }), { foo: { '0': 'bar', bad: 'baz' } });
|
137
|
+
st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true }), { foo: { bad: 'baz', '0': 'bar', '1': 'foo' } });
|
138
|
+
st.deepEqual(qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true }), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] });
|
139
|
+
st.end();
|
195
140
|
});
|
196
141
|
|
197
|
-
|
142
|
+
t.deepEqual(qs.parse('a[b]=c&a=d'), { a: { b: 'c', d: true } }, 'can add keys to objects');
|
198
143
|
|
199
|
-
|
200
|
-
|
144
|
+
t.test('correctly prunes undefined values when converting an array to an object', function (st) {
|
145
|
+
st.deepEqual(qs.parse('a[2]=b&a[99999999]=c'), { a: { '2': 'b', '99999999': 'c' } });
|
146
|
+
st.end();
|
201
147
|
});
|
202
148
|
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
done();
|
149
|
+
t.test('supports malformed uri characters', function (st) {
|
150
|
+
st.deepEqual(qs.parse('{%:%}', { strictNullHandling: true }), { '{%:%}': null });
|
151
|
+
st.deepEqual(qs.parse('{%:%}='), { '{%:%}': '' });
|
152
|
+
st.deepEqual(qs.parse('foo=%:%}'), { foo: '%:%}' });
|
153
|
+
st.end();
|
209
154
|
});
|
210
155
|
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
done();
|
156
|
+
t.test('doesn\'t produce empty keys', function (st) {
|
157
|
+
st.deepEqual(qs.parse('_r=1&'), { '_r': '1' });
|
158
|
+
st.end();
|
215
159
|
});
|
216
160
|
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
done();
|
161
|
+
t.test('cannot access Object prototype', function (st) {
|
162
|
+
qs.parse('constructor[prototype][bad]=bad');
|
163
|
+
qs.parse('bad[constructor][prototype][bad]=bad');
|
164
|
+
st.equal(typeof Object.prototype.bad, 'undefined');
|
165
|
+
st.end();
|
223
166
|
});
|
224
167
|
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
done();
|
168
|
+
t.test('parses arrays of objects', function (st) {
|
169
|
+
st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] });
|
170
|
+
st.deepEqual(qs.parse('a[0][b]=c'), { a: [{ b: 'c' }] });
|
171
|
+
st.end();
|
230
172
|
});
|
231
173
|
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
done();
|
174
|
+
t.test('allows for empty strings in arrays', function (st) {
|
175
|
+
st.deepEqual(qs.parse('a[]=b&a[]=&a[]=c'), { a: ['b', '', 'c'] });
|
176
|
+
st.deepEqual(qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true }), { a: ['b', null, 'c', ''] });
|
177
|
+
st.deepEqual(qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true }), { a: ['b', '', 'c', null] });
|
178
|
+
st.deepEqual(qs.parse('a[]=&a[]=b&a[]=c'), { a: ['', 'b', 'c'] });
|
179
|
+
st.end();
|
239
180
|
});
|
240
181
|
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
done();
|
182
|
+
t.test('compacts sparse arrays', function (st) {
|
183
|
+
st.deepEqual(qs.parse('a[10]=1&a[2]=2'), { a: ['2', '1'] });
|
184
|
+
st.end();
|
245
185
|
});
|
246
186
|
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
done();
|
187
|
+
t.test('parses semi-parsed strings', function (st) {
|
188
|
+
st.deepEqual(qs.parse({ 'a[b]': 'c' }), { a: { b: 'c' } });
|
189
|
+
st.deepEqual(qs.parse({ 'a[b]': 'c', 'a[d]': 'e' }), { a: { b: 'c', d: 'e' } });
|
190
|
+
st.end();
|
252
191
|
});
|
253
192
|
|
254
|
-
|
255
|
-
|
193
|
+
t.test('parses buffers correctly', function (st) {
|
256
194
|
var b = new Buffer('test');
|
257
|
-
|
258
|
-
|
195
|
+
st.deepEqual(qs.parse({ a: b }), { a: b });
|
196
|
+
st.end();
|
259
197
|
});
|
260
198
|
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
done();
|
199
|
+
t.test('continues parsing when no parent is found', function (st) {
|
200
|
+
st.deepEqual(qs.parse('[]=&a=b'), { '0': '', a: 'b' });
|
201
|
+
st.deepEqual(qs.parse('[]&a=b', { strictNullHandling: true }), { '0': null, a: 'b' });
|
202
|
+
st.deepEqual(qs.parse('[foo]=bar'), { foo: 'bar' });
|
203
|
+
st.end();
|
267
204
|
});
|
268
205
|
|
269
|
-
|
270
|
-
|
206
|
+
t.test('does not error when parsing a very long array', function (st) {
|
271
207
|
var str = 'a[]=a';
|
272
208
|
while (Buffer.byteLength(str) < 128 * 1024) {
|
273
|
-
str
|
209
|
+
str = str + '&' + str;
|
274
210
|
}
|
275
211
|
|
276
|
-
|
212
|
+
st.doesNotThrow(function () { qs.parse(str); });
|
277
213
|
|
278
|
-
|
279
|
-
}).to.not.throw();
|
280
|
-
|
281
|
-
done();
|
214
|
+
st.end();
|
282
215
|
});
|
283
216
|
|
284
|
-
|
285
|
-
|
217
|
+
t.test('should not throw when a native prototype has an enumerable property', { parallel: false }, function (st) {
|
286
218
|
Object.prototype.crash = '';
|
287
219
|
Array.prototype.crash = '';
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
220
|
+
st.doesNotThrow(qs.parse.bind(null, 'a=b'));
|
221
|
+
st.deepEqual(qs.parse('a=b'), { a: 'b' });
|
222
|
+
st.doesNotThrow(qs.parse.bind(null, 'a[][b]=c'));
|
223
|
+
st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] });
|
292
224
|
delete Object.prototype.crash;
|
293
225
|
delete Array.prototype.crash;
|
294
|
-
|
226
|
+
st.end();
|
295
227
|
});
|
296
228
|
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
done();
|
229
|
+
t.test('parses a string with an alternative string delimiter', function (st) {
|
230
|
+
st.deepEqual(qs.parse('a=b;c=d', { delimiter: ';' }), { a: 'b', c: 'd' });
|
231
|
+
st.end();
|
301
232
|
});
|
302
233
|
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
done();
|
234
|
+
t.test('parses a string with an alternative RegExp delimiter', function (st) {
|
235
|
+
st.deepEqual(qs.parse('a=b; c=d', { delimiter: /[;,] */ }), { a: 'b', c: 'd' });
|
236
|
+
st.end();
|
307
237
|
});
|
308
238
|
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
done();
|
239
|
+
t.test('does not use non-splittable objects as delimiters', function (st) {
|
240
|
+
st.deepEqual(qs.parse('a=b&c=d', { delimiter: true }), { a: 'b', c: 'd' });
|
241
|
+
st.end();
|
313
242
|
});
|
314
243
|
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
done();
|
244
|
+
t.test('allows overriding parameter limit', function (st) {
|
245
|
+
st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: 1 }), { a: 'b' });
|
246
|
+
st.end();
|
319
247
|
});
|
320
248
|
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
done();
|
249
|
+
t.test('allows setting the parameter limit to Infinity', function (st) {
|
250
|
+
st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: Infinity }), { a: 'b', c: 'd' });
|
251
|
+
st.end();
|
325
252
|
});
|
326
253
|
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
done();
|
254
|
+
t.test('allows overriding array limit', function (st) {
|
255
|
+
st.deepEqual(qs.parse('a[0]=b', { arrayLimit: -1 }), { a: { '0': 'b' } });
|
256
|
+
st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: -1 }), { a: { '-1': 'b' } });
|
257
|
+
st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 }), { a: { '0': 'b', '1': 'c' } });
|
258
|
+
st.end();
|
333
259
|
});
|
334
260
|
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
done();
|
261
|
+
t.test('allows disabling array parsing', function (st) {
|
262
|
+
st.deepEqual(qs.parse('a[0]=b&a[1]=c', { parseArrays: false }), { a: { '0': 'b', '1': 'c' } });
|
263
|
+
st.end();
|
339
264
|
});
|
340
265
|
|
341
|
-
|
342
|
-
|
266
|
+
t.test('parses an object', function (st) {
|
343
267
|
var input = {
|
344
268
|
'user[name]': { 'pop[bob]': 3 },
|
345
269
|
'user[email]': null
|
346
270
|
};
|
347
271
|
|
348
272
|
var expected = {
|
349
|
-
|
350
|
-
|
351
|
-
|
273
|
+
user: {
|
274
|
+
name: { 'pop[bob]': 3 },
|
275
|
+
email: null
|
352
276
|
}
|
353
277
|
};
|
354
278
|
|
355
|
-
var result =
|
279
|
+
var result = qs.parse(input);
|
356
280
|
|
357
|
-
|
358
|
-
|
281
|
+
st.deepEqual(result, expected);
|
282
|
+
st.end();
|
359
283
|
});
|
360
284
|
|
361
|
-
|
362
|
-
|
285
|
+
t.test('parses an object in dot notation', function (st) {
|
363
286
|
var input = {
|
364
287
|
'user.name': { 'pop[bob]': 3 },
|
365
288
|
'user.email.': null
|
366
289
|
};
|
367
290
|
|
368
291
|
var expected = {
|
369
|
-
|
370
|
-
|
371
|
-
|
292
|
+
user: {
|
293
|
+
name: { 'pop[bob]': 3 },
|
294
|
+
email: null
|
372
295
|
}
|
373
296
|
};
|
374
297
|
|
375
|
-
var result =
|
298
|
+
var result = qs.parse(input, { allowDots: true });
|
376
299
|
|
377
|
-
|
378
|
-
|
300
|
+
st.deepEqual(result, expected);
|
301
|
+
st.end();
|
379
302
|
});
|
380
303
|
|
381
|
-
|
382
|
-
|
304
|
+
t.test('parses an object and not child values', function (st) {
|
383
305
|
var input = {
|
384
306
|
'user[name]': { 'pop[bob]': { 'test': 3 } },
|
385
307
|
'user[email]': null
|
386
308
|
};
|
387
309
|
|
388
310
|
var expected = {
|
389
|
-
|
390
|
-
|
391
|
-
|
311
|
+
user: {
|
312
|
+
name: { 'pop[bob]': { 'test': 3 } },
|
313
|
+
email: null
|
392
314
|
}
|
393
315
|
};
|
394
316
|
|
395
|
-
var result =
|
317
|
+
var result = qs.parse(input);
|
396
318
|
|
397
|
-
|
398
|
-
|
319
|
+
st.deepEqual(result, expected);
|
320
|
+
st.end();
|
399
321
|
});
|
400
322
|
|
401
|
-
|
402
|
-
|
323
|
+
t.test('does not blow up when Buffer global is missing', function (st) {
|
403
324
|
var tempBuffer = global.Buffer;
|
404
325
|
delete global.Buffer;
|
405
|
-
var result =
|
326
|
+
var result = qs.parse('a=b&c=d');
|
406
327
|
global.Buffer = tempBuffer;
|
407
|
-
|
408
|
-
|
328
|
+
st.deepEqual(result, { a: 'b', c: 'd' });
|
329
|
+
st.end();
|
409
330
|
});
|
410
331
|
|
411
|
-
|
412
|
-
|
332
|
+
t.test('does not crash when parsing circular references', function (st) {
|
413
333
|
var a = {};
|
414
334
|
a.b = a;
|
415
335
|
|
416
336
|
var parsed;
|
417
337
|
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
}).to.not.throw();
|
338
|
+
st.doesNotThrow(function () {
|
339
|
+
parsed = qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a });
|
340
|
+
});
|
422
341
|
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
342
|
+
st.equal('foo' in parsed, true, 'parsed has "foo" property');
|
343
|
+
st.equal('bar' in parsed.foo, true);
|
344
|
+
st.equal('baz' in parsed.foo, true);
|
345
|
+
st.equal(parsed.foo.bar, 'baz');
|
346
|
+
st.deepEqual(parsed.foo.baz, a);
|
347
|
+
st.end();
|
428
348
|
});
|
429
349
|
|
430
|
-
|
431
|
-
|
350
|
+
t.test('parses plain objects correctly', function (st) {
|
432
351
|
var a = Object.create(null);
|
433
352
|
a.b = 'c';
|
434
353
|
|
435
|
-
|
436
|
-
var result =
|
437
|
-
|
438
|
-
|
439
|
-
|
354
|
+
st.deepEqual(qs.parse(a), { b: 'c' });
|
355
|
+
var result = qs.parse({ a: a });
|
356
|
+
st.equal('a' in result, true, 'result has "a" property');
|
357
|
+
st.deepEqual(result.a, a);
|
358
|
+
st.end();
|
440
359
|
});
|
441
360
|
|
442
|
-
|
443
|
-
|
361
|
+
t.test('parses dates correctly', function (st) {
|
444
362
|
var now = new Date();
|
445
|
-
|
446
|
-
|
363
|
+
st.deepEqual(qs.parse({ a: now }), { a: now });
|
364
|
+
st.end();
|
447
365
|
});
|
448
366
|
|
449
|
-
|
450
|
-
|
367
|
+
t.test('parses regular expressions correctly', function (st) {
|
451
368
|
var re = /^test$/;
|
452
|
-
|
453
|
-
|
369
|
+
st.deepEqual(qs.parse({ a: re }), { a: re });
|
370
|
+
st.end();
|
454
371
|
});
|
455
372
|
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
done();
|
373
|
+
t.test('can allow overwriting prototype properties', function (st) {
|
374
|
+
st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }), { a: { hasOwnProperty: 'b' } }, { prototype: false });
|
375
|
+
st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: true }), { hasOwnProperty: 'b' }, { prototype: false });
|
376
|
+
st.end();
|
461
377
|
});
|
462
378
|
|
463
|
-
|
464
|
-
|
379
|
+
t.test('can return plain objects', function (st) {
|
465
380
|
var expected = Object.create(null);
|
466
381
|
expected.a = Object.create(null);
|
467
382
|
expected.a.b = 'c';
|
468
383
|
expected.a.hasOwnProperty = 'd';
|
469
|
-
|
470
|
-
|
384
|
+
st.deepEqual(qs.parse('a[b]=c&a[hasOwnProperty]=d', { plainObjects: true }), expected);
|
385
|
+
st.deepEqual(qs.parse(null, { plainObjects: true }), Object.create(null));
|
471
386
|
var expectedArray = Object.create(null);
|
472
387
|
expectedArray.a = Object.create(null);
|
473
388
|
expectedArray.a['0'] = 'b';
|
474
389
|
expectedArray.a.c = 'd';
|
475
|
-
|
476
|
-
|
390
|
+
st.deepEqual(qs.parse('a[]=b&a[c]=d', { plainObjects: true }), expectedArray);
|
391
|
+
st.end();
|
477
392
|
});
|
478
393
|
});
|