cline 1.0.0-nightly.5 → 1.0.0-nightly.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cline +0 -0
- package/bin/cline-host +0 -0
- package/node_modules/base64-js/LICENSE +21 -0
- package/node_modules/base64-js/README.md +34 -0
- package/node_modules/base64-js/base64js.min.js +1 -0
- package/node_modules/base64-js/index.d.ts +3 -0
- package/node_modules/base64-js/index.js +150 -0
- package/node_modules/base64-js/package.json +47 -0
- package/node_modules/better-sqlite3/LICENSE +21 -0
- package/node_modules/better-sqlite3/README.md +99 -0
- package/node_modules/better-sqlite3/binding.gyp +38 -0
- package/node_modules/better-sqlite3/deps/common.gypi +68 -0
- package/node_modules/better-sqlite3/deps/copy.js +31 -0
- package/node_modules/better-sqlite3/deps/defines.gypi +41 -0
- package/node_modules/better-sqlite3/deps/download.sh +122 -0
- package/node_modules/better-sqlite3/deps/patches/1208.patch +15 -0
- package/node_modules/better-sqlite3/deps/sqlite3/sqlite3.c +262875 -0
- package/node_modules/better-sqlite3/deps/sqlite3/sqlite3.h +13775 -0
- package/node_modules/better-sqlite3/deps/sqlite3/sqlite3ext.h +723 -0
- package/node_modules/better-sqlite3/deps/sqlite3.gyp +80 -0
- package/node_modules/better-sqlite3/deps/test_extension.c +21 -0
- package/node_modules/better-sqlite3/lib/database.js +90 -0
- package/node_modules/better-sqlite3/lib/index.js +3 -0
- package/node_modules/better-sqlite3/lib/methods/aggregate.js +43 -0
- package/node_modules/better-sqlite3/lib/methods/backup.js +67 -0
- package/node_modules/better-sqlite3/lib/methods/function.js +31 -0
- package/node_modules/better-sqlite3/lib/methods/inspect.js +7 -0
- package/node_modules/better-sqlite3/lib/methods/pragma.js +12 -0
- package/node_modules/better-sqlite3/lib/methods/serialize.js +16 -0
- package/node_modules/better-sqlite3/lib/methods/table.js +189 -0
- package/node_modules/better-sqlite3/lib/methods/transaction.js +78 -0
- package/node_modules/better-sqlite3/lib/methods/wrappers.js +54 -0
- package/node_modules/better-sqlite3/lib/sqlite-error.js +20 -0
- package/node_modules/better-sqlite3/lib/util.js +12 -0
- package/node_modules/better-sqlite3/package.json +62 -0
- package/node_modules/better-sqlite3/src/better_sqlite3.cpp +2189 -0
- package/node_modules/better-sqlite3/src/better_sqlite3.hpp +1036 -0
- package/node_modules/bindings/LICENSE.md +22 -0
- package/node_modules/bindings/README.md +98 -0
- package/node_modules/bindings/bindings.js +221 -0
- package/node_modules/bindings/package.json +28 -0
- package/node_modules/bl/.travis.yml +17 -0
- package/node_modules/bl/BufferList.js +396 -0
- package/node_modules/bl/LICENSE.md +13 -0
- package/node_modules/bl/README.md +247 -0
- package/node_modules/bl/bl.js +84 -0
- package/node_modules/bl/package.json +37 -0
- package/node_modules/bl/test/convert.js +21 -0
- package/node_modules/bl/test/indexOf.js +492 -0
- package/node_modules/bl/test/isBufferList.js +32 -0
- package/node_modules/bl/test/test.js +869 -0
- package/node_modules/buffer/AUTHORS.md +70 -0
- package/node_modules/buffer/LICENSE +21 -0
- package/node_modules/buffer/README.md +410 -0
- package/node_modules/buffer/index.d.ts +186 -0
- package/node_modules/buffer/index.js +1817 -0
- package/node_modules/buffer/package.json +96 -0
- package/node_modules/chownr/LICENSE +15 -0
- package/node_modules/chownr/README.md +3 -0
- package/node_modules/chownr/chownr.js +167 -0
- package/node_modules/chownr/package.json +29 -0
- package/node_modules/decompress-response/index.d.ts +22 -0
- package/node_modules/decompress-response/index.js +58 -0
- package/node_modules/decompress-response/license +9 -0
- package/node_modules/decompress-response/package.json +56 -0
- package/node_modules/decompress-response/readme.md +48 -0
- package/node_modules/deep-extend/LICENSE +20 -0
- package/node_modules/deep-extend/README.md +91 -0
- package/node_modules/deep-extend/index.js +1 -0
- package/node_modules/deep-extend/lib/deep-extend.js +150 -0
- package/node_modules/deep-extend/package.json +62 -0
- package/node_modules/detect-libc/LICENSE +201 -0
- package/node_modules/detect-libc/README.md +163 -0
- package/node_modules/detect-libc/index.d.ts +14 -0
- package/node_modules/detect-libc/lib/detect-libc.js +267 -0
- package/node_modules/detect-libc/lib/filesystem.js +41 -0
- package/node_modules/detect-libc/lib/process.js +24 -0
- package/node_modules/detect-libc/package.json +41 -0
- package/node_modules/end-of-stream/LICENSE +21 -0
- package/node_modules/end-of-stream/README.md +54 -0
- package/node_modules/end-of-stream/index.js +96 -0
- package/node_modules/end-of-stream/package.json +37 -0
- package/node_modules/expand-template/.travis.yml +6 -0
- package/node_modules/expand-template/LICENSE +21 -0
- package/node_modules/expand-template/README.md +43 -0
- package/node_modules/expand-template/index.js +26 -0
- package/node_modules/expand-template/package.json +29 -0
- package/node_modules/expand-template/test.js +67 -0
- package/node_modules/file-uri-to-path/.npmignore +1 -0
- package/node_modules/file-uri-to-path/.travis.yml +30 -0
- package/node_modules/file-uri-to-path/History.md +21 -0
- package/node_modules/file-uri-to-path/LICENSE +20 -0
- package/node_modules/file-uri-to-path/README.md +74 -0
- package/node_modules/file-uri-to-path/index.d.ts +2 -0
- package/node_modules/file-uri-to-path/index.js +66 -0
- package/node_modules/file-uri-to-path/package.json +32 -0
- package/node_modules/file-uri-to-path/test/test.js +24 -0
- package/node_modules/file-uri-to-path/test/tests.json +13 -0
- package/node_modules/fs-constants/LICENSE +21 -0
- package/node_modules/fs-constants/README.md +26 -0
- package/node_modules/fs-constants/browser.js +1 -0
- package/node_modules/fs-constants/index.js +1 -0
- package/node_modules/fs-constants/package.json +19 -0
- package/node_modules/github-from-package/.travis.yml +4 -0
- package/node_modules/github-from-package/LICENSE +18 -0
- package/node_modules/github-from-package/example/package.json +8 -0
- package/node_modules/github-from-package/example/url.js +3 -0
- package/node_modules/github-from-package/index.js +17 -0
- package/node_modules/github-from-package/package.json +30 -0
- package/node_modules/github-from-package/readme.markdown +53 -0
- package/node_modules/github-from-package/test/a.json +8 -0
- package/node_modules/github-from-package/test/b.json +5 -0
- package/node_modules/github-from-package/test/c.json +5 -0
- package/node_modules/github-from-package/test/d.json +7 -0
- package/node_modules/github-from-package/test/e.json +5 -0
- package/node_modules/github-from-package/test/url.js +19 -0
- package/node_modules/ieee754/LICENSE +11 -0
- package/node_modules/ieee754/README.md +51 -0
- package/node_modules/ieee754/index.d.ts +10 -0
- package/node_modules/ieee754/index.js +85 -0
- package/node_modules/ieee754/package.json +52 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/ini/LICENSE +15 -0
- package/node_modules/ini/README.md +102 -0
- package/node_modules/ini/ini.js +206 -0
- package/node_modules/ini/package.json +33 -0
- package/node_modules/mimic-response/index.d.ts +17 -0
- package/node_modules/mimic-response/index.js +77 -0
- package/node_modules/mimic-response/license +9 -0
- package/node_modules/mimic-response/package.json +42 -0
- package/node_modules/mimic-response/readme.md +78 -0
- package/node_modules/minimist/.eslintrc +29 -0
- package/node_modules/minimist/.github/FUNDING.yml +12 -0
- package/node_modules/minimist/.nycrc +14 -0
- package/node_modules/minimist/CHANGELOG.md +298 -0
- package/node_modules/minimist/LICENSE +18 -0
- package/node_modules/minimist/README.md +121 -0
- package/node_modules/minimist/example/parse.js +4 -0
- package/node_modules/minimist/index.js +263 -0
- package/node_modules/minimist/package.json +75 -0
- package/node_modules/minimist/test/all_bool.js +34 -0
- package/node_modules/minimist/test/bool.js +177 -0
- package/node_modules/minimist/test/dash.js +43 -0
- package/node_modules/minimist/test/default_bool.js +37 -0
- package/node_modules/minimist/test/dotted.js +24 -0
- package/node_modules/minimist/test/kv_short.js +32 -0
- package/node_modules/minimist/test/long.js +33 -0
- package/node_modules/minimist/test/num.js +38 -0
- package/node_modules/minimist/test/parse.js +209 -0
- package/node_modules/minimist/test/parse_modified.js +11 -0
- package/node_modules/minimist/test/proto.js +64 -0
- package/node_modules/minimist/test/short.js +69 -0
- package/node_modules/minimist/test/stop_early.js +17 -0
- package/node_modules/minimist/test/unknown.js +104 -0
- package/node_modules/minimist/test/whitespace.js +10 -0
- package/node_modules/mkdirp-classic/LICENSE +21 -0
- package/node_modules/mkdirp-classic/README.md +18 -0
- package/node_modules/mkdirp-classic/index.js +98 -0
- package/node_modules/mkdirp-classic/package.json +18 -0
- package/node_modules/napi-build-utils/.github/workflows/run-npm-tests.yml +31 -0
- package/node_modules/napi-build-utils/LICENSE +21 -0
- package/node_modules/napi-build-utils/README.md +52 -0
- package/node_modules/napi-build-utils/index.js +214 -0
- package/node_modules/napi-build-utils/index.md +0 -0
- package/node_modules/napi-build-utils/package.json +42 -0
- package/node_modules/node-abi/LICENSE +21 -0
- package/node_modules/node-abi/README.md +54 -0
- package/node_modules/node-abi/abi_registry.json +408 -0
- package/node_modules/node-abi/index.js +179 -0
- package/node_modules/node-abi/package.json +45 -0
- package/node_modules/once/LICENSE +15 -0
- package/node_modules/once/README.md +79 -0
- package/node_modules/once/once.js +42 -0
- package/node_modules/once/package.json +33 -0
- package/node_modules/prebuild-install/CHANGELOG.md +131 -0
- package/node_modules/prebuild-install/CONTRIBUTING.md +6 -0
- package/node_modules/prebuild-install/LICENSE +21 -0
- package/node_modules/prebuild-install/README.md +163 -0
- package/node_modules/prebuild-install/asset.js +44 -0
- package/node_modules/prebuild-install/bin.js +78 -0
- package/node_modules/prebuild-install/download.js +142 -0
- package/node_modules/prebuild-install/error.js +14 -0
- package/node_modules/prebuild-install/help.txt +16 -0
- package/node_modules/prebuild-install/index.js +1 -0
- package/node_modules/prebuild-install/log.js +33 -0
- package/node_modules/prebuild-install/package.json +67 -0
- package/node_modules/prebuild-install/proxy.js +35 -0
- package/node_modules/prebuild-install/rc.js +64 -0
- package/node_modules/prebuild-install/util.js +143 -0
- package/node_modules/pump/.github/FUNDING.yml +2 -0
- package/node_modules/pump/.travis.yml +5 -0
- package/node_modules/pump/LICENSE +21 -0
- package/node_modules/pump/README.md +74 -0
- package/node_modules/pump/SECURITY.md +5 -0
- package/node_modules/pump/index.js +86 -0
- package/node_modules/pump/package.json +24 -0
- package/node_modules/pump/test-browser.js +66 -0
- package/node_modules/pump/test-node.js +53 -0
- package/node_modules/rc/LICENSE.APACHE2 +15 -0
- package/node_modules/rc/LICENSE.BSD +26 -0
- package/node_modules/rc/LICENSE.MIT +24 -0
- package/node_modules/rc/README.md +227 -0
- package/node_modules/rc/browser.js +7 -0
- package/node_modules/rc/cli.js +4 -0
- package/node_modules/rc/index.js +53 -0
- package/node_modules/rc/lib/utils.js +104 -0
- package/node_modules/rc/package.json +29 -0
- package/node_modules/rc/test/ini.js +16 -0
- package/node_modules/rc/test/nested-env-vars.js +50 -0
- package/node_modules/rc/test/test.js +59 -0
- package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- package/node_modules/readable-stream/GOVERNANCE.md +136 -0
- package/node_modules/readable-stream/LICENSE +47 -0
- package/node_modules/readable-stream/README.md +106 -0
- package/node_modules/readable-stream/errors-browser.js +127 -0
- package/node_modules/readable-stream/errors.js +116 -0
- package/node_modules/readable-stream/experimentalWarning.js +17 -0
- package/node_modules/readable-stream/lib/_stream_duplex.js +126 -0
- package/node_modules/readable-stream/lib/_stream_passthrough.js +37 -0
- package/node_modules/readable-stream/lib/_stream_readable.js +1027 -0
- package/node_modules/readable-stream/lib/_stream_transform.js +190 -0
- package/node_modules/readable-stream/lib/_stream_writable.js +641 -0
- package/node_modules/readable-stream/lib/internal/streams/async_iterator.js +180 -0
- package/node_modules/readable-stream/lib/internal/streams/buffer_list.js +183 -0
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +96 -0
- package/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +86 -0
- package/node_modules/readable-stream/lib/internal/streams/from-browser.js +3 -0
- package/node_modules/readable-stream/lib/internal/streams/from.js +52 -0
- package/node_modules/readable-stream/lib/internal/streams/pipeline.js +86 -0
- package/node_modules/readable-stream/lib/internal/streams/state.js +22 -0
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- package/node_modules/readable-stream/package.json +68 -0
- package/node_modules/readable-stream/readable-browser.js +9 -0
- package/node_modules/readable-stream/readable.js +16 -0
- package/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/safe-buffer/index.js +65 -0
- package/node_modules/safe-buffer/package.json +51 -0
- package/node_modules/semver/LICENSE +15 -0
- package/node_modules/semver/README.md +664 -0
- package/node_modules/semver/bin/semver.js +191 -0
- package/node_modules/semver/classes/comparator.js +143 -0
- package/node_modules/semver/classes/index.js +7 -0
- package/node_modules/semver/classes/range.js +556 -0
- package/node_modules/semver/classes/semver.js +319 -0
- package/node_modules/semver/functions/clean.js +8 -0
- package/node_modules/semver/functions/cmp.js +54 -0
- package/node_modules/semver/functions/coerce.js +62 -0
- package/node_modules/semver/functions/compare-build.js +9 -0
- package/node_modules/semver/functions/compare-loose.js +5 -0
- package/node_modules/semver/functions/compare.js +7 -0
- package/node_modules/semver/functions/diff.js +60 -0
- package/node_modules/semver/functions/eq.js +5 -0
- package/node_modules/semver/functions/gt.js +5 -0
- package/node_modules/semver/functions/gte.js +5 -0
- package/node_modules/semver/functions/inc.js +21 -0
- package/node_modules/semver/functions/lt.js +5 -0
- package/node_modules/semver/functions/lte.js +5 -0
- package/node_modules/semver/functions/major.js +5 -0
- package/node_modules/semver/functions/minor.js +5 -0
- package/node_modules/semver/functions/neq.js +5 -0
- package/node_modules/semver/functions/parse.js +18 -0
- package/node_modules/semver/functions/patch.js +5 -0
- package/node_modules/semver/functions/prerelease.js +8 -0
- package/node_modules/semver/functions/rcompare.js +5 -0
- package/node_modules/semver/functions/rsort.js +5 -0
- package/node_modules/semver/functions/satisfies.js +12 -0
- package/node_modules/semver/functions/sort.js +5 -0
- package/node_modules/semver/functions/valid.js +8 -0
- package/node_modules/semver/index.js +91 -0
- package/node_modules/semver/internal/constants.js +37 -0
- package/node_modules/semver/internal/debug.js +11 -0
- package/node_modules/semver/internal/identifiers.js +25 -0
- package/node_modules/semver/internal/lrucache.js +42 -0
- package/node_modules/semver/internal/parse-options.js +17 -0
- package/node_modules/semver/internal/re.js +223 -0
- package/node_modules/semver/package.json +78 -0
- package/node_modules/semver/preload.js +4 -0
- package/node_modules/semver/range.bnf +16 -0
- package/node_modules/semver/ranges/gtr.js +6 -0
- package/node_modules/semver/ranges/intersects.js +9 -0
- package/node_modules/semver/ranges/ltr.js +6 -0
- package/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/node_modules/semver/ranges/min-version.js +63 -0
- package/node_modules/semver/ranges/outside.js +82 -0
- package/node_modules/semver/ranges/simplify.js +49 -0
- package/node_modules/semver/ranges/subset.js +249 -0
- package/node_modules/semver/ranges/to-comparators.js +10 -0
- package/node_modules/semver/ranges/valid.js +13 -0
- package/node_modules/simple-concat/.travis.yml +3 -0
- package/node_modules/simple-concat/LICENSE +20 -0
- package/node_modules/simple-concat/README.md +44 -0
- package/node_modules/simple-concat/index.js +15 -0
- package/node_modules/simple-concat/package.json +47 -0
- package/node_modules/simple-concat/test/basic.js +41 -0
- package/node_modules/simple-get/.github/dependabot.yml +15 -0
- package/node_modules/simple-get/.github/workflows/ci.yml +23 -0
- package/node_modules/simple-get/LICENSE +20 -0
- package/node_modules/simple-get/README.md +333 -0
- package/node_modules/simple-get/index.js +108 -0
- package/node_modules/simple-get/package.json +67 -0
- package/node_modules/string_decoder/LICENSE +48 -0
- package/node_modules/string_decoder/README.md +47 -0
- package/node_modules/string_decoder/lib/string_decoder.js +296 -0
- package/node_modules/string_decoder/package.json +34 -0
- package/node_modules/strip-json-comments/index.js +70 -0
- package/node_modules/strip-json-comments/license +21 -0
- package/node_modules/strip-json-comments/package.json +42 -0
- package/node_modules/strip-json-comments/readme.md +64 -0
- package/node_modules/tar-fs/.travis.yml +6 -0
- package/node_modules/tar-fs/LICENSE +21 -0
- package/node_modules/tar-fs/README.md +165 -0
- package/node_modules/tar-fs/index.js +358 -0
- package/node_modules/tar-fs/package.json +41 -0
- package/node_modules/tar-fs/test/fixtures/a/hello.txt +1 -0
- package/node_modules/tar-fs/test/fixtures/b/a/test.txt +1 -0
- package/node_modules/tar-fs/test/fixtures/d/file1 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/file2 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/sub-dir/file5 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/sub-files/file3 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/sub-files/file4 +0 -0
- package/node_modules/tar-fs/test/fixtures/e/directory/.ignore +0 -0
- package/node_modules/tar-fs/test/fixtures/e/file +0 -0
- package/node_modules/tar-fs/test/fixtures/invalid.tar +0 -0
- package/node_modules/tar-fs/test/index.js +346 -0
- package/node_modules/tar-stream/LICENSE +21 -0
- package/node_modules/tar-stream/README.md +168 -0
- package/node_modules/tar-stream/extract.js +257 -0
- package/node_modules/tar-stream/headers.js +295 -0
- package/node_modules/tar-stream/index.js +2 -0
- package/node_modules/tar-stream/pack.js +255 -0
- package/node_modules/tar-stream/package.json +58 -0
- package/node_modules/tar-stream/sandbox.js +11 -0
- package/node_modules/tunnel-agent/LICENSE +55 -0
- package/node_modules/tunnel-agent/README.md +4 -0
- package/node_modules/tunnel-agent/index.js +244 -0
- package/node_modules/tunnel-agent/package.json +22 -0
- package/node_modules/util-deprecate/History.md +16 -0
- package/node_modules/util-deprecate/LICENSE +24 -0
- package/node_modules/util-deprecate/README.md +53 -0
- package/node_modules/util-deprecate/browser.js +67 -0
- package/node_modules/util-deprecate/node.js +6 -0
- package/node_modules/util-deprecate/package.json +27 -0
- package/node_modules/wrappy/LICENSE +15 -0
- package/node_modules/wrappy/README.md +36 -0
- package/node_modules/wrappy/package.json +29 -0
- package/node_modules/wrappy/wrappy.js +33 -0
- package/package.json +1 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "buffer",
|
|
3
|
+
"description": "Node.js Buffer API, for the browser",
|
|
4
|
+
"version": "5.7.1",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Feross Aboukhadijeh",
|
|
7
|
+
"email": "feross@feross.org",
|
|
8
|
+
"url": "https://feross.org"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/feross/buffer/issues"
|
|
12
|
+
},
|
|
13
|
+
"contributors": [
|
|
14
|
+
"Romain Beauxis <toots@rastageeks.org>",
|
|
15
|
+
"James Halliday <mail@substack.net>"
|
|
16
|
+
],
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"base64-js": "^1.3.1",
|
|
19
|
+
"ieee754": "^1.1.13"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"airtap": "^3.0.0",
|
|
23
|
+
"benchmark": "^2.1.4",
|
|
24
|
+
"browserify": "^17.0.0",
|
|
25
|
+
"concat-stream": "^2.0.0",
|
|
26
|
+
"hyperquest": "^2.1.3",
|
|
27
|
+
"is-buffer": "^2.0.4",
|
|
28
|
+
"is-nan": "^1.3.0",
|
|
29
|
+
"split": "^1.0.1",
|
|
30
|
+
"standard": "*",
|
|
31
|
+
"tape": "^5.0.1",
|
|
32
|
+
"through2": "^4.0.2",
|
|
33
|
+
"uglify-js": "^3.11.3"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://github.com/feross/buffer",
|
|
36
|
+
"jspm": {
|
|
37
|
+
"map": {
|
|
38
|
+
"./index.js": {
|
|
39
|
+
"node": "@node/buffer"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"arraybuffer",
|
|
45
|
+
"browser",
|
|
46
|
+
"browserify",
|
|
47
|
+
"buffer",
|
|
48
|
+
"compatible",
|
|
49
|
+
"dataview",
|
|
50
|
+
"uint8array"
|
|
51
|
+
],
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"main": "index.js",
|
|
54
|
+
"types": "index.d.ts",
|
|
55
|
+
"repository": {
|
|
56
|
+
"type": "git",
|
|
57
|
+
"url": "git://github.com/feross/buffer.git"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"perf": "browserify --debug perf/bracket-notation.js > perf/bundle.js && open perf/index.html",
|
|
61
|
+
"perf-node": "node perf/bracket-notation.js && node perf/concat.js && node perf/copy-big.js && node perf/copy.js && node perf/new-big.js && node perf/new.js && node perf/readDoubleBE.js && node perf/readFloatBE.js && node perf/readUInt32LE.js && node perf/slice.js && node perf/writeFloatBE.js",
|
|
62
|
+
"size": "browserify -r ./ | uglifyjs -c -m | gzip | wc -c",
|
|
63
|
+
"test": "standard && node ./bin/test.js",
|
|
64
|
+
"test-browser-es5": "airtap -- test/*.js",
|
|
65
|
+
"test-browser-es5-local": "airtap --local -- test/*.js",
|
|
66
|
+
"test-browser-es6": "airtap -- test/*.js test/node/*.js",
|
|
67
|
+
"test-browser-es6-local": "airtap --local -- test/*.js test/node/*.js",
|
|
68
|
+
"test-node": "tape test/*.js test/node/*.js",
|
|
69
|
+
"update-authors": "./bin/update-authors.sh"
|
|
70
|
+
},
|
|
71
|
+
"standard": {
|
|
72
|
+
"ignore": [
|
|
73
|
+
"test/node/**/*.js",
|
|
74
|
+
"test/common.js",
|
|
75
|
+
"test/_polyfill.js",
|
|
76
|
+
"perf/**/*.js"
|
|
77
|
+
],
|
|
78
|
+
"globals": [
|
|
79
|
+
"SharedArrayBuffer"
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
"funding": [
|
|
83
|
+
{
|
|
84
|
+
"type": "github",
|
|
85
|
+
"url": "https://github.com/sponsors/feross"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"type": "patreon",
|
|
89
|
+
"url": "https://www.patreon.com/feross"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"type": "consulting",
|
|
93
|
+
"url": "https://feross.org/support"
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
The ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
15
|
+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
const fs = require('fs')
|
|
3
|
+
const path = require('path')
|
|
4
|
+
|
|
5
|
+
/* istanbul ignore next */
|
|
6
|
+
const LCHOWN = fs.lchown ? 'lchown' : 'chown'
|
|
7
|
+
/* istanbul ignore next */
|
|
8
|
+
const LCHOWNSYNC = fs.lchownSync ? 'lchownSync' : 'chownSync'
|
|
9
|
+
|
|
10
|
+
/* istanbul ignore next */
|
|
11
|
+
const needEISDIRHandled = fs.lchown &&
|
|
12
|
+
!process.version.match(/v1[1-9]+\./) &&
|
|
13
|
+
!process.version.match(/v10\.[6-9]/)
|
|
14
|
+
|
|
15
|
+
const lchownSync = (path, uid, gid) => {
|
|
16
|
+
try {
|
|
17
|
+
return fs[LCHOWNSYNC](path, uid, gid)
|
|
18
|
+
} catch (er) {
|
|
19
|
+
if (er.code !== 'ENOENT')
|
|
20
|
+
throw er
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* istanbul ignore next */
|
|
25
|
+
const chownSync = (path, uid, gid) => {
|
|
26
|
+
try {
|
|
27
|
+
return fs.chownSync(path, uid, gid)
|
|
28
|
+
} catch (er) {
|
|
29
|
+
if (er.code !== 'ENOENT')
|
|
30
|
+
throw er
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* istanbul ignore next */
|
|
35
|
+
const handleEISDIR =
|
|
36
|
+
needEISDIRHandled ? (path, uid, gid, cb) => er => {
|
|
37
|
+
// Node prior to v10 had a very questionable implementation of
|
|
38
|
+
// fs.lchown, which would always try to call fs.open on a directory
|
|
39
|
+
// Fall back to fs.chown in those cases.
|
|
40
|
+
if (!er || er.code !== 'EISDIR')
|
|
41
|
+
cb(er)
|
|
42
|
+
else
|
|
43
|
+
fs.chown(path, uid, gid, cb)
|
|
44
|
+
}
|
|
45
|
+
: (_, __, ___, cb) => cb
|
|
46
|
+
|
|
47
|
+
/* istanbul ignore next */
|
|
48
|
+
const handleEISDirSync =
|
|
49
|
+
needEISDIRHandled ? (path, uid, gid) => {
|
|
50
|
+
try {
|
|
51
|
+
return lchownSync(path, uid, gid)
|
|
52
|
+
} catch (er) {
|
|
53
|
+
if (er.code !== 'EISDIR')
|
|
54
|
+
throw er
|
|
55
|
+
chownSync(path, uid, gid)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
: (path, uid, gid) => lchownSync(path, uid, gid)
|
|
59
|
+
|
|
60
|
+
// fs.readdir could only accept an options object as of node v6
|
|
61
|
+
const nodeVersion = process.version
|
|
62
|
+
let readdir = (path, options, cb) => fs.readdir(path, options, cb)
|
|
63
|
+
let readdirSync = (path, options) => fs.readdirSync(path, options)
|
|
64
|
+
/* istanbul ignore next */
|
|
65
|
+
if (/^v4\./.test(nodeVersion))
|
|
66
|
+
readdir = (path, options, cb) => fs.readdir(path, cb)
|
|
67
|
+
|
|
68
|
+
const chown = (cpath, uid, gid, cb) => {
|
|
69
|
+
fs[LCHOWN](cpath, uid, gid, handleEISDIR(cpath, uid, gid, er => {
|
|
70
|
+
// Skip ENOENT error
|
|
71
|
+
cb(er && er.code !== 'ENOENT' ? er : null)
|
|
72
|
+
}))
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const chownrKid = (p, child, uid, gid, cb) => {
|
|
76
|
+
if (typeof child === 'string')
|
|
77
|
+
return fs.lstat(path.resolve(p, child), (er, stats) => {
|
|
78
|
+
// Skip ENOENT error
|
|
79
|
+
if (er)
|
|
80
|
+
return cb(er.code !== 'ENOENT' ? er : null)
|
|
81
|
+
stats.name = child
|
|
82
|
+
chownrKid(p, stats, uid, gid, cb)
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
if (child.isDirectory()) {
|
|
86
|
+
chownr(path.resolve(p, child.name), uid, gid, er => {
|
|
87
|
+
if (er)
|
|
88
|
+
return cb(er)
|
|
89
|
+
const cpath = path.resolve(p, child.name)
|
|
90
|
+
chown(cpath, uid, gid, cb)
|
|
91
|
+
})
|
|
92
|
+
} else {
|
|
93
|
+
const cpath = path.resolve(p, child.name)
|
|
94
|
+
chown(cpath, uid, gid, cb)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
const chownr = (p, uid, gid, cb) => {
|
|
100
|
+
readdir(p, { withFileTypes: true }, (er, children) => {
|
|
101
|
+
// any error other than ENOTDIR or ENOTSUP means it's not readable,
|
|
102
|
+
// or doesn't exist. give up.
|
|
103
|
+
if (er) {
|
|
104
|
+
if (er.code === 'ENOENT')
|
|
105
|
+
return cb()
|
|
106
|
+
else if (er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP')
|
|
107
|
+
return cb(er)
|
|
108
|
+
}
|
|
109
|
+
if (er || !children.length)
|
|
110
|
+
return chown(p, uid, gid, cb)
|
|
111
|
+
|
|
112
|
+
let len = children.length
|
|
113
|
+
let errState = null
|
|
114
|
+
const then = er => {
|
|
115
|
+
if (errState)
|
|
116
|
+
return
|
|
117
|
+
if (er)
|
|
118
|
+
return cb(errState = er)
|
|
119
|
+
if (-- len === 0)
|
|
120
|
+
return chown(p, uid, gid, cb)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
children.forEach(child => chownrKid(p, child, uid, gid, then))
|
|
124
|
+
})
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const chownrKidSync = (p, child, uid, gid) => {
|
|
128
|
+
if (typeof child === 'string') {
|
|
129
|
+
try {
|
|
130
|
+
const stats = fs.lstatSync(path.resolve(p, child))
|
|
131
|
+
stats.name = child
|
|
132
|
+
child = stats
|
|
133
|
+
} catch (er) {
|
|
134
|
+
if (er.code === 'ENOENT')
|
|
135
|
+
return
|
|
136
|
+
else
|
|
137
|
+
throw er
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (child.isDirectory())
|
|
142
|
+
chownrSync(path.resolve(p, child.name), uid, gid)
|
|
143
|
+
|
|
144
|
+
handleEISDirSync(path.resolve(p, child.name), uid, gid)
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const chownrSync = (p, uid, gid) => {
|
|
148
|
+
let children
|
|
149
|
+
try {
|
|
150
|
+
children = readdirSync(p, { withFileTypes: true })
|
|
151
|
+
} catch (er) {
|
|
152
|
+
if (er.code === 'ENOENT')
|
|
153
|
+
return
|
|
154
|
+
else if (er.code === 'ENOTDIR' || er.code === 'ENOTSUP')
|
|
155
|
+
return handleEISDirSync(p, uid, gid)
|
|
156
|
+
else
|
|
157
|
+
throw er
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (children && children.length)
|
|
161
|
+
children.forEach(child => chownrKidSync(p, child, uid, gid))
|
|
162
|
+
|
|
163
|
+
return handleEISDirSync(p, uid, gid)
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
module.exports = chownr
|
|
167
|
+
chownr.sync = chownrSync
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
|
|
3
|
+
"name": "chownr",
|
|
4
|
+
"description": "like `chown -R`",
|
|
5
|
+
"version": "1.1.4",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git://github.com/isaacs/chownr.git"
|
|
9
|
+
},
|
|
10
|
+
"main": "chownr.js",
|
|
11
|
+
"files": [
|
|
12
|
+
"chownr.js"
|
|
13
|
+
],
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"mkdirp": "0.3",
|
|
16
|
+
"rimraf": "^2.7.1",
|
|
17
|
+
"tap": "^14.10.6"
|
|
18
|
+
},
|
|
19
|
+
"tap": {
|
|
20
|
+
"check-coverage": true
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"test": "tap",
|
|
24
|
+
"preversion": "npm test",
|
|
25
|
+
"postversion": "npm publish",
|
|
26
|
+
"prepublishOnly": "git push origin --follow-tags"
|
|
27
|
+
},
|
|
28
|
+
"license": "ISC"
|
|
29
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="node"/>
|
|
2
|
+
import {IncomingMessage} from 'http';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
Decompress a HTTP response if needed.
|
|
6
|
+
|
|
7
|
+
@param response - The HTTP incoming stream with compressed data.
|
|
8
|
+
@returns The decompressed HTTP response stream.
|
|
9
|
+
|
|
10
|
+
@example
|
|
11
|
+
```
|
|
12
|
+
import {http} from 'http';
|
|
13
|
+
import decompressResponse = require('decompress-response');
|
|
14
|
+
|
|
15
|
+
http.get('https://sindresorhus.com', response => {
|
|
16
|
+
response = decompressResponse(response);
|
|
17
|
+
});
|
|
18
|
+
```
|
|
19
|
+
*/
|
|
20
|
+
declare function decompressResponse(response: IncomingMessage): IncomingMessage;
|
|
21
|
+
|
|
22
|
+
export = decompressResponse;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const {Transform, PassThrough} = require('stream');
|
|
3
|
+
const zlib = require('zlib');
|
|
4
|
+
const mimicResponse = require('mimic-response');
|
|
5
|
+
|
|
6
|
+
module.exports = response => {
|
|
7
|
+
const contentEncoding = (response.headers['content-encoding'] || '').toLowerCase();
|
|
8
|
+
|
|
9
|
+
if (!['gzip', 'deflate', 'br'].includes(contentEncoding)) {
|
|
10
|
+
return response;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// TODO: Remove this when targeting Node.js 12.
|
|
14
|
+
const isBrotli = contentEncoding === 'br';
|
|
15
|
+
if (isBrotli && typeof zlib.createBrotliDecompress !== 'function') {
|
|
16
|
+
response.destroy(new Error('Brotli is not supported on Node.js < 12'));
|
|
17
|
+
return response;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let isEmpty = true;
|
|
21
|
+
|
|
22
|
+
const checker = new Transform({
|
|
23
|
+
transform(data, _encoding, callback) {
|
|
24
|
+
isEmpty = false;
|
|
25
|
+
|
|
26
|
+
callback(null, data);
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
flush(callback) {
|
|
30
|
+
callback();
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const finalStream = new PassThrough({
|
|
35
|
+
autoDestroy: false,
|
|
36
|
+
destroy(error, callback) {
|
|
37
|
+
response.destroy();
|
|
38
|
+
|
|
39
|
+
callback(error);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const decompressStream = isBrotli ? zlib.createBrotliDecompress() : zlib.createUnzip();
|
|
44
|
+
|
|
45
|
+
decompressStream.once('error', error => {
|
|
46
|
+
if (isEmpty && !response.readable) {
|
|
47
|
+
finalStream.end();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
finalStream.destroy(error);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
mimicResponse(response, finalStream);
|
|
55
|
+
response.pipe(checker).pipe(decompressStream).pipe(finalStream);
|
|
56
|
+
|
|
57
|
+
return finalStream;
|
|
58
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "decompress-response",
|
|
3
|
+
"version": "6.0.0",
|
|
4
|
+
"description": "Decompress a HTTP response if needed",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "sindresorhus/decompress-response",
|
|
7
|
+
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Sindre Sorhus",
|
|
10
|
+
"email": "sindresorhus@gmail.com",
|
|
11
|
+
"url": "https://sindresorhus.com"
|
|
12
|
+
},
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=10"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"test": "xo && ava && tsd"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"index.js",
|
|
21
|
+
"index.d.ts"
|
|
22
|
+
],
|
|
23
|
+
"keywords": [
|
|
24
|
+
"decompress",
|
|
25
|
+
"response",
|
|
26
|
+
"http",
|
|
27
|
+
"https",
|
|
28
|
+
"zlib",
|
|
29
|
+
"gzip",
|
|
30
|
+
"zip",
|
|
31
|
+
"deflate",
|
|
32
|
+
"unzip",
|
|
33
|
+
"ungzip",
|
|
34
|
+
"incoming",
|
|
35
|
+
"message",
|
|
36
|
+
"stream",
|
|
37
|
+
"compressed",
|
|
38
|
+
"brotli"
|
|
39
|
+
],
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"mimic-response": "^3.1.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/node": "^14.0.1",
|
|
45
|
+
"ava": "^2.2.0",
|
|
46
|
+
"get-stream": "^5.0.0",
|
|
47
|
+
"pify": "^5.0.0",
|
|
48
|
+
"tsd": "^0.11.0",
|
|
49
|
+
"xo": "^0.30.0"
|
|
50
|
+
},
|
|
51
|
+
"xo": {
|
|
52
|
+
"rules": {
|
|
53
|
+
"@typescript-eslint/prefer-readonly-parameter-types": "off"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# decompress-response [](https://travis-ci.com/sindresorhus/decompress-response)
|
|
2
|
+
|
|
3
|
+
> Decompress a HTTP response if needed
|
|
4
|
+
|
|
5
|
+
Decompresses the [response](https://nodejs.org/api/http.html#http_class_http_incomingmessage) from [`http.request`](https://nodejs.org/api/http.html#http_http_request_options_callback) if it's gzipped, deflated or compressed with Brotli, otherwise just passes it through.
|
|
6
|
+
|
|
7
|
+
Used by [`got`](https://github.com/sindresorhus/got).
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
$ npm install decompress-response
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
const http = require('http');
|
|
19
|
+
const decompressResponse = require('decompress-response');
|
|
20
|
+
|
|
21
|
+
http.get('https://sindresorhus.com', response => {
|
|
22
|
+
response = decompressResponse(response);
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## API
|
|
27
|
+
|
|
28
|
+
### decompressResponse(response)
|
|
29
|
+
|
|
30
|
+
Returns the decompressed HTTP response stream.
|
|
31
|
+
|
|
32
|
+
#### response
|
|
33
|
+
|
|
34
|
+
Type: [`http.IncomingMessage`](https://nodejs.org/api/http.html#http_class_http_incomingmessage)
|
|
35
|
+
|
|
36
|
+
The HTTP incoming stream with compressed data.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
<div align="center">
|
|
41
|
+
<b>
|
|
42
|
+
<a href="https://tidelift.com/subscription/pkg/npm-decompress-response?utm_source=npm-decompress-response&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
|
43
|
+
</b>
|
|
44
|
+
<br>
|
|
45
|
+
<sub>
|
|
46
|
+
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
|
47
|
+
</sub>
|
|
48
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2013-2018, Viacheslav Lotsmanov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
Deep Extend
|
|
2
|
+
===========
|
|
3
|
+
|
|
4
|
+
Recursive object extending.
|
|
5
|
+
|
|
6
|
+
[](https://travis-ci.org/unclechu/node-deep-extend)
|
|
7
|
+
|
|
8
|
+
[](https://nodei.co/npm/deep-extend/)
|
|
9
|
+
|
|
10
|
+
Install
|
|
11
|
+
-------
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
$ npm install deep-extend
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Usage
|
|
18
|
+
-----
|
|
19
|
+
|
|
20
|
+
```javascript
|
|
21
|
+
var deepExtend = require('deep-extend');
|
|
22
|
+
var obj1 = {
|
|
23
|
+
a: 1,
|
|
24
|
+
b: 2,
|
|
25
|
+
d: {
|
|
26
|
+
a: 1,
|
|
27
|
+
b: [],
|
|
28
|
+
c: { test1: 123, test2: 321 }
|
|
29
|
+
},
|
|
30
|
+
f: 5,
|
|
31
|
+
g: 123,
|
|
32
|
+
i: 321,
|
|
33
|
+
j: [1, 2]
|
|
34
|
+
};
|
|
35
|
+
var obj2 = {
|
|
36
|
+
b: 3,
|
|
37
|
+
c: 5,
|
|
38
|
+
d: {
|
|
39
|
+
b: { first: 'one', second: 'two' },
|
|
40
|
+
c: { test2: 222 }
|
|
41
|
+
},
|
|
42
|
+
e: { one: 1, two: 2 },
|
|
43
|
+
f: [],
|
|
44
|
+
g: (void 0),
|
|
45
|
+
h: /abc/g,
|
|
46
|
+
i: null,
|
|
47
|
+
j: [3, 4]
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
deepExtend(obj1, obj2);
|
|
51
|
+
|
|
52
|
+
console.log(obj1);
|
|
53
|
+
/*
|
|
54
|
+
{ a: 1,
|
|
55
|
+
b: 3,
|
|
56
|
+
d:
|
|
57
|
+
{ a: 1,
|
|
58
|
+
b: { first: 'one', second: 'two' },
|
|
59
|
+
c: { test1: 123, test2: 222 } },
|
|
60
|
+
f: [],
|
|
61
|
+
g: undefined,
|
|
62
|
+
c: 5,
|
|
63
|
+
e: { one: 1, two: 2 },
|
|
64
|
+
h: /abc/g,
|
|
65
|
+
i: null,
|
|
66
|
+
j: [3, 4] }
|
|
67
|
+
*/
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Unit testing
|
|
71
|
+
------------
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
$ npm test
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Changelog
|
|
78
|
+
---------
|
|
79
|
+
|
|
80
|
+
[CHANGELOG.md](./CHANGELOG.md)
|
|
81
|
+
|
|
82
|
+
Any issues?
|
|
83
|
+
-----------
|
|
84
|
+
|
|
85
|
+
Please, report about issues
|
|
86
|
+
[here](https://github.com/unclechu/node-deep-extend/issues).
|
|
87
|
+
|
|
88
|
+
License
|
|
89
|
+
-------
|
|
90
|
+
|
|
91
|
+
[MIT](./LICENSE)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./lib/deep-extend');
|