webpack_rails 0.3.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/webpack_rails/ErrorMessagePlugin.js +37 -0
- data/lib/webpack_rails/engine.rb +6 -5
- data/lib/webpack_rails/node_modules/cors/CONTRIBUTING.md +35 -0
- data/lib/webpack_rails/node_modules/cors/LICENSE +9 -0
- data/lib/webpack_rails/node_modules/cors/README.md +192 -0
- data/lib/webpack_rails/node_modules/cors/lib/index.js +242 -0
- data/lib/webpack_rails/node_modules/cors/node_modules/vary/HISTORY.md +29 -0
- data/lib/webpack_rails/node_modules/cors/node_modules/vary/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/cors/node_modules/vary/README.md +91 -0
- data/lib/webpack_rails/node_modules/cors/node_modules/vary/index.js +124 -0
- data/lib/webpack_rails/node_modules/cors/node_modules/vary/package.json +72 -0
- data/lib/webpack_rails/node_modules/cors/package.json +79 -0
- data/lib/webpack_rails/node_modules/cors/test/basic-auth.js +40 -0
- data/lib/webpack_rails/node_modules/cors/test/body-events.js +81 -0
- data/lib/webpack_rails/node_modules/cors/test/cors.js +652 -0
- data/lib/webpack_rails/node_modules/cors/test/error-response.js +77 -0
- data/lib/webpack_rails/node_modules/cors/test/example-app.js +98 -0
- data/lib/webpack_rails/node_modules/cors/test/issue-2.js +56 -0
- data/lib/webpack_rails/node_modules/cors/test/issue-31.js +58 -0
- data/lib/webpack_rails/node_modules/cors/test/mocha.opts +3 -0
- data/lib/webpack_rails/node_modules/express/History.md +3025 -0
- data/lib/webpack_rails/node_modules/express/LICENSE +24 -0
- data/lib/webpack_rails/node_modules/express/Readme.md +138 -0
- data/lib/webpack_rails/node_modules/express/index.js +11 -0
- data/lib/webpack_rails/node_modules/express/lib/application.js +643 -0
- data/lib/webpack_rails/node_modules/express/lib/express.js +103 -0
- data/lib/webpack_rails/node_modules/express/lib/middleware/init.js +36 -0
- data/lib/webpack_rails/node_modules/express/lib/middleware/query.js +51 -0
- data/lib/webpack_rails/node_modules/express/lib/request.js +489 -0
- data/lib/webpack_rails/node_modules/express/lib/response.js +1053 -0
- data/lib/webpack_rails/node_modules/express/lib/router/index.js +645 -0
- data/lib/webpack_rails/node_modules/express/lib/router/layer.js +176 -0
- data/lib/webpack_rails/node_modules/express/lib/router/route.js +210 -0
- data/lib/webpack_rails/node_modules/express/lib/utils.js +300 -0
- data/lib/webpack_rails/node_modules/express/lib/view.js +173 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/HISTORY.md +170 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/README.md +135 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/index.js +231 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/HISTORY.md +171 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/README.md +103 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/index.js +188 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/HISTORY.md +274 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/README.md +82 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/db.json +6474 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/index.js +11 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/package.json +94 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/package.json +84 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/HISTORY.md +76 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/LICENSE +24 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/README.md +203 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/index.js +62 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/lib/charset.js +102 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/lib/encoding.js +118 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/lib/language.js +112 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/lib/mediaType.js +179 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/package.json +86 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/package.json +98 -0
- data/lib/webpack_rails/node_modules/express/node_modules/array-flatten/LICENSE +21 -0
- data/lib/webpack_rails/node_modules/express/node_modules/array-flatten/README.md +43 -0
- data/lib/webpack_rails/node_modules/express/node_modules/array-flatten/array-flatten.js +64 -0
- data/lib/webpack_rails/node_modules/express/node_modules/array-flatten/package.json +62 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-disposition/HISTORY.md +40 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-disposition/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-disposition/README.md +141 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-disposition/index.js +443 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-disposition/package.json +66 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-type/HISTORY.md +9 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-type/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-type/README.md +92 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-type/index.js +214 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-type/package.json +65 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie/README.md +64 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie/index.js +116 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie/package.json +68 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie-signature/History.md +38 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie-signature/Readme.md +42 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie-signature/index.js +51 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie-signature/package.json +59 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/History.md +195 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/Makefile +36 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/Readme.md +188 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/bower.json +28 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/browser.js +168 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/component.json +19 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/debug.js +197 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/node.js +209 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/node_modules/ms/History.md +66 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/node_modules/ms/LICENSE +20 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/node_modules/ms/README.md +35 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/node_modules/ms/index.js +125 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/node_modules/ms/package.json +47 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/package.json +73 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/History.md +75 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/Readme.md +274 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/index.js +529 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/buffer-concat.js +33 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/callsite-tostring.js +101 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/index.js +69 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/package.json +66 -0
- data/lib/webpack_rails/node_modules/express/node_modules/escape-html/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/escape-html/Readme.md +15 -0
- data/lib/webpack_rails/node_modules/express/node_modules/escape-html/index.js +29 -0
- data/lib/webpack_rails/node_modules/express/node_modules/escape-html/package.json +51 -0
- data/lib/webpack_rails/node_modules/express/node_modules/etag/HISTORY.md +71 -0
- data/lib/webpack_rails/node_modules/express/node_modules/etag/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/etag/README.md +165 -0
- data/lib/webpack_rails/node_modules/express/node_modules/etag/index.js +132 -0
- data/lib/webpack_rails/node_modules/express/node_modules/etag/package.json +73 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/HISTORY.md +90 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/README.md +133 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/index.js +151 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/node_modules/unpipe/HISTORY.md +4 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/node_modules/unpipe/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/node_modules/unpipe/README.md +43 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/node_modules/unpipe/index.js +69 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/node_modules/unpipe/package.json +59 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/package.json +81 -0
- data/lib/webpack_rails/node_modules/express/node_modules/fresh/HISTORY.md +38 -0
- data/lib/webpack_rails/node_modules/express/node_modules/fresh/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/fresh/README.md +58 -0
- data/lib/webpack_rails/node_modules/express/node_modules/fresh/index.js +57 -0
- data/lib/webpack_rails/node_modules/express/node_modules/fresh/package.json +87 -0
- data/lib/webpack_rails/node_modules/express/node_modules/merge-descriptors/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/merge-descriptors/README.md +34 -0
- data/lib/webpack_rails/node_modules/express/node_modules/merge-descriptors/index.js +57 -0
- data/lib/webpack_rails/node_modules/express/node_modules/merge-descriptors/package.json +125 -0
- data/lib/webpack_rails/node_modules/express/node_modules/methods/HISTORY.md +24 -0
- data/lib/webpack_rails/node_modules/express/node_modules/methods/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/methods/README.md +41 -0
- data/lib/webpack_rails/node_modules/express/node_modules/methods/index.js +42 -0
- data/lib/webpack_rails/node_modules/express/node_modules/methods/package.json +88 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/HISTORY.md +88 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/README.md +154 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/index.js +196 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/node_modules/ee-first/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/node_modules/ee-first/README.md +80 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/node_modules/ee-first/index.js +95 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/node_modules/ee-first/package.json +64 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/package.json +71 -0
- data/lib/webpack_rails/node_modules/express/node_modules/parseurl/HISTORY.md +42 -0
- data/lib/webpack_rails/node_modules/express/node_modules/parseurl/LICENSE +24 -0
- data/lib/webpack_rails/node_modules/express/node_modules/parseurl/README.md +107 -0
- data/lib/webpack_rails/node_modules/express/node_modules/parseurl/index.js +136 -0
- data/lib/webpack_rails/node_modules/express/node_modules/parseurl/package.json +80 -0
- data/lib/webpack_rails/node_modules/express/node_modules/path-to-regexp/History.md +36 -0
- data/lib/webpack_rails/node_modules/express/node_modules/path-to-regexp/LICENSE +21 -0
- data/lib/webpack_rails/node_modules/express/node_modules/path-to-regexp/Readme.md +35 -0
- data/lib/webpack_rails/node_modules/express/node_modules/path-to-regexp/index.js +129 -0
- data/lib/webpack_rails/node_modules/express/node_modules/path-to-regexp/package.json +184 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/HISTORY.md +66 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/README.md +137 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/index.js +345 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/HISTORY.md +4 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/README.md +53 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/index.js +35 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/package.json +65 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/Cakefile +18 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/LICENSE +19 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/README.md +161 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/ipaddr.min.js +1 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/lib/ipaddr.js +439 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/package.json +60 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/src/ipaddr.coffee +374 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/test/ipaddr.test.coffee +262 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/package.json +90 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/CHANGELOG.md +88 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/CONTRIBUTING.md +1 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/LICENSE +28 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/README.md +317 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/bower.json +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/lib/index.js +15 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/lib/parse.js +186 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/lib/stringify.js +121 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/lib/utils.js +190 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/package.json +56 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/test/parse.js +478 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/test/stringify.js +259 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/test/utils.js +28 -0
- data/lib/webpack_rails/node_modules/express/node_modules/range-parser/HISTORY.md +35 -0
- data/lib/webpack_rails/node_modules/express/node_modules/range-parser/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/range-parser/README.md +48 -0
- data/lib/webpack_rails/node_modules/express/node_modules/range-parser/index.js +49 -0
- data/lib/webpack_rails/node_modules/express/node_modules/range-parser/package.json +76 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/HISTORY.md +295 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/README.md +195 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/index.js +820 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/destroy/README.md +38 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/destroy/index.js +36 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/destroy/package.json +67 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/HISTORY.md +76 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/README.md +63 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/index.js +120 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/LICENSE +16 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/README.md +42 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/inherits.js +1 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/inherits_browser.js +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/package.json +50 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/test.js +25 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/package.json +85 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/LICENSE +19 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/README.md +90 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/build/build.js +11 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/build/test.js +57 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/cli.js +8 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/mime.js +108 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/package.json +73 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/types.json +1 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/ms/History.md +66 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/ms/LICENSE +20 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/ms/README.md +35 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/ms/index.js +125 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/ms/package.json +47 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/statuses/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/statuses/README.md +114 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/statuses/codes.json +64 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/statuses/index.js +60 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/statuses/package.json +84 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/package.json +89 -0
- data/lib/webpack_rails/node_modules/express/node_modules/serve-static/HISTORY.md +284 -0
- data/lib/webpack_rails/node_modules/express/node_modules/serve-static/LICENSE +25 -0
- data/lib/webpack_rails/node_modules/express/node_modules/serve-static/README.md +235 -0
- data/lib/webpack_rails/node_modules/express/node_modules/serve-static/index.js +187 -0
- data/lib/webpack_rails/node_modules/express/node_modules/serve-static/package.json +83 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/HISTORY.md +180 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/README.md +132 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/index.js +262 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/media-typer/HISTORY.md +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/media-typer/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/media-typer/README.md +81 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/media-typer/index.js +270 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/media-typer/package.json +58 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/HISTORY.md +171 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/README.md +103 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/index.js +188 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/HISTORY.md +274 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/README.md +82 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/db.json +6474 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/index.js +11 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/package.json +94 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/package.json +84 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/package.json +93 -0
- data/lib/webpack_rails/node_modules/express/node_modules/utils-merge/LICENSE +20 -0
- data/lib/webpack_rails/node_modules/express/node_modules/utils-merge/README.md +34 -0
- data/lib/webpack_rails/node_modules/express/node_modules/utils-merge/index.js +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/utils-merge/package.json +58 -0
- data/lib/webpack_rails/node_modules/express/node_modules/vary/HISTORY.md +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/vary/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/vary/README.md +91 -0
- data/lib/webpack_rails/node_modules/express/node_modules/vary/index.js +117 -0
- data/lib/webpack_rails/node_modules/express/node_modules/vary/package.json +72 -0
- data/lib/webpack_rails/node_modules/express/package.json +167 -0
- data/lib/webpack_rails/node_modules/is-array/History.md +11 -0
- data/lib/webpack_rails/node_modules/is-array/Makefile +11 -0
- data/lib/webpack_rails/node_modules/is-array/Readme.md +27 -0
- data/lib/webpack_rails/node_modules/is-array/component.json +13 -0
- data/lib/webpack_rails/node_modules/is-array/index.js +33 -0
- data/lib/webpack_rails/node_modules/is-array/package.json +41 -0
- data/lib/webpack_rails/node_modules/is-array/test/test.html +46 -0
- data/lib/webpack_rails/node_modules/is-object/LICENSE +19 -0
- data/lib/webpack_rails/node_modules/is-object/README.md +55 -0
- data/lib/webpack_rails/node_modules/is-object/index.js +5 -0
- data/lib/webpack_rails/node_modules/is-object/package.json +91 -0
- data/lib/webpack_rails/node_modules/is-object/test/index.js +23 -0
- data/lib/webpack_rails/node_modules/is-string/CHANGELOG.md +19 -0
- data/lib/webpack_rails/node_modules/is-string/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/is-string/Makefile +61 -0
- data/lib/webpack_rails/node_modules/is-string/README.md +57 -0
- data/lib/webpack_rails/node_modules/is-string/index.js +20 -0
- data/lib/webpack_rails/node_modules/is-string/package.json +93 -0
- data/lib/webpack_rails/node_modules/is-string/test.js +36 -0
- data/lib/webpack_rails/node_modules/js-string-escape/CHANGELOG.md +9 -0
- data/lib/webpack_rails/node_modules/js-string-escape/LICENSE +21 -0
- data/lib/webpack_rails/node_modules/js-string-escape/README.md +44 -0
- data/lib/webpack_rails/node_modules/js-string-escape/index.js +22 -0
- data/lib/webpack_rails/node_modules/js-string-escape/package.json +63 -0
- data/lib/webpack_rails/node_modules/js-string-escape/test/test.js +43 -0
- data/lib/webpack_rails/node_modules/strip-ansi/index.js +6 -0
- data/lib/webpack_rails/node_modules/strip-ansi/license +21 -0
- data/lib/webpack_rails/node_modules/strip-ansi/node_modules/ansi-regex/index.js +4 -0
- data/lib/webpack_rails/node_modules/strip-ansi/node_modules/ansi-regex/license +21 -0
- data/lib/webpack_rails/node_modules/strip-ansi/node_modules/ansi-regex/package.json +86 -0
- data/lib/webpack_rails/node_modules/strip-ansi/node_modules/ansi-regex/readme.md +31 -0
- data/lib/webpack_rails/node_modules/strip-ansi/package.json +85 -0
- data/lib/webpack_rails/node_modules/strip-ansi/readme.md +33 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/README.md +109 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/client-overlay.js +35 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/client.js +131 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/README.md +15 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/client.js +30 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/index.html +18 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/package.json +14 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/server.js +41 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/webpack.config.js +22 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/helpers.js +8 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/middleware.js +83 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/History.md +20 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/License.md +19 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/Readme.md +15 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/decode.js +80 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/encode.js +64 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/index.js +4 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/package.json +96 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/test/common-index.js +3 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/test/index.js +210 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/test/tap-index.js +3 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/cli.js +47 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/index.js +6 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/node_modules/ansi-regex/index.js +4 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/node_modules/ansi-regex/license +21 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/node_modules/ansi-regex/package.json +86 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/node_modules/ansi-regex/readme.md +33 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/package.json +89 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/readme.md +43 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/package.json +58 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/process-update.js +105 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/test/client-test.js +81 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/test/helpers-test.js +22 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/test/middleware-test.js +188 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/test/mocha.opts +1 -0
- data/lib/webpack_rails/node_modules/xtend/LICENCE +19 -0
- data/lib/webpack_rails/node_modules/xtend/Makefile +4 -0
- data/lib/webpack_rails/node_modules/xtend/README.md +32 -0
- data/lib/webpack_rails/node_modules/xtend/immutable.js +17 -0
- data/lib/webpack_rails/node_modules/xtend/mutable.js +15 -0
- data/lib/webpack_rails/node_modules/xtend/package.json +88 -0
- data/lib/webpack_rails/node_modules/xtend/test.js +63 -0
- data/lib/webpack_rails/package.json +22 -0
- data/lib/webpack_rails/processor.rb +28 -9
- data/lib/webpack_rails/require_directive_processor.rb +51 -0
- data/lib/webpack_rails/sprockets_environment.rb +45 -0
- data/lib/webpack_rails/task.rb +51 -22
- data/lib/webpack_rails/webpack-task-dev-server.js +122 -0
- data/lib/webpack_rails/{webpack-task.js → webpack-task-watch.js} +0 -0
- data/lib/webpack_rails/webpack.rake +5 -5
- data/lib/webpack_rails.rb +1 -3
- metadata +346 -5
- data/lib/webpack_rails/sprockets_base_webpack.rb +0 -14
- data/lib/webpack_rails/sprockets_index_webpack.rb +0 -15
data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/README.md
ADDED
@@ -0,0 +1,161 @@
|
|
1
|
+
# ipaddr.js — an IPv6 and IPv4 address manipulation library
|
2
|
+
|
3
|
+
ipaddr.js is a small (1.9K minified and gzipped) library for manipulating
|
4
|
+
IP addresses in JavaScript environments. It runs on both CommonJS runtimes
|
5
|
+
(e.g. [nodejs]) and in a web browser.
|
6
|
+
|
7
|
+
ipaddr.js allows you to verify and parse string representation of an IP
|
8
|
+
address, match it against a CIDR range or range list, determine if it falls
|
9
|
+
into some reserved ranges (examples include loopback and private ranges),
|
10
|
+
and convert between IPv4 and IPv4-mapped IPv6 addresses.
|
11
|
+
|
12
|
+
[nodejs]: http://nodejs.org
|
13
|
+
|
14
|
+
## Installation
|
15
|
+
|
16
|
+
`npm install ipaddr.js`
|
17
|
+
|
18
|
+
## API
|
19
|
+
|
20
|
+
ipaddr.js defines one object in the global scope: `ipaddr`. In CommonJS,
|
21
|
+
it is exported from the module:
|
22
|
+
|
23
|
+
```js
|
24
|
+
var ipaddr = require('ipaddr.js');
|
25
|
+
```
|
26
|
+
|
27
|
+
The API consists of several global methods and two classes: ipaddr.IPv6 and ipaddr.IPv4.
|
28
|
+
|
29
|
+
### Global methods
|
30
|
+
|
31
|
+
There are three global methods defined: `ipaddr.isValid`, `ipaddr.parse` and
|
32
|
+
`ipaddr.process`. All of them receive a string as a single parameter.
|
33
|
+
|
34
|
+
The `ipaddr.isValid` method returns `true` if the address is a valid IPv4 or
|
35
|
+
IPv6 address, and `false` otherwise. It does not throw any exceptions.
|
36
|
+
|
37
|
+
The `ipaddr.parse` method returns an object representing the IP address,
|
38
|
+
or throws an `Error` if the passed string is not a valid representation of an
|
39
|
+
IP address.
|
40
|
+
|
41
|
+
The `ipaddr.process` method works just like the `ipaddr.parse` one, but it
|
42
|
+
automatically converts IPv4-mapped IPv6 addresses to their IPv4 couterparts
|
43
|
+
before returning. It is useful when you have a Node.js instance listening
|
44
|
+
on an IPv6 socket, and the `net.ivp6.bindv6only` sysctl parameter (or its
|
45
|
+
equivalent on non-Linux OS) is set to 0. In this case, you can accept IPv4
|
46
|
+
connections on your IPv6-only socket, but the remote address will be mangled.
|
47
|
+
Use `ipaddr.process` method to automatically demangle it.
|
48
|
+
|
49
|
+
### Object representation
|
50
|
+
|
51
|
+
Parsing methods return an object which descends from `ipaddr.IPv6` or
|
52
|
+
`ipaddr.IPv4`. These objects share some properties, but most of them differ.
|
53
|
+
|
54
|
+
#### Shared properties
|
55
|
+
|
56
|
+
One can determine the type of address by calling `addr.kind()`. It will return
|
57
|
+
either `"ipv6"` or `"ipv4"`.
|
58
|
+
|
59
|
+
An address can be converted back to its string representation with `addr.toString()`.
|
60
|
+
Note that this method:
|
61
|
+
* does not return the original string used to create the object (in fact, there is
|
62
|
+
no way of getting that string)
|
63
|
+
* returns a compact representation (when it is applicable)
|
64
|
+
|
65
|
+
A `match(range, bits)` method can be used to check if the address falls into a
|
66
|
+
certain CIDR range.
|
67
|
+
Note that an address can be (obviously) matched only against an address of the same type.
|
68
|
+
|
69
|
+
For example:
|
70
|
+
|
71
|
+
```js
|
72
|
+
var addr = ipaddr.parse("2001:db8:1234::1");
|
73
|
+
var range = ipaddr.parse("2001:db8::");
|
74
|
+
|
75
|
+
addr.match(range, 32); // => true
|
76
|
+
```
|
77
|
+
|
78
|
+
Alternatively, `match` can also be called as `match([range, bits])`. In this way,
|
79
|
+
it can be used together with the `parseCIDR(string)` method, which parses an IP
|
80
|
+
address together with a CIDR range.
|
81
|
+
|
82
|
+
For example:
|
83
|
+
|
84
|
+
```js
|
85
|
+
var addr = ipaddr.parse("2001:db8:1234::1");
|
86
|
+
|
87
|
+
addr.match(ipaddr.parseCIDR("2001:db8::/32")); // => true
|
88
|
+
```
|
89
|
+
|
90
|
+
A `range()` method returns one of predefined names for several special ranges defined
|
91
|
+
by IP protocols. The exact names (and their respective CIDR ranges) can be looked up
|
92
|
+
in the source: [IPv6 ranges] and [IPv4 ranges]. Some common ones include `"unicast"`
|
93
|
+
(the default one) and `"reserved"`.
|
94
|
+
|
95
|
+
You can match against your own range list by using
|
96
|
+
`ipaddr.subnetMatch(address, rangeList, defaultName)` method. It can work with both
|
97
|
+
IPv6 and IPv4 addresses, and accepts a name-to-subnet map as the range list. For example:
|
98
|
+
|
99
|
+
```js
|
100
|
+
var rangeList = {
|
101
|
+
documentationOnly: [ ipaddr.parse('2001:db8::'), 32 ],
|
102
|
+
tunnelProviders: [
|
103
|
+
[ ipaddr.parse('2001:470::'), 32 ], // he.net
|
104
|
+
[ ipaddr.parse('2001:5c0::'), 32 ] // freenet6
|
105
|
+
]
|
106
|
+
};
|
107
|
+
ipaddr.subnetMatch(ipaddr.parse('2001:470:8:66::1'), rangeList, 'unknown'); // => "he.net"
|
108
|
+
```
|
109
|
+
|
110
|
+
The addresses can be converted to their byte representation with `toByteArray()`.
|
111
|
+
(Actually, JavaScript mostly does not know about byte buffers. They are emulated with
|
112
|
+
arrays of numbers, each in range of 0..255.)
|
113
|
+
|
114
|
+
```js
|
115
|
+
var bytes = ipaddr.parse('2a00:1450:8007::68').toByteArray(); // ipv6.google.com
|
116
|
+
bytes // => [42, 0x00, 0x14, 0x50, 0x80, 0x07, 0x00, <zeroes...>, 0x00, 0x68 ]
|
117
|
+
```
|
118
|
+
|
119
|
+
The `ipaddr.IPv4` and `ipaddr.IPv6` objects have some methods defined, too. All of them
|
120
|
+
have the same interface for both protocols, and are similar to global methods.
|
121
|
+
|
122
|
+
`ipaddr.IPvX.isValid(string)` can be used to check if the string is a valid address
|
123
|
+
for particular protocol, and `ipaddr.IPvX.parse(string)` is the error-throwing parser.
|
124
|
+
|
125
|
+
[IPv6 ranges]: https://github.com/whitequark/ipaddr.js/blob/master/src/ipaddr.coffee#L186
|
126
|
+
[IPv4 ranges]: https://github.com/whitequark/ipaddr.js/blob/master/src/ipaddr.coffee#L71
|
127
|
+
|
128
|
+
#### IPv6 properties
|
129
|
+
|
130
|
+
Sometimes you will want to convert IPv6 not to a compact string representation (with
|
131
|
+
the `::` substitution); the `toNormalizedString()` method will return an address where
|
132
|
+
all zeroes are explicit.
|
133
|
+
|
134
|
+
For example:
|
135
|
+
|
136
|
+
```js
|
137
|
+
var addr = ipaddr.parse("2001:0db8::0001");
|
138
|
+
addr.toString(); // => "2001:db8::1"
|
139
|
+
addr.toNormalizedString(); // => "2001:db8:0:0:0:0:0:1"
|
140
|
+
```
|
141
|
+
|
142
|
+
The `isIPv4MappedAddress()` method will return `true` if this address is an IPv4-mapped
|
143
|
+
one, and `toIPv4Address()` will return an IPv4 object address.
|
144
|
+
|
145
|
+
To access the underlying binary representation of the address, use `addr.parts`.
|
146
|
+
|
147
|
+
```js
|
148
|
+
var addr = ipaddr.parse("2001:db8:10::1234:DEAD");
|
149
|
+
addr.parts // => [0x2001, 0xdb8, 0x10, 0, 0, 0, 0x1234, 0xdead]
|
150
|
+
```
|
151
|
+
|
152
|
+
#### IPv4 properties
|
153
|
+
|
154
|
+
`toIPv4MappedAddress()` will return a corresponding IPv4-mapped IPv6 address.
|
155
|
+
|
156
|
+
To access the underlying representation of the address, use `addr.octets`.
|
157
|
+
|
158
|
+
```js
|
159
|
+
var addr = ipaddr.parse("192.168.1.1");
|
160
|
+
addr.octets // => [192, 168, 1, 1]
|
161
|
+
```
|
@@ -0,0 +1 @@
|
|
1
|
+
(function(){var r,t,e,n,i,o,a,s;t={},s=this,"undefined"!=typeof module&&null!==module&&module.exports?module.exports=t:s.ipaddr=t,a=function(r,t,e,n){var i,o;if(r.length!==t.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");for(i=0;n>0;){if(o=e-n,0>o&&(o=0),r[i]>>o!==t[i]>>o)return!1;n-=e,i+=1}return!0},t.subnetMatch=function(r,t,e){var n,i,o,a,s;null==e&&(e="unicast");for(n in t)for(i=t[n],"[object Array]"!==toString.call(i[0])&&(i=[i]),a=0,s=i.length;s>a;a++)if(o=i[a],r.match.apply(r,o))return n;return e},t.IPv4=function(){function r(r){var t,e,n;if(4!==r.length)throw new Error("ipaddr: ipv4 octet count should be 4");for(e=0,n=r.length;n>e;e++)if(t=r[e],!(t>=0&&255>=t))throw new Error("ipaddr: ipv4 octet is a byte");this.octets=r}return r.prototype.kind=function(){return"ipv4"},r.prototype.toString=function(){return this.octets.join(".")},r.prototype.toByteArray=function(){return this.octets.slice(0)},r.prototype.match=function(r,t){var e;if(void 0===t&&(e=r,r=e[0],t=e[1]),"ipv4"!==r.kind())throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return a(this.octets,r.octets,8,t)},r.prototype.SpecialRanges={unspecified:[[new r([0,0,0,0]),8]],broadcast:[[new r([255,255,255,255]),32]],multicast:[[new r([224,0,0,0]),4]],linkLocal:[[new r([169,254,0,0]),16]],loopback:[[new r([127,0,0,0]),8]],"private":[[new r([10,0,0,0]),8],[new r([172,16,0,0]),12],[new r([192,168,0,0]),16]],reserved:[[new r([192,0,0,0]),24],[new r([192,0,2,0]),24],[new r([192,88,99,0]),24],[new r([198,51,100,0]),24],[new r([203,0,113,0]),24],[new r([240,0,0,0]),4]]},r.prototype.range=function(){return t.subnetMatch(this,this.SpecialRanges)},r.prototype.toIPv4MappedAddress=function(){return t.IPv6.parse("::ffff:"+this.toString())},r}(),e="(0?\\d+|0x[a-f0-9]+)",n={fourOctet:new RegExp("^"+e+"\\."+e+"\\."+e+"\\."+e+"$","i"),longValue:new RegExp("^"+e+"$","i")},t.IPv4.parser=function(r){var t,e,i,o,a;if(e=function(r){return"0"===r[0]&&"x"!==r[1]?parseInt(r,8):parseInt(r)},t=r.match(n.fourOctet))return function(){var r,n,o,a;for(o=t.slice(1,6),a=[],r=0,n=o.length;n>r;r++)i=o[r],a.push(e(i));return a}();if(t=r.match(n.longValue)){if(a=e(t[1]),a>4294967295||0>a)throw new Error("ipaddr: address outside defined range");return function(){var r,t;for(t=[],o=r=0;24>=r;o=r+=8)t.push(a>>o&255);return t}().reverse()}return null},t.IPv6=function(){function r(r){var t,e,n;if(8!==r.length)throw new Error("ipaddr: ipv6 part count should be 8");for(e=0,n=r.length;n>e;e++)if(t=r[e],!(t>=0&&65535>=t))throw new Error("ipaddr: ipv6 part should fit to two octets");this.parts=r}return r.prototype.kind=function(){return"ipv6"},r.prototype.toString=function(){var r,t,e,n,i,o,a;for(i=function(){var r,e,n,i;for(n=this.parts,i=[],r=0,e=n.length;e>r;r++)t=n[r],i.push(t.toString(16));return i}.call(this),r=[],e=function(t){return r.push(t)},n=0,o=0,a=i.length;a>o;o++)switch(t=i[o],n){case 0:e("0"===t?"":t),n=1;break;case 1:"0"===t?n=2:e(t);break;case 2:"0"!==t&&(e(""),e(t),n=3);break;case 3:e(t)}return 2===n&&(e(""),e("")),r.join(":")},r.prototype.toByteArray=function(){var r,t,e,n,i;for(r=[],i=this.parts,e=0,n=i.length;n>e;e++)t=i[e],r.push(t>>8),r.push(255&t);return r},r.prototype.toNormalizedString=function(){var r;return function(){var t,e,n,i;for(n=this.parts,i=[],t=0,e=n.length;e>t;t++)r=n[t],i.push(r.toString(16));return i}.call(this).join(":")},r.prototype.match=function(r,t){var e;if(void 0===t&&(e=r,r=e[0],t=e[1]),"ipv6"!==r.kind())throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return a(this.parts,r.parts,16,t)},r.prototype.SpecialRanges={unspecified:[new r([0,0,0,0,0,0,0,0]),128],linkLocal:[new r([65152,0,0,0,0,0,0,0]),10],multicast:[new r([65280,0,0,0,0,0,0,0]),8],loopback:[new r([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new r([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new r([0,0,0,0,0,65535,0,0]),96],rfc6145:[new r([0,0,0,0,65535,0,0,0]),96],rfc6052:[new r([100,65435,0,0,0,0,0,0]),96],"6to4":[new r([8194,0,0,0,0,0,0,0]),16],teredo:[new r([8193,0,0,0,0,0,0,0]),32],reserved:[[new r([8193,3512,0,0,0,0,0,0]),32]]},r.prototype.range=function(){return t.subnetMatch(this,this.SpecialRanges)},r.prototype.isIPv4MappedAddress=function(){return"ipv4Mapped"===this.range()},r.prototype.toIPv4Address=function(){var r,e,n;if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");return n=this.parts.slice(-2),r=n[0],e=n[1],new t.IPv4([r>>8,255&r,e>>8,255&e])},r}(),i="(?:[0-9a-f]+::?)+",o={"native":new RegExp("^(::)?("+i+")?([0-9a-f]+)?(::)?$","i"),transitional:new RegExp("^((?:"+i+")|(?:::)(?:"+i+")?)"+(""+e+"\\."+e+"\\."+e+"\\."+e+"$"),"i")},r=function(r,t){var e,n,i,o,a;if(r.indexOf("::")!==r.lastIndexOf("::"))return null;for(e=0,n=-1;(n=r.indexOf(":",n+1))>=0;)e++;if(":"===r[0]&&e--,":"===r[r.length-1]&&e--,e>t)return null;for(a=t-e,o=":";a--;)o+="0:";return r=r.replace("::",o),":"===r[0]&&(r=r.slice(1)),":"===r[r.length-1]&&(r=r.slice(0,-1)),function(){var t,e,n,o;for(n=r.split(":"),o=[],t=0,e=n.length;e>t;t++)i=n[t],o.push(parseInt(i,16));return o}()},t.IPv6.parser=function(t){var e,n;return t.match(o["native"])?r(t,8):(e=t.match(o.transitional))&&(n=r(e[1].slice(0,-1),6))?(n.push(parseInt(e[2])<<8|parseInt(e[3])),n.push(parseInt(e[4])<<8|parseInt(e[5])),n):null},t.IPv4.isIPv4=t.IPv6.isIPv6=function(r){return null!==this.parser(r)},t.IPv4.isValid=t.IPv6.isValid=function(r){var t;try{return new this(this.parser(r)),!0}catch(e){return t=e,!1}},t.IPv4.parse=t.IPv6.parse=function(r){var t;if(t=this.parser(r),null===t)throw new Error("ipaddr: string is not formatted like ip address");return new this(t)},t.IPv4.parseCIDR=t.IPv6.parseCIDR=function(r){var t;if(t=r.match(/^(.+)\/(\d+)$/))return[this.parse(t[1]),parseInt(t[2])];throw new Error("ipaddr: string is not formatted like a CIDR range")},t.isValid=function(r){return t.IPv6.isValid(r)||t.IPv4.isValid(r)},t.parse=function(r){if(t.IPv6.isValid(r))return t.IPv6.parse(r);if(t.IPv4.isValid(r))return t.IPv4.parse(r);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},t.parseCIDR=function(r){var e;try{return t.IPv6.parseCIDR(r)}catch(n){e=n;try{return t.IPv4.parseCIDR(r)}catch(n){throw e=n,new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},t.process=function(r){var t;return t=this.parse(r),"ipv6"===t.kind()&&t.isIPv4MappedAddress()?t.toIPv4Address():t}}).call(this);
|
@@ -0,0 +1,439 @@
|
|
1
|
+
(function() {
|
2
|
+
var expandIPv6, ipaddr, ipv4Part, ipv4Regexes, ipv6Part, ipv6Regexes, matchCIDR, root;
|
3
|
+
|
4
|
+
ipaddr = {};
|
5
|
+
|
6
|
+
root = this;
|
7
|
+
|
8
|
+
if ((typeof module !== "undefined" && module !== null) && module.exports) {
|
9
|
+
module.exports = ipaddr;
|
10
|
+
} else {
|
11
|
+
root['ipaddr'] = ipaddr;
|
12
|
+
}
|
13
|
+
|
14
|
+
matchCIDR = function(first, second, partSize, cidrBits) {
|
15
|
+
var part, shift;
|
16
|
+
if (first.length !== second.length) {
|
17
|
+
throw new Error("ipaddr: cannot match CIDR for objects with different lengths");
|
18
|
+
}
|
19
|
+
part = 0;
|
20
|
+
while (cidrBits > 0) {
|
21
|
+
shift = partSize - cidrBits;
|
22
|
+
if (shift < 0) {
|
23
|
+
shift = 0;
|
24
|
+
}
|
25
|
+
if (first[part] >> shift !== second[part] >> shift) {
|
26
|
+
return false;
|
27
|
+
}
|
28
|
+
cidrBits -= partSize;
|
29
|
+
part += 1;
|
30
|
+
}
|
31
|
+
return true;
|
32
|
+
};
|
33
|
+
|
34
|
+
ipaddr.subnetMatch = function(address, rangeList, defaultName) {
|
35
|
+
var rangeName, rangeSubnets, subnet, _i, _len;
|
36
|
+
if (defaultName == null) {
|
37
|
+
defaultName = 'unicast';
|
38
|
+
}
|
39
|
+
for (rangeName in rangeList) {
|
40
|
+
rangeSubnets = rangeList[rangeName];
|
41
|
+
if (toString.call(rangeSubnets[0]) !== '[object Array]') {
|
42
|
+
rangeSubnets = [rangeSubnets];
|
43
|
+
}
|
44
|
+
for (_i = 0, _len = rangeSubnets.length; _i < _len; _i++) {
|
45
|
+
subnet = rangeSubnets[_i];
|
46
|
+
if (address.match.apply(address, subnet)) {
|
47
|
+
return rangeName;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
return defaultName;
|
52
|
+
};
|
53
|
+
|
54
|
+
ipaddr.IPv4 = (function() {
|
55
|
+
function IPv4(octets) {
|
56
|
+
var octet, _i, _len;
|
57
|
+
if (octets.length !== 4) {
|
58
|
+
throw new Error("ipaddr: ipv4 octet count should be 4");
|
59
|
+
}
|
60
|
+
for (_i = 0, _len = octets.length; _i < _len; _i++) {
|
61
|
+
octet = octets[_i];
|
62
|
+
if (!((0 <= octet && octet <= 255))) {
|
63
|
+
throw new Error("ipaddr: ipv4 octet is a byte");
|
64
|
+
}
|
65
|
+
}
|
66
|
+
this.octets = octets;
|
67
|
+
}
|
68
|
+
|
69
|
+
IPv4.prototype.kind = function() {
|
70
|
+
return 'ipv4';
|
71
|
+
};
|
72
|
+
|
73
|
+
IPv4.prototype.toString = function() {
|
74
|
+
return this.octets.join(".");
|
75
|
+
};
|
76
|
+
|
77
|
+
IPv4.prototype.toByteArray = function() {
|
78
|
+
return this.octets.slice(0);
|
79
|
+
};
|
80
|
+
|
81
|
+
IPv4.prototype.match = function(other, cidrRange) {
|
82
|
+
var _ref;
|
83
|
+
if (cidrRange === void 0) {
|
84
|
+
_ref = other, other = _ref[0], cidrRange = _ref[1];
|
85
|
+
}
|
86
|
+
if (other.kind() !== 'ipv4') {
|
87
|
+
throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");
|
88
|
+
}
|
89
|
+
return matchCIDR(this.octets, other.octets, 8, cidrRange);
|
90
|
+
};
|
91
|
+
|
92
|
+
IPv4.prototype.SpecialRanges = {
|
93
|
+
unspecified: [[new IPv4([0, 0, 0, 0]), 8]],
|
94
|
+
broadcast: [[new IPv4([255, 255, 255, 255]), 32]],
|
95
|
+
multicast: [[new IPv4([224, 0, 0, 0]), 4]],
|
96
|
+
linkLocal: [[new IPv4([169, 254, 0, 0]), 16]],
|
97
|
+
loopback: [[new IPv4([127, 0, 0, 0]), 8]],
|
98
|
+
"private": [[new IPv4([10, 0, 0, 0]), 8], [new IPv4([172, 16, 0, 0]), 12], [new IPv4([192, 168, 0, 0]), 16]],
|
99
|
+
reserved: [[new IPv4([192, 0, 0, 0]), 24], [new IPv4([192, 0, 2, 0]), 24], [new IPv4([192, 88, 99, 0]), 24], [new IPv4([198, 51, 100, 0]), 24], [new IPv4([203, 0, 113, 0]), 24], [new IPv4([240, 0, 0, 0]), 4]]
|
100
|
+
};
|
101
|
+
|
102
|
+
IPv4.prototype.range = function() {
|
103
|
+
return ipaddr.subnetMatch(this, this.SpecialRanges);
|
104
|
+
};
|
105
|
+
|
106
|
+
IPv4.prototype.toIPv4MappedAddress = function() {
|
107
|
+
return ipaddr.IPv6.parse("::ffff:" + (this.toString()));
|
108
|
+
};
|
109
|
+
|
110
|
+
return IPv4;
|
111
|
+
|
112
|
+
})();
|
113
|
+
|
114
|
+
ipv4Part = "(0?\\d+|0x[a-f0-9]+)";
|
115
|
+
|
116
|
+
ipv4Regexes = {
|
117
|
+
fourOctet: new RegExp("^" + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "$", 'i'),
|
118
|
+
longValue: new RegExp("^" + ipv4Part + "$", 'i')
|
119
|
+
};
|
120
|
+
|
121
|
+
ipaddr.IPv4.parser = function(string) {
|
122
|
+
var match, parseIntAuto, part, shift, value;
|
123
|
+
parseIntAuto = function(string) {
|
124
|
+
if (string[0] === "0" && string[1] !== "x") {
|
125
|
+
return parseInt(string, 8);
|
126
|
+
} else {
|
127
|
+
return parseInt(string);
|
128
|
+
}
|
129
|
+
};
|
130
|
+
if (match = string.match(ipv4Regexes.fourOctet)) {
|
131
|
+
return (function() {
|
132
|
+
var _i, _len, _ref, _results;
|
133
|
+
_ref = match.slice(1, 6);
|
134
|
+
_results = [];
|
135
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
136
|
+
part = _ref[_i];
|
137
|
+
_results.push(parseIntAuto(part));
|
138
|
+
}
|
139
|
+
return _results;
|
140
|
+
})();
|
141
|
+
} else if (match = string.match(ipv4Regexes.longValue)) {
|
142
|
+
value = parseIntAuto(match[1]);
|
143
|
+
if (value > 0xffffffff || value < 0) {
|
144
|
+
throw new Error("ipaddr: address outside defined range");
|
145
|
+
}
|
146
|
+
return ((function() {
|
147
|
+
var _i, _results;
|
148
|
+
_results = [];
|
149
|
+
for (shift = _i = 0; _i <= 24; shift = _i += 8) {
|
150
|
+
_results.push((value >> shift) & 0xff);
|
151
|
+
}
|
152
|
+
return _results;
|
153
|
+
})()).reverse();
|
154
|
+
} else {
|
155
|
+
return null;
|
156
|
+
}
|
157
|
+
};
|
158
|
+
|
159
|
+
ipaddr.IPv6 = (function() {
|
160
|
+
function IPv6(parts) {
|
161
|
+
var part, _i, _len;
|
162
|
+
if (parts.length !== 8) {
|
163
|
+
throw new Error("ipaddr: ipv6 part count should be 8");
|
164
|
+
}
|
165
|
+
for (_i = 0, _len = parts.length; _i < _len; _i++) {
|
166
|
+
part = parts[_i];
|
167
|
+
if (!((0 <= part && part <= 0xffff))) {
|
168
|
+
throw new Error("ipaddr: ipv6 part should fit to two octets");
|
169
|
+
}
|
170
|
+
}
|
171
|
+
this.parts = parts;
|
172
|
+
}
|
173
|
+
|
174
|
+
IPv6.prototype.kind = function() {
|
175
|
+
return 'ipv6';
|
176
|
+
};
|
177
|
+
|
178
|
+
IPv6.prototype.toString = function() {
|
179
|
+
var compactStringParts, part, pushPart, state, stringParts, _i, _len;
|
180
|
+
stringParts = (function() {
|
181
|
+
var _i, _len, _ref, _results;
|
182
|
+
_ref = this.parts;
|
183
|
+
_results = [];
|
184
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
185
|
+
part = _ref[_i];
|
186
|
+
_results.push(part.toString(16));
|
187
|
+
}
|
188
|
+
return _results;
|
189
|
+
}).call(this);
|
190
|
+
compactStringParts = [];
|
191
|
+
pushPart = function(part) {
|
192
|
+
return compactStringParts.push(part);
|
193
|
+
};
|
194
|
+
state = 0;
|
195
|
+
for (_i = 0, _len = stringParts.length; _i < _len; _i++) {
|
196
|
+
part = stringParts[_i];
|
197
|
+
switch (state) {
|
198
|
+
case 0:
|
199
|
+
if (part === '0') {
|
200
|
+
pushPart('');
|
201
|
+
} else {
|
202
|
+
pushPart(part);
|
203
|
+
}
|
204
|
+
state = 1;
|
205
|
+
break;
|
206
|
+
case 1:
|
207
|
+
if (part === '0') {
|
208
|
+
state = 2;
|
209
|
+
} else {
|
210
|
+
pushPart(part);
|
211
|
+
}
|
212
|
+
break;
|
213
|
+
case 2:
|
214
|
+
if (part !== '0') {
|
215
|
+
pushPart('');
|
216
|
+
pushPart(part);
|
217
|
+
state = 3;
|
218
|
+
}
|
219
|
+
break;
|
220
|
+
case 3:
|
221
|
+
pushPart(part);
|
222
|
+
}
|
223
|
+
}
|
224
|
+
if (state === 2) {
|
225
|
+
pushPart('');
|
226
|
+
pushPart('');
|
227
|
+
}
|
228
|
+
return compactStringParts.join(":");
|
229
|
+
};
|
230
|
+
|
231
|
+
IPv6.prototype.toByteArray = function() {
|
232
|
+
var bytes, part, _i, _len, _ref;
|
233
|
+
bytes = [];
|
234
|
+
_ref = this.parts;
|
235
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
236
|
+
part = _ref[_i];
|
237
|
+
bytes.push(part >> 8);
|
238
|
+
bytes.push(part & 0xff);
|
239
|
+
}
|
240
|
+
return bytes;
|
241
|
+
};
|
242
|
+
|
243
|
+
IPv6.prototype.toNormalizedString = function() {
|
244
|
+
var part;
|
245
|
+
return ((function() {
|
246
|
+
var _i, _len, _ref, _results;
|
247
|
+
_ref = this.parts;
|
248
|
+
_results = [];
|
249
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
250
|
+
part = _ref[_i];
|
251
|
+
_results.push(part.toString(16));
|
252
|
+
}
|
253
|
+
return _results;
|
254
|
+
}).call(this)).join(":");
|
255
|
+
};
|
256
|
+
|
257
|
+
IPv6.prototype.match = function(other, cidrRange) {
|
258
|
+
var _ref;
|
259
|
+
if (cidrRange === void 0) {
|
260
|
+
_ref = other, other = _ref[0], cidrRange = _ref[1];
|
261
|
+
}
|
262
|
+
if (other.kind() !== 'ipv6') {
|
263
|
+
throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");
|
264
|
+
}
|
265
|
+
return matchCIDR(this.parts, other.parts, 16, cidrRange);
|
266
|
+
};
|
267
|
+
|
268
|
+
IPv6.prototype.SpecialRanges = {
|
269
|
+
unspecified: [new IPv6([0, 0, 0, 0, 0, 0, 0, 0]), 128],
|
270
|
+
linkLocal: [new IPv6([0xfe80, 0, 0, 0, 0, 0, 0, 0]), 10],
|
271
|
+
multicast: [new IPv6([0xff00, 0, 0, 0, 0, 0, 0, 0]), 8],
|
272
|
+
loopback: [new IPv6([0, 0, 0, 0, 0, 0, 0, 1]), 128],
|
273
|
+
uniqueLocal: [new IPv6([0xfc00, 0, 0, 0, 0, 0, 0, 0]), 7],
|
274
|
+
ipv4Mapped: [new IPv6([0, 0, 0, 0, 0, 0xffff, 0, 0]), 96],
|
275
|
+
rfc6145: [new IPv6([0, 0, 0, 0, 0xffff, 0, 0, 0]), 96],
|
276
|
+
rfc6052: [new IPv6([0x64, 0xff9b, 0, 0, 0, 0, 0, 0]), 96],
|
277
|
+
'6to4': [new IPv6([0x2002, 0, 0, 0, 0, 0, 0, 0]), 16],
|
278
|
+
teredo: [new IPv6([0x2001, 0, 0, 0, 0, 0, 0, 0]), 32],
|
279
|
+
reserved: [[new IPv6([0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]), 32]]
|
280
|
+
};
|
281
|
+
|
282
|
+
IPv6.prototype.range = function() {
|
283
|
+
return ipaddr.subnetMatch(this, this.SpecialRanges);
|
284
|
+
};
|
285
|
+
|
286
|
+
IPv6.prototype.isIPv4MappedAddress = function() {
|
287
|
+
return this.range() === 'ipv4Mapped';
|
288
|
+
};
|
289
|
+
|
290
|
+
IPv6.prototype.toIPv4Address = function() {
|
291
|
+
var high, low, _ref;
|
292
|
+
if (!this.isIPv4MappedAddress()) {
|
293
|
+
throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");
|
294
|
+
}
|
295
|
+
_ref = this.parts.slice(-2), high = _ref[0], low = _ref[1];
|
296
|
+
return new ipaddr.IPv4([high >> 8, high & 0xff, low >> 8, low & 0xff]);
|
297
|
+
};
|
298
|
+
|
299
|
+
return IPv6;
|
300
|
+
|
301
|
+
})();
|
302
|
+
|
303
|
+
ipv6Part = "(?:[0-9a-f]+::?)+";
|
304
|
+
|
305
|
+
ipv6Regexes = {
|
306
|
+
"native": new RegExp("^(::)?(" + ipv6Part + ")?([0-9a-f]+)?(::)?$", 'i'),
|
307
|
+
transitional: new RegExp(("^((?:" + ipv6Part + ")|(?:::)(?:" + ipv6Part + ")?)") + ("" + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "$"), 'i')
|
308
|
+
};
|
309
|
+
|
310
|
+
expandIPv6 = function(string, parts) {
|
311
|
+
var colonCount, lastColon, part, replacement, replacementCount;
|
312
|
+
if (string.indexOf('::') !== string.lastIndexOf('::')) {
|
313
|
+
return null;
|
314
|
+
}
|
315
|
+
colonCount = 0;
|
316
|
+
lastColon = -1;
|
317
|
+
while ((lastColon = string.indexOf(':', lastColon + 1)) >= 0) {
|
318
|
+
colonCount++;
|
319
|
+
}
|
320
|
+
if (string[0] === ':') {
|
321
|
+
colonCount--;
|
322
|
+
}
|
323
|
+
if (string[string.length - 1] === ':') {
|
324
|
+
colonCount--;
|
325
|
+
}
|
326
|
+
if (colonCount > parts) {
|
327
|
+
return null;
|
328
|
+
}
|
329
|
+
replacementCount = parts - colonCount;
|
330
|
+
replacement = ':';
|
331
|
+
while (replacementCount--) {
|
332
|
+
replacement += '0:';
|
333
|
+
}
|
334
|
+
string = string.replace('::', replacement);
|
335
|
+
if (string[0] === ':') {
|
336
|
+
string = string.slice(1);
|
337
|
+
}
|
338
|
+
if (string[string.length - 1] === ':') {
|
339
|
+
string = string.slice(0, -1);
|
340
|
+
}
|
341
|
+
return (function() {
|
342
|
+
var _i, _len, _ref, _results;
|
343
|
+
_ref = string.split(":");
|
344
|
+
_results = [];
|
345
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
346
|
+
part = _ref[_i];
|
347
|
+
_results.push(parseInt(part, 16));
|
348
|
+
}
|
349
|
+
return _results;
|
350
|
+
})();
|
351
|
+
};
|
352
|
+
|
353
|
+
ipaddr.IPv6.parser = function(string) {
|
354
|
+
var match, parts;
|
355
|
+
if (string.match(ipv6Regexes['native'])) {
|
356
|
+
return expandIPv6(string, 8);
|
357
|
+
} else if (match = string.match(ipv6Regexes['transitional'])) {
|
358
|
+
parts = expandIPv6(match[1].slice(0, -1), 6);
|
359
|
+
if (parts) {
|
360
|
+
parts.push(parseInt(match[2]) << 8 | parseInt(match[3]));
|
361
|
+
parts.push(parseInt(match[4]) << 8 | parseInt(match[5]));
|
362
|
+
return parts;
|
363
|
+
}
|
364
|
+
}
|
365
|
+
return null;
|
366
|
+
};
|
367
|
+
|
368
|
+
ipaddr.IPv4.isIPv4 = ipaddr.IPv6.isIPv6 = function(string) {
|
369
|
+
return this.parser(string) !== null;
|
370
|
+
};
|
371
|
+
|
372
|
+
ipaddr.IPv4.isValid = ipaddr.IPv6.isValid = function(string) {
|
373
|
+
var e;
|
374
|
+
try {
|
375
|
+
new this(this.parser(string));
|
376
|
+
return true;
|
377
|
+
} catch (_error) {
|
378
|
+
e = _error;
|
379
|
+
return false;
|
380
|
+
}
|
381
|
+
};
|
382
|
+
|
383
|
+
ipaddr.IPv4.parse = ipaddr.IPv6.parse = function(string) {
|
384
|
+
var parts;
|
385
|
+
parts = this.parser(string);
|
386
|
+
if (parts === null) {
|
387
|
+
throw new Error("ipaddr: string is not formatted like ip address");
|
388
|
+
}
|
389
|
+
return new this(parts);
|
390
|
+
};
|
391
|
+
|
392
|
+
ipaddr.IPv4.parseCIDR = ipaddr.IPv6.parseCIDR = function(string) {
|
393
|
+
var match;
|
394
|
+
if (match = string.match(/^(.+)\/(\d+)$/)) {
|
395
|
+
return [this.parse(match[1]), parseInt(match[2])];
|
396
|
+
}
|
397
|
+
throw new Error("ipaddr: string is not formatted like a CIDR range");
|
398
|
+
};
|
399
|
+
|
400
|
+
ipaddr.isValid = function(string) {
|
401
|
+
return ipaddr.IPv6.isValid(string) || ipaddr.IPv4.isValid(string);
|
402
|
+
};
|
403
|
+
|
404
|
+
ipaddr.parse = function(string) {
|
405
|
+
if (ipaddr.IPv6.isValid(string)) {
|
406
|
+
return ipaddr.IPv6.parse(string);
|
407
|
+
} else if (ipaddr.IPv4.isValid(string)) {
|
408
|
+
return ipaddr.IPv4.parse(string);
|
409
|
+
} else {
|
410
|
+
throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format");
|
411
|
+
}
|
412
|
+
};
|
413
|
+
|
414
|
+
ipaddr.parseCIDR = function(string) {
|
415
|
+
var e;
|
416
|
+
try {
|
417
|
+
return ipaddr.IPv6.parseCIDR(string);
|
418
|
+
} catch (_error) {
|
419
|
+
e = _error;
|
420
|
+
try {
|
421
|
+
return ipaddr.IPv4.parseCIDR(string);
|
422
|
+
} catch (_error) {
|
423
|
+
e = _error;
|
424
|
+
throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format");
|
425
|
+
}
|
426
|
+
}
|
427
|
+
};
|
428
|
+
|
429
|
+
ipaddr.process = function(string) {
|
430
|
+
var addr;
|
431
|
+
addr = this.parse(string);
|
432
|
+
if (addr.kind() === 'ipv6' && addr.isIPv4MappedAddress()) {
|
433
|
+
return addr.toIPv4Address();
|
434
|
+
} else {
|
435
|
+
return addr;
|
436
|
+
}
|
437
|
+
};
|
438
|
+
|
439
|
+
}).call(this);
|
@@ -0,0 +1,60 @@
|
|
1
|
+
{
|
2
|
+
"name": "ipaddr.js",
|
3
|
+
"description": "A library for manipulating IPv4 and IPv6 addresses in JavaScript.",
|
4
|
+
"version": "1.0.1",
|
5
|
+
"author": {
|
6
|
+
"name": "Peter Zotov",
|
7
|
+
"email": "whitequark@whitequark.org"
|
8
|
+
},
|
9
|
+
"directories": {
|
10
|
+
"lib": "./lib"
|
11
|
+
},
|
12
|
+
"dependencies": {},
|
13
|
+
"devDependencies": {
|
14
|
+
"coffee-script": "~1.6",
|
15
|
+
"nodeunit": "~0.5.3",
|
16
|
+
"uglify-js": "latest"
|
17
|
+
},
|
18
|
+
"scripts": {
|
19
|
+
"test": "cake build test"
|
20
|
+
},
|
21
|
+
"keywords": [
|
22
|
+
"ip",
|
23
|
+
"ipv4",
|
24
|
+
"ipv6"
|
25
|
+
],
|
26
|
+
"repository": {
|
27
|
+
"type": "git",
|
28
|
+
"url": "git://github.com/whitequark/ipaddr.js.git"
|
29
|
+
},
|
30
|
+
"main": "./lib/ipaddr",
|
31
|
+
"engines": {
|
32
|
+
"node": ">= 0.2.5"
|
33
|
+
},
|
34
|
+
"license": "MIT",
|
35
|
+
"gitHead": "0a5a26d9317a58d67047e7f32b5b1bbe7f2f7fbf",
|
36
|
+
"bugs": {
|
37
|
+
"url": "https://github.com/whitequark/ipaddr.js/issues"
|
38
|
+
},
|
39
|
+
"_id": "ipaddr.js@1.0.1",
|
40
|
+
"_shasum": "5f38801dc73e0400fc7076386f6ed5215fbd8f95",
|
41
|
+
"_from": "ipaddr.js@1.0.1",
|
42
|
+
"_npmVersion": "1.4.21",
|
43
|
+
"_npmUser": {
|
44
|
+
"name": "whitequark",
|
45
|
+
"email": "whitequark@whitequark.org"
|
46
|
+
},
|
47
|
+
"maintainers": [
|
48
|
+
{
|
49
|
+
"name": "whitequark",
|
50
|
+
"email": "whitequark@whitequark.org"
|
51
|
+
}
|
52
|
+
],
|
53
|
+
"dist": {
|
54
|
+
"shasum": "5f38801dc73e0400fc7076386f6ed5215fbd8f95",
|
55
|
+
"tarball": "http://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.0.1.tgz"
|
56
|
+
},
|
57
|
+
"_resolved": "http://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.0.1.tgz",
|
58
|
+
"readme": "ERROR: No README data found!",
|
59
|
+
"homepage": "https://github.com/whitequark/ipaddr.js#readme"
|
60
|
+
}
|