fsevents 1.0.11 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of fsevents might be problematic. Click here for more details.
- package/.npmignore +1 -3
- package/.travis.yml +7 -5
- package/ISSUE_TEMPLATE.md +8 -0
- package/build/.target.mk +49 -0
- package/build/Makefile +352 -0
- package/build/action_after_build.target.mk +32 -0
- package/build/binding.Makefile +6 -0
- package/build/fse.target.mk +169 -0
- package/build/gyp-mac-tool +612 -0
- package/fsevents.cc +2 -2
- package/lib/binding/Release/node-v11-darwin-x64/fse.node +0 -0
- package/lib/binding/Release/node-v46-darwin-x64/fse.node +0 -0
- package/lib/binding/Release/node-v47-darwin-x64/fse.node +0 -0
- package/lib/binding/Release/node-v48-darwin-x64/fse.node +0 -0
- package/node_modules/{aws4/node_modules/lru-cache/node_modules/pseudomap → abbrev}/LICENSE +0 -0
- package/node_modules/{node-pre-gyp/node_modules/nopt/node_modules/abbrev → abbrev}/README.md +0 -0
- package/node_modules/{node-pre-gyp/node_modules/nopt/node_modules/abbrev → abbrev}/abbrev.js +0 -0
- package/node_modules/abbrev/package.json +90 -0
- package/node_modules/{lodash.repeat/LICENSE → ansi-regex/license} +5 -7
- package/node_modules/ansi-regex/package.json +47 -21
- package/node_modules/{lodash.padstart/LICENSE → ansi-styles/license} +5 -7
- package/node_modules/ansi-styles/package.json +44 -19
- package/node_modules/aproba/LICENSE +14 -0
- package/node_modules/aproba/README.md +59 -0
- package/node_modules/aproba/index.js +62 -0
- package/node_modules/aproba/package.json +96 -0
- package/node_modules/are-we-there-yet/package.json +31 -6
- package/node_modules/asn1/package.json +31 -5
- package/node_modules/assert-plus/package.json +33 -8
- package/node_modules/{node-uuid/LICENSE.md → asynckit/LICENSE} +1 -1
- package/node_modules/asynckit/README.md +233 -0
- package/node_modules/asynckit/bench.js +76 -0
- package/node_modules/asynckit/index.js +6 -0
- package/node_modules/asynckit/lib/abort.js +29 -0
- package/node_modules/asynckit/lib/async.js +34 -0
- package/node_modules/asynckit/lib/defer.js +26 -0
- package/node_modules/asynckit/lib/iterate.js +75 -0
- package/node_modules/asynckit/lib/readable_asynckit.js +91 -0
- package/node_modules/asynckit/lib/readable_parallel.js +25 -0
- package/node_modules/asynckit/lib/readable_serial.js +25 -0
- package/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
- package/node_modules/asynckit/lib/state.js +37 -0
- package/node_modules/asynckit/lib/streamify.js +141 -0
- package/node_modules/asynckit/lib/terminator.js +29 -0
- package/node_modules/asynckit/package.json +126 -0
- package/node_modules/asynckit/parallel.js +43 -0
- package/node_modules/asynckit/serial.js +17 -0
- package/node_modules/asynckit/serialOrdered.js +75 -0
- package/node_modules/asynckit/stream.js +21 -0
- package/node_modules/aws-sign2/package.json +31 -5
- package/node_modules/aws4/README.md +9 -0
- package/node_modules/aws4/aws4.js +9 -4
- package/node_modules/aws4/lru.js +96 -0
- package/node_modules/aws4/package.json +79 -56
- package/node_modules/{fstream-ignore/node_modules/minimatch/node_modules/brace-expansion → balanced-match}/.npmignore +2 -0
- package/node_modules/{fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match → balanced-match}/LICENSE.md +0 -0
- package/node_modules/{rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match → balanced-match}/README.md +5 -3
- package/node_modules/{fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match → balanced-match}/index.js +9 -1
- package/node_modules/balanced-match/package.json +110 -0
- package/node_modules/bcrypt-pbkdf/README.md +39 -0
- package/node_modules/bcrypt-pbkdf/index.js +559 -0
- package/node_modules/bcrypt-pbkdf/package.json +72 -0
- package/node_modules/block-stream/package.json +47 -14
- package/node_modules/boom/package.json +30 -4
- package/node_modules/{fstream-ignore/node_modules/minimatch/node_modules/brace-expansion → brace-expansion}/README.md +0 -0
- package/node_modules/{rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion → brace-expansion}/index.js +10 -0
- package/node_modules/brace-expansion/package.json +112 -0
- package/node_modules/buffer-shims/index.js +108 -0
- package/node_modules/buffer-shims/license.md +19 -0
- package/node_modules/buffer-shims/package.json +86 -0
- package/node_modules/buffer-shims/readme.md +21 -0
- package/node_modules/caseless/package.json +34 -8
- package/node_modules/{lodash.pad/LICENSE → chalk/license} +5 -7
- package/node_modules/chalk/node_modules/supports-color/index.js +50 -0
- package/node_modules/chalk/node_modules/supports-color/license +21 -0
- package/node_modules/chalk/node_modules/supports-color/package.json +113 -0
- package/node_modules/chalk/node_modules/supports-color/readme.md +36 -0
- package/node_modules/chalk/package.json +47 -22
- package/node_modules/code-point-at/index.js +32 -0
- package/node_modules/code-point-at/license +21 -0
- package/node_modules/code-point-at/package.json +106 -0
- package/node_modules/code-point-at/readme.md +32 -0
- package/node_modules/combined-stream/package.json +31 -5
- package/node_modules/commander/History.md +261 -0
- package/node_modules/commander/LICENSE +22 -0
- package/node_modules/commander/package.json +32 -6
- package/node_modules/{fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map → concat-map}/.travis.yml +0 -0
- package/node_modules/{fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map → concat-map}/LICENSE +0 -0
- package/node_modules/{fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map → concat-map}/README.markdown +0 -0
- package/node_modules/{fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map → concat-map}/example/map.js +0 -0
- package/node_modules/{fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map → concat-map}/index.js +0 -0
- package/node_modules/{rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map → concat-map}/package.json +47 -21
- package/node_modules/{fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map → concat-map}/test/map.js +0 -0
- package/node_modules/console-control-strings/LICENSE +13 -0
- package/node_modules/console-control-strings/README.md +145 -0
- package/node_modules/console-control-strings/README.md~ +140 -0
- package/node_modules/console-control-strings/index.js +125 -0
- package/node_modules/console-control-strings/package.json +96 -0
- package/node_modules/core-util-is/package.json +38 -11
- package/node_modules/cryptiles/package.json +30 -4
- package/node_modules/dashdash/CHANGES.md +364 -0
- package/node_modules/dashdash/LICENSE.txt +24 -0
- package/node_modules/dashdash/etc/dashdash.bash_completion.in +4 -3
- package/node_modules/dashdash/lib/dashdash.js +34 -1
- package/node_modules/dashdash/node_modules/assert-plus/package.json +33 -8
- package/node_modules/dashdash/package.json +49 -23
- package/node_modules/debug/package.json +36 -10
- package/node_modules/deep-extend/CHANGELOG.md +21 -0
- package/node_modules/{rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map → deep-extend}/LICENSE +3 -1
- package/node_modules/deep-extend/package.json +40 -15
- package/node_modules/delayed-stream/package.json +31 -5
- package/node_modules/delegates/package.json +31 -6
- package/node_modules/ecc-jsbn/package.json +33 -7
- package/node_modules/escape-string-regexp/license +21 -0
- package/node_modules/escape-string-regexp/package.json +37 -12
- package/node_modules/extend/package.json +32 -6
- package/node_modules/extsprintf/package.json +30 -5
- package/node_modules/forever-agent/package.json +31 -5
- package/node_modules/form-data/README.md +7 -8
- package/node_modules/form-data/lib/browser.js +1 -1
- package/node_modules/form-data/lib/form_data.js +101 -72
- package/node_modules/form-data/lib/populate.js +6 -5
- package/node_modules/form-data/package.json +80 -47
- package/node_modules/fs.realpath/LICENSE +43 -0
- package/node_modules/fs.realpath/README.md +33 -0
- package/node_modules/fs.realpath/index.js +66 -0
- package/node_modules/fs.realpath/old.js +303 -0
- package/node_modules/fs.realpath/package.json +94 -0
- package/node_modules/fstream/.travis.yml +4 -4
- package/node_modules/fstream/lib/collect.js +2 -0
- package/node_modules/fstream/package.json +46 -16
- package/node_modules/fstream-ignore/package.json +54 -18
- package/node_modules/gauge/CHANGELOG.md +145 -0
- package/node_modules/gauge/README.md +321 -88
- package/node_modules/gauge/base-theme.js +14 -0
- package/node_modules/gauge/error.js +24 -0
- package/node_modules/gauge/has-color.js +12 -0
- package/node_modules/gauge/index.js +230 -0
- package/node_modules/gauge/package.json +82 -27
- package/node_modules/gauge/plumbing.js +47 -0
- package/node_modules/gauge/process.js +3 -0
- package/node_modules/gauge/progress-bar.js +29 -219
- package/node_modules/gauge/render-template.js +181 -0
- package/node_modules/gauge/set-immediate.js +7 -0
- package/node_modules/gauge/set-interval.js +3 -0
- package/node_modules/gauge/spin.js +5 -0
- package/node_modules/gauge/template-item.js +73 -0
- package/node_modules/gauge/theme-set.js +115 -0
- package/node_modules/gauge/themes.js +54 -0
- package/node_modules/gauge/wide-truncate.js +25 -0
- package/node_modules/generate-function/package.json +32 -6
- package/node_modules/generate-object-property/package.json +30 -4
- package/node_modules/getpass/.npmignore +8 -0
- package/node_modules/getpass/.travis.yml +9 -0
- package/node_modules/getpass/LICENSE +18 -0
- package/node_modules/getpass/README.md +32 -0
- package/node_modules/getpass/lib/index.js +123 -0
- package/node_modules/getpass/node_modules/assert-plus/AUTHORS +6 -0
- package/node_modules/getpass/node_modules/assert-plus/CHANGES.md +14 -0
- package/node_modules/getpass/node_modules/assert-plus/README.md +162 -0
- package/node_modules/getpass/node_modules/assert-plus/assert.js +211 -0
- package/node_modules/getpass/node_modules/assert-plus/package.json +115 -0
- package/node_modules/getpass/package.json +90 -0
- package/node_modules/{aws4/node_modules/lru-cache/node_modules/yallist → glob}/LICENSE +0 -0
- package/node_modules/{rimraf/node_modules/glob → glob}/README.md +3 -0
- package/node_modules/glob/changelog.md +67 -0
- package/node_modules/{rimraf/node_modules/glob → glob}/common.js +6 -1
- package/node_modules/{rimraf/node_modules/glob → glob}/glob.js +25 -15
- package/node_modules/glob/package.json +111 -0
- package/node_modules/{rimraf/node_modules/glob → glob}/sync.js +31 -12
- package/node_modules/graceful-fs/LICENSE +15 -0
- package/node_modules/graceful-fs/README.md +83 -3
- package/node_modules/graceful-fs/graceful-fs.js +23 -14
- package/node_modules/graceful-fs/package.json +50 -24
- package/node_modules/graceful-fs/polyfills.js +99 -21
- package/node_modules/graceful-readlink/package.json +30 -4
- package/node_modules/har-validator/LICENSE +13 -0
- package/node_modules/har-validator/package.json +32 -6
- package/node_modules/has-ansi/license +21 -0
- package/node_modules/has-ansi/package.json +45 -19
- package/node_modules/has-unicode/index.js +3 -8
- package/node_modules/has-unicode/package.json +50 -18
- package/node_modules/hawk/package.json +34 -8
- package/node_modules/hoek/package.json +30 -4
- package/node_modules/http-signature/package.json +30 -4
- package/node_modules/{rimraf/node_modules/glob/node_modules/inflight → inflight}/LICENSE +0 -0
- package/node_modules/{rimraf/node_modules/glob/node_modules/inflight → inflight}/README.md +0 -0
- package/node_modules/inflight/inflight.js +54 -0
- package/node_modules/inflight/package.json +105 -0
- package/node_modules/inherits/inherits.js +7 -1
- package/node_modules/inherits/package.json +53 -26
- package/node_modules/{node-pre-gyp/node_modules/nopt → ini}/LICENSE +0 -0
- package/node_modules/ini/package.json +32 -7
- package/node_modules/is-fullwidth-code-point/index.js +46 -0
- package/node_modules/is-fullwidth-code-point/license +21 -0
- package/node_modules/is-fullwidth-code-point/package.json +108 -0
- package/node_modules/is-fullwidth-code-point/readme.md +39 -0
- package/node_modules/is-my-json-valid/index.js +10 -0
- package/node_modules/is-my-json-valid/package.json +52 -19
- package/node_modules/is-my-json-valid/test/misc.js +24 -0
- package/node_modules/is-property/package.json +35 -9
- package/node_modules/is-typedarray/package.json +32 -6
- package/node_modules/isarray/package.json +44 -17
- package/node_modules/isstream/package.json +35 -9
- package/node_modules/jodid25519/package.json +33 -7
- package/node_modules/jsbn/package.json +30 -4
- package/node_modules/json-schema/lib/links.js +17 -3
- package/node_modules/json-schema/lib/validate.js +18 -5
- package/node_modules/json-schema/package.json +44 -12
- package/node_modules/json-stringify-safe/package.json +34 -8
- package/node_modules/jsonpointer/LICENSE.md +21 -0
- package/node_modules/jsonpointer/README.md +17 -10
- package/node_modules/jsonpointer/jsonpointer.js +73 -56
- package/node_modules/jsonpointer/package.json +57 -18
- package/node_modules/jsprim/CHANGES.md +9 -0
- package/node_modules/jsprim/README.md +13 -4
- package/node_modules/jsprim/lib/jsprim.js +12 -2
- package/node_modules/jsprim/package.json +44 -14
- package/node_modules/mime-db/HISTORY.md +55 -0
- package/node_modules/mime-db/db.json +139 -2
- package/node_modules/mime-db/package.json +56 -27
- package/node_modules/mime-types/HISTORY.md +19 -0
- package/node_modules/mime-types/index.js +8 -8
- package/node_modules/mime-types/package.json +48 -19
- package/node_modules/{node-pre-gyp/node_modules/nopt/node_modules/abbrev → minimatch}/LICENSE +0 -0
- package/node_modules/{fstream-ignore/node_modules/minimatch → minimatch}/README.md +2 -9
- package/node_modules/{rimraf/node_modules/glob/node_modules/minimatch → minimatch}/minimatch.js +34 -23
- package/node_modules/minimatch/package.json +98 -0
- package/node_modules/minimist/package.json +24 -16
- package/node_modules/mkdirp/package.json +25 -15
- package/node_modules/ms/History.md +66 -0
- package/node_modules/ms/package.json +29 -3
- package/node_modules/node-pre-gyp/CHANGELOG.md +37 -0
- package/node_modules/node-pre-gyp/README.md +34 -30
- package/node_modules/node-pre-gyp/appveyor.yml +20 -10
- package/node_modules/node-pre-gyp/lib/install.js +42 -8
- package/node_modules/node-pre-gyp/lib/node-pre-gyp.js +2 -0
- package/node_modules/node-pre-gyp/lib/testbinary.js +9 -9
- package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +172 -0
- package/node_modules/node-pre-gyp/package.json +55 -57
- package/node_modules/{ansi → nopt}/.npmignore +0 -0
- package/node_modules/{node-pre-gyp/node_modules/nopt → nopt}/.travis.yml +0 -0
- package/node_modules/{rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy → nopt}/LICENSE +0 -0
- package/node_modules/{node-pre-gyp/node_modules/nopt → nopt}/README.md +0 -0
- package/node_modules/{node-pre-gyp/node_modules/nopt → nopt}/bin/nopt.js +0 -0
- package/node_modules/{node-pre-gyp/node_modules/nopt → nopt}/examples/my-program.js +0 -0
- package/node_modules/{node-pre-gyp/node_modules/nopt → nopt}/lib/nopt.js +0 -0
- package/node_modules/{node-pre-gyp/node_modules/nopt → nopt}/package.json +32 -6
- package/node_modules/{node-pre-gyp/node_modules/nopt → nopt}/test/basic.js +0 -0
- package/node_modules/npmlog/CHANGELOG.md +45 -0
- package/node_modules/npmlog/README.md +23 -2
- package/node_modules/npmlog/log.js +109 -58
- package/node_modules/npmlog/package.json +54 -20
- package/node_modules/number-is-nan/index.js +4 -0
- package/node_modules/number-is-nan/license +21 -0
- package/node_modules/number-is-nan/package.json +103 -0
- package/node_modules/number-is-nan/readme.md +28 -0
- package/node_modules/oauth-sign/package.json +47 -15
- package/node_modules/object-assign/index.js +83 -0
- package/node_modules/object-assign/license +21 -0
- package/node_modules/object-assign/package.json +114 -0
- package/node_modules/object-assign/readme.md +56 -0
- package/node_modules/{rimraf/node_modules/glob/node_modules/once/node_modules/wrappy → once}/LICENSE +0 -0
- package/node_modules/once/README.md +28 -0
- package/node_modules/once/once.js +21 -0
- package/node_modules/once/package.json +47 -16
- package/node_modules/{rimraf/node_modules/glob/node_modules/path-is-absolute → path-is-absolute}/index.js +5 -5
- package/node_modules/path-is-absolute/license +21 -0
- package/node_modules/path-is-absolute/package.json +111 -0
- package/node_modules/{rimraf/node_modules/glob/node_modules/path-is-absolute → path-is-absolute}/readme.md +19 -11
- package/node_modules/pinkie/license +21 -0
- package/node_modules/pinkie/package.json +35 -10
- package/node_modules/pinkie-promise/index.js +1 -1
- package/node_modules/pinkie-promise/license +21 -0
- package/node_modules/pinkie-promise/package.json +46 -16
- package/node_modules/process-nextick-args/index.js +31 -8
- package/node_modules/process-nextick-args/package.json +44 -13
- package/node_modules/punycode/LICENSE-MIT.txt +20 -0
- package/node_modules/punycode/README.md +176 -0
- package/node_modules/punycode/package.json +127 -0
- package/node_modules/punycode/punycode.js +533 -0
- package/node_modules/qs/.eslintrc +15 -13
- package/node_modules/qs/CHANGELOG.md +34 -0
- package/node_modules/qs/README.md +66 -3
- package/node_modules/qs/dist/qs.js +196 -97
- package/node_modules/qs/lib/formats.js +18 -0
- package/node_modules/qs/lib/index.js +6 -4
- package/node_modules/qs/lib/parse.js +48 -46
- package/node_modules/qs/lib/stringify.js +90 -33
- package/node_modules/qs/lib/utils.js +28 -10
- package/node_modules/qs/package.json +57 -24
- package/node_modules/qs/test/.eslintrc +9 -0
- package/node_modules/qs/test/index.js +2 -0
- package/node_modules/qs/test/parse.js +100 -34
- package/node_modules/qs/test/stringify.js +315 -12
- package/node_modules/qs/test/utils.js +13 -0
- package/node_modules/rc/node_modules/minimist/package.json +40 -14
- package/node_modules/rc/package.json +34 -9
- package/node_modules/readable-stream/.npmignore +5 -1
- package/node_modules/readable-stream/.travis.yml +4 -7
- package/node_modules/readable-stream/README.md +6 -2
- package/node_modules/readable-stream/lib/_stream_readable.js +173 -112
- package/node_modules/readable-stream/lib/_stream_transform.js +9 -7
- package/node_modules/readable-stream/lib/_stream_writable.js +57 -19
- package/node_modules/readable-stream/lib/internal/streams/BufferList.js +64 -0
- package/node_modules/readable-stream/package.json +59 -22
- package/node_modules/readable-stream/readable.js +4 -0
- package/node_modules/request/CHANGELOG.md +93 -24
- package/node_modules/request/README.md +12 -8
- package/node_modules/request/index.js +8 -8
- package/node_modules/request/lib/auth.js +1 -1
- package/node_modules/request/lib/helpers.js +7 -16
- package/node_modules/request/lib/multipart.js +1 -1
- package/node_modules/request/lib/oauth.js +1 -1
- package/node_modules/request/lib/redirect.js +5 -1
- package/node_modules/request/package.json +79 -38
- package/node_modules/request/request.js +140 -84
- package/node_modules/rimraf/package.json +44 -19
- package/node_modules/rimraf/rimraf.js +12 -4
- package/node_modules/semver/README.md +31 -8
- package/node_modules/semver/package.json +48 -14
- package/node_modules/semver/range.bnf +1 -1
- package/node_modules/semver/semver.js +21 -6
- package/node_modules/set-blocking/CHANGELOG.md +26 -0
- package/node_modules/set-blocking/LICENSE.txt +14 -0
- package/node_modules/set-blocking/README.md +31 -0
- package/node_modules/set-blocking/index.js +7 -0
- package/node_modules/set-blocking/package.json +106 -0
- package/node_modules/signal-exit/CHANGELOG.md +27 -0
- package/node_modules/signal-exit/LICENSE.txt +16 -0
- package/node_modules/signal-exit/README.md +40 -0
- package/node_modules/signal-exit/index.js +157 -0
- package/node_modules/signal-exit/package.json +106 -0
- package/node_modules/signal-exit/signals.js +53 -0
- package/node_modules/sntp/package.json +32 -6
- package/node_modules/sshpk/.travis.yml +3 -3
- package/node_modules/sshpk/README.md +237 -7
- package/node_modules/sshpk/bin/sshpk-conv +20 -2
- package/node_modules/sshpk/bin/sshpk-sign +16 -1
- package/node_modules/sshpk/lib/certificate.js +291 -0
- package/node_modules/sshpk/lib/errors.js +27 -1
- package/node_modules/sshpk/lib/fingerprint.js +28 -7
- package/node_modules/sshpk/lib/formats/auto.js +8 -8
- package/node_modules/sshpk/lib/formats/openssh-cert.js +289 -0
- package/node_modules/sshpk/lib/formats/pem.js +41 -7
- package/node_modules/sshpk/lib/formats/pkcs1.js +4 -4
- package/node_modules/sshpk/lib/formats/pkcs8.js +6 -11
- package/node_modules/sshpk/lib/formats/rfc4253.js +2 -2
- package/node_modules/sshpk/lib/formats/ssh-private.js +143 -20
- package/node_modules/sshpk/lib/formats/ssh.js +2 -2
- package/node_modules/sshpk/lib/formats/x509-pem.js +77 -0
- package/node_modules/sshpk/lib/formats/x509.js +484 -0
- package/node_modules/sshpk/lib/identity.js +255 -0
- package/node_modules/sshpk/lib/index.js +14 -1
- package/node_modules/sshpk/lib/key.js +21 -17
- package/node_modules/sshpk/lib/private-key.js +19 -12
- package/node_modules/sshpk/lib/signature.js +14 -6
- package/node_modules/sshpk/lib/ssh-buffer.js +24 -0
- package/node_modules/sshpk/lib/utils.js +82 -1
- package/node_modules/sshpk/node_modules/assert-plus/AUTHORS +6 -0
- package/node_modules/sshpk/node_modules/assert-plus/CHANGES.md +14 -0
- package/node_modules/sshpk/node_modules/assert-plus/README.md +162 -0
- package/node_modules/sshpk/node_modules/assert-plus/assert.js +211 -0
- package/node_modules/sshpk/node_modules/assert-plus/package.json +115 -0
- package/node_modules/sshpk/package.json +63 -35
- package/node_modules/string-width/index.js +37 -0
- package/node_modules/string-width/license +21 -0
- package/node_modules/string-width/package.json +124 -0
- package/node_modules/string-width/readme.md +42 -0
- package/node_modules/string_decoder/package.json +35 -8
- package/node_modules/stringstream/package.json +34 -8
- package/node_modules/strip-ansi/license +21 -0
- package/node_modules/strip-ansi/package.json +49 -22
- package/node_modules/strip-json-comments/license +21 -0
- package/node_modules/strip-json-comments/package.json +43 -17
- package/node_modules/supports-color/cli.js +28 -0
- package/node_modules/supports-color/index.js +2 -20
- package/node_modules/supports-color/package.json +61 -36
- package/node_modules/supports-color/readme.md +14 -6
- package/node_modules/tar/package.json +31 -5
- package/node_modules/tar-pack/README.md +4 -1
- package/node_modules/tar-pack/index.js +17 -12
- package/node_modules/tar-pack/node_modules/once/LICENSE +15 -0
- package/node_modules/{rimraf/node_modules/glob → tar-pack}/node_modules/once/README.md +0 -0
- package/node_modules/{rimraf/node_modules/glob → tar-pack}/node_modules/once/once.js +0 -0
- package/node_modules/{rimraf/node_modules/glob → tar-pack}/node_modules/once/package.json +34 -9
- package/node_modules/tar-pack/node_modules/readable-stream/.npmignore +8 -0
- package/node_modules/tar-pack/node_modules/readable-stream/.travis.yml +49 -0
- package/node_modules/tar-pack/node_modules/readable-stream/LICENSE +18 -0
- package/node_modules/tar-pack/node_modules/readable-stream/README.md +36 -0
- package/node_modules/tar-pack/node_modules/readable-stream/doc/stream.md +2015 -0
- package/node_modules/tar-pack/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
- package/node_modules/tar-pack/node_modules/readable-stream/duplex.js +1 -0
- package/node_modules/tar-pack/node_modules/readable-stream/lib/_stream_duplex.js +75 -0
- package/node_modules/tar-pack/node_modules/readable-stream/lib/_stream_passthrough.js +26 -0
- package/node_modules/tar-pack/node_modules/readable-stream/lib/_stream_readable.js +937 -0
- package/node_modules/tar-pack/node_modules/readable-stream/lib/_stream_transform.js +180 -0
- package/node_modules/tar-pack/node_modules/readable-stream/lib/_stream_writable.js +526 -0
- package/node_modules/tar-pack/node_modules/readable-stream/lib/internal/streams/BufferList.js +64 -0
- package/node_modules/tar-pack/node_modules/readable-stream/package.json +125 -0
- package/node_modules/tar-pack/node_modules/readable-stream/passthrough.js +1 -0
- package/node_modules/tar-pack/node_modules/readable-stream/readable.js +16 -0
- package/node_modules/tar-pack/node_modules/readable-stream/transform.js +1 -0
- package/node_modules/tar-pack/node_modules/readable-stream/writable.js +1 -0
- package/node_modules/tar-pack/package.json +54 -20
- package/node_modules/tar-pack/test/index.js +43 -1
- package/node_modules/tough-cookie/LICENSE +27 -0
- package/node_modules/tough-cookie/README.md +17 -3
- package/node_modules/tough-cookie/lib/cookie.js +6 -12
- package/node_modules/tough-cookie/package.json +62 -30
- package/node_modules/tunnel-agent/package.json +46 -13
- package/node_modules/tweetnacl/AUTHORS.md +28 -0
- package/node_modules/tweetnacl/CHANGELOG.md +40 -0
- package/node_modules/tweetnacl/LICENSE +24 -0
- package/node_modules/tweetnacl/PULL_REQUEST_TEMPLATE.md +20 -0
- package/node_modules/tweetnacl/README.md +33 -19
- package/node_modules/tweetnacl/nacl-fast.min.js +2 -2
- package/node_modules/tweetnacl/nacl.d.ts +98 -0
- package/node_modules/tweetnacl/nacl.min.js +1 -1
- package/node_modules/tweetnacl/package.json +44 -17
- package/node_modules/uid-number/package.json +32 -7
- package/node_modules/util-deprecate/package.json +37 -10
- package/node_modules/uuid/.npmignore +8 -0
- package/node_modules/uuid/.travis.yml +5 -0
- package/node_modules/uuid/AUTHORS +5 -0
- package/node_modules/uuid/HISTORY.md +28 -0
- package/node_modules/{lodash.padend/LICENSE → uuid/LICENSE.md} +1 -3
- package/node_modules/uuid/README.md +132 -0
- package/node_modules/{node-uuid → uuid}/bin/uuid +0 -0
- package/node_modules/uuid/index.js +8 -0
- package/node_modules/uuid/lib/bytesToUuid.js +23 -0
- package/node_modules/uuid/lib/rng-browser.js +33 -0
- package/node_modules/uuid/lib/rng.js +10 -0
- package/node_modules/uuid/package.json +122 -0
- package/node_modules/uuid/test/mocha.opts +3 -0
- package/node_modules/uuid/test/test.js +96 -0
- package/node_modules/uuid/v1.js +103 -0
- package/node_modules/uuid/v4.js +29 -0
- package/node_modules/verror/package.json +30 -5
- package/node_modules/wide-align/.npmignore +5 -0
- package/node_modules/wide-align/LICENSE +14 -0
- package/node_modules/wide-align/README.md +47 -0
- package/node_modules/wide-align/align.js +65 -0
- package/node_modules/wide-align/package.json +93 -0
- package/node_modules/wide-align/test/align.js +37 -0
- package/node_modules/wrappy/package.json +55 -16
- package/node_modules/xtend/package.json +45 -19
- package/package.json +3 -3
- package/node_modules/ansi/.jshintrc +0 -4
- package/node_modules/ansi/History.md +0 -23
- package/node_modules/ansi/LICENSE +0 -24
- package/node_modules/ansi/README.md +0 -98
- package/node_modules/ansi/examples/beep/index.js +0 -16
- package/node_modules/ansi/examples/clear/index.js +0 -15
- package/node_modules/ansi/examples/cursorPosition.js +0 -32
- package/node_modules/ansi/examples/progress/index.js +0 -87
- package/node_modules/ansi/lib/ansi.js +0 -405
- package/node_modules/ansi/lib/newlines.js +0 -71
- package/node_modules/ansi/package.json +0 -69
- package/node_modules/async/README.md +0 -1877
- package/node_modules/async/dist/async.js +0 -1265
- package/node_modules/async/dist/async.min.js +0 -2
- package/node_modules/async/lib/async.js +0 -1265
- package/node_modules/async/package.json +0 -131
- package/node_modules/aws4/node_modules/lru-cache/README.md +0 -142
- package/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js +0 -469
- package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/README.md +0 -60
- package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/map.js +0 -9
- package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/package.json +0 -60
- package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js +0 -113
- package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/test/basic.js +0 -86
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.npmignore +0 -4
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.travis.yml +0 -7
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md +0 -4
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/README.md +0 -204
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/package.json +0 -60
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/test/basic.js +0 -188
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/yallist.js +0 -360
- package/node_modules/aws4/node_modules/lru-cache/package.json +0 -78
- package/node_modules/bl/.jshintrc +0 -59
- package/node_modules/bl/.npmignore +0 -1
- package/node_modules/bl/.travis.yml +0 -13
- package/node_modules/bl/LICENSE.md +0 -13
- package/node_modules/bl/README.md +0 -200
- package/node_modules/bl/bl.js +0 -227
- package/node_modules/bl/package.json +0 -72
- package/node_modules/bl/test/test.js +0 -571
- package/node_modules/block-stream/bench/block-stream-pause.js +0 -70
- package/node_modules/block-stream/bench/block-stream.js +0 -68
- package/node_modules/block-stream/bench/dropper-pause.js +0 -70
- package/node_modules/block-stream/bench/dropper.js +0 -68
- package/node_modules/block-stream/test/basic.js +0 -27
- package/node_modules/block-stream/test/nopad-thorough.js +0 -68
- package/node_modules/block-stream/test/nopad.js +0 -57
- package/node_modules/block-stream/test/pause-resume.js +0 -73
- package/node_modules/block-stream/test/thorough.js +0 -68
- package/node_modules/block-stream/test/two-stream.js +0 -59
- package/node_modules/form-data/.dockerignore +0 -7
- package/node_modules/form-data/.editorconfig +0 -10
- package/node_modules/form-data/.eslintignore +0 -1
- package/node_modules/form-data/.eslintrc +0 -64
- package/node_modules/form-data/wercker.yml +0 -36
- package/node_modules/fstream-ignore/.npmignore +0 -1
- package/node_modules/fstream-ignore/example/basic.js +0 -13
- package/node_modules/fstream-ignore/node_modules/minimatch/minimatch.js +0 -912
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/example.js +0 -8
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/index.js +0 -191
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +0 -2
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml +0 -3
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +0 -6
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +0 -89
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +0 -5
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +0 -80
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +0 -84
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +0 -91
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json +0 -86
- package/node_modules/fstream-ignore/node_modules/minimatch/package.json +0 -67
- package/node_modules/fstream-ignore/test/.ignore +0 -2
- package/node_modules/fstream-ignore/test/.npmignore +0 -1
- package/node_modules/fstream-ignore/test/00-setup.js +0 -71
- package/node_modules/fstream-ignore/test/basic.js +0 -28
- package/node_modules/fstream-ignore/test/common.js +0 -40
- package/node_modules/fstream-ignore/test/ignore-most.js +0 -41
- package/node_modules/fstream-ignore/test/nested-ignores.js +0 -51
- package/node_modules/fstream-ignore/test/read-file-order.js +0 -81
- package/node_modules/fstream-ignore/test/unignore-child.js +0 -38
- package/node_modules/fstream-ignore/test/zz-cleanup.js +0 -10
- package/node_modules/gauge/.npmignore +0 -32
- package/node_modules/gauge/example.png +0 -0
- package/node_modules/gauge/test/progress-bar.js +0 -176
- package/node_modules/has-unicode/.npmignore +0 -32
- package/node_modules/has-unicode/test/index.js +0 -26
- package/node_modules/inherits/test.js +0 -25
- package/node_modules/jsonpointer/.travis.yml +0 -10
- package/node_modules/jsonpointer/test.js +0 -98
- package/node_modules/lodash.pad/README.md +0 -18
- package/node_modules/lodash.pad/index.js +0 -296
- package/node_modules/lodash.pad/package.json +0 -91
- package/node_modules/lodash.padend/README.md +0 -18
- package/node_modules/lodash.padend/index.js +0 -285
- package/node_modules/lodash.padend/package.json +0 -91
- package/node_modules/lodash.padstart/README.md +0 -18
- package/node_modules/lodash.padstart/index.js +0 -285
- package/node_modules/lodash.padstart/package.json +0 -91
- package/node_modules/lodash.repeat/README.md +0 -18
- package/node_modules/lodash.repeat/index.js +0 -215
- package/node_modules/lodash.repeat/package.json +0 -92
- package/node_modules/lodash.tostring/LICENSE +0 -23
- package/node_modules/lodash.tostring/README.md +0 -18
- package/node_modules/lodash.tostring/index.js +0 -164
- package/node_modules/lodash.tostring/package.json +0 -91
- package/node_modules/node-pre-gyp/node_modules/nopt/.npmignore +0 -1
- package/node_modules/node-pre-gyp/node_modules/nopt/node_modules/abbrev/.npmignore +0 -4
- package/node_modules/node-pre-gyp/node_modules/nopt/node_modules/abbrev/.travis.yml +0 -5
- package/node_modules/node-pre-gyp/node_modules/nopt/node_modules/abbrev/CONTRIBUTING.md +0 -3
- package/node_modules/node-pre-gyp/node_modules/nopt/node_modules/abbrev/package.json +0 -56
- package/node_modules/node-pre-gyp/node_modules/nopt/node_modules/abbrev/test.js +0 -47
- package/node_modules/node-uuid/.npmignore +0 -4
- package/node_modules/node-uuid/README.md +0 -254
- package/node_modules/node-uuid/benchmark/README.md +0 -53
- package/node_modules/node-uuid/benchmark/bench.gnu +0 -174
- package/node_modules/node-uuid/benchmark/bench.sh +0 -34
- package/node_modules/node-uuid/benchmark/benchmark-native.c +0 -34
- package/node_modules/node-uuid/benchmark/benchmark.js +0 -84
- package/node_modules/node-uuid/bower.json +0 -23
- package/node_modules/node-uuid/component.json +0 -25
- package/node_modules/node-uuid/package.json +0 -87
- package/node_modules/node-uuid/test/compare_v1.js +0 -63
- package/node_modules/node-uuid/test/test.html +0 -17
- package/node_modules/node-uuid/test/test.js +0 -231
- package/node_modules/node-uuid/uuid.js +0 -272
- package/node_modules/npmlog/.nyc_output/64996.json +0 -1
- package/node_modules/npmlog/.nyc_output/64998.json +0 -1
- package/node_modules/npmlog/.nyc_output/65000.json +0 -1
- package/node_modules/npmlog/.travis.yml +0 -14
- package/node_modules/npmlog/example.js +0 -39
- package/node_modules/npmlog/test/basic.js +0 -235
- package/node_modules/npmlog/test/progress.js +0 -131
- package/node_modules/oauth-sign/test.js +0 -89
- package/node_modules/qs/.npmignore +0 -18
- package/node_modules/qs/.travis.yml +0 -69
- package/node_modules/qs/bower.json +0 -22
- package/node_modules/qs/component.json +0 -15
- package/node_modules/readable-stream/.zuul.yml +0 -1
- package/node_modules/readable-stream/doc/stream.markdown +0 -1760
- package/node_modules/request/.eslintrc +0 -45
- package/node_modules/request/.npmignore +0 -6
- package/node_modules/request/.travis.yml +0 -15
- package/node_modules/request/CONTRIBUTING.md +0 -44
- package/node_modules/rimraf/node_modules/glob/node_modules/inflight/.eslintrc +0 -17
- package/node_modules/rimraf/node_modules/glob/node_modules/inflight/inflight.js +0 -44
- package/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy/README.md +0 -36
- package/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json +0 -59
- package/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy/test/basic.js +0 -51
- package/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy/wrappy.js +0 -33
- package/node_modules/rimraf/node_modules/glob/node_modules/inflight/package.json +0 -68
- package/node_modules/rimraf/node_modules/glob/node_modules/inflight/test.js +0 -97
- package/node_modules/rimraf/node_modules/glob/node_modules/inherits/LICENSE +0 -16
- package/node_modules/rimraf/node_modules/glob/node_modules/inherits/README.md +0 -42
- package/node_modules/rimraf/node_modules/glob/node_modules/inherits/inherits.js +0 -1
- package/node_modules/rimraf/node_modules/glob/node_modules/inherits/inherits_browser.js +0 -23
- package/node_modules/rimraf/node_modules/glob/node_modules/inherits/package.json +0 -59
- package/node_modules/rimraf/node_modules/glob/node_modules/inherits/test.js +0 -25
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/README.md +0 -216
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +0 -3
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +0 -122
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +0 -8
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +0 -2
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml +0 -3
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md +0 -21
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +0 -6
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +0 -5
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +0 -50
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +0 -80
- package/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/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml +0 -4
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown +0 -62
- package/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/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js +0 -13
- package/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/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +0 -86
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/package.json +0 -67
- package/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/README.md +0 -36
- package/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/package.json +0 -59
- package/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js +0 -51
- package/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js +0 -33
- package/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/package.json +0 -79
- package/node_modules/rimraf/node_modules/glob/package.json +0 -85
- package/node_modules/semver/.npmignore +0 -4
- package/node_modules/semver/.travis.yml +0 -5
- package/node_modules/semver/test/big-numbers.js +0 -31
- package/node_modules/semver/test/clean.js +0 -29
- package/node_modules/semver/test/gtr.js +0 -173
- package/node_modules/semver/test/index.js +0 -698
- package/node_modules/semver/test/ltr.js +0 -181
- package/node_modules/semver/test/major-minor-patch.js +0 -72
- package/node_modules/tunnel-agent/.jshintrc +0 -5
- package/node_modules/tweetnacl/COPYING.txt +0 -9
- package/node_modules/wrappy/test/basic.js +0 -51
- package/test/fsevents.js +0 -27
- package/test/function.js +0 -93
@@ -1,9 +1,11 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
var
|
4
|
-
var
|
3
|
+
var stringify = require('./stringify');
|
4
|
+
var parse = require('./parse');
|
5
|
+
var formats = require('./formats');
|
5
6
|
|
6
7
|
module.exports = {
|
7
|
-
|
8
|
-
parse:
|
8
|
+
formats: formats,
|
9
|
+
parse: parse,
|
10
|
+
stringify: stringify
|
9
11
|
};
|
@@ -1,19 +1,22 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
var
|
3
|
+
var utils = require('./utils');
|
4
4
|
|
5
|
-
var
|
5
|
+
var has = Object.prototype.hasOwnProperty;
|
6
|
+
|
7
|
+
var defaults = {
|
8
|
+
allowDots: false,
|
9
|
+
allowPrototypes: false,
|
10
|
+
arrayLimit: 20,
|
11
|
+
decoder: utils.decode,
|
6
12
|
delimiter: '&',
|
7
13
|
depth: 5,
|
8
|
-
arrayLimit: 20,
|
9
14
|
parameterLimit: 1000,
|
10
|
-
strictNullHandling: false,
|
11
15
|
plainObjects: false,
|
12
|
-
|
13
|
-
allowDots: false
|
16
|
+
strictNullHandling: false
|
14
17
|
};
|
15
18
|
|
16
|
-
|
19
|
+
var parseValues = function parseValues(str, options) {
|
17
20
|
var obj = {};
|
18
21
|
var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit);
|
19
22
|
|
@@ -21,28 +24,25 @@ internals.parseValues = function (str, options) {
|
|
21
24
|
var part = parts[i];
|
22
25
|
var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1;
|
23
26
|
|
27
|
+
var key, val;
|
24
28
|
if (pos === -1) {
|
25
|
-
|
26
|
-
|
27
|
-
if (options.strictNullHandling) {
|
28
|
-
obj[Utils.decode(part)] = null;
|
29
|
-
}
|
29
|
+
key = options.decoder(part);
|
30
|
+
val = options.strictNullHandling ? null : '';
|
30
31
|
} else {
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
}
|
32
|
+
key = options.decoder(part.slice(0, pos));
|
33
|
+
val = options.decoder(part.slice(pos + 1));
|
34
|
+
}
|
35
|
+
if (has.call(obj, key)) {
|
36
|
+
obj[key] = [].concat(obj[key]).concat(val);
|
37
|
+
} else {
|
38
|
+
obj[key] = val;
|
39
39
|
}
|
40
40
|
}
|
41
41
|
|
42
42
|
return obj;
|
43
43
|
};
|
44
44
|
|
45
|
-
|
45
|
+
var parseObject = function parseObject(chain, val, options) {
|
46
46
|
if (!chain.length) {
|
47
47
|
return val;
|
48
48
|
}
|
@@ -52,7 +52,7 @@ internals.parseObject = function (chain, val, options) {
|
|
52
52
|
var obj;
|
53
53
|
if (root === '[]') {
|
54
54
|
obj = [];
|
55
|
-
obj = obj.concat(
|
55
|
+
obj = obj.concat(parseObject(chain, val, options));
|
56
56
|
} else {
|
57
57
|
obj = options.plainObjects ? Object.create(null) : {};
|
58
58
|
var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root;
|
@@ -65,16 +65,16 @@ internals.parseObject = function (chain, val, options) {
|
|
65
65
|
(options.parseArrays && index <= options.arrayLimit)
|
66
66
|
) {
|
67
67
|
obj = [];
|
68
|
-
obj[index] =
|
68
|
+
obj[index] = parseObject(chain, val, options);
|
69
69
|
} else {
|
70
|
-
obj[cleanRoot] =
|
70
|
+
obj[cleanRoot] = parseObject(chain, val, options);
|
71
71
|
}
|
72
72
|
}
|
73
73
|
|
74
74
|
return obj;
|
75
75
|
};
|
76
76
|
|
77
|
-
|
77
|
+
var parseKeys = function parseKeys(givenKey, val, options) {
|
78
78
|
if (!givenKey) {
|
79
79
|
return;
|
80
80
|
}
|
@@ -97,7 +97,7 @@ internals.parseKeys = function (givenKey, val, options) {
|
|
97
97
|
if (segment[1]) {
|
98
98
|
// If we aren't using plain objects, optionally prefix keys
|
99
99
|
// that would overwrite object prototype properties
|
100
|
-
if (!options.plainObjects && Object.prototype
|
100
|
+
if (!options.plainObjects && has.call(Object.prototype, segment[1])) {
|
101
101
|
if (!options.allowPrototypes) {
|
102
102
|
return;
|
103
103
|
}
|
@@ -111,7 +111,7 @@ internals.parseKeys = function (givenKey, val, options) {
|
|
111
111
|
var i = 0;
|
112
112
|
while ((segment = child.exec(key)) !== null && i < options.depth) {
|
113
113
|
i += 1;
|
114
|
-
if (!options.plainObjects && Object.prototype
|
114
|
+
if (!options.plainObjects && has.call(Object.prototype, segment[1].replace(/\[|\]/g, ''))) {
|
115
115
|
if (!options.allowPrototypes) {
|
116
116
|
continue;
|
117
117
|
}
|
@@ -125,30 +125,32 @@ internals.parseKeys = function (givenKey, val, options) {
|
|
125
125
|
keys.push('[' + key.slice(segment.index) + ']');
|
126
126
|
}
|
127
127
|
|
128
|
-
return
|
128
|
+
return parseObject(keys, val, options);
|
129
129
|
};
|
130
130
|
|
131
131
|
module.exports = function (str, opts) {
|
132
132
|
var options = opts || {};
|
133
|
-
|
134
|
-
options.
|
135
|
-
|
133
|
+
|
134
|
+
if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') {
|
135
|
+
throw new TypeError('Decoder has to be a function.');
|
136
|
+
}
|
137
|
+
|
138
|
+
options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter;
|
139
|
+
options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth;
|
140
|
+
options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit;
|
136
141
|
options.parseArrays = options.parseArrays !== false;
|
137
|
-
options.
|
138
|
-
options.
|
139
|
-
options.
|
140
|
-
options.
|
141
|
-
options.
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
str === null ||
|
146
|
-
typeof str === 'undefined'
|
147
|
-
) {
|
142
|
+
options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder;
|
143
|
+
options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots;
|
144
|
+
options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects;
|
145
|
+
options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes;
|
146
|
+
options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit;
|
147
|
+
options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
|
148
|
+
|
149
|
+
if (str === '' || str === null || typeof str === 'undefined') {
|
148
150
|
return options.plainObjects ? Object.create(null) : {};
|
149
151
|
}
|
150
152
|
|
151
|
-
var tempObj = typeof str === 'string' ?
|
153
|
+
var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
|
152
154
|
var obj = options.plainObjects ? Object.create(null) : {};
|
153
155
|
|
154
156
|
// Iterate over the keys and setup the new object
|
@@ -156,9 +158,9 @@ module.exports = function (str, opts) {
|
|
156
158
|
var keys = Object.keys(tempObj);
|
157
159
|
for (var i = 0; i < keys.length; ++i) {
|
158
160
|
var key = keys[i];
|
159
|
-
var newObj =
|
160
|
-
obj =
|
161
|
+
var newObj = parseKeys(key, tempObj[key], options);
|
162
|
+
obj = utils.merge(obj, newObj, options);
|
161
163
|
}
|
162
164
|
|
163
|
-
return
|
165
|
+
return utils.compact(obj);
|
164
166
|
};
|
@@ -1,46 +1,52 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
var
|
3
|
+
var utils = require('./utils');
|
4
|
+
var formats = require('./formats');
|
4
5
|
|
5
|
-
var
|
6
|
+
var arrayPrefixGenerators = {
|
7
|
+
brackets: function brackets(prefix) {
|
8
|
+
return prefix + '[]';
|
9
|
+
},
|
10
|
+
indices: function indices(prefix, key) {
|
11
|
+
return prefix + '[' + key + ']';
|
12
|
+
},
|
13
|
+
repeat: function repeat(prefix) {
|
14
|
+
return prefix;
|
15
|
+
}
|
16
|
+
};
|
17
|
+
|
18
|
+
var toISO = Date.prototype.toISOString;
|
19
|
+
|
20
|
+
var defaults = {
|
6
21
|
delimiter: '&',
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
indices: function (prefix, key) {
|
12
|
-
return prefix + '[' + key + ']';
|
13
|
-
},
|
14
|
-
repeat: function (prefix) {
|
15
|
-
return prefix;
|
16
|
-
}
|
22
|
+
encode: true,
|
23
|
+
encoder: utils.encode,
|
24
|
+
serializeDate: function serializeDate(date) {
|
25
|
+
return toISO.call(date);
|
17
26
|
},
|
18
|
-
strictNullHandling: false,
|
19
27
|
skipNulls: false,
|
20
|
-
|
28
|
+
strictNullHandling: false
|
21
29
|
};
|
22
30
|
|
23
|
-
|
31
|
+
var stringify = function stringify(object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter) {
|
24
32
|
var obj = object;
|
25
33
|
if (typeof filter === 'function') {
|
26
34
|
obj = filter(prefix, obj);
|
27
|
-
} else if (Utils.isBuffer(obj)) {
|
28
|
-
obj = String(obj);
|
29
35
|
} else if (obj instanceof Date) {
|
30
|
-
obj = obj
|
36
|
+
obj = serializeDate(obj);
|
31
37
|
} else if (obj === null) {
|
32
38
|
if (strictNullHandling) {
|
33
|
-
return
|
39
|
+
return encoder ? encoder(prefix) : prefix;
|
34
40
|
}
|
35
41
|
|
36
42
|
obj = '';
|
37
43
|
}
|
38
44
|
|
39
|
-
if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean') {
|
40
|
-
if (
|
41
|
-
return [
|
45
|
+
if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {
|
46
|
+
if (encoder) {
|
47
|
+
return [formatter(encoder(prefix)) + '=' + formatter(encoder(obj))];
|
42
48
|
}
|
43
|
-
return [prefix + '=' + obj];
|
49
|
+
return [formatter(prefix) + '=' + formatter(String(obj))];
|
44
50
|
}
|
45
51
|
|
46
52
|
var values = [];
|
@@ -65,9 +71,33 @@ internals.stringify = function (object, prefix, generateArrayPrefix, strictNullH
|
|
65
71
|
}
|
66
72
|
|
67
73
|
if (Array.isArray(obj)) {
|
68
|
-
values = values.concat(
|
74
|
+
values = values.concat(stringify(
|
75
|
+
obj[key],
|
76
|
+
generateArrayPrefix(prefix, key),
|
77
|
+
generateArrayPrefix,
|
78
|
+
strictNullHandling,
|
79
|
+
skipNulls,
|
80
|
+
encoder,
|
81
|
+
filter,
|
82
|
+
sort,
|
83
|
+
allowDots,
|
84
|
+
serializeDate,
|
85
|
+
formatter
|
86
|
+
));
|
69
87
|
} else {
|
70
|
-
values = values.concat(
|
88
|
+
values = values.concat(stringify(
|
89
|
+
obj[key],
|
90
|
+
prefix + (allowDots ? '.' + key : '[' + key + ']'),
|
91
|
+
generateArrayPrefix,
|
92
|
+
strictNullHandling,
|
93
|
+
skipNulls,
|
94
|
+
encoder,
|
95
|
+
filter,
|
96
|
+
sort,
|
97
|
+
allowDots,
|
98
|
+
serializeDate,
|
99
|
+
formatter
|
100
|
+
));
|
71
101
|
}
|
72
102
|
}
|
73
103
|
|
@@ -77,18 +107,33 @@ internals.stringify = function (object, prefix, generateArrayPrefix, strictNullH
|
|
77
107
|
module.exports = function (object, opts) {
|
78
108
|
var obj = object;
|
79
109
|
var options = opts || {};
|
80
|
-
var delimiter = typeof options.delimiter === 'undefined' ?
|
81
|
-
var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling :
|
82
|
-
var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls :
|
83
|
-
var encode = typeof options.encode === 'boolean' ? options.encode :
|
110
|
+
var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter;
|
111
|
+
var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
|
112
|
+
var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls;
|
113
|
+
var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode;
|
114
|
+
var encoder = encode ? (typeof options.encoder === 'function' ? options.encoder : defaults.encoder) : null;
|
84
115
|
var sort = typeof options.sort === 'function' ? options.sort : null;
|
116
|
+
var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;
|
117
|
+
var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate;
|
118
|
+
if (typeof options.format === 'undefined') {
|
119
|
+
options.format = formats.default;
|
120
|
+
} else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) {
|
121
|
+
throw new TypeError('Unknown format option provided.');
|
122
|
+
}
|
123
|
+
var formatter = formats.formatters[options.format];
|
85
124
|
var objKeys;
|
86
125
|
var filter;
|
126
|
+
|
127
|
+
if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {
|
128
|
+
throw new TypeError('Encoder has to be a function.');
|
129
|
+
}
|
130
|
+
|
87
131
|
if (typeof options.filter === 'function') {
|
88
132
|
filter = options.filter;
|
89
133
|
obj = filter('', obj);
|
90
134
|
} else if (Array.isArray(options.filter)) {
|
91
|
-
|
135
|
+
filter = options.filter;
|
136
|
+
objKeys = filter;
|
92
137
|
}
|
93
138
|
|
94
139
|
var keys = [];
|
@@ -98,7 +143,7 @@ module.exports = function (object, opts) {
|
|
98
143
|
}
|
99
144
|
|
100
145
|
var arrayFormat;
|
101
|
-
if (options.arrayFormat in
|
146
|
+
if (options.arrayFormat in arrayPrefixGenerators) {
|
102
147
|
arrayFormat = options.arrayFormat;
|
103
148
|
} else if ('indices' in options) {
|
104
149
|
arrayFormat = options.indices ? 'indices' : 'repeat';
|
@@ -106,7 +151,7 @@ module.exports = function (object, opts) {
|
|
106
151
|
arrayFormat = 'indices';
|
107
152
|
}
|
108
153
|
|
109
|
-
var generateArrayPrefix =
|
154
|
+
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
110
155
|
|
111
156
|
if (!objKeys) {
|
112
157
|
objKeys = Object.keys(obj);
|
@@ -123,7 +168,19 @@ module.exports = function (object, opts) {
|
|
123
168
|
continue;
|
124
169
|
}
|
125
170
|
|
126
|
-
keys = keys.concat(
|
171
|
+
keys = keys.concat(stringify(
|
172
|
+
obj[key],
|
173
|
+
key,
|
174
|
+
generateArrayPrefix,
|
175
|
+
strictNullHandling,
|
176
|
+
skipNulls,
|
177
|
+
encoder,
|
178
|
+
filter,
|
179
|
+
sort,
|
180
|
+
allowDots,
|
181
|
+
serializeDate,
|
182
|
+
formatter
|
183
|
+
));
|
127
184
|
}
|
128
185
|
|
129
186
|
return keys.join(delimiter);
|
@@ -1,16 +1,18 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
+
var has = Object.prototype.hasOwnProperty;
|
4
|
+
|
3
5
|
var hexTable = (function () {
|
4
|
-
var array =
|
6
|
+
var array = [];
|
5
7
|
for (var i = 0; i < 256; ++i) {
|
6
|
-
array
|
8
|
+
array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
|
7
9
|
}
|
8
10
|
|
9
11
|
return array;
|
10
12
|
}());
|
11
13
|
|
12
14
|
exports.arrayToObject = function (source, options) {
|
13
|
-
var obj = options.plainObjects ? Object.create(null) : {};
|
15
|
+
var obj = options && options.plainObjects ? Object.create(null) : {};
|
14
16
|
for (var i = 0; i < source.length; ++i) {
|
15
17
|
if (typeof source[i] !== 'undefined') {
|
16
18
|
obj[i] = source[i];
|
@@ -46,7 +48,22 @@ exports.merge = function (target, source, options) {
|
|
46
48
|
mergeTarget = exports.arrayToObject(target, options);
|
47
49
|
}
|
48
50
|
|
49
|
-
|
51
|
+
if (Array.isArray(target) && Array.isArray(source)) {
|
52
|
+
source.forEach(function (item, i) {
|
53
|
+
if (has.call(target, i)) {
|
54
|
+
if (target[i] && typeof target[i] === 'object') {
|
55
|
+
target[i] = exports.merge(target[i], item, options);
|
56
|
+
} else {
|
57
|
+
target.push(item);
|
58
|
+
}
|
59
|
+
} else {
|
60
|
+
target[i] = item;
|
61
|
+
}
|
62
|
+
});
|
63
|
+
return target;
|
64
|
+
}
|
65
|
+
|
66
|
+
return Object.keys(source).reduce(function (acc, key) {
|
50
67
|
var value = source[key];
|
51
68
|
|
52
69
|
if (Object.prototype.hasOwnProperty.call(acc, key)) {
|
@@ -54,7 +71,7 @@ exports.merge = function (target, source, options) {
|
|
54
71
|
} else {
|
55
72
|
acc[key] = value;
|
56
73
|
}
|
57
|
-
|
74
|
+
return acc;
|
58
75
|
}, mergeTarget);
|
59
76
|
};
|
60
77
|
|
@@ -109,7 +126,7 @@ exports.encode = function (str) {
|
|
109
126
|
|
110
127
|
i += 1;
|
111
128
|
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
112
|
-
out +=
|
129
|
+
out += hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)];
|
113
130
|
}
|
114
131
|
|
115
132
|
return out;
|
@@ -132,7 +149,9 @@ exports.compact = function (obj, references) {
|
|
132
149
|
var compacted = [];
|
133
150
|
|
134
151
|
for (var i = 0; i < obj.length; ++i) {
|
135
|
-
if (typeof obj[i]
|
152
|
+
if (obj[i] && typeof obj[i] === 'object') {
|
153
|
+
compacted.push(exports.compact(obj[i], refs));
|
154
|
+
} else if (typeof obj[i] !== 'undefined') {
|
136
155
|
compacted.push(obj[i]);
|
137
156
|
}
|
138
157
|
}
|
@@ -141,10 +160,9 @@ exports.compact = function (obj, references) {
|
|
141
160
|
}
|
142
161
|
|
143
162
|
var keys = Object.keys(obj);
|
144
|
-
|
145
|
-
var key = keys[j];
|
163
|
+
keys.forEach(function (key) {
|
146
164
|
obj[key] = exports.compact(obj[key], refs);
|
147
|
-
}
|
165
|
+
});
|
148
166
|
|
149
167
|
return obj;
|
150
168
|
};
|
@@ -1,20 +1,50 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
|
2
|
+
"_args": [
|
3
|
+
[
|
4
|
+
{
|
5
|
+
"raw": "qs@~6.3.0",
|
6
|
+
"scope": null,
|
7
|
+
"escapedName": "qs",
|
8
|
+
"name": "qs",
|
9
|
+
"rawSpec": "~6.3.0",
|
10
|
+
"spec": ">=6.3.0 <6.4.0",
|
11
|
+
"type": "range"
|
12
|
+
},
|
13
|
+
"/Users/eshanker/Code/fsevents/node_modules/request"
|
14
|
+
]
|
15
|
+
],
|
16
|
+
"_from": "qs@>=6.3.0 <6.4.0",
|
17
|
+
"_id": "qs@6.3.0",
|
18
|
+
"_inCache": true,
|
4
19
|
"_location": "/qs",
|
5
|
-
"_nodeVersion": "
|
20
|
+
"_nodeVersion": "6.6.0",
|
21
|
+
"_npmOperationalInternal": {
|
22
|
+
"host": "packages-16-east.internal.npmjs.com",
|
23
|
+
"tmp": "tmp/qs-6.3.0.tgz_1476663988179_0.7400497454218566"
|
24
|
+
},
|
6
25
|
"_npmUser": {
|
7
|
-
"
|
8
|
-
"
|
26
|
+
"name": "ljharb",
|
27
|
+
"email": "ljharb@gmail.com"
|
9
28
|
},
|
10
|
-
"_npmVersion": "3.3
|
29
|
+
"_npmVersion": "3.10.3",
|
11
30
|
"_phantomChildren": {},
|
31
|
+
"_requested": {
|
32
|
+
"raw": "qs@~6.3.0",
|
33
|
+
"scope": null,
|
34
|
+
"escapedName": "qs",
|
35
|
+
"name": "qs",
|
36
|
+
"rawSpec": "~6.3.0",
|
37
|
+
"spec": ">=6.3.0 <6.4.0",
|
38
|
+
"type": "range"
|
39
|
+
},
|
12
40
|
"_requiredBy": [
|
13
41
|
"/request"
|
14
42
|
],
|
15
|
-
"_resolved": "https://registry.npmjs.org/qs/-/qs-6.0.
|
16
|
-
"_shasum": "
|
43
|
+
"_resolved": "https://registry.npmjs.org/qs/-/qs-6.3.0.tgz",
|
44
|
+
"_shasum": "f403b264f23bc01228c74131b407f18d5ea5d442",
|
17
45
|
"_shrinkwrap": null,
|
46
|
+
"_spec": "qs@~6.3.0",
|
47
|
+
"_where": "/Users/eshanker/Code/fsevents/node_modules/request",
|
18
48
|
"bugs": {
|
19
49
|
"url": "https://github.com/ljharb/qs/issues"
|
20
50
|
},
|
@@ -28,28 +58,31 @@
|
|
28
58
|
"dependencies": {},
|
29
59
|
"description": "A querystring parser that supports nesting and arrays, with a depth limit",
|
30
60
|
"devDependencies": {
|
31
|
-
"@ljharb/eslint-config": "^
|
32
|
-
"browserify": "^
|
61
|
+
"@ljharb/eslint-config": "^8.0.0",
|
62
|
+
"browserify": "^13.1.0",
|
33
63
|
"covert": "^1.1.0",
|
34
|
-
"eslint": "^
|
35
|
-
"evalmd": "^0.0.
|
64
|
+
"eslint": "^3.8.0",
|
65
|
+
"evalmd": "^0.0.17",
|
66
|
+
"iconv-lite": "^0.4.13",
|
36
67
|
"mkdirp": "^0.5.1",
|
37
68
|
"parallelshell": "^2.0.0",
|
38
|
-
"
|
69
|
+
"qs-iconv": "^1.0.3",
|
70
|
+
"safe-publish-latest": "^1.1.1",
|
71
|
+
"tape": "^4.6.2"
|
39
72
|
},
|
40
73
|
"directories": {},
|
41
74
|
"dist": {
|
42
|
-
"shasum": "
|
43
|
-
"tarball": "
|
75
|
+
"shasum": "f403b264f23bc01228c74131b407f18d5ea5d442",
|
76
|
+
"tarball": "https://registry.npmjs.org/qs/-/qs-6.3.0.tgz"
|
44
77
|
},
|
45
78
|
"engines": {
|
46
79
|
"node": ">=0.6"
|
47
80
|
},
|
48
|
-
"gitHead": "
|
81
|
+
"gitHead": "8aa9c26f90335b5483a4f456dea9acbada8a881c",
|
49
82
|
"homepage": "https://github.com/ljharb/qs",
|
50
83
|
"keywords": [
|
51
|
-
"
|
52
|
-
"
|
84
|
+
"querystring",
|
85
|
+
"qs"
|
53
86
|
],
|
54
87
|
"license": "BSD-3-Clause",
|
55
88
|
"main": "lib/index.js",
|
@@ -69,8 +102,7 @@
|
|
69
102
|
],
|
70
103
|
"name": "qs",
|
71
104
|
"optionalDependencies": {},
|
72
|
-
"readme": "# qs\n\nA querystring parsing and stringifying library with some added security.\n\n[](http://travis-ci.org/ljharb/qs)\n\nLead Maintainer: [Jordan Harband](https://github.com/ljharb)\n\nThe **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring).\n\n## Usage\n\n```javascript\nvar qs = require('qs');\nvar assert = require('assert');\n\nvar obj = qs.parse('a=c');\nassert.deepEqual(obj, { a: 'c' });\n\nvar str = qs.stringify(obj);\nassert.equal(str, 'a=c');\n```\n\n### Parsing Objects\n\n[](#preventEval)\n```javascript\nqs.parse(string, [options]);\n```\n\n**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`.\nFor example, the string `'foo[bar]=baz'` converts to:\n\n```javascript\nassert.deepEqual(qs.parse('foo[bar]=baz'), {\n foo: {\n bar: 'baz'\n }\n});\n```\n\nWhen using the `plainObjects` option the parsed value is returned as a plain object, created via `Object.create(null)` and as such you should be aware that prototype methods will not exist on it and a user may set those names to whatever value they like:\n\n```javascript\nvar plainObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true });\nassert.deepEqual(plainObject, { a: { hasOwnProperty: 'b' } });\n```\n\nBy default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. *WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. Always be careful with this option.\n\n```javascript\nvar protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true });\nassert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } });\n```\n\nURI encoded strings work too:\n\n```javascript\nassert.deepEqual(qs.parse('a%5Bb%5D=c'), {\n a: { b: 'c' }\n});\n```\n\nYou can also nest your objects, like `'foo[bar][baz]=foobarbaz'`:\n\n```javascript\nassert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), {\n foo: {\n bar: {\n baz: 'foobarbaz'\n }\n }\n});\n```\n\nBy default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like\n`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be:\n\n```javascript\nvar expected = {\n a: {\n b: {\n c: {\n d: {\n e: {\n f: {\n '[g][h][i]': 'j'\n }\n }\n }\n }\n }\n }\n};\nvar string = 'a[b][c][d][e][f][g][h][i]=j';\nassert.deepEqual(qs.parse(string), expected);\n```\n\nThis depth can be overridden by passing a `depth` option to `qs.parse(string, [options])`:\n\n```javascript\nvar deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 });\nassert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } });\n```\n\nThe depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number.\n\nFor similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option:\n\n```javascript\nvar limited = qs.parse('a=b&c=d', { parameterLimit: 1 });\nassert.deepEqual(limited, { a: 'b' });\n```\n\nAn optional delimiter can also be passed:\n\n```javascript\nvar delimited = qs.parse('a=b;c=d', { delimiter: ';' });\nassert.deepEqual(delimited, { a: 'b', c: 'd' });\n```\n\nDelimiters can be a regular expression too:\n\n```javascript\nvar regexed = qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ });\nassert.deepEqual(regexed, { a: 'b', c: 'd', e: 'f' });\n```\n\nOption `allowDots` can be used to enable dot notation:\n\n```javascript\nvar withDots = qs.parse('a.b=c', { allowDots: true });\nassert.deepEqual(withDots, { a: { b: 'c' } });\n```\n\n### Parsing Arrays\n\n**qs** can also parse arrays using a similar `[]` notation:\n\n```javascript\nvar withArray = qs.parse('a[]=b&a[]=c');\nassert.deepEqual(withArray, { a: ['b', 'c'] });\n```\n\nYou may specify an index as well:\n\n```javascript\nvar withIndexes = qs.parse('a[1]=c&a[0]=b');\nassert.deepEqual(withIndexes, { a: ['b', 'c'] });\n```\n\nNote that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number\nto create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving\ntheir order:\n\n```javascript\nvar noSparse = qs.parse('a[1]=b&a[15]=c');\nassert.deepEqual(noSparse, { a: ['b', 'c'] });\n```\n\nNote that an empty string is also a value, and will be preserved:\n\n```javascript\nvar withEmptyString = qs.parse('a[]=&a[]=b');\nassert.deepEqual(withEmptyString, { a: ['', 'b'] });\n\nvar withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c');\nassert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] });\n```\n\n**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will\ninstead be converted to an object with the index as the key:\n\n```javascript\nvar withMaxIndex = qs.parse('a[100]=b');\nassert.deepEqual(withMaxIndex, { a: { '100': 'b' } });\n```\n\nThis limit can be overridden by passing an `arrayLimit` option:\n\n```javascript\nvar withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 });\nassert.deepEqual(withArrayLimit, { a: { '1': 'b' } });\n```\n\nTo disable array parsing entirely, set `parseArrays` to `false`.\n\n```javascript\nvar noParsingArrays = qs.parse('a[]=b', { parseArrays: false });\nassert.deepEqual(noParsingArrays, { a: { '0': 'b' } });\n```\n\nIf you mix notations, **qs** will merge the two items into an object:\n\n```javascript\nvar mixedNotation = qs.parse('a[0]=b&a[b]=c');\nassert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } });\n```\n\nYou can also create arrays of objects:\n\n```javascript\nvar arraysOfObjects = qs.parse('a[][b]=c');\nassert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] });\n```\n\n### Stringifying\n\n[](#preventEval)\n```javascript\nqs.stringify(object, [options]);\n```\n\nWhen stringifying, **qs** by default URI encodes output. Objects are stringified as you would expect:\n\n```javascript\nassert.equal(qs.stringify({ a: 'b' }), 'a=b');\nassert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c');\n```\n\nThis encoding can be disabled by setting the `encode` option to `false`:\n\n```javascript\nvar unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false });\nassert.equal(unencoded, 'a[b]=c');\n```\n\nExamples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage.\n\nWhen arrays are stringified, by default they are given explicit indices:\n\n```javascript\nqs.stringify({ a: ['b', 'c', 'd'] });\n// 'a[0]=b&a[1]=c&a[2]=d'\n```\n\nYou may override this by setting the `indices` option to `false`:\n\n```javascript\nqs.stringify({ a: ['b', 'c', 'd'] }, { indices: false });\n// 'a=b&a=c&a=d'\n```\n\nYou may use the `arrayFormat` option to specify the format of the output array\n\n```javascript\nqs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })\n// 'a[0]=b&a[1]=c'\nqs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })\n// 'a[]=b&a[]=c'\nqs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })\n// 'a=b&a=c'\n```\n\nEmpty strings and null values will omit the value, but the equals sign (=) remains in place:\n\n```javascript\nassert.equal(qs.stringify({ a: '' }), 'a=');\n```\n\nProperties that are set to `undefined` will be omitted entirely:\n\n```javascript\nassert.equal(qs.stringify({ a: null, b: undefined }), 'a=');\n```\n\nThe delimiter may be overridden with stringify as well:\n\n```javascript\nassert.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d');\n```\n\nFinally, you can use the `filter` option to restrict which keys will be included in the stringified output.\nIf you pass a function, it will be called for each key to obtain the replacement value. Otherwise, if you\npass an array, it will be used to select properties and array indices for stringification:\n\n```javascript\nfunction filterFunc(prefix, value) {\n if (prefix == 'b') {\n // Return an `undefined` value to omit a property.\n return;\n }\n if (prefix == 'e[f]') {\n return value.getTime();\n }\n if (prefix == 'e[g][0]') {\n return value * 2;\n }\n return value;\n}\nqs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc });\n// 'a=b&c=d&e[f]=123&e[g][0]=4'\nqs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] });\n// 'a=b&e=f'\nqs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] });\n// 'a[0]=b&a[2]=d'\n```\n\n### Handling of `null` values\n\nBy default, `null` values are treated like empty strings:\n\n```javascript\nvar withNull = qs.stringify({ a: null, b: '' });\nassert.equal(withNull, 'a=&b=');\n```\n\nParsing does not distinguish between parameters with and without equal signs. Both are converted to empty strings.\n\n```javascript\nvar equalsInsensitive = qs.parse('a&b=');\nassert.deepEqual(equalsInsensitive, { a: '', b: '' });\n```\n\nTo distinguish between `null` values and empty strings use the `strictNullHandling` flag. In the result string the `null`\nvalues have no `=` sign:\n\n```javascript\nvar strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true });\nassert.equal(strictNull, 'a&b=');\n```\n\nTo parse values without `=` back to `null` use the `strictNullHandling` flag:\n\n```javascript\nvar parsedStrictNull = qs.parse('a&b=', { strictNullHandling: true });\nassert.deepEqual(parsedStrictNull, { a: null, b: '' });\n```\n\nTo completely skip rendering keys with `null` values, use the `skipNulls` flag:\n\n```javascript\nvar nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true });\nassert.equal(nullsSkipped, 'a=b');\n```\n",
|
73
|
-
"readmeFilename": "README.md",
|
105
|
+
"readme": "ERROR: No README data found!",
|
74
106
|
"repository": {
|
75
107
|
"type": "git",
|
76
108
|
"url": "git+https://github.com/ljharb/qs.git"
|
@@ -78,11 +110,12 @@
|
|
78
110
|
"scripts": {
|
79
111
|
"coverage": "covert test",
|
80
112
|
"dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js",
|
81
|
-
"lint": "eslint lib/*.js
|
82
|
-
"prepublish": "npm run dist",
|
113
|
+
"lint": "eslint lib/*.js test/*.js",
|
114
|
+
"prepublish": "safe-publish-latest && npm run dist",
|
115
|
+
"pretest": "npm run --silent readme && npm run --silent lint",
|
83
116
|
"readme": "evalmd README.md",
|
84
|
-
"test": "
|
117
|
+
"test": "npm run --silent coverage",
|
85
118
|
"tests-only": "node test"
|
86
119
|
},
|
87
|
-
"version": "6.0
|
120
|
+
"version": "6.3.0"
|
88
121
|
}
|