es6-crawler-detect 3.1.3 → 3.2.0
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/.babelrc +18 -17
- package/.eslintignore +6 -0
- package/.eslintrc.json +30 -0
- package/.github/FUNDING.yml +12 -12
- package/.github/ISSUE_TEMPLATE/bug_report.md +41 -38
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -20
- package/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +29 -0
- package/.prettierrc.json +5 -0
- package/CODE_OF_CONDUCT.md +76 -76
- package/LICENSE +21 -21
- package/README.md +103 -93
- package/dist/main.bundle.js +1 -1
- package/example/node/dist/crawler.min.js +1 -1
- package/example/node/index.html +21 -21
- package/example/node/node_modules/.bin/mime +15 -0
- package/example/node/node_modules/.bin/mime.cmd +7 -0
- package/example/node/node_modules/.yarn-integrity +67 -0
- package/example/node/node_modules/accepts/HISTORY.md +236 -0
- package/example/node/node_modules/accepts/LICENSE +23 -0
- package/example/node/node_modules/accepts/README.md +142 -0
- package/example/node/node_modules/accepts/index.js +238 -0
- package/example/node/node_modules/accepts/package.json +47 -0
- package/example/node/node_modules/array-flatten/LICENSE +21 -0
- package/example/node/node_modules/array-flatten/README.md +43 -0
- package/example/node/node_modules/array-flatten/array-flatten.js +64 -0
- package/example/node/node_modules/array-flatten/package.json +39 -0
- package/example/node/node_modules/body-parser/HISTORY.md +624 -0
- package/example/node/node_modules/body-parser/LICENSE +23 -0
- package/example/node/node_modules/body-parser/README.md +456 -0
- package/example/node/node_modules/body-parser/index.js +157 -0
- package/example/node/node_modules/body-parser/lib/read.js +181 -0
- package/example/node/node_modules/body-parser/lib/types/json.js +230 -0
- package/example/node/node_modules/body-parser/lib/types/raw.js +101 -0
- package/example/node/node_modules/body-parser/lib/types/text.js +121 -0
- package/example/node/node_modules/body-parser/lib/types/urlencoded.js +284 -0
- package/example/node/node_modules/body-parser/package.json +52 -0
- package/example/node/node_modules/bytes/History.md +92 -0
- package/example/node/node_modules/bytes/LICENSE +23 -0
- package/example/node/node_modules/bytes/Readme.md +152 -0
- package/example/node/node_modules/bytes/index.js +166 -0
- package/example/node/node_modules/bytes/package.json +42 -0
- package/example/node/node_modules/content-disposition/HISTORY.md +60 -0
- package/example/node/node_modules/content-disposition/LICENSE +22 -0
- package/example/node/node_modules/content-disposition/README.md +142 -0
- package/example/node/node_modules/content-disposition/index.js +458 -0
- package/example/node/node_modules/content-disposition/package.json +44 -0
- package/example/node/node_modules/content-type/HISTORY.md +24 -0
- package/example/node/node_modules/content-type/LICENSE +22 -0
- package/example/node/node_modules/content-type/README.md +92 -0
- package/example/node/node_modules/content-type/index.js +222 -0
- package/example/node/node_modules/content-type/package.json +40 -0
- package/example/node/node_modules/cookie/HISTORY.md +128 -0
- package/example/node/node_modules/cookie/LICENSE +24 -0
- package/example/node/node_modules/cookie/README.md +257 -0
- package/example/node/node_modules/cookie/index.js +202 -0
- package/example/node/node_modules/cookie/package.json +40 -0
- package/example/node/node_modules/cookie-signature/History.md +38 -0
- package/example/node/node_modules/cookie-signature/Readme.md +42 -0
- package/example/node/node_modules/cookie-signature/index.js +51 -0
- package/example/node/node_modules/cookie-signature/package.json +18 -0
- package/example/node/node_modules/debug/.coveralls.yml +1 -0
- package/example/node/node_modules/debug/.eslintrc +11 -0
- package/example/node/node_modules/debug/.travis.yml +14 -0
- package/example/node/node_modules/debug/CHANGELOG.md +362 -0
- package/example/node/node_modules/debug/LICENSE +19 -0
- package/example/node/node_modules/debug/Makefile +50 -0
- package/example/node/node_modules/debug/README.md +312 -0
- package/example/node/node_modules/debug/component.json +19 -0
- package/example/node/node_modules/debug/karma.conf.js +70 -0
- package/example/node/node_modules/debug/node.js +1 -0
- package/example/node/node_modules/debug/package.json +49 -0
- package/example/node/node_modules/debug/src/browser.js +185 -0
- package/example/node/node_modules/debug/src/debug.js +202 -0
- package/example/node/node_modules/debug/src/index.js +10 -0
- package/example/node/node_modules/debug/src/inspector-log.js +15 -0
- package/example/node/node_modules/debug/src/node.js +248 -0
- package/example/node/node_modules/depd/History.md +96 -0
- package/example/node/node_modules/depd/LICENSE +22 -0
- package/example/node/node_modules/depd/Readme.md +280 -0
- package/example/node/node_modules/depd/index.js +522 -0
- package/example/node/node_modules/depd/lib/browser/index.js +77 -0
- package/example/node/node_modules/depd/lib/compat/callsite-tostring.js +103 -0
- package/example/node/node_modules/depd/lib/compat/event-listener-count.js +22 -0
- package/example/node/node_modules/depd/lib/compat/index.js +79 -0
- package/example/node/node_modules/depd/package.json +41 -0
- package/example/node/node_modules/destroy/LICENSE +22 -0
- package/example/node/node_modules/destroy/README.md +60 -0
- package/example/node/node_modules/destroy/index.js +75 -0
- package/example/node/node_modules/destroy/package.json +37 -0
- package/example/node/node_modules/ee-first/LICENSE +22 -0
- package/example/node/node_modules/ee-first/README.md +80 -0
- package/example/node/node_modules/ee-first/index.js +95 -0
- package/example/node/node_modules/ee-first/package.json +29 -0
- package/example/node/node_modules/encodeurl/HISTORY.md +14 -0
- package/example/node/node_modules/encodeurl/LICENSE +22 -0
- package/example/node/node_modules/encodeurl/README.md +128 -0
- package/example/node/node_modules/encodeurl/index.js +60 -0
- package/example/node/node_modules/encodeurl/package.json +40 -0
- package/example/node/node_modules/escape-html/LICENSE +24 -0
- package/example/node/node_modules/escape-html/Readme.md +43 -0
- package/example/node/node_modules/escape-html/index.js +78 -0
- package/example/node/node_modules/escape-html/package.json +24 -0
- package/example/node/node_modules/etag/HISTORY.md +83 -0
- package/example/node/node_modules/etag/LICENSE +22 -0
- package/example/node/node_modules/etag/README.md +159 -0
- package/example/node/node_modules/etag/index.js +131 -0
- package/example/node/node_modules/etag/package.json +47 -0
- package/example/node/node_modules/express/History.md +3510 -0
- package/example/node/node_modules/express/LICENSE +24 -0
- package/example/node/node_modules/express/Readme.md +158 -0
- package/example/node/node_modules/express/index.js +11 -0
- package/example/node/node_modules/express/lib/application.js +644 -0
- package/example/node/node_modules/express/lib/express.js +116 -0
- package/example/node/node_modules/express/lib/middleware/init.js +43 -0
- package/example/node/node_modules/express/lib/middleware/query.js +47 -0
- package/example/node/node_modules/express/lib/request.js +525 -0
- package/example/node/node_modules/express/lib/response.js +1147 -0
- package/example/node/node_modules/express/lib/router/index.js +668 -0
- package/example/node/node_modules/express/lib/router/layer.js +181 -0
- package/example/node/node_modules/express/lib/router/route.js +216 -0
- package/example/node/node_modules/express/lib/utils.js +302 -0
- package/example/node/node_modules/express/lib/view.js +182 -0
- package/example/node/node_modules/express/package.json +99 -0
- package/example/node/node_modules/finalhandler/HISTORY.md +187 -0
- package/example/node/node_modules/finalhandler/LICENSE +22 -0
- package/example/node/node_modules/finalhandler/README.md +148 -0
- package/example/node/node_modules/finalhandler/index.js +331 -0
- package/example/node/node_modules/finalhandler/package.json +45 -0
- package/example/node/node_modules/forwarded/HISTORY.md +21 -0
- package/example/node/node_modules/forwarded/LICENSE +22 -0
- package/example/node/node_modules/forwarded/README.md +57 -0
- package/example/node/node_modules/forwarded/index.js +90 -0
- package/example/node/node_modules/forwarded/package.json +45 -0
- package/example/node/node_modules/fresh/HISTORY.md +70 -0
- package/example/node/node_modules/fresh/LICENSE +23 -0
- package/example/node/node_modules/fresh/README.md +119 -0
- package/example/node/node_modules/fresh/index.js +137 -0
- package/example/node/node_modules/fresh/package.json +46 -0
- package/example/node/node_modules/http-errors/HISTORY.md +165 -0
- package/example/node/node_modules/http-errors/LICENSE +23 -0
- package/example/node/node_modules/http-errors/README.md +169 -0
- package/example/node/node_modules/http-errors/index.js +299 -0
- package/example/node/node_modules/http-errors/package.json +49 -0
- package/example/node/node_modules/iconv-lite/Changelog.md +162 -0
- package/example/node/node_modules/iconv-lite/LICENSE +21 -0
- package/example/node/node_modules/iconv-lite/README.md +156 -0
- package/example/node/node_modules/iconv-lite/encodings/dbcs-codec.js +555 -0
- package/example/node/node_modules/iconv-lite/encodings/dbcs-data.js +176 -0
- package/example/node/node_modules/iconv-lite/encodings/index.js +22 -0
- package/example/node/node_modules/iconv-lite/encodings/internal.js +188 -0
- package/example/node/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
- package/example/node/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/example/node/node_modules/iconv-lite/encodings/sbcs-data.js +174 -0
- package/example/node/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/example/node/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/example/node/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/example/node/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/example/node/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/example/node/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/example/node/node_modules/iconv-lite/encodings/tables/gbk-added.json +55 -0
- package/example/node/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/example/node/node_modules/iconv-lite/encodings/utf16.js +177 -0
- package/example/node/node_modules/iconv-lite/encodings/utf7.js +290 -0
- package/example/node/node_modules/iconv-lite/lib/bom-handling.js +52 -0
- package/example/node/node_modules/iconv-lite/lib/extend-node.js +217 -0
- package/example/node/node_modules/iconv-lite/lib/index.d.ts +24 -0
- package/example/node/node_modules/iconv-lite/lib/index.js +153 -0
- package/example/node/node_modules/iconv-lite/lib/streams.js +121 -0
- package/example/node/node_modules/iconv-lite/package.json +46 -0
- package/example/node/node_modules/inherits/LICENSE +16 -0
- package/example/node/node_modules/inherits/README.md +42 -0
- package/example/node/node_modules/inherits/inherits.js +9 -0
- package/example/node/node_modules/inherits/inherits_browser.js +27 -0
- package/example/node/node_modules/inherits/package.json +29 -0
- package/example/node/node_modules/ipaddr.js/LICENSE +19 -0
- package/example/node/node_modules/ipaddr.js/README.md +233 -0
- package/example/node/node_modules/ipaddr.js/ipaddr.min.js +1 -0
- package/example/node/node_modules/ipaddr.js/lib/ipaddr.js +673 -0
- package/example/node/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +68 -0
- package/example/node/node_modules/ipaddr.js/package.json +35 -0
- package/example/node/node_modules/media-typer/HISTORY.md +22 -0
- package/example/node/node_modules/media-typer/LICENSE +22 -0
- package/example/node/node_modules/media-typer/README.md +81 -0
- package/example/node/node_modules/media-typer/index.js +270 -0
- package/example/node/node_modules/media-typer/package.json +26 -0
- package/example/node/node_modules/merge-descriptors/HISTORY.md +21 -0
- package/example/node/node_modules/merge-descriptors/LICENSE +23 -0
- package/example/node/node_modules/merge-descriptors/README.md +48 -0
- package/example/node/node_modules/merge-descriptors/index.js +60 -0
- package/example/node/node_modules/merge-descriptors/package.json +32 -0
- package/example/node/node_modules/methods/HISTORY.md +29 -0
- package/example/node/node_modules/methods/LICENSE +24 -0
- package/example/node/node_modules/methods/README.md +51 -0
- package/example/node/node_modules/methods/index.js +69 -0
- package/example/node/node_modules/methods/package.json +36 -0
- package/example/node/node_modules/mime/CHANGELOG.md +164 -0
- package/example/node/node_modules/mime/LICENSE +21 -0
- package/example/node/node_modules/mime/README.md +90 -0
- package/example/node/node_modules/mime/cli.js +8 -0
- package/example/node/node_modules/mime/mime.js +108 -0
- package/example/node/node_modules/mime/package.json +44 -0
- package/example/node/node_modules/mime/src/build.js +53 -0
- package/example/node/node_modules/mime/src/test.js +60 -0
- package/example/node/node_modules/mime/types.json +1 -0
- package/example/node/node_modules/mime-db/HISTORY.md +499 -0
- package/example/node/node_modules/mime-db/LICENSE +22 -0
- package/example/node/node_modules/mime-db/README.md +100 -0
- package/example/node/node_modules/mime-db/db.json +8471 -0
- package/example/node/node_modules/mime-db/index.js +11 -0
- package/example/node/node_modules/mime-db/package.json +59 -0
- package/example/node/node_modules/mime-types/HISTORY.md +388 -0
- package/example/node/node_modules/mime-types/LICENSE +23 -0
- package/example/node/node_modules/mime-types/README.md +113 -0
- package/example/node/node_modules/mime-types/index.js +188 -0
- package/example/node/node_modules/mime-types/package.json +44 -0
- package/example/node/node_modules/ms/index.js +152 -0
- package/example/node/node_modules/ms/license.md +21 -0
- package/example/node/node_modules/ms/package.json +37 -0
- package/example/node/node_modules/ms/readme.md +51 -0
- package/example/node/node_modules/negotiator/HISTORY.md +103 -0
- package/example/node/node_modules/negotiator/LICENSE +24 -0
- package/example/node/node_modules/negotiator/README.md +203 -0
- package/example/node/node_modules/negotiator/index.js +124 -0
- package/example/node/node_modules/negotiator/lib/charset.js +169 -0
- package/example/node/node_modules/negotiator/lib/encoding.js +184 -0
- package/example/node/node_modules/negotiator/lib/language.js +179 -0
- package/example/node/node_modules/negotiator/lib/mediaType.js +294 -0
- package/example/node/node_modules/negotiator/package.json +42 -0
- package/example/node/node_modules/on-finished/HISTORY.md +88 -0
- package/example/node/node_modules/on-finished/LICENSE +23 -0
- package/example/node/node_modules/on-finished/README.md +154 -0
- package/example/node/node_modules/on-finished/index.js +196 -0
- package/example/node/node_modules/on-finished/package.json +31 -0
- package/example/node/node_modules/parseurl/HISTORY.md +58 -0
- package/example/node/node_modules/parseurl/LICENSE +24 -0
- package/example/node/node_modules/parseurl/README.md +133 -0
- package/example/node/node_modules/parseurl/index.js +158 -0
- package/example/node/node_modules/parseurl/package.json +40 -0
- package/example/node/node_modules/path-to-regexp/History.md +36 -0
- package/example/node/node_modules/path-to-regexp/LICENSE +21 -0
- package/example/node/node_modules/path-to-regexp/Readme.md +35 -0
- package/example/node/node_modules/path-to-regexp/index.js +129 -0
- package/example/node/node_modules/path-to-regexp/package.json +30 -0
- package/example/node/node_modules/proxy-addr/HISTORY.md +161 -0
- package/example/node/node_modules/proxy-addr/LICENSE +22 -0
- package/example/node/node_modules/proxy-addr/README.md +139 -0
- package/example/node/node_modules/proxy-addr/index.js +327 -0
- package/example/node/node_modules/proxy-addr/package.json +47 -0
- package/example/node/node_modules/qs/.editorconfig +39 -0
- package/example/node/node_modules/qs/.eslintignore +2 -0
- package/example/node/node_modules/qs/.eslintrc +35 -0
- package/example/node/node_modules/qs/.github/FUNDING.yml +12 -0
- package/example/node/node_modules/qs/.nycrc +13 -0
- package/example/node/node_modules/qs/CHANGELOG.md +359 -0
- package/example/node/node_modules/qs/LICENSE.md +29 -0
- package/example/node/node_modules/qs/README.md +604 -0
- package/example/node/node_modules/qs/dist/qs.js +832 -0
- package/example/node/node_modules/qs/lib/formats.js +23 -0
- package/example/node/node_modules/qs/lib/index.js +11 -0
- package/example/node/node_modules/qs/lib/parse.js +257 -0
- package/example/node/node_modules/qs/lib/stringify.js +278 -0
- package/example/node/node_modules/qs/lib/utils.js +251 -0
- package/example/node/node_modules/qs/package.json +69 -0
- package/example/node/node_modules/qs/test/parse.js +772 -0
- package/example/node/node_modules/qs/test/stringify.js +793 -0
- package/example/node/node_modules/qs/test/utils.js +136 -0
- package/example/node/node_modules/range-parser/HISTORY.md +56 -0
- package/example/node/node_modules/range-parser/LICENSE +23 -0
- package/example/node/node_modules/range-parser/README.md +84 -0
- package/example/node/node_modules/range-parser/index.js +162 -0
- package/example/node/node_modules/range-parser/package.json +44 -0
- package/example/node/node_modules/raw-body/HISTORY.md +284 -0
- package/example/node/node_modules/raw-body/LICENSE +22 -0
- package/example/node/node_modules/raw-body/README.md +217 -0
- package/example/node/node_modules/raw-body/index.d.ts +87 -0
- package/example/node/node_modules/raw-body/index.js +286 -0
- package/example/node/node_modules/raw-body/package.json +48 -0
- package/example/node/node_modules/safe-buffer/LICENSE +21 -0
- package/example/node/node_modules/safe-buffer/README.md +584 -0
- package/example/node/node_modules/safe-buffer/index.d.ts +187 -0
- package/example/node/node_modules/safe-buffer/index.js +65 -0
- package/example/node/node_modules/safe-buffer/package.json +51 -0
- package/example/node/node_modules/safer-buffer/LICENSE +21 -0
- package/example/node/node_modules/safer-buffer/Porting-Buffer.md +268 -0
- package/example/node/node_modules/safer-buffer/Readme.md +156 -0
- package/example/node/node_modules/safer-buffer/dangerous.js +58 -0
- package/example/node/node_modules/safer-buffer/package.json +34 -0
- package/example/node/node_modules/safer-buffer/safer.js +77 -0
- package/example/node/node_modules/safer-buffer/tests.js +406 -0
- package/example/node/node_modules/send/HISTORY.md +506 -0
- package/example/node/node_modules/send/LICENSE +23 -0
- package/example/node/node_modules/send/README.md +327 -0
- package/example/node/node_modules/send/index.js +1133 -0
- package/example/node/node_modules/send/node_modules/.bin/mime +15 -0
- package/example/node/node_modules/send/node_modules/.bin/mime.cmd +7 -0
- package/example/node/node_modules/send/node_modules/ms/index.js +162 -0
- package/example/node/node_modules/send/node_modules/ms/license.md +21 -0
- package/example/node/node_modules/send/node_modules/ms/package.json +38 -0
- package/example/node/node_modules/send/node_modules/ms/readme.md +59 -0
- package/example/node/node_modules/send/package.json +61 -0
- package/example/node/node_modules/serve-static/HISTORY.md +459 -0
- package/example/node/node_modules/serve-static/LICENSE +25 -0
- package/example/node/node_modules/serve-static/README.md +257 -0
- package/example/node/node_modules/serve-static/index.js +210 -0
- package/example/node/node_modules/serve-static/package.json +42 -0
- package/example/node/node_modules/setprototypeof/LICENSE +13 -0
- package/example/node/node_modules/setprototypeof/README.md +31 -0
- package/example/node/node_modules/setprototypeof/index.d.ts +2 -0
- package/example/node/node_modules/setprototypeof/index.js +17 -0
- package/example/node/node_modules/setprototypeof/package.json +38 -0
- package/example/node/node_modules/setprototypeof/test/index.js +24 -0
- package/example/node/node_modules/statuses/HISTORY.md +65 -0
- package/example/node/node_modules/statuses/LICENSE +23 -0
- package/example/node/node_modules/statuses/README.md +127 -0
- package/example/node/node_modules/statuses/codes.json +66 -0
- package/example/node/node_modules/statuses/index.js +113 -0
- package/example/node/node_modules/statuses/package.json +48 -0
- package/example/node/node_modules/toidentifier/HISTORY.md +9 -0
- package/example/node/node_modules/toidentifier/LICENSE +21 -0
- package/example/node/node_modules/toidentifier/README.md +61 -0
- package/example/node/node_modules/toidentifier/index.js +32 -0
- package/example/node/node_modules/toidentifier/package.json +38 -0
- package/example/node/node_modules/type-is/HISTORY.md +259 -0
- package/example/node/node_modules/type-is/LICENSE +23 -0
- package/example/node/node_modules/type-is/README.md +170 -0
- package/example/node/node_modules/type-is/index.js +266 -0
- package/example/node/node_modules/type-is/package.json +45 -0
- package/example/node/node_modules/unpipe/HISTORY.md +4 -0
- package/example/node/node_modules/unpipe/LICENSE +22 -0
- package/example/node/node_modules/unpipe/README.md +43 -0
- package/example/node/node_modules/unpipe/index.js +69 -0
- package/example/node/node_modules/unpipe/package.json +27 -0
- package/example/node/node_modules/utils-merge/LICENSE +20 -0
- package/example/node/node_modules/utils-merge/README.md +34 -0
- package/example/node/node_modules/utils-merge/index.js +23 -0
- package/example/node/node_modules/utils-merge/package.json +40 -0
- package/example/node/node_modules/vary/HISTORY.md +39 -0
- package/example/node/node_modules/vary/LICENSE +22 -0
- package/example/node/node_modules/vary/README.md +101 -0
- package/example/node/node_modules/vary/index.js +149 -0
- package/example/node/node_modules/vary/package.json +43 -0
- package/example/node/package.json +11 -0
- package/example/node/server.js +21 -15
- package/example/node/yarn.lock +352 -0
- package/package.json +59 -47
- package/src/index.js +15 -10
- package/src/lib/crawler/crawlers.js +1398 -11
- package/src/lib/crawler/exclusions.js +55 -8
- package/src/lib/crawler/headers.js +18 -9
- package/src/lib/crawler/provider.js +6 -8
- package/src/lib/crawler.js +101 -90
- package/test/lib/crawler.test.js +43 -26
- package/webpack.common.js +7 -7
- package/webpack.dev.js +4 -4
- package/webpack.prod.js +8 -9
@@ -0,0 +1,65 @@
|
|
1
|
+
1.5.0 / 2018-03-27
|
2
|
+
==================
|
3
|
+
|
4
|
+
* Add `103 Early Hints`
|
5
|
+
|
6
|
+
1.4.0 / 2017-10-20
|
7
|
+
==================
|
8
|
+
|
9
|
+
* Add `STATUS_CODES` export
|
10
|
+
|
11
|
+
1.3.1 / 2016-11-11
|
12
|
+
==================
|
13
|
+
|
14
|
+
* Fix return type in JSDoc
|
15
|
+
|
16
|
+
1.3.0 / 2016-05-17
|
17
|
+
==================
|
18
|
+
|
19
|
+
* Add `421 Misdirected Request`
|
20
|
+
* perf: enable strict mode
|
21
|
+
|
22
|
+
1.2.1 / 2015-02-01
|
23
|
+
==================
|
24
|
+
|
25
|
+
* Fix message for status 451
|
26
|
+
- `451 Unavailable For Legal Reasons`
|
27
|
+
|
28
|
+
1.2.0 / 2014-09-28
|
29
|
+
==================
|
30
|
+
|
31
|
+
* Add `208 Already Repored`
|
32
|
+
* Add `226 IM Used`
|
33
|
+
* Add `306 (Unused)`
|
34
|
+
* Add `415 Unable For Legal Reasons`
|
35
|
+
* Add `508 Loop Detected`
|
36
|
+
|
37
|
+
1.1.1 / 2014-09-24
|
38
|
+
==================
|
39
|
+
|
40
|
+
* Add missing 308 to `codes.json`
|
41
|
+
|
42
|
+
1.1.0 / 2014-09-21
|
43
|
+
==================
|
44
|
+
|
45
|
+
* Add `codes.json` for universal support
|
46
|
+
|
47
|
+
1.0.4 / 2014-08-20
|
48
|
+
==================
|
49
|
+
|
50
|
+
* Package cleanup
|
51
|
+
|
52
|
+
1.0.3 / 2014-06-08
|
53
|
+
==================
|
54
|
+
|
55
|
+
* Add 308 to `.redirect` category
|
56
|
+
|
57
|
+
1.0.2 / 2014-03-13
|
58
|
+
==================
|
59
|
+
|
60
|
+
* Add `.retry` category
|
61
|
+
|
62
|
+
1.0.1 / 2014-03-12
|
63
|
+
==================
|
64
|
+
|
65
|
+
* Initial release
|
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
The MIT License (MIT)
|
3
|
+
|
4
|
+
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
|
5
|
+
Copyright (c) 2016 Douglas Christopher Wilson <doug@somethingdoug.com>
|
6
|
+
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
9
|
+
in the Software without restriction, including without limitation the rights
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
12
|
+
furnished to do so, subject to the following conditions:
|
13
|
+
|
14
|
+
The above copyright notice and this permission notice shall be included in
|
15
|
+
all copies or substantial portions of the Software.
|
16
|
+
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
23
|
+
THE SOFTWARE.
|
@@ -0,0 +1,127 @@
|
|
1
|
+
# Statuses
|
2
|
+
|
3
|
+
[![NPM Version][npm-image]][npm-url]
|
4
|
+
[![NPM Downloads][downloads-image]][downloads-url]
|
5
|
+
[![Node.js Version][node-version-image]][node-version-url]
|
6
|
+
[![Build Status][travis-image]][travis-url]
|
7
|
+
[![Test Coverage][coveralls-image]][coveralls-url]
|
8
|
+
|
9
|
+
HTTP status utility for node.
|
10
|
+
|
11
|
+
This module provides a list of status codes and messages sourced from
|
12
|
+
a few different projects:
|
13
|
+
|
14
|
+
* The [IANA Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml)
|
15
|
+
* The [Node.js project](https://nodejs.org/)
|
16
|
+
* The [NGINX project](https://www.nginx.com/)
|
17
|
+
* The [Apache HTTP Server project](https://httpd.apache.org/)
|
18
|
+
|
19
|
+
## Installation
|
20
|
+
|
21
|
+
This is a [Node.js](https://nodejs.org/en/) module available through the
|
22
|
+
[npm registry](https://www.npmjs.com/). Installation is done using the
|
23
|
+
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
24
|
+
|
25
|
+
```sh
|
26
|
+
$ npm install statuses
|
27
|
+
```
|
28
|
+
|
29
|
+
## API
|
30
|
+
|
31
|
+
<!-- eslint-disable no-unused-vars -->
|
32
|
+
|
33
|
+
```js
|
34
|
+
var status = require('statuses')
|
35
|
+
```
|
36
|
+
|
37
|
+
### var code = status(Integer || String)
|
38
|
+
|
39
|
+
If `Integer` or `String` is a valid HTTP code or status message, then the
|
40
|
+
appropriate `code` will be returned. Otherwise, an error will be thrown.
|
41
|
+
|
42
|
+
<!-- eslint-disable no-undef -->
|
43
|
+
|
44
|
+
```js
|
45
|
+
status(403) // => 403
|
46
|
+
status('403') // => 403
|
47
|
+
status('forbidden') // => 403
|
48
|
+
status('Forbidden') // => 403
|
49
|
+
status(306) // throws, as it's not supported by node.js
|
50
|
+
```
|
51
|
+
|
52
|
+
### status.STATUS_CODES
|
53
|
+
|
54
|
+
Returns an object which maps status codes to status messages, in
|
55
|
+
the same format as the
|
56
|
+
[Node.js http module](https://nodejs.org/dist/latest/docs/api/http.html#http_http_status_codes).
|
57
|
+
|
58
|
+
### status.codes
|
59
|
+
|
60
|
+
Returns an array of all the status codes as `Integer`s.
|
61
|
+
|
62
|
+
### var msg = status[code]
|
63
|
+
|
64
|
+
Map of `code` to `status message`. `undefined` for invalid `code`s.
|
65
|
+
|
66
|
+
<!-- eslint-disable no-undef, no-unused-expressions -->
|
67
|
+
|
68
|
+
```js
|
69
|
+
status[404] // => 'Not Found'
|
70
|
+
```
|
71
|
+
|
72
|
+
### var code = status[msg]
|
73
|
+
|
74
|
+
Map of `status message` to `code`. `msg` can either be title-cased or
|
75
|
+
lower-cased. `undefined` for invalid `status message`s.
|
76
|
+
|
77
|
+
<!-- eslint-disable no-undef, no-unused-expressions -->
|
78
|
+
|
79
|
+
```js
|
80
|
+
status['not found'] // => 404
|
81
|
+
status['Not Found'] // => 404
|
82
|
+
```
|
83
|
+
|
84
|
+
### status.redirect[code]
|
85
|
+
|
86
|
+
Returns `true` if a status code is a valid redirect status.
|
87
|
+
|
88
|
+
<!-- eslint-disable no-undef, no-unused-expressions -->
|
89
|
+
|
90
|
+
```js
|
91
|
+
status.redirect[200] // => undefined
|
92
|
+
status.redirect[301] // => true
|
93
|
+
```
|
94
|
+
|
95
|
+
### status.empty[code]
|
96
|
+
|
97
|
+
Returns `true` if a status code expects an empty body.
|
98
|
+
|
99
|
+
<!-- eslint-disable no-undef, no-unused-expressions -->
|
100
|
+
|
101
|
+
```js
|
102
|
+
status.empty[200] // => undefined
|
103
|
+
status.empty[204] // => true
|
104
|
+
status.empty[304] // => true
|
105
|
+
```
|
106
|
+
|
107
|
+
### status.retry[code]
|
108
|
+
|
109
|
+
Returns `true` if you should retry the rest.
|
110
|
+
|
111
|
+
<!-- eslint-disable no-undef, no-unused-expressions -->
|
112
|
+
|
113
|
+
```js
|
114
|
+
status.retry[501] // => undefined
|
115
|
+
status.retry[503] // => true
|
116
|
+
```
|
117
|
+
|
118
|
+
[npm-image]: https://img.shields.io/npm/v/statuses.svg
|
119
|
+
[npm-url]: https://npmjs.org/package/statuses
|
120
|
+
[node-version-image]: https://img.shields.io/node/v/statuses.svg
|
121
|
+
[node-version-url]: https://nodejs.org/en/download
|
122
|
+
[travis-image]: https://img.shields.io/travis/jshttp/statuses.svg
|
123
|
+
[travis-url]: https://travis-ci.org/jshttp/statuses
|
124
|
+
[coveralls-image]: https://img.shields.io/coveralls/jshttp/statuses.svg
|
125
|
+
[coveralls-url]: https://coveralls.io/r/jshttp/statuses?branch=master
|
126
|
+
[downloads-image]: https://img.shields.io/npm/dm/statuses.svg
|
127
|
+
[downloads-url]: https://npmjs.org/package/statuses
|
@@ -0,0 +1,66 @@
|
|
1
|
+
{
|
2
|
+
"100": "Continue",
|
3
|
+
"101": "Switching Protocols",
|
4
|
+
"102": "Processing",
|
5
|
+
"103": "Early Hints",
|
6
|
+
"200": "OK",
|
7
|
+
"201": "Created",
|
8
|
+
"202": "Accepted",
|
9
|
+
"203": "Non-Authoritative Information",
|
10
|
+
"204": "No Content",
|
11
|
+
"205": "Reset Content",
|
12
|
+
"206": "Partial Content",
|
13
|
+
"207": "Multi-Status",
|
14
|
+
"208": "Already Reported",
|
15
|
+
"226": "IM Used",
|
16
|
+
"300": "Multiple Choices",
|
17
|
+
"301": "Moved Permanently",
|
18
|
+
"302": "Found",
|
19
|
+
"303": "See Other",
|
20
|
+
"304": "Not Modified",
|
21
|
+
"305": "Use Proxy",
|
22
|
+
"306": "(Unused)",
|
23
|
+
"307": "Temporary Redirect",
|
24
|
+
"308": "Permanent Redirect",
|
25
|
+
"400": "Bad Request",
|
26
|
+
"401": "Unauthorized",
|
27
|
+
"402": "Payment Required",
|
28
|
+
"403": "Forbidden",
|
29
|
+
"404": "Not Found",
|
30
|
+
"405": "Method Not Allowed",
|
31
|
+
"406": "Not Acceptable",
|
32
|
+
"407": "Proxy Authentication Required",
|
33
|
+
"408": "Request Timeout",
|
34
|
+
"409": "Conflict",
|
35
|
+
"410": "Gone",
|
36
|
+
"411": "Length Required",
|
37
|
+
"412": "Precondition Failed",
|
38
|
+
"413": "Payload Too Large",
|
39
|
+
"414": "URI Too Long",
|
40
|
+
"415": "Unsupported Media Type",
|
41
|
+
"416": "Range Not Satisfiable",
|
42
|
+
"417": "Expectation Failed",
|
43
|
+
"418": "I'm a teapot",
|
44
|
+
"421": "Misdirected Request",
|
45
|
+
"422": "Unprocessable Entity",
|
46
|
+
"423": "Locked",
|
47
|
+
"424": "Failed Dependency",
|
48
|
+
"425": "Unordered Collection",
|
49
|
+
"426": "Upgrade Required",
|
50
|
+
"428": "Precondition Required",
|
51
|
+
"429": "Too Many Requests",
|
52
|
+
"431": "Request Header Fields Too Large",
|
53
|
+
"451": "Unavailable For Legal Reasons",
|
54
|
+
"500": "Internal Server Error",
|
55
|
+
"501": "Not Implemented",
|
56
|
+
"502": "Bad Gateway",
|
57
|
+
"503": "Service Unavailable",
|
58
|
+
"504": "Gateway Timeout",
|
59
|
+
"505": "HTTP Version Not Supported",
|
60
|
+
"506": "Variant Also Negotiates",
|
61
|
+
"507": "Insufficient Storage",
|
62
|
+
"508": "Loop Detected",
|
63
|
+
"509": "Bandwidth Limit Exceeded",
|
64
|
+
"510": "Not Extended",
|
65
|
+
"511": "Network Authentication Required"
|
66
|
+
}
|
@@ -0,0 +1,113 @@
|
|
1
|
+
/*!
|
2
|
+
* statuses
|
3
|
+
* Copyright(c) 2014 Jonathan Ong
|
4
|
+
* Copyright(c) 2016 Douglas Christopher Wilson
|
5
|
+
* MIT Licensed
|
6
|
+
*/
|
7
|
+
|
8
|
+
'use strict'
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Module dependencies.
|
12
|
+
* @private
|
13
|
+
*/
|
14
|
+
|
15
|
+
var codes = require('./codes.json')
|
16
|
+
|
17
|
+
/**
|
18
|
+
* Module exports.
|
19
|
+
* @public
|
20
|
+
*/
|
21
|
+
|
22
|
+
module.exports = status
|
23
|
+
|
24
|
+
// status code to message map
|
25
|
+
status.STATUS_CODES = codes
|
26
|
+
|
27
|
+
// array of status codes
|
28
|
+
status.codes = populateStatusesMap(status, codes)
|
29
|
+
|
30
|
+
// status codes for redirects
|
31
|
+
status.redirect = {
|
32
|
+
300: true,
|
33
|
+
301: true,
|
34
|
+
302: true,
|
35
|
+
303: true,
|
36
|
+
305: true,
|
37
|
+
307: true,
|
38
|
+
308: true
|
39
|
+
}
|
40
|
+
|
41
|
+
// status codes for empty bodies
|
42
|
+
status.empty = {
|
43
|
+
204: true,
|
44
|
+
205: true,
|
45
|
+
304: true
|
46
|
+
}
|
47
|
+
|
48
|
+
// status codes for when you should retry the request
|
49
|
+
status.retry = {
|
50
|
+
502: true,
|
51
|
+
503: true,
|
52
|
+
504: true
|
53
|
+
}
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Populate the statuses map for given codes.
|
57
|
+
* @private
|
58
|
+
*/
|
59
|
+
|
60
|
+
function populateStatusesMap (statuses, codes) {
|
61
|
+
var arr = []
|
62
|
+
|
63
|
+
Object.keys(codes).forEach(function forEachCode (code) {
|
64
|
+
var message = codes[code]
|
65
|
+
var status = Number(code)
|
66
|
+
|
67
|
+
// Populate properties
|
68
|
+
statuses[status] = message
|
69
|
+
statuses[message] = status
|
70
|
+
statuses[message.toLowerCase()] = status
|
71
|
+
|
72
|
+
// Add to array
|
73
|
+
arr.push(status)
|
74
|
+
})
|
75
|
+
|
76
|
+
return arr
|
77
|
+
}
|
78
|
+
|
79
|
+
/**
|
80
|
+
* Get the status code.
|
81
|
+
*
|
82
|
+
* Given a number, this will throw if it is not a known status
|
83
|
+
* code, otherwise the code will be returned. Given a string,
|
84
|
+
* the string will be parsed for a number and return the code
|
85
|
+
* if valid, otherwise will lookup the code assuming this is
|
86
|
+
* the status message.
|
87
|
+
*
|
88
|
+
* @param {string|number} code
|
89
|
+
* @returns {number}
|
90
|
+
* @public
|
91
|
+
*/
|
92
|
+
|
93
|
+
function status (code) {
|
94
|
+
if (typeof code === 'number') {
|
95
|
+
if (!status[code]) throw new Error('invalid status code: ' + code)
|
96
|
+
return code
|
97
|
+
}
|
98
|
+
|
99
|
+
if (typeof code !== 'string') {
|
100
|
+
throw new TypeError('code must be a number or string')
|
101
|
+
}
|
102
|
+
|
103
|
+
// '403'
|
104
|
+
var n = parseInt(code, 10)
|
105
|
+
if (!isNaN(n)) {
|
106
|
+
if (!status[n]) throw new Error('invalid status code: ' + n)
|
107
|
+
return n
|
108
|
+
}
|
109
|
+
|
110
|
+
n = status[code.toLowerCase()]
|
111
|
+
if (!n) throw new Error('invalid status message: "' + code + '"')
|
112
|
+
return n
|
113
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
{
|
2
|
+
"name": "statuses",
|
3
|
+
"description": "HTTP status utility",
|
4
|
+
"version": "1.5.0",
|
5
|
+
"contributors": [
|
6
|
+
"Douglas Christopher Wilson <doug@somethingdoug.com>",
|
7
|
+
"Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
|
8
|
+
],
|
9
|
+
"repository": "jshttp/statuses",
|
10
|
+
"license": "MIT",
|
11
|
+
"keywords": [
|
12
|
+
"http",
|
13
|
+
"status",
|
14
|
+
"code"
|
15
|
+
],
|
16
|
+
"files": [
|
17
|
+
"HISTORY.md",
|
18
|
+
"index.js",
|
19
|
+
"codes.json",
|
20
|
+
"LICENSE"
|
21
|
+
],
|
22
|
+
"devDependencies": {
|
23
|
+
"csv-parse": "1.2.4",
|
24
|
+
"eslint": "4.19.1",
|
25
|
+
"eslint-config-standard": "11.0.0",
|
26
|
+
"eslint-plugin-import": "2.9.0",
|
27
|
+
"eslint-plugin-markdown": "1.0.0-beta.6",
|
28
|
+
"eslint-plugin-node": "6.0.1",
|
29
|
+
"eslint-plugin-promise": "3.7.0",
|
30
|
+
"eslint-plugin-standard": "3.0.1",
|
31
|
+
"istanbul": "0.4.5",
|
32
|
+
"mocha": "1.21.5",
|
33
|
+
"raw-body": "2.3.2",
|
34
|
+
"stream-to-array": "2.3.0"
|
35
|
+
},
|
36
|
+
"engines": {
|
37
|
+
"node": ">= 0.6"
|
38
|
+
},
|
39
|
+
"scripts": {
|
40
|
+
"build": "node scripts/build.js",
|
41
|
+
"fetch": "node scripts/fetch-apache.js && node scripts/fetch-iana.js && node scripts/fetch-nginx.js && node scripts/fetch-node.js",
|
42
|
+
"lint": "eslint --plugin markdown --ext js,md .",
|
43
|
+
"test": "mocha --reporter spec --check-leaks --bail test/",
|
44
|
+
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
|
45
|
+
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
|
46
|
+
"update": "npm run fetch && npm run build"
|
47
|
+
}
|
48
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2016 Douglas Christopher Wilson <doug@somethingdoug.com>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, 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,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# toidentifier
|
2
|
+
|
3
|
+
[![NPM Version][npm-image]][npm-url]
|
4
|
+
[![NPM Downloads][downloads-image]][downloads-url]
|
5
|
+
[![Build Status][github-actions-ci-image]][github-actions-ci-url]
|
6
|
+
[![Test Coverage][codecov-image]][codecov-url]
|
7
|
+
|
8
|
+
> Convert a string of words to a JavaScript identifier
|
9
|
+
|
10
|
+
## Install
|
11
|
+
|
12
|
+
This is a [Node.js](https://nodejs.org/en/) module available through the
|
13
|
+
[npm registry](https://www.npmjs.com/). Installation is done using the
|
14
|
+
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
15
|
+
|
16
|
+
```bash
|
17
|
+
$ npm install toidentifier
|
18
|
+
```
|
19
|
+
|
20
|
+
## Example
|
21
|
+
|
22
|
+
```js
|
23
|
+
var toIdentifier = require('toidentifier')
|
24
|
+
|
25
|
+
console.log(toIdentifier('Bad Request'))
|
26
|
+
// => "BadRequest"
|
27
|
+
```
|
28
|
+
|
29
|
+
## API
|
30
|
+
|
31
|
+
This CommonJS module exports a single default function: `toIdentifier`.
|
32
|
+
|
33
|
+
### toIdentifier(string)
|
34
|
+
|
35
|
+
Given a string as the argument, it will be transformed according to
|
36
|
+
the following rules and the new string will be returned:
|
37
|
+
|
38
|
+
1. Split into words separated by space characters (`0x20`).
|
39
|
+
2. Upper case the first character of each word.
|
40
|
+
3. Join the words together with no separator.
|
41
|
+
4. Remove all non-word (`[0-9a-z_]`) characters.
|
42
|
+
|
43
|
+
## License
|
44
|
+
|
45
|
+
[MIT](LICENSE)
|
46
|
+
|
47
|
+
[codecov-image]: https://img.shields.io/codecov/c/github/component/toidentifier.svg
|
48
|
+
[codecov-url]: https://codecov.io/gh/component/toidentifier
|
49
|
+
[downloads-image]: https://img.shields.io/npm/dm/toidentifier.svg
|
50
|
+
[downloads-url]: https://npmjs.org/package/toidentifier
|
51
|
+
[github-actions-ci-image]: https://img.shields.io/github/workflow/status/component/toidentifier/ci/master?label=ci
|
52
|
+
[github-actions-ci-url]: https://github.com/component/toidentifier?query=workflow%3Aci
|
53
|
+
[npm-image]: https://img.shields.io/npm/v/toidentifier.svg
|
54
|
+
[npm-url]: https://npmjs.org/package/toidentifier
|
55
|
+
|
56
|
+
|
57
|
+
##
|
58
|
+
|
59
|
+
[npm]: https://www.npmjs.com/
|
60
|
+
|
61
|
+
[yarn]: https://yarnpkg.com/
|
@@ -0,0 +1,32 @@
|
|
1
|
+
/*!
|
2
|
+
* toidentifier
|
3
|
+
* Copyright(c) 2016 Douglas Christopher Wilson
|
4
|
+
* MIT Licensed
|
5
|
+
*/
|
6
|
+
|
7
|
+
'use strict'
|
8
|
+
|
9
|
+
/**
|
10
|
+
* Module exports.
|
11
|
+
* @public
|
12
|
+
*/
|
13
|
+
|
14
|
+
module.exports = toIdentifier
|
15
|
+
|
16
|
+
/**
|
17
|
+
* Trasform the given string into a JavaScript identifier
|
18
|
+
*
|
19
|
+
* @param {string} str
|
20
|
+
* @returns {string}
|
21
|
+
* @public
|
22
|
+
*/
|
23
|
+
|
24
|
+
function toIdentifier (str) {
|
25
|
+
return str
|
26
|
+
.split(' ')
|
27
|
+
.map(function (token) {
|
28
|
+
return token.slice(0, 1).toUpperCase() + token.slice(1)
|
29
|
+
})
|
30
|
+
.join('')
|
31
|
+
.replace(/[^ _0-9a-z]/gi, '')
|
32
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
{
|
2
|
+
"name": "toidentifier",
|
3
|
+
"description": "Convert a string of words to a JavaScript identifier",
|
4
|
+
"version": "1.0.1",
|
5
|
+
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
|
6
|
+
"contributors": [
|
7
|
+
"Douglas Christopher Wilson <doug@somethingdoug.com>",
|
8
|
+
"Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)"
|
9
|
+
],
|
10
|
+
"repository": "component/toidentifier",
|
11
|
+
"devDependencies": {
|
12
|
+
"eslint": "7.32.0",
|
13
|
+
"eslint-config-standard": "14.1.1",
|
14
|
+
"eslint-plugin-import": "2.25.3",
|
15
|
+
"eslint-plugin-markdown": "2.2.1",
|
16
|
+
"eslint-plugin-node": "11.1.0",
|
17
|
+
"eslint-plugin-promise": "4.3.1",
|
18
|
+
"eslint-plugin-standard": "4.1.0",
|
19
|
+
"mocha": "9.1.3",
|
20
|
+
"nyc": "15.1.0"
|
21
|
+
},
|
22
|
+
"engines": {
|
23
|
+
"node": ">=0.6"
|
24
|
+
},
|
25
|
+
"license": "MIT",
|
26
|
+
"files": [
|
27
|
+
"HISTORY.md",
|
28
|
+
"LICENSE",
|
29
|
+
"index.js"
|
30
|
+
],
|
31
|
+
"scripts": {
|
32
|
+
"lint": "eslint .",
|
33
|
+
"test": "mocha --reporter spec --bail --check-leaks test/",
|
34
|
+
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
|
35
|
+
"test-cov": "nyc --reporter=html --reporter=text npm test",
|
36
|
+
"version": "node scripts/version-history.js && git add HISTORY.md"
|
37
|
+
}
|
38
|
+
}
|