crabatool 1.0.2 → 1.0.3
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/index.js +23 -2
- package/ngp/config.js +2 -2
- package/ngp/node_modules/.bin/mime +12 -0
- package/ngp/node_modules/.bin/mime.cmd +17 -0
- package/ngp/node_modules/.bin/mime.ps1 +28 -0
- package/ngp/node_modules/.bin/uglifyjs +12 -0
- package/ngp/node_modules/.bin/uglifyjs.cmd +17 -0
- package/ngp/node_modules/.bin/uglifyjs.ps1 +28 -0
- package/ngp/node_modules/.package-lock.json +863 -0
- package/ngp/node_modules/accepts/HISTORY.md +243 -0
- package/ngp/node_modules/accepts/LICENSE +23 -0
- package/ngp/node_modules/accepts/README.md +140 -0
- package/ngp/node_modules/accepts/index.js +238 -0
- package/ngp/node_modules/accepts/package.json +47 -0
- package/ngp/node_modules/anymatch/LICENSE +15 -0
- package/ngp/node_modules/anymatch/README.md +87 -0
- package/ngp/node_modules/anymatch/index.d.ts +19 -0
- package/ngp/node_modules/anymatch/index.js +104 -0
- package/ngp/node_modules/anymatch/package.json +48 -0
- package/ngp/node_modules/array-flatten/LICENSE +21 -0
- package/ngp/node_modules/array-flatten/README.md +43 -0
- package/ngp/node_modules/array-flatten/array-flatten.js +64 -0
- package/ngp/node_modules/array-flatten/package.json +39 -0
- package/ngp/node_modules/binary-extensions/binary-extensions.json +260 -0
- package/ngp/node_modules/binary-extensions/binary-extensions.json.d.ts +3 -0
- package/ngp/node_modules/binary-extensions/index.d.ts +14 -0
- package/ngp/node_modules/binary-extensions/index.js +1 -0
- package/ngp/node_modules/binary-extensions/license +9 -0
- package/ngp/node_modules/binary-extensions/package.json +38 -0
- package/ngp/node_modules/binary-extensions/readme.md +41 -0
- package/ngp/node_modules/body-parser/HISTORY.md +651 -0
- package/ngp/node_modules/body-parser/LICENSE +23 -0
- package/ngp/node_modules/body-parser/README.md +464 -0
- package/ngp/node_modules/body-parser/SECURITY.md +25 -0
- package/ngp/node_modules/body-parser/index.js +157 -0
- package/ngp/node_modules/body-parser/lib/read.js +205 -0
- package/ngp/node_modules/body-parser/lib/types/json.js +236 -0
- package/ngp/node_modules/body-parser/lib/types/raw.js +101 -0
- package/ngp/node_modules/body-parser/lib/types/text.js +121 -0
- package/ngp/node_modules/body-parser/lib/types/urlencoded.js +284 -0
- package/ngp/node_modules/body-parser/node_modules/bytes/History.md +97 -0
- package/ngp/node_modules/body-parser/node_modules/bytes/LICENSE +23 -0
- package/ngp/node_modules/body-parser/node_modules/bytes/Readme.md +152 -0
- package/ngp/node_modules/body-parser/node_modules/bytes/index.js +170 -0
- package/ngp/node_modules/body-parser/node_modules/bytes/package.json +42 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/Changelog.md +162 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/LICENSE +21 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/README.md +156 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/encodings/dbcs-codec.js +555 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/encodings/dbcs-data.js +176 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/encodings/index.js +22 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/encodings/internal.js +188 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/encodings/sbcs-data.js +174 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/encodings/tables/gbk-added.json +55 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/encodings/utf16.js +177 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/encodings/utf7.js +290 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/lib/bom-handling.js +52 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/lib/extend-node.js +217 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/lib/index.d.ts +24 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/lib/index.js +153 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/lib/streams.js +121 -0
- package/ngp/node_modules/body-parser/node_modules/iconv-lite/package.json +46 -0
- package/ngp/node_modules/body-parser/package.json +56 -0
- package/ngp/node_modules/braces/CHANGELOG.md +184 -0
- package/ngp/node_modules/braces/LICENSE +21 -0
- package/ngp/node_modules/braces/README.md +593 -0
- package/ngp/node_modules/braces/index.js +170 -0
- package/ngp/node_modules/braces/lib/compile.js +57 -0
- package/ngp/node_modules/braces/lib/constants.js +57 -0
- package/ngp/node_modules/braces/lib/expand.js +113 -0
- package/ngp/node_modules/braces/lib/parse.js +333 -0
- package/ngp/node_modules/braces/lib/stringify.js +32 -0
- package/ngp/node_modules/braces/lib/utils.js +112 -0
- package/ngp/node_modules/braces/package.json +77 -0
- package/ngp/node_modules/bytes/History.md +82 -0
- package/ngp/node_modules/bytes/LICENSE +23 -0
- package/ngp/node_modules/bytes/Readme.md +125 -0
- package/ngp/node_modules/bytes/index.js +159 -0
- package/ngp/node_modules/bytes/package.json +39 -0
- package/ngp/node_modules/call-bind/.eslintignore +1 -0
- package/ngp/node_modules/call-bind/.eslintrc +17 -0
- package/ngp/node_modules/call-bind/.github/FUNDING.yml +12 -0
- package/ngp/node_modules/call-bind/.nycrc +13 -0
- package/ngp/node_modules/call-bind/CHANGELOG.md +42 -0
- package/ngp/node_modules/call-bind/LICENSE +21 -0
- package/ngp/node_modules/call-bind/README.md +2 -0
- package/ngp/node_modules/call-bind/callBound.js +15 -0
- package/ngp/node_modules/call-bind/index.js +47 -0
- package/ngp/node_modules/call-bind/package.json +80 -0
- package/ngp/node_modules/call-bind/test/callBound.js +55 -0
- package/ngp/node_modules/call-bind/test/index.js +66 -0
- package/ngp/node_modules/chokidar/LICENSE +21 -0
- package/ngp/node_modules/chokidar/README.md +308 -0
- package/ngp/node_modules/chokidar/index.js +973 -0
- package/ngp/node_modules/chokidar/lib/constants.js +65 -0
- package/ngp/node_modules/chokidar/lib/fsevents-handler.js +524 -0
- package/ngp/node_modules/chokidar/lib/nodefs-handler.js +654 -0
- package/ngp/node_modules/chokidar/package.json +85 -0
- package/ngp/node_modules/chokidar/types/index.d.ts +188 -0
- package/ngp/node_modules/compressible/HISTORY.md +111 -0
- package/ngp/node_modules/compressible/LICENSE +24 -0
- package/ngp/node_modules/compressible/README.md +61 -0
- package/ngp/node_modules/compressible/index.js +58 -0
- package/ngp/node_modules/compressible/package.json +48 -0
- package/ngp/node_modules/compression/HISTORY.md +307 -0
- package/ngp/node_modules/compression/LICENSE +23 -0
- package/ngp/node_modules/compression/README.md +240 -0
- package/ngp/node_modules/compression/index.js +288 -0
- package/ngp/node_modules/compression/package.json +47 -0
- package/ngp/node_modules/content-disposition/HISTORY.md +60 -0
- package/ngp/node_modules/content-disposition/LICENSE +22 -0
- package/ngp/node_modules/content-disposition/README.md +142 -0
- package/ngp/node_modules/content-disposition/index.js +458 -0
- package/ngp/node_modules/content-disposition/node_modules/safe-buffer/LICENSE +21 -0
- package/ngp/node_modules/content-disposition/node_modules/safe-buffer/README.md +584 -0
- package/ngp/node_modules/content-disposition/node_modules/safe-buffer/index.d.ts +187 -0
- package/ngp/node_modules/content-disposition/node_modules/safe-buffer/index.js +65 -0
- package/ngp/node_modules/content-disposition/node_modules/safe-buffer/package.json +51 -0
- package/ngp/node_modules/content-disposition/package.json +44 -0
- package/ngp/node_modules/content-type/HISTORY.md +24 -0
- package/ngp/node_modules/content-type/LICENSE +22 -0
- package/ngp/node_modules/content-type/README.md +92 -0
- package/ngp/node_modules/content-type/index.js +222 -0
- package/ngp/node_modules/content-type/package.json +40 -0
- package/ngp/node_modules/cookie/HISTORY.md +142 -0
- package/ngp/node_modules/cookie/LICENSE +24 -0
- package/ngp/node_modules/cookie/README.md +302 -0
- package/ngp/node_modules/cookie/SECURITY.md +25 -0
- package/ngp/node_modules/cookie/index.js +270 -0
- package/ngp/node_modules/cookie/package.json +44 -0
- package/ngp/node_modules/cookie-signature/History.md +38 -0
- package/ngp/node_modules/cookie-signature/Readme.md +42 -0
- package/ngp/node_modules/cookie-signature/index.js +51 -0
- package/ngp/node_modules/cookie-signature/package.json +18 -0
- package/ngp/node_modules/crabatool/index.js +28 -0
- package/ngp/node_modules/crabatool/ngp/config.js +25 -0
- package/ngp/node_modules/crabatool/ngp/ngp.js +3 -0
- package/ngp/node_modules/crabatool/ngp/package.json +15 -0
- package/ngp/node_modules/crabatool/ngp/readme.md +4 -0
- package/ngp/node_modules/crabatool/package.json +25 -0
- package/ngp/node_modules/crabatool/readme.md +12 -0
- package/ngp/node_modules/crabatool/server.js +124 -0
- package/ngp/node_modules/debug/.coveralls.yml +1 -0
- package/ngp/node_modules/debug/.eslintrc +11 -0
- package/ngp/node_modules/debug/.travis.yml +14 -0
- package/ngp/node_modules/debug/CHANGELOG.md +362 -0
- package/ngp/node_modules/debug/LICENSE +19 -0
- package/ngp/node_modules/debug/Makefile +50 -0
- package/ngp/node_modules/debug/README.md +312 -0
- package/ngp/node_modules/debug/component.json +19 -0
- package/ngp/node_modules/debug/karma.conf.js +70 -0
- package/ngp/node_modules/debug/node.js +1 -0
- package/ngp/node_modules/debug/package.json +49 -0
- package/ngp/node_modules/debug/src/browser.js +185 -0
- package/ngp/node_modules/debug/src/debug.js +202 -0
- package/ngp/node_modules/debug/src/index.js +10 -0
- package/ngp/node_modules/debug/src/inspector-log.js +15 -0
- package/ngp/node_modules/debug/src/node.js +248 -0
- package/ngp/node_modules/depd/History.md +103 -0
- package/ngp/node_modules/depd/LICENSE +22 -0
- package/ngp/node_modules/depd/Readme.md +280 -0
- package/ngp/node_modules/depd/index.js +538 -0
- package/ngp/node_modules/depd/lib/browser/index.js +77 -0
- package/ngp/node_modules/depd/package.json +45 -0
- package/ngp/node_modules/destroy/LICENSE +23 -0
- package/ngp/node_modules/destroy/README.md +63 -0
- package/ngp/node_modules/destroy/index.js +209 -0
- package/ngp/node_modules/destroy/package.json +48 -0
- package/ngp/node_modules/ee-first/LICENSE +22 -0
- package/ngp/node_modules/ee-first/README.md +80 -0
- package/ngp/node_modules/ee-first/index.js +95 -0
- package/ngp/node_modules/ee-first/package.json +29 -0
- package/ngp/node_modules/encodeurl/HISTORY.md +14 -0
- package/ngp/node_modules/encodeurl/LICENSE +22 -0
- package/ngp/node_modules/encodeurl/README.md +128 -0
- package/ngp/node_modules/encodeurl/index.js +60 -0
- package/ngp/node_modules/encodeurl/package.json +40 -0
- package/ngp/node_modules/escape-html/LICENSE +24 -0
- package/ngp/node_modules/escape-html/Readme.md +43 -0
- package/ngp/node_modules/escape-html/index.js +78 -0
- package/ngp/node_modules/escape-html/package.json +24 -0
- package/ngp/node_modules/etag/HISTORY.md +83 -0
- package/ngp/node_modules/etag/LICENSE +22 -0
- package/ngp/node_modules/etag/README.md +159 -0
- package/ngp/node_modules/etag/index.js +131 -0
- package/ngp/node_modules/etag/package.json +47 -0
- package/ngp/node_modules/express/History.md +3579 -0
- package/ngp/node_modules/express/LICENSE +24 -0
- package/ngp/node_modules/express/Readme.md +166 -0
- package/ngp/node_modules/express/index.js +11 -0
- package/ngp/node_modules/express/lib/application.js +661 -0
- package/ngp/node_modules/express/lib/express.js +116 -0
- package/ngp/node_modules/express/lib/middleware/init.js +43 -0
- package/ngp/node_modules/express/lib/middleware/query.js +47 -0
- package/ngp/node_modules/express/lib/request.js +525 -0
- package/ngp/node_modules/express/lib/response.js +1169 -0
- package/ngp/node_modules/express/lib/router/index.js +673 -0
- package/ngp/node_modules/express/lib/router/layer.js +181 -0
- package/ngp/node_modules/express/lib/router/route.js +225 -0
- package/ngp/node_modules/express/lib/utils.js +304 -0
- package/ngp/node_modules/express/lib/view.js +182 -0
- package/ngp/node_modules/express/node_modules/safe-buffer/LICENSE +21 -0
- package/ngp/node_modules/express/node_modules/safe-buffer/README.md +584 -0
- package/ngp/node_modules/express/node_modules/safe-buffer/index.d.ts +187 -0
- package/ngp/node_modules/express/node_modules/safe-buffer/index.js +65 -0
- package/ngp/node_modules/express/node_modules/safe-buffer/package.json +51 -0
- package/ngp/node_modules/express/package.json +99 -0
- package/ngp/node_modules/fill-range/LICENSE +21 -0
- package/ngp/node_modules/fill-range/README.md +237 -0
- package/ngp/node_modules/fill-range/index.js +249 -0
- package/ngp/node_modules/fill-range/package.json +69 -0
- package/ngp/node_modules/finalhandler/HISTORY.md +195 -0
- package/ngp/node_modules/finalhandler/LICENSE +22 -0
- package/ngp/node_modules/finalhandler/README.md +147 -0
- package/ngp/node_modules/finalhandler/SECURITY.md +25 -0
- package/ngp/node_modules/finalhandler/index.js +336 -0
- package/ngp/node_modules/finalhandler/package.json +46 -0
- package/ngp/node_modules/forwarded/HISTORY.md +21 -0
- package/ngp/node_modules/forwarded/LICENSE +22 -0
- package/ngp/node_modules/forwarded/README.md +57 -0
- package/ngp/node_modules/forwarded/index.js +90 -0
- package/ngp/node_modules/forwarded/package.json +45 -0
- package/ngp/node_modules/fresh/HISTORY.md +70 -0
- package/ngp/node_modules/fresh/LICENSE +23 -0
- package/ngp/node_modules/fresh/README.md +119 -0
- package/ngp/node_modules/fresh/index.js +137 -0
- package/ngp/node_modules/fresh/package.json +46 -0
- package/ngp/node_modules/function-bind/.editorconfig +20 -0
- package/ngp/node_modules/function-bind/.eslintrc +15 -0
- package/ngp/node_modules/function-bind/.jscs.json +176 -0
- package/ngp/node_modules/function-bind/.travis.yml +168 -0
- package/ngp/node_modules/function-bind/LICENSE +20 -0
- package/ngp/node_modules/function-bind/README.md +48 -0
- package/ngp/node_modules/function-bind/implementation.js +52 -0
- package/ngp/node_modules/function-bind/index.js +5 -0
- package/ngp/node_modules/function-bind/package.json +63 -0
- package/ngp/node_modules/function-bind/test/.eslintrc +9 -0
- package/ngp/node_modules/function-bind/test/index.js +252 -0
- package/ngp/node_modules/get-intrinsic/.eslintignore +1 -0
- package/ngp/node_modules/get-intrinsic/.eslintrc +43 -0
- package/ngp/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
- package/ngp/node_modules/get-intrinsic/.nycrc +13 -0
- package/ngp/node_modules/get-intrinsic/CHANGELOG.md +64 -0
- package/ngp/node_modules/get-intrinsic/LICENSE +21 -0
- package/ngp/node_modules/get-intrinsic/README.md +65 -0
- package/ngp/node_modules/get-intrinsic/index.js +330 -0
- package/ngp/node_modules/get-intrinsic/package.json +78 -0
- package/ngp/node_modules/get-intrinsic/test/GetIntrinsic.js +260 -0
- package/ngp/node_modules/glob-parent/CHANGELOG.md +110 -0
- package/ngp/node_modules/glob-parent/LICENSE +15 -0
- package/ngp/node_modules/glob-parent/README.md +137 -0
- package/ngp/node_modules/glob-parent/index.js +42 -0
- package/ngp/node_modules/glob-parent/package.json +48 -0
- package/ngp/node_modules/has/LICENSE-MIT +22 -0
- package/ngp/node_modules/has/README.md +18 -0
- package/ngp/node_modules/has/package.json +48 -0
- package/ngp/node_modules/has/src/index.js +5 -0
- package/ngp/node_modules/has/test/index.js +10 -0
- package/ngp/node_modules/has-symbols/.eslintrc +11 -0
- package/ngp/node_modules/has-symbols/.github/FUNDING.yml +12 -0
- package/ngp/node_modules/has-symbols/.nycrc +9 -0
- package/ngp/node_modules/has-symbols/CHANGELOG.md +75 -0
- package/ngp/node_modules/has-symbols/LICENSE +21 -0
- package/ngp/node_modules/has-symbols/README.md +46 -0
- package/ngp/node_modules/has-symbols/index.js +13 -0
- package/ngp/node_modules/has-symbols/package.json +101 -0
- package/ngp/node_modules/has-symbols/shams.js +42 -0
- package/ngp/node_modules/has-symbols/test/index.js +22 -0
- package/ngp/node_modules/has-symbols/test/shams/core-js.js +28 -0
- package/ngp/node_modules/has-symbols/test/shams/get-own-property-symbols.js +28 -0
- package/ngp/node_modules/has-symbols/test/tests.js +56 -0
- package/ngp/node_modules/http-errors/HISTORY.md +180 -0
- package/ngp/node_modules/http-errors/LICENSE +23 -0
- package/ngp/node_modules/http-errors/README.md +169 -0
- package/ngp/node_modules/http-errors/index.js +289 -0
- package/ngp/node_modules/http-errors/package.json +50 -0
- package/ngp/node_modules/iconv-lite/Changelog.md +184 -0
- package/ngp/node_modules/iconv-lite/LICENSE +21 -0
- package/ngp/node_modules/iconv-lite/README.md +166 -0
- package/ngp/node_modules/iconv-lite/encodings/dbcs-codec.js +555 -0
- package/ngp/node_modules/iconv-lite/encodings/dbcs-data.js +176 -0
- package/ngp/node_modules/iconv-lite/encodings/index.js +23 -0
- package/ngp/node_modules/iconv-lite/encodings/internal.js +188 -0
- package/ngp/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
- package/ngp/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/ngp/node_modules/iconv-lite/encodings/sbcs-data.js +179 -0
- package/ngp/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/ngp/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/ngp/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/ngp/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/ngp/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/ngp/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/ngp/node_modules/iconv-lite/encodings/tables/gbk-added.json +55 -0
- package/ngp/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/ngp/node_modules/iconv-lite/encodings/utf16.js +177 -0
- package/ngp/node_modules/iconv-lite/encodings/utf32.js +281 -0
- package/ngp/node_modules/iconv-lite/encodings/utf7.js +290 -0
- package/ngp/node_modules/iconv-lite/lib/bom-handling.js +52 -0
- package/ngp/node_modules/iconv-lite/lib/extend-node.js +217 -0
- package/ngp/node_modules/iconv-lite/lib/index.d.ts +41 -0
- package/ngp/node_modules/iconv-lite/lib/index.js +153 -0
- package/ngp/node_modules/iconv-lite/lib/streams.js +121 -0
- package/ngp/node_modules/iconv-lite/package.json +45 -0
- package/ngp/node_modules/inherits/LICENSE +16 -0
- package/ngp/node_modules/inherits/README.md +42 -0
- package/ngp/node_modules/inherits/inherits.js +9 -0
- package/ngp/node_modules/inherits/inherits_browser.js +27 -0
- package/ngp/node_modules/inherits/package.json +29 -0
- package/ngp/node_modules/ipaddr.js/LICENSE +19 -0
- package/ngp/node_modules/ipaddr.js/README.md +233 -0
- package/ngp/node_modules/ipaddr.js/ipaddr.min.js +1 -0
- package/ngp/node_modules/ipaddr.js/lib/ipaddr.js +673 -0
- package/ngp/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +68 -0
- package/ngp/node_modules/ipaddr.js/package.json +35 -0
- package/ngp/node_modules/is-binary-path/index.d.ts +17 -0
- package/ngp/node_modules/is-binary-path/index.js +7 -0
- package/ngp/node_modules/is-binary-path/license +9 -0
- package/ngp/node_modules/is-binary-path/package.json +40 -0
- package/ngp/node_modules/is-binary-path/readme.md +34 -0
- package/ngp/node_modules/is-extglob/LICENSE +21 -0
- package/ngp/node_modules/is-extglob/README.md +107 -0
- package/ngp/node_modules/is-extglob/index.js +20 -0
- package/ngp/node_modules/is-extglob/package.json +69 -0
- package/ngp/node_modules/is-glob/LICENSE +21 -0
- package/ngp/node_modules/is-glob/README.md +206 -0
- package/ngp/node_modules/is-glob/index.js +150 -0
- package/ngp/node_modules/is-glob/package.json +81 -0
- package/ngp/node_modules/is-number/LICENSE +21 -0
- package/ngp/node_modules/is-number/README.md +187 -0
- package/ngp/node_modules/is-number/index.js +18 -0
- package/ngp/node_modules/is-number/package.json +82 -0
- package/ngp/node_modules/media-typer/HISTORY.md +22 -0
- package/ngp/node_modules/media-typer/LICENSE +22 -0
- package/ngp/node_modules/media-typer/README.md +81 -0
- package/ngp/node_modules/media-typer/index.js +270 -0
- package/ngp/node_modules/media-typer/package.json +26 -0
- package/ngp/node_modules/merge-descriptors/HISTORY.md +21 -0
- package/ngp/node_modules/merge-descriptors/LICENSE +23 -0
- package/ngp/node_modules/merge-descriptors/README.md +48 -0
- package/ngp/node_modules/merge-descriptors/index.js +60 -0
- package/ngp/node_modules/merge-descriptors/package.json +32 -0
- package/ngp/node_modules/methods/HISTORY.md +29 -0
- package/ngp/node_modules/methods/LICENSE +24 -0
- package/ngp/node_modules/methods/README.md +51 -0
- package/ngp/node_modules/methods/index.js +69 -0
- package/ngp/node_modules/methods/package.json +36 -0
- package/ngp/node_modules/mime/CHANGELOG.md +164 -0
- package/ngp/node_modules/mime/LICENSE +21 -0
- package/ngp/node_modules/mime/README.md +90 -0
- package/ngp/node_modules/mime/cli.js +8 -0
- package/ngp/node_modules/mime/mime.js +108 -0
- package/ngp/node_modules/mime/package.json +44 -0
- package/ngp/node_modules/mime/src/build.js +53 -0
- package/ngp/node_modules/mime/src/test.js +60 -0
- package/ngp/node_modules/mime/types.json +1 -0
- package/ngp/node_modules/mime-db/HISTORY.md +507 -0
- package/ngp/node_modules/mime-db/LICENSE +23 -0
- package/ngp/node_modules/mime-db/README.md +100 -0
- package/ngp/node_modules/mime-db/db.json +8519 -0
- package/ngp/node_modules/mime-db/index.js +12 -0
- package/ngp/node_modules/mime-db/package.json +60 -0
- package/ngp/node_modules/mime-types/HISTORY.md +397 -0
- package/ngp/node_modules/mime-types/LICENSE +23 -0
- package/ngp/node_modules/mime-types/README.md +113 -0
- package/ngp/node_modules/mime-types/index.js +188 -0
- package/ngp/node_modules/mime-types/package.json +44 -0
- package/ngp/node_modules/ms/index.js +152 -0
- package/ngp/node_modules/ms/license.md +21 -0
- package/ngp/node_modules/ms/package.json +37 -0
- package/ngp/node_modules/ms/readme.md +51 -0
- package/ngp/node_modules/negotiator/HISTORY.md +108 -0
- package/ngp/node_modules/negotiator/LICENSE +24 -0
- package/ngp/node_modules/negotiator/README.md +203 -0
- package/ngp/node_modules/negotiator/index.js +82 -0
- package/ngp/node_modules/negotiator/lib/charset.js +169 -0
- package/ngp/node_modules/negotiator/lib/encoding.js +184 -0
- package/ngp/node_modules/negotiator/lib/language.js +179 -0
- package/ngp/node_modules/negotiator/lib/mediaType.js +294 -0
- package/ngp/node_modules/negotiator/package.json +42 -0
- package/ngp/node_modules/normalize-path/LICENSE +21 -0
- package/ngp/node_modules/normalize-path/README.md +127 -0
- package/ngp/node_modules/normalize-path/index.js +35 -0
- package/ngp/node_modules/normalize-path/package.json +77 -0
- package/ngp/node_modules/object-inspect/.eslintrc +53 -0
- package/ngp/node_modules/object-inspect/.github/FUNDING.yml +12 -0
- package/ngp/node_modules/object-inspect/.nycrc +13 -0
- package/ngp/node_modules/object-inspect/CHANGELOG.md +360 -0
- package/ngp/node_modules/object-inspect/LICENSE +21 -0
- package/ngp/node_modules/object-inspect/example/all.js +23 -0
- package/ngp/node_modules/object-inspect/example/circular.js +6 -0
- package/ngp/node_modules/object-inspect/example/fn.js +5 -0
- package/ngp/node_modules/object-inspect/example/inspect.js +10 -0
- package/ngp/node_modules/object-inspect/index.js +512 -0
- package/ngp/node_modules/object-inspect/package-support.json +20 -0
- package/ngp/node_modules/object-inspect/package.json +94 -0
- package/ngp/node_modules/object-inspect/readme.markdown +86 -0
- package/ngp/node_modules/object-inspect/test/bigint.js +58 -0
- package/ngp/node_modules/object-inspect/test/browser/dom.js +15 -0
- package/ngp/node_modules/object-inspect/test/circular.js +16 -0
- package/ngp/node_modules/object-inspect/test/deep.js +12 -0
- package/ngp/node_modules/object-inspect/test/element.js +53 -0
- package/ngp/node_modules/object-inspect/test/err.js +48 -0
- package/ngp/node_modules/object-inspect/test/fakes.js +29 -0
- package/ngp/node_modules/object-inspect/test/fn.js +76 -0
- package/ngp/node_modules/object-inspect/test/has.js +15 -0
- package/ngp/node_modules/object-inspect/test/holes.js +15 -0
- package/ngp/node_modules/object-inspect/test/indent-option.js +271 -0
- package/ngp/node_modules/object-inspect/test/inspect.js +139 -0
- package/ngp/node_modules/object-inspect/test/lowbyte.js +12 -0
- package/ngp/node_modules/object-inspect/test/number.js +58 -0
- package/ngp/node_modules/object-inspect/test/quoteStyle.js +17 -0
- package/ngp/node_modules/object-inspect/test/toStringTag.js +40 -0
- package/ngp/node_modules/object-inspect/test/undef.js +12 -0
- package/ngp/node_modules/object-inspect/test/values.js +211 -0
- package/ngp/node_modules/object-inspect/test-core-js.js +26 -0
- package/ngp/node_modules/object-inspect/util.inspect.js +1 -0
- package/ngp/node_modules/on-finished/HISTORY.md +98 -0
- package/ngp/node_modules/on-finished/LICENSE +23 -0
- package/ngp/node_modules/on-finished/README.md +162 -0
- package/ngp/node_modules/on-finished/index.js +234 -0
- package/ngp/node_modules/on-finished/package.json +39 -0
- package/ngp/node_modules/on-headers/HISTORY.md +21 -0
- package/ngp/node_modules/on-headers/LICENSE +22 -0
- package/ngp/node_modules/on-headers/README.md +81 -0
- package/ngp/node_modules/on-headers/index.js +132 -0
- package/ngp/node_modules/on-headers/package.json +42 -0
- package/ngp/node_modules/parseurl/HISTORY.md +58 -0
- package/ngp/node_modules/parseurl/LICENSE +24 -0
- package/ngp/node_modules/parseurl/README.md +133 -0
- package/ngp/node_modules/parseurl/index.js +158 -0
- package/ngp/node_modules/parseurl/package.json +40 -0
- package/ngp/node_modules/path-to-regexp/History.md +36 -0
- package/ngp/node_modules/path-to-regexp/LICENSE +21 -0
- package/ngp/node_modules/path-to-regexp/Readme.md +35 -0
- package/ngp/node_modules/path-to-regexp/index.js +129 -0
- package/ngp/node_modules/path-to-regexp/package.json +30 -0
- package/ngp/node_modules/picomatch/CHANGELOG.md +136 -0
- package/ngp/node_modules/picomatch/LICENSE +21 -0
- package/ngp/node_modules/picomatch/README.md +708 -0
- package/ngp/node_modules/picomatch/index.js +3 -0
- package/ngp/node_modules/picomatch/lib/constants.js +179 -0
- package/ngp/node_modules/picomatch/lib/parse.js +1091 -0
- package/ngp/node_modules/picomatch/lib/picomatch.js +342 -0
- package/ngp/node_modules/picomatch/lib/scan.js +391 -0
- package/ngp/node_modules/picomatch/lib/utils.js +64 -0
- package/ngp/node_modules/picomatch/package.json +81 -0
- package/ngp/node_modules/proxy-addr/HISTORY.md +161 -0
- package/ngp/node_modules/proxy-addr/LICENSE +22 -0
- package/ngp/node_modules/proxy-addr/README.md +139 -0
- package/ngp/node_modules/proxy-addr/index.js +327 -0
- package/ngp/node_modules/proxy-addr/package.json +47 -0
- package/ngp/node_modules/qs/.editorconfig +40 -0
- package/ngp/node_modules/qs/.eslintrc +38 -0
- package/ngp/node_modules/qs/.github/FUNDING.yml +12 -0
- package/ngp/node_modules/qs/.nycrc +13 -0
- package/ngp/node_modules/qs/CHANGELOG.md +388 -0
- package/ngp/node_modules/qs/LICENSE.md +29 -0
- package/ngp/node_modules/qs/README.md +623 -0
- package/ngp/node_modules/qs/dist/qs.js +2044 -0
- package/ngp/node_modules/qs/lib/formats.js +23 -0
- package/ngp/node_modules/qs/lib/index.js +11 -0
- package/ngp/node_modules/qs/lib/parse.js +263 -0
- package/ngp/node_modules/qs/lib/stringify.js +317 -0
- package/ngp/node_modules/qs/lib/utils.js +252 -0
- package/ngp/node_modules/qs/package.json +73 -0
- package/ngp/node_modules/qs/test/parse.js +841 -0
- package/ngp/node_modules/qs/test/stringify.js +865 -0
- package/ngp/node_modules/qs/test/utils.js +136 -0
- package/ngp/node_modules/range-parser/HISTORY.md +56 -0
- package/ngp/node_modules/range-parser/LICENSE +23 -0
- package/ngp/node_modules/range-parser/README.md +84 -0
- package/ngp/node_modules/range-parser/index.js +162 -0
- package/ngp/node_modules/range-parser/package.json +44 -0
- package/ngp/node_modules/raw-body/HISTORY.md +303 -0
- package/ngp/node_modules/raw-body/LICENSE +22 -0
- package/ngp/node_modules/raw-body/README.md +223 -0
- package/ngp/node_modules/raw-body/SECURITY.md +24 -0
- package/ngp/node_modules/raw-body/index.d.ts +87 -0
- package/ngp/node_modules/raw-body/index.js +329 -0
- package/ngp/node_modules/raw-body/node_modules/bytes/History.md +97 -0
- package/ngp/node_modules/raw-body/node_modules/bytes/LICENSE +23 -0
- package/ngp/node_modules/raw-body/node_modules/bytes/Readme.md +152 -0
- package/ngp/node_modules/raw-body/node_modules/bytes/index.js +170 -0
- package/ngp/node_modules/raw-body/node_modules/bytes/package.json +42 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/Changelog.md +162 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/LICENSE +21 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/README.md +156 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/encodings/dbcs-codec.js +555 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/encodings/dbcs-data.js +176 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/encodings/index.js +22 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/encodings/internal.js +188 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/encodings/sbcs-data.js +174 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/encodings/tables/gbk-added.json +55 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/encodings/utf16.js +177 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/encodings/utf7.js +290 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/lib/bom-handling.js +52 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/lib/extend-node.js +217 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/lib/index.d.ts +24 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/lib/index.js +153 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/lib/streams.js +121 -0
- package/ngp/node_modules/raw-body/node_modules/iconv-lite/package.json +46 -0
- package/ngp/node_modules/raw-body/package.json +49 -0
- package/ngp/node_modules/readdirp/LICENSE +21 -0
- package/ngp/node_modules/readdirp/README.md +122 -0
- package/ngp/node_modules/readdirp/index.d.ts +43 -0
- package/ngp/node_modules/readdirp/index.js +287 -0
- package/ngp/node_modules/readdirp/package.json +122 -0
- package/ngp/node_modules/safe-buffer/LICENSE +21 -0
- package/ngp/node_modules/safe-buffer/README.md +584 -0
- package/ngp/node_modules/safe-buffer/index.d.ts +187 -0
- package/ngp/node_modules/safe-buffer/index.js +62 -0
- package/ngp/node_modules/safe-buffer/package.json +37 -0
- package/ngp/node_modules/safer-buffer/LICENSE +21 -0
- package/ngp/node_modules/safer-buffer/Porting-Buffer.md +268 -0
- package/ngp/node_modules/safer-buffer/Readme.md +156 -0
- package/ngp/node_modules/safer-buffer/dangerous.js +58 -0
- package/ngp/node_modules/safer-buffer/package.json +34 -0
- package/ngp/node_modules/safer-buffer/safer.js +77 -0
- package/ngp/node_modules/safer-buffer/tests.js +406 -0
- package/ngp/node_modules/send/HISTORY.md +521 -0
- package/ngp/node_modules/send/LICENSE +23 -0
- package/ngp/node_modules/send/README.md +327 -0
- package/ngp/node_modules/send/SECURITY.md +24 -0
- package/ngp/node_modules/send/index.js +1143 -0
- package/ngp/node_modules/send/node_modules/ms/index.js +162 -0
- package/ngp/node_modules/send/node_modules/ms/license.md +21 -0
- package/ngp/node_modules/send/node_modules/ms/package.json +38 -0
- package/ngp/node_modules/send/node_modules/ms/readme.md +59 -0
- package/ngp/node_modules/send/package.json +62 -0
- package/ngp/node_modules/serve-static/HISTORY.md +471 -0
- package/ngp/node_modules/serve-static/LICENSE +25 -0
- package/ngp/node_modules/serve-static/README.md +257 -0
- package/ngp/node_modules/serve-static/index.js +210 -0
- package/ngp/node_modules/serve-static/package.json +42 -0
- package/ngp/node_modules/setprototypeof/LICENSE +13 -0
- package/ngp/node_modules/setprototypeof/README.md +31 -0
- package/ngp/node_modules/setprototypeof/index.d.ts +2 -0
- package/ngp/node_modules/setprototypeof/index.js +17 -0
- package/ngp/node_modules/setprototypeof/package.json +38 -0
- package/ngp/node_modules/setprototypeof/test/index.js +24 -0
- package/ngp/node_modules/side-channel/.eslintignore +1 -0
- package/ngp/node_modules/side-channel/.eslintrc +11 -0
- package/ngp/node_modules/side-channel/.github/FUNDING.yml +12 -0
- package/ngp/node_modules/side-channel/.nycrc +13 -0
- package/ngp/node_modules/side-channel/CHANGELOG.md +65 -0
- package/ngp/node_modules/side-channel/LICENSE +21 -0
- package/ngp/node_modules/side-channel/README.md +2 -0
- package/ngp/node_modules/side-channel/index.js +124 -0
- package/ngp/node_modules/side-channel/package.json +67 -0
- package/ngp/node_modules/side-channel/test/index.js +78 -0
- package/ngp/node_modules/statuses/HISTORY.md +82 -0
- package/ngp/node_modules/statuses/LICENSE +23 -0
- package/ngp/node_modules/statuses/README.md +136 -0
- package/ngp/node_modules/statuses/codes.json +65 -0
- package/ngp/node_modules/statuses/index.js +146 -0
- package/ngp/node_modules/statuses/package.json +49 -0
- package/ngp/node_modules/to-regex-range/LICENSE +21 -0
- package/ngp/node_modules/to-regex-range/README.md +305 -0
- package/ngp/node_modules/to-regex-range/index.js +288 -0
- package/ngp/node_modules/to-regex-range/package.json +88 -0
- package/ngp/node_modules/toidentifier/HISTORY.md +9 -0
- package/ngp/node_modules/toidentifier/LICENSE +21 -0
- package/ngp/node_modules/toidentifier/README.md +61 -0
- package/ngp/node_modules/toidentifier/index.js +32 -0
- package/ngp/node_modules/toidentifier/package.json +38 -0
- package/ngp/node_modules/type-is/HISTORY.md +259 -0
- package/ngp/node_modules/type-is/LICENSE +23 -0
- package/ngp/node_modules/type-is/README.md +170 -0
- package/ngp/node_modules/type-is/index.js +266 -0
- package/ngp/node_modules/type-is/package.json +45 -0
- package/ngp/node_modules/uglify-js/LICENSE +29 -0
- package/ngp/node_modules/uglify-js/README.md +1423 -0
- package/ngp/node_modules/uglify-js/bin/uglifyjs +603 -0
- package/ngp/node_modules/uglify-js/lib/ast.js +2132 -0
- package/ngp/node_modules/uglify-js/lib/compress.js +13762 -0
- package/ngp/node_modules/uglify-js/lib/minify.js +277 -0
- package/ngp/node_modules/uglify-js/lib/mozilla-ast.js +1274 -0
- package/ngp/node_modules/uglify-js/lib/output.js +1936 -0
- package/ngp/node_modules/uglify-js/lib/parse.js +2559 -0
- package/ngp/node_modules/uglify-js/lib/propmangle.js +259 -0
- package/ngp/node_modules/uglify-js/lib/scope.js +860 -0
- package/ngp/node_modules/uglify-js/lib/sourcemap.js +195 -0
- package/ngp/node_modules/uglify-js/lib/transform.js +250 -0
- package/ngp/node_modules/uglify-js/lib/utils.js +285 -0
- package/ngp/node_modules/uglify-js/package.json +56 -0
- package/ngp/node_modules/uglify-js/tools/domprops.html +456 -0
- package/ngp/node_modules/uglify-js/tools/domprops.json +8325 -0
- package/ngp/node_modules/uglify-js/tools/exports.js +8 -0
- package/ngp/node_modules/uglify-js/tools/node.js +110 -0
- package/ngp/node_modules/uglify-js/tools/tty.js +22 -0
- package/ngp/node_modules/unpipe/HISTORY.md +4 -0
- package/ngp/node_modules/unpipe/LICENSE +22 -0
- package/ngp/node_modules/unpipe/README.md +43 -0
- package/ngp/node_modules/unpipe/index.js +69 -0
- package/ngp/node_modules/unpipe/package.json +27 -0
- package/ngp/node_modules/utils-merge/LICENSE +20 -0
- package/ngp/node_modules/utils-merge/README.md +34 -0
- package/ngp/node_modules/utils-merge/index.js +23 -0
- package/ngp/node_modules/utils-merge/package.json +40 -0
- package/ngp/node_modules/vary/HISTORY.md +39 -0
- package/ngp/node_modules/vary/LICENSE +22 -0
- package/ngp/node_modules/vary/README.md +101 -0
- package/ngp/node_modules/vary/index.js +149 -0
- package/ngp/node_modules/vary/package.json +43 -0
- package/ngp/package-lock.json +1508 -0
- package/package.json +3 -2
- package/readme.md +0 -4
|
@@ -0,0 +1,603 @@
|
|
|
1
|
+
#! /usr/bin/env node
|
|
2
|
+
// -*- js -*-
|
|
3
|
+
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
require("../tools/tty");
|
|
7
|
+
|
|
8
|
+
var fs = require("fs");
|
|
9
|
+
var info = require("../package.json");
|
|
10
|
+
var path = require("path");
|
|
11
|
+
var UglifyJS = require("../tools/node");
|
|
12
|
+
|
|
13
|
+
var skip_keys = [ "cname", "fixed", "in_arg", "inlined", "length_read", "parent_scope", "redef", "scope", "unused" ];
|
|
14
|
+
var truthy_keys = [ "optional", "pure", "terminal", "uses_arguments", "uses_eval", "uses_with" ];
|
|
15
|
+
|
|
16
|
+
var files = {};
|
|
17
|
+
var options = {};
|
|
18
|
+
var short_forms = {
|
|
19
|
+
b: "beautify",
|
|
20
|
+
c: "compress",
|
|
21
|
+
d: "define",
|
|
22
|
+
e: "enclose",
|
|
23
|
+
h: "help",
|
|
24
|
+
m: "mangle",
|
|
25
|
+
o: "output",
|
|
26
|
+
O: "output-opts",
|
|
27
|
+
p: "parse",
|
|
28
|
+
v: "version",
|
|
29
|
+
V: "version",
|
|
30
|
+
};
|
|
31
|
+
var args = process.argv.slice(2);
|
|
32
|
+
var paths = [];
|
|
33
|
+
var output, nameCache;
|
|
34
|
+
var specified = {};
|
|
35
|
+
while (args.length) {
|
|
36
|
+
var arg = args.shift();
|
|
37
|
+
if (arg[0] != "-") {
|
|
38
|
+
paths.push(arg);
|
|
39
|
+
} else if (arg == "--") {
|
|
40
|
+
paths = paths.concat(args);
|
|
41
|
+
break;
|
|
42
|
+
} else if (arg[1] == "-") {
|
|
43
|
+
process_option(arg.slice(2));
|
|
44
|
+
} else [].forEach.call(arg.slice(1), function(letter, index, arg) {
|
|
45
|
+
if (!(letter in short_forms)) fatal("invalid option -" + letter);
|
|
46
|
+
process_option(short_forms[letter], index + 1 < arg.length);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function process_option(name, no_value) {
|
|
51
|
+
specified[name] = true;
|
|
52
|
+
switch (name) {
|
|
53
|
+
case "help":
|
|
54
|
+
switch (read_value()) {
|
|
55
|
+
case "ast":
|
|
56
|
+
print(UglifyJS.describe_ast());
|
|
57
|
+
break;
|
|
58
|
+
case "options":
|
|
59
|
+
var text = [];
|
|
60
|
+
var toplevels = [];
|
|
61
|
+
var padding = "";
|
|
62
|
+
var defaults = UglifyJS.default_options();
|
|
63
|
+
for (var name in defaults) {
|
|
64
|
+
var option = defaults[name];
|
|
65
|
+
if (option && typeof option == "object") {
|
|
66
|
+
text.push("--" + ({
|
|
67
|
+
output: "beautify",
|
|
68
|
+
sourceMap: "source-map",
|
|
69
|
+
}[name] || name) + " options:");
|
|
70
|
+
text.push(format_object(option));
|
|
71
|
+
text.push("");
|
|
72
|
+
} else {
|
|
73
|
+
if (padding.length < name.length) padding = Array(name.length + 1).join(" ");
|
|
74
|
+
toplevels.push([ {
|
|
75
|
+
keep_fargs: "keep-fargs",
|
|
76
|
+
keep_fnames: "keep-fnames",
|
|
77
|
+
nameCache: "name-cache",
|
|
78
|
+
}[name] || name, option ]);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
toplevels.forEach(function(tokens) {
|
|
82
|
+
text.push("--" + tokens[0] + padding.slice(tokens[0].length - 2) + tokens[1]);
|
|
83
|
+
});
|
|
84
|
+
print(text.join("\n"));
|
|
85
|
+
break;
|
|
86
|
+
default:
|
|
87
|
+
print([
|
|
88
|
+
"Usage: uglifyjs [files...] [options]",
|
|
89
|
+
"",
|
|
90
|
+
"Options:",
|
|
91
|
+
" -h, --help Print usage information.",
|
|
92
|
+
" `--help options` for details on available options.",
|
|
93
|
+
" -v, -V, --version Print version number.",
|
|
94
|
+
" -p, --parse <options> Specify parser options.",
|
|
95
|
+
" -c, --compress [options] Enable compressor/specify compressor options.",
|
|
96
|
+
" -m, --mangle [options] Mangle names/specify mangler options.",
|
|
97
|
+
" --mangle-props [options] Mangle properties/specify mangler options.",
|
|
98
|
+
" -b, --beautify [options] Beautify output/specify output options.",
|
|
99
|
+
" -O, --output-opts <options> Output options (beautify disabled).",
|
|
100
|
+
" -o, --output <file> Output file (default STDOUT).",
|
|
101
|
+
" --annotations Process and preserve comment annotations.",
|
|
102
|
+
" --no-annotations Ignore and discard comment annotations.",
|
|
103
|
+
" --comments [filter] Preserve copyright comments in the output.",
|
|
104
|
+
" --config-file <file> Read minify() options from JSON file.",
|
|
105
|
+
" -d, --define <expr>[=value] Global definitions.",
|
|
106
|
+
" -e, --enclose [arg[,...][:value[,...]]] Embed everything in a big function, with configurable argument(s) & value(s).",
|
|
107
|
+
" --ie Support non-standard Internet Explorer.",
|
|
108
|
+
" --keep-fargs Do not mangle/drop function arguments.",
|
|
109
|
+
" --keep-fnames Do not mangle/drop function names. Useful for code relying on Function.prototype.name.",
|
|
110
|
+
" --module Process input as ES module (implies --toplevel)",
|
|
111
|
+
" --name-cache <file> File to hold mangled name mappings.",
|
|
112
|
+
" --rename Force symbol expansion.",
|
|
113
|
+
" --no-rename Disable symbol expansion.",
|
|
114
|
+
" --self Build UglifyJS as a library (implies --wrap UglifyJS)",
|
|
115
|
+
" --source-map [options] Enable source map/specify source map options.",
|
|
116
|
+
" --timings Display operations run time on STDERR.",
|
|
117
|
+
" --toplevel Compress and/or mangle variables in toplevel scope.",
|
|
118
|
+
" --v8 Support non-standard Chrome & Node.js.",
|
|
119
|
+
" --validate Perform validation during AST manipulations.",
|
|
120
|
+
" --verbose Print diagnostic messages.",
|
|
121
|
+
" --warn Print warning messages.",
|
|
122
|
+
" --webkit Support non-standard Safari/Webkit.",
|
|
123
|
+
" --wrap <name> Embed everything as a function with “exports” corresponding to “name” globally.",
|
|
124
|
+
"",
|
|
125
|
+
"(internal debug use only)",
|
|
126
|
+
" --in-situ Warning: replaces original source files with minified output.",
|
|
127
|
+
" --reduce-test Reduce a standalone test case (assumes cloned repository).",
|
|
128
|
+
].join("\n"));
|
|
129
|
+
}
|
|
130
|
+
process.exit();
|
|
131
|
+
case "version":
|
|
132
|
+
print(info.name + " " + info.version);
|
|
133
|
+
process.exit();
|
|
134
|
+
case "config-file":
|
|
135
|
+
var config = JSON.parse(read_file(read_value(true)));
|
|
136
|
+
if (config.mangle && config.mangle.properties && config.mangle.properties.regex) {
|
|
137
|
+
config.mangle.properties.regex = UglifyJS.parse(config.mangle.properties.regex, {
|
|
138
|
+
expression: true,
|
|
139
|
+
}).value;
|
|
140
|
+
}
|
|
141
|
+
for (var key in config) if (!(key in options)) options[key] = config[key];
|
|
142
|
+
break;
|
|
143
|
+
case "compress":
|
|
144
|
+
case "mangle":
|
|
145
|
+
options[name] = parse_js(read_value(), options[name]);
|
|
146
|
+
break;
|
|
147
|
+
case "source-map":
|
|
148
|
+
options.sourceMap = parse_js(read_value(), options.sourceMap);
|
|
149
|
+
break;
|
|
150
|
+
case "enclose":
|
|
151
|
+
options[name] = read_value();
|
|
152
|
+
break;
|
|
153
|
+
case "annotations":
|
|
154
|
+
case "ie":
|
|
155
|
+
case "ie8":
|
|
156
|
+
case "module":
|
|
157
|
+
case "timings":
|
|
158
|
+
case "toplevel":
|
|
159
|
+
case "v8":
|
|
160
|
+
case "validate":
|
|
161
|
+
case "webkit":
|
|
162
|
+
options[name] = true;
|
|
163
|
+
break;
|
|
164
|
+
case "no-annotations":
|
|
165
|
+
options.annotations = false;
|
|
166
|
+
break;
|
|
167
|
+
case "keep-fargs":
|
|
168
|
+
options.keep_fargs = true;
|
|
169
|
+
break;
|
|
170
|
+
case "keep-fnames":
|
|
171
|
+
options.keep_fnames = true;
|
|
172
|
+
break;
|
|
173
|
+
case "wrap":
|
|
174
|
+
options[name] = read_value(true);
|
|
175
|
+
break;
|
|
176
|
+
case "verbose":
|
|
177
|
+
options.warnings = "verbose";
|
|
178
|
+
break;
|
|
179
|
+
case "warn":
|
|
180
|
+
if (!options.warnings) options.warnings = true;
|
|
181
|
+
break;
|
|
182
|
+
case "beautify":
|
|
183
|
+
options.output = parse_js(read_value(), options.output);
|
|
184
|
+
if (!("beautify" in options.output)) options.output.beautify = true;
|
|
185
|
+
break;
|
|
186
|
+
case "output-opts":
|
|
187
|
+
options.output = parse_js(read_value(true), options.output);
|
|
188
|
+
break;
|
|
189
|
+
case "comments":
|
|
190
|
+
if (typeof options.output != "object") options.output = {};
|
|
191
|
+
options.output.comments = read_value();
|
|
192
|
+
if (options.output.comments === true) options.output.comments = "some";
|
|
193
|
+
break;
|
|
194
|
+
case "define":
|
|
195
|
+
if (typeof options.compress != "object") options.compress = {};
|
|
196
|
+
options.compress.global_defs = parse_js(read_value(true), options.compress.global_defs, "define");
|
|
197
|
+
break;
|
|
198
|
+
case "mangle-props":
|
|
199
|
+
if (typeof options.mangle != "object") options.mangle = {};
|
|
200
|
+
options.mangle.properties = parse_js(read_value(), options.mangle.properties);
|
|
201
|
+
break;
|
|
202
|
+
case "name-cache":
|
|
203
|
+
nameCache = read_value(true);
|
|
204
|
+
options.nameCache = JSON.parse(read_file(nameCache, "{}"));
|
|
205
|
+
break;
|
|
206
|
+
case "output":
|
|
207
|
+
output = read_value(true);
|
|
208
|
+
break;
|
|
209
|
+
case "parse":
|
|
210
|
+
options.parse = parse_js(read_value(true), options.parse);
|
|
211
|
+
break;
|
|
212
|
+
case "rename":
|
|
213
|
+
options.rename = true;
|
|
214
|
+
break;
|
|
215
|
+
case "no-rename":
|
|
216
|
+
options.rename = false;
|
|
217
|
+
break;
|
|
218
|
+
case "in-situ":
|
|
219
|
+
case "reduce-test":
|
|
220
|
+
case "self":
|
|
221
|
+
break;
|
|
222
|
+
default:
|
|
223
|
+
fatal("invalid option --" + name);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function read_value(required) {
|
|
227
|
+
if (no_value || !args.length || args[0][0] == "-") {
|
|
228
|
+
if (required) fatal("missing option argument for --" + name);
|
|
229
|
+
return true;
|
|
230
|
+
}
|
|
231
|
+
return args.shift();
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
if (!output && options.sourceMap && options.sourceMap.url != "inline") fatal("cannot write source map to STDOUT");
|
|
235
|
+
if (specified["beautify"] && specified["output-opts"]) fatal("--beautify cannot be used with --output-opts");
|
|
236
|
+
[ "compress", "mangle" ].forEach(function(name) {
|
|
237
|
+
if (!(name in options)) options[name] = false;
|
|
238
|
+
});
|
|
239
|
+
if (options.mangle && options.mangle.properties) {
|
|
240
|
+
if (options.mangle.properties.domprops) {
|
|
241
|
+
delete options.mangle.properties.domprops;
|
|
242
|
+
} else {
|
|
243
|
+
if (typeof options.mangle.properties != "object") options.mangle.properties = {};
|
|
244
|
+
if (!Array.isArray(options.mangle.properties.reserved)) options.mangle.properties.reserved = [];
|
|
245
|
+
require("../tools/domprops").forEach(function(name) {
|
|
246
|
+
UglifyJS.push_uniq(options.mangle.properties.reserved, name);
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
if (/^ast|spidermonkey$/.test(output)) {
|
|
251
|
+
if (typeof options.output != "object") options.output = {};
|
|
252
|
+
options.output.ast = true;
|
|
253
|
+
options.output.code = false;
|
|
254
|
+
}
|
|
255
|
+
if (options.parse && (options.parse.acorn || options.parse.spidermonkey)
|
|
256
|
+
&& options.sourceMap && options.sourceMap.content == "inline") {
|
|
257
|
+
fatal("inline source map only works with built-in parser");
|
|
258
|
+
}
|
|
259
|
+
if (options.warnings) {
|
|
260
|
+
UglifyJS.AST_Node.log_function(print_error, options.warnings == "verbose");
|
|
261
|
+
delete options.warnings;
|
|
262
|
+
}
|
|
263
|
+
var convert_path = function(name) {
|
|
264
|
+
return name;
|
|
265
|
+
};
|
|
266
|
+
if (typeof options.sourceMap == "object" && "base" in options.sourceMap) {
|
|
267
|
+
convert_path = function() {
|
|
268
|
+
var base = options.sourceMap.base;
|
|
269
|
+
delete options.sourceMap.base;
|
|
270
|
+
return function(name) {
|
|
271
|
+
return path.relative(base, name);
|
|
272
|
+
};
|
|
273
|
+
}();
|
|
274
|
+
}
|
|
275
|
+
if (specified["self"]) {
|
|
276
|
+
if (paths.length) UglifyJS.AST_Node.warn("Ignoring input files since --self was passed");
|
|
277
|
+
if (!options.wrap) options.wrap = "UglifyJS";
|
|
278
|
+
paths = UglifyJS.FILES;
|
|
279
|
+
}
|
|
280
|
+
if (specified["in-situ"]) {
|
|
281
|
+
if (output && output != "spidermonkey" || specified["reduce-test"] || specified["self"]) {
|
|
282
|
+
fatal("incompatible options specified");
|
|
283
|
+
}
|
|
284
|
+
paths.forEach(function(name) {
|
|
285
|
+
print(name);
|
|
286
|
+
if (/^ast|spidermonkey$/.test(name)) fatal("invalid file name specified");
|
|
287
|
+
files = {};
|
|
288
|
+
files[convert_path(name)] = read_file(name);
|
|
289
|
+
output = name;
|
|
290
|
+
run();
|
|
291
|
+
});
|
|
292
|
+
} else if (paths.length) {
|
|
293
|
+
simple_glob(paths).forEach(function(name) {
|
|
294
|
+
files[convert_path(name)] = read_file(name);
|
|
295
|
+
});
|
|
296
|
+
run();
|
|
297
|
+
} else {
|
|
298
|
+
var timerId = process.stdin.isTTY && process.argv.length < 3 && setTimeout(function() {
|
|
299
|
+
print_error("Waiting for input... (use `--help` to print usage information)");
|
|
300
|
+
}, 1500);
|
|
301
|
+
var chunks = [];
|
|
302
|
+
process.stdin.setEncoding("utf8");
|
|
303
|
+
process.stdin.once("data", function() {
|
|
304
|
+
clearTimeout(timerId);
|
|
305
|
+
}).on("data", function(chunk) {
|
|
306
|
+
chunks.push(chunk);
|
|
307
|
+
}).on("end", function() {
|
|
308
|
+
files = { STDIN: chunks.join("") };
|
|
309
|
+
run();
|
|
310
|
+
});
|
|
311
|
+
process.stdin.resume();
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
function convert_ast(fn) {
|
|
315
|
+
return UglifyJS.AST_Node.from_mozilla_ast(Object.keys(files).reduce(fn, null));
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
function run() {
|
|
319
|
+
var content = options.sourceMap && options.sourceMap.content;
|
|
320
|
+
if (content && content != "inline") {
|
|
321
|
+
UglifyJS.AST_Node.info("Using input source map: {content}", {
|
|
322
|
+
content : content,
|
|
323
|
+
});
|
|
324
|
+
options.sourceMap.content = read_file(content, content);
|
|
325
|
+
}
|
|
326
|
+
try {
|
|
327
|
+
if (options.parse) {
|
|
328
|
+
if (options.parse.acorn) {
|
|
329
|
+
var annotations = Object.create(null);
|
|
330
|
+
files = convert_ast(function(toplevel, name) {
|
|
331
|
+
var content = files[name];
|
|
332
|
+
var list = annotations[name] = [];
|
|
333
|
+
var prev = -1;
|
|
334
|
+
return require("acorn").parse(content, {
|
|
335
|
+
allowHashBang: true,
|
|
336
|
+
ecmaVersion: "latest",
|
|
337
|
+
locations: true,
|
|
338
|
+
onComment: function(block, text, start, end) {
|
|
339
|
+
var match = /[@#]__PURE__/.exec(text);
|
|
340
|
+
if (!match) {
|
|
341
|
+
if (start != prev) return;
|
|
342
|
+
match = [ list[prev] ];
|
|
343
|
+
}
|
|
344
|
+
while (/\s/.test(content[end])) end++;
|
|
345
|
+
list[end] = match[0];
|
|
346
|
+
prev = end;
|
|
347
|
+
},
|
|
348
|
+
preserveParens: true,
|
|
349
|
+
program: toplevel,
|
|
350
|
+
sourceFile: name,
|
|
351
|
+
sourceType: "module",
|
|
352
|
+
});
|
|
353
|
+
});
|
|
354
|
+
files.walk(new UglifyJS.TreeWalker(function(node) {
|
|
355
|
+
if (!(node instanceof UglifyJS.AST_Call)) return;
|
|
356
|
+
var list = annotations[node.start.file];
|
|
357
|
+
var pure = list[node.start.pos];
|
|
358
|
+
if (!pure) {
|
|
359
|
+
var tokens = node.start.parens;
|
|
360
|
+
if (tokens) for (var i = 0; !pure && i < tokens.length; i++) {
|
|
361
|
+
pure = list[tokens[i].pos];
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
if (pure) node.pure = pure;
|
|
365
|
+
}));
|
|
366
|
+
} else if (options.parse.spidermonkey) {
|
|
367
|
+
files = convert_ast(function(toplevel, name) {
|
|
368
|
+
var obj = JSON.parse(files[name]);
|
|
369
|
+
if (!toplevel) return obj;
|
|
370
|
+
toplevel.body = toplevel.body.concat(obj.body);
|
|
371
|
+
return toplevel;
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
} catch (ex) {
|
|
376
|
+
fatal(ex);
|
|
377
|
+
}
|
|
378
|
+
var result;
|
|
379
|
+
if (specified["reduce-test"]) {
|
|
380
|
+
// load on demand - assumes cloned repository
|
|
381
|
+
var reduce_test = require("../test/reduce");
|
|
382
|
+
if (Object.keys(files).length != 1) fatal("can only test on a single file");
|
|
383
|
+
result = reduce_test(files[Object.keys(files)[0]], options, {
|
|
384
|
+
log: print_error,
|
|
385
|
+
verbose: true,
|
|
386
|
+
});
|
|
387
|
+
} else {
|
|
388
|
+
result = UglifyJS.minify(files, options);
|
|
389
|
+
}
|
|
390
|
+
if (result.error) {
|
|
391
|
+
var ex = result.error;
|
|
392
|
+
if (ex.name == "SyntaxError") {
|
|
393
|
+
print_error("Parse error at " + ex.filename + ":" + ex.line + "," + ex.col);
|
|
394
|
+
var file = files[ex.filename];
|
|
395
|
+
if (file) {
|
|
396
|
+
var col = ex.col;
|
|
397
|
+
var lines = file.split(/\r?\n/);
|
|
398
|
+
var line = lines[ex.line - 1];
|
|
399
|
+
if (!line && !col) {
|
|
400
|
+
line = lines[ex.line - 2];
|
|
401
|
+
col = line.length;
|
|
402
|
+
}
|
|
403
|
+
if (line) {
|
|
404
|
+
var limit = 70;
|
|
405
|
+
if (col > limit) {
|
|
406
|
+
line = line.slice(col - limit);
|
|
407
|
+
col = limit;
|
|
408
|
+
}
|
|
409
|
+
print_error(line.slice(0, 80));
|
|
410
|
+
print_error(line.slice(0, col).replace(/\S/g, " ") + "^");
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
} else if (ex.defs) {
|
|
414
|
+
print_error("Supported options:");
|
|
415
|
+
print_error(format_object(ex.defs));
|
|
416
|
+
}
|
|
417
|
+
fatal(ex);
|
|
418
|
+
} else if (output == "ast") {
|
|
419
|
+
if (!options.compress && !options.mangle) {
|
|
420
|
+
var toplevel = result.ast;
|
|
421
|
+
if (!(toplevel instanceof UglifyJS.AST_Toplevel)) {
|
|
422
|
+
if (!(toplevel instanceof UglifyJS.AST_Statement)) toplevel = new UglifyJS.AST_SimpleStatement({
|
|
423
|
+
body: toplevel,
|
|
424
|
+
});
|
|
425
|
+
toplevel = new UglifyJS.AST_Toplevel({
|
|
426
|
+
body: [ toplevel ],
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
toplevel.figure_out_scope({});
|
|
430
|
+
}
|
|
431
|
+
print(JSON.stringify(result.ast, function(key, value) {
|
|
432
|
+
if (value) switch (key) {
|
|
433
|
+
case "enclosed":
|
|
434
|
+
return value.length ? value.map(symdef) : undefined;
|
|
435
|
+
case "functions":
|
|
436
|
+
case "globals":
|
|
437
|
+
case "variables":
|
|
438
|
+
return value.size() ? value.map(symdef) : undefined;
|
|
439
|
+
case "thedef":
|
|
440
|
+
return symdef(value);
|
|
441
|
+
}
|
|
442
|
+
if (skip_property(key, value)) return;
|
|
443
|
+
if (value instanceof UglifyJS.AST_Token) return;
|
|
444
|
+
if (value instanceof UglifyJS.Dictionary) return;
|
|
445
|
+
if (value instanceof UglifyJS.AST_Node) {
|
|
446
|
+
var result = {
|
|
447
|
+
_class: "AST_" + value.TYPE
|
|
448
|
+
};
|
|
449
|
+
value.CTOR.PROPS.forEach(function(prop) {
|
|
450
|
+
result[prop] = value[prop];
|
|
451
|
+
});
|
|
452
|
+
return result;
|
|
453
|
+
}
|
|
454
|
+
return value;
|
|
455
|
+
}, 2));
|
|
456
|
+
} else if (output == "spidermonkey") {
|
|
457
|
+
print(JSON.stringify(result.ast.to_mozilla_ast(), null, 2));
|
|
458
|
+
} else if (output) {
|
|
459
|
+
var code;
|
|
460
|
+
if (result.ast) {
|
|
461
|
+
var opts = {};
|
|
462
|
+
for (var name in options.output) {
|
|
463
|
+
if (!/^ast|code$/.test(name)) opts[name] = options.output[name];
|
|
464
|
+
}
|
|
465
|
+
code = UglifyJS.AST_Node.from_mozilla_ast(result.ast.to_mozilla_ast()).print_to_string(opts);
|
|
466
|
+
} else {
|
|
467
|
+
code = result.code;
|
|
468
|
+
}
|
|
469
|
+
fs.writeFileSync(output, code);
|
|
470
|
+
if (result.map) fs.writeFileSync(output + ".map", result.map);
|
|
471
|
+
} else {
|
|
472
|
+
print(result.code);
|
|
473
|
+
}
|
|
474
|
+
if (nameCache) fs.writeFileSync(nameCache, JSON.stringify(options.nameCache));
|
|
475
|
+
if (result.timings) for (var phase in result.timings) {
|
|
476
|
+
print_error("- " + phase + ": " + result.timings[phase].toFixed(3) + "s");
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
function fatal(message) {
|
|
481
|
+
if (message instanceof Error) {
|
|
482
|
+
message = message.stack.replace(/^\S*?Error:/, "ERROR:")
|
|
483
|
+
} else {
|
|
484
|
+
message = "ERROR: " + message;
|
|
485
|
+
}
|
|
486
|
+
print_error(message);
|
|
487
|
+
process.exit(1);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
// A file glob function that only supports "*" and "?" wildcards in the basename.
|
|
491
|
+
// Example: "foo/bar/*baz??.*.js"
|
|
492
|
+
// Argument `glob` may be a string or an array of strings.
|
|
493
|
+
// Returns an array of strings. Garbage in, garbage out.
|
|
494
|
+
function simple_glob(glob) {
|
|
495
|
+
if (Array.isArray(glob)) {
|
|
496
|
+
return [].concat.apply([], glob.map(simple_glob));
|
|
497
|
+
}
|
|
498
|
+
if (glob.match(/\*|\?/)) {
|
|
499
|
+
var dir = path.dirname(glob);
|
|
500
|
+
try {
|
|
501
|
+
var entries = fs.readdirSync(dir);
|
|
502
|
+
} catch (ex) {}
|
|
503
|
+
if (entries) {
|
|
504
|
+
var pattern = "^" + path.basename(glob)
|
|
505
|
+
.replace(/[.+^$[\]\\(){}]/g, "\\$&")
|
|
506
|
+
.replace(/\*/g, "[^/\\\\]*")
|
|
507
|
+
.replace(/\?/g, "[^/\\\\]") + "$";
|
|
508
|
+
var mod = process.platform === "win32" ? "i" : "";
|
|
509
|
+
var rx = new RegExp(pattern, mod);
|
|
510
|
+
var results = entries.sort().filter(function(name) {
|
|
511
|
+
return rx.test(name);
|
|
512
|
+
}).map(function(name) {
|
|
513
|
+
return path.join(dir, name);
|
|
514
|
+
});
|
|
515
|
+
if (results.length) return results;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
return [ glob ];
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
function read_file(path, default_value) {
|
|
522
|
+
try {
|
|
523
|
+
return fs.readFileSync(path, "utf8");
|
|
524
|
+
} catch (ex) {
|
|
525
|
+
if (ex.code == "ENOENT" && default_value != null) return default_value;
|
|
526
|
+
fatal(ex);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
function parse_js(value, options, flag) {
|
|
531
|
+
if (!options || typeof options != "object") options = Object.create(null);
|
|
532
|
+
if (typeof value == "string") try {
|
|
533
|
+
UglifyJS.parse(value, {
|
|
534
|
+
expression: true
|
|
535
|
+
}).walk(new UglifyJS.TreeWalker(function(node) {
|
|
536
|
+
if (node instanceof UglifyJS.AST_Assign) {
|
|
537
|
+
var name = node.left.print_to_string();
|
|
538
|
+
var value = node.right;
|
|
539
|
+
if (flag) {
|
|
540
|
+
options[name] = value;
|
|
541
|
+
} else if (value instanceof UglifyJS.AST_Array) {
|
|
542
|
+
options[name] = value.elements.map(to_string);
|
|
543
|
+
} else {
|
|
544
|
+
options[name] = to_string(value);
|
|
545
|
+
}
|
|
546
|
+
return true;
|
|
547
|
+
}
|
|
548
|
+
if (node instanceof UglifyJS.AST_Symbol || node instanceof UglifyJS.AST_PropAccess) {
|
|
549
|
+
var name = node.print_to_string();
|
|
550
|
+
options[name] = true;
|
|
551
|
+
return true;
|
|
552
|
+
}
|
|
553
|
+
if (!(node instanceof UglifyJS.AST_Sequence)) throw node;
|
|
554
|
+
|
|
555
|
+
function to_string(value) {
|
|
556
|
+
return value instanceof UglifyJS.AST_Constant ? value.value : value.print_to_string({
|
|
557
|
+
quote_keys: true
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
}));
|
|
561
|
+
} catch (ex) {
|
|
562
|
+
if (flag) {
|
|
563
|
+
fatal("cannot parse arguments for '" + flag + "': " + value);
|
|
564
|
+
} else {
|
|
565
|
+
options[value] = null;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
return options;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
function skip_property(key, value) {
|
|
572
|
+
return skip_keys.indexOf(key) >= 0
|
|
573
|
+
// only skip truthy_keys if their value is falsy
|
|
574
|
+
|| truthy_keys.indexOf(key) >= 0 && !value;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
function symdef(def) {
|
|
578
|
+
var ret = (1e6 + def.id) + " " + def.name;
|
|
579
|
+
if (def.mangled_name) ret += " " + def.mangled_name;
|
|
580
|
+
return ret;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
function format_object(obj) {
|
|
584
|
+
var lines = [];
|
|
585
|
+
var padding = "";
|
|
586
|
+
Object.keys(obj).map(function(name) {
|
|
587
|
+
if (padding.length < name.length) padding = Array(name.length + 1).join(" ");
|
|
588
|
+
return [ name, JSON.stringify(obj[name]) ];
|
|
589
|
+
}).forEach(function(tokens) {
|
|
590
|
+
lines.push(" " + tokens[0] + padding.slice(tokens[0].length - 2) + tokens[1]);
|
|
591
|
+
});
|
|
592
|
+
return lines.join("\n");
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
function print_error(msg) {
|
|
596
|
+
process.stderr.write(msg);
|
|
597
|
+
process.stderr.write("\n");
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
function print(txt) {
|
|
601
|
+
process.stdout.write(txt);
|
|
602
|
+
process.stdout.write("\n");
|
|
603
|
+
}
|