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
@@ -0,0 +1,259 @@
|
|
1
|
+
/* eslint no-extend-native:0 */
|
2
|
+
// Load modules
|
3
|
+
|
4
|
+
var Code = require('code');
|
5
|
+
var Lab = require('lab');
|
6
|
+
var Qs = require('../');
|
7
|
+
|
8
|
+
|
9
|
+
// Declare internals
|
10
|
+
|
11
|
+
var internals = {};
|
12
|
+
|
13
|
+
|
14
|
+
// Test shortcuts
|
15
|
+
|
16
|
+
var lab = exports.lab = Lab.script();
|
17
|
+
var expect = Code.expect;
|
18
|
+
var describe = lab.experiment;
|
19
|
+
var it = lab.test;
|
20
|
+
|
21
|
+
|
22
|
+
describe('stringify()', function () {
|
23
|
+
|
24
|
+
it('stringifies a querystring object', function (done) {
|
25
|
+
|
26
|
+
expect(Qs.stringify({ a: 'b' })).to.equal('a=b');
|
27
|
+
expect(Qs.stringify({ a: 1 })).to.equal('a=1');
|
28
|
+
expect(Qs.stringify({ a: 1, b: 2 })).to.equal('a=1&b=2');
|
29
|
+
expect(Qs.stringify({ a: 'A_Z' })).to.equal('a=A_Z');
|
30
|
+
expect(Qs.stringify({ a: '€' })).to.equal('a=%E2%82%AC');
|
31
|
+
expect(Qs.stringify({ a: '' })).to.equal('a=%EE%80%80');
|
32
|
+
expect(Qs.stringify({ a: 'א' })).to.equal('a=%D7%90');
|
33
|
+
expect(Qs.stringify({ a: '𐐷' })).to.equal('a=%F0%90%90%B7');
|
34
|
+
done();
|
35
|
+
});
|
36
|
+
|
37
|
+
it('stringifies a nested object', function (done) {
|
38
|
+
|
39
|
+
expect(Qs.stringify({ a: { b: 'c' } })).to.equal('a%5Bb%5D=c');
|
40
|
+
expect(Qs.stringify({ a: { b: { c: { d: 'e' } } } })).to.equal('a%5Bb%5D%5Bc%5D%5Bd%5D=e');
|
41
|
+
done();
|
42
|
+
});
|
43
|
+
|
44
|
+
it('stringifies an array value', function (done) {
|
45
|
+
|
46
|
+
expect(Qs.stringify({ a: ['b', 'c', 'd'] })).to.equal('a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d');
|
47
|
+
done();
|
48
|
+
});
|
49
|
+
|
50
|
+
it('omits array indices when asked', function (done) {
|
51
|
+
|
52
|
+
expect(Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false })).to.equal('a=b&a=c&a=d');
|
53
|
+
done();
|
54
|
+
});
|
55
|
+
|
56
|
+
it('stringifies a nested array value', function (done) {
|
57
|
+
|
58
|
+
expect(Qs.stringify({ a: { b: ['c', 'd'] } })).to.equal('a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d');
|
59
|
+
done();
|
60
|
+
});
|
61
|
+
|
62
|
+
it('stringifies an object inside an array', function (done) {
|
63
|
+
|
64
|
+
expect(Qs.stringify({ a: [{ b: 'c' }] })).to.equal('a%5B0%5D%5Bb%5D=c');
|
65
|
+
expect(Qs.stringify({ a: [{ b: { c: [1] } }] })).to.equal('a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1');
|
66
|
+
done();
|
67
|
+
});
|
68
|
+
|
69
|
+
it('does not omit object keys when indices = false', function (done) {
|
70
|
+
|
71
|
+
expect(Qs.stringify({ a: [{ b: 'c' }] }, { indices: false })).to.equal('a%5Bb%5D=c');
|
72
|
+
done();
|
73
|
+
});
|
74
|
+
|
75
|
+
it('uses indices notation for arrays when indices=true', function (done) {
|
76
|
+
|
77
|
+
expect(Qs.stringify({ a: ['b', 'c'] }, { indices: true })).to.equal('a%5B0%5D=b&a%5B1%5D=c');
|
78
|
+
done();
|
79
|
+
});
|
80
|
+
|
81
|
+
it('uses indices notation for arrays when no arrayFormat is specified', function (done) {
|
82
|
+
|
83
|
+
expect(Qs.stringify({ a: ['b', 'c'] })).to.equal('a%5B0%5D=b&a%5B1%5D=c');
|
84
|
+
done();
|
85
|
+
});
|
86
|
+
|
87
|
+
it('uses indices notation for arrays when no arrayFormat=indices', function (done) {
|
88
|
+
|
89
|
+
expect(Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })).to.equal('a%5B0%5D=b&a%5B1%5D=c');
|
90
|
+
done();
|
91
|
+
});
|
92
|
+
|
93
|
+
it('uses repeat notation for arrays when no arrayFormat=repeat', function (done) {
|
94
|
+
|
95
|
+
expect(Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })).to.equal('a=b&a=c');
|
96
|
+
done();
|
97
|
+
});
|
98
|
+
|
99
|
+
it('uses brackets notation for arrays when no arrayFormat=brackets', function (done) {
|
100
|
+
|
101
|
+
expect(Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })).to.equal('a%5B%5D=b&a%5B%5D=c');
|
102
|
+
done();
|
103
|
+
});
|
104
|
+
|
105
|
+
it('stringifies a complicated object', function (done) {
|
106
|
+
|
107
|
+
expect(Qs.stringify({ a: { b: 'c', d: 'e' } })).to.equal('a%5Bb%5D=c&a%5Bd%5D=e');
|
108
|
+
done();
|
109
|
+
});
|
110
|
+
|
111
|
+
it('stringifies an empty value', function (done) {
|
112
|
+
|
113
|
+
expect(Qs.stringify({ a: '' })).to.equal('a=');
|
114
|
+
expect(Qs.stringify({ a: null }, { strictNullHandling: true })).to.equal('a');
|
115
|
+
|
116
|
+
expect(Qs.stringify({ a: '', b: '' })).to.equal('a=&b=');
|
117
|
+
expect(Qs.stringify({ a: null, b: '' }, { strictNullHandling: true })).to.equal('a&b=');
|
118
|
+
|
119
|
+
expect(Qs.stringify({ a: { b: '' } })).to.equal('a%5Bb%5D=');
|
120
|
+
expect(Qs.stringify({ a: { b: null } }, { strictNullHandling: true })).to.equal('a%5Bb%5D');
|
121
|
+
expect(Qs.stringify({ a: { b: null } }, { strictNullHandling: false })).to.equal('a%5Bb%5D=');
|
122
|
+
|
123
|
+
done();
|
124
|
+
});
|
125
|
+
|
126
|
+
it('stringifies an empty object', function (done) {
|
127
|
+
|
128
|
+
var obj = Object.create(null);
|
129
|
+
obj.a = 'b';
|
130
|
+
expect(Qs.stringify(obj)).to.equal('a=b');
|
131
|
+
done();
|
132
|
+
});
|
133
|
+
|
134
|
+
it('returns an empty string for invalid input', function (done) {
|
135
|
+
|
136
|
+
expect(Qs.stringify(undefined)).to.equal('');
|
137
|
+
expect(Qs.stringify(false)).to.equal('');
|
138
|
+
expect(Qs.stringify(null)).to.equal('');
|
139
|
+
expect(Qs.stringify('')).to.equal('');
|
140
|
+
done();
|
141
|
+
});
|
142
|
+
|
143
|
+
it('stringifies an object with an empty object as a child', function (done) {
|
144
|
+
|
145
|
+
var obj = {
|
146
|
+
a: Object.create(null)
|
147
|
+
};
|
148
|
+
|
149
|
+
obj.a.b = 'c';
|
150
|
+
expect(Qs.stringify(obj)).to.equal('a%5Bb%5D=c');
|
151
|
+
done();
|
152
|
+
});
|
153
|
+
|
154
|
+
it('drops keys with a value of undefined', function (done) {
|
155
|
+
|
156
|
+
expect(Qs.stringify({ a: undefined })).to.equal('');
|
157
|
+
|
158
|
+
expect(Qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true })).to.equal('a%5Bc%5D');
|
159
|
+
expect(Qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false })).to.equal('a%5Bc%5D=');
|
160
|
+
expect(Qs.stringify({ a: { b: undefined, c: '' } })).to.equal('a%5Bc%5D=');
|
161
|
+
done();
|
162
|
+
});
|
163
|
+
|
164
|
+
it('url encodes values', function (done) {
|
165
|
+
|
166
|
+
expect(Qs.stringify({ a: 'b c' })).to.equal('a=b%20c');
|
167
|
+
done();
|
168
|
+
});
|
169
|
+
|
170
|
+
it('stringifies a date', function (done) {
|
171
|
+
|
172
|
+
var now = new Date();
|
173
|
+
var str = 'a=' + encodeURIComponent(now.toISOString());
|
174
|
+
expect(Qs.stringify({ a: now })).to.equal(str);
|
175
|
+
done();
|
176
|
+
});
|
177
|
+
|
178
|
+
it('stringifies the weird object from qs', function (done) {
|
179
|
+
|
180
|
+
expect(Qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' })).to.equal('my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F');
|
181
|
+
done();
|
182
|
+
});
|
183
|
+
|
184
|
+
it('skips properties that are part of the object prototype', function (done) {
|
185
|
+
|
186
|
+
Object.prototype.crash = 'test';
|
187
|
+
expect(Qs.stringify({ a: 'b' })).to.equal('a=b');
|
188
|
+
expect(Qs.stringify({ a: { b: 'c' } })).to.equal('a%5Bb%5D=c');
|
189
|
+
delete Object.prototype.crash;
|
190
|
+
done();
|
191
|
+
});
|
192
|
+
|
193
|
+
it('stringifies boolean values', function (done) {
|
194
|
+
|
195
|
+
expect(Qs.stringify({ a: true })).to.equal('a=true');
|
196
|
+
expect(Qs.stringify({ a: { b: true } })).to.equal('a%5Bb%5D=true');
|
197
|
+
expect(Qs.stringify({ b: false })).to.equal('b=false');
|
198
|
+
expect(Qs.stringify({ b: { c: false } })).to.equal('b%5Bc%5D=false');
|
199
|
+
done();
|
200
|
+
});
|
201
|
+
|
202
|
+
it('stringifies buffer values', function (done) {
|
203
|
+
|
204
|
+
expect(Qs.stringify({ a: new Buffer('test') })).to.equal('a=test');
|
205
|
+
expect(Qs.stringify({ a: { b: new Buffer('test') } })).to.equal('a%5Bb%5D=test');
|
206
|
+
done();
|
207
|
+
});
|
208
|
+
|
209
|
+
it('stringifies an object using an alternative delimiter', function (done) {
|
210
|
+
|
211
|
+
expect(Qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' })).to.equal('a=b;c=d');
|
212
|
+
done();
|
213
|
+
});
|
214
|
+
|
215
|
+
it('doesn\'t blow up when Buffer global is missing', function (done) {
|
216
|
+
|
217
|
+
var tempBuffer = global.Buffer;
|
218
|
+
delete global.Buffer;
|
219
|
+
expect(Qs.stringify({ a: 'b', c: 'd' })).to.equal('a=b&c=d');
|
220
|
+
global.Buffer = tempBuffer;
|
221
|
+
done();
|
222
|
+
});
|
223
|
+
|
224
|
+
it('selects properties when filter=array', function (done) {
|
225
|
+
|
226
|
+
expect(Qs.stringify({ a: 'b' }, { filter: ['a'] })).to.equal('a=b');
|
227
|
+
expect(Qs.stringify({ a: 1 }, { filter: [] })).to.equal('');
|
228
|
+
expect(Qs.stringify({ a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, { filter: ['a', 'b', 0, 2] })).to.equal('a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3');
|
229
|
+
done();
|
230
|
+
|
231
|
+
});
|
232
|
+
|
233
|
+
it('supports custom representations when filter=function', function (done) {
|
234
|
+
|
235
|
+
var calls = 0;
|
236
|
+
var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } };
|
237
|
+
var filterFunc = function (prefix, value) {
|
238
|
+
|
239
|
+
calls++;
|
240
|
+
if (calls === 1) {
|
241
|
+
expect(prefix).to.be.empty();
|
242
|
+
expect(value).to.equal(obj);
|
243
|
+
}
|
244
|
+
else if (prefix === 'c') {
|
245
|
+
return;
|
246
|
+
}
|
247
|
+
else if (value instanceof Date) {
|
248
|
+
expect(prefix).to.equal('e[f]');
|
249
|
+
return value.getTime();
|
250
|
+
}
|
251
|
+
return value;
|
252
|
+
};
|
253
|
+
|
254
|
+
expect(Qs.stringify(obj, { filter: filterFunc })).to.equal('a=b&e%5Bf%5D=1257894000000');
|
255
|
+
expect(calls).to.equal(5);
|
256
|
+
done();
|
257
|
+
|
258
|
+
});
|
259
|
+
});
|
@@ -0,0 +1,28 @@
|
|
1
|
+
// Load modules
|
2
|
+
|
3
|
+
var Code = require('code');
|
4
|
+
var Lab = require('lab');
|
5
|
+
var Utils = require('../lib/utils');
|
6
|
+
|
7
|
+
|
8
|
+
// Declare internals
|
9
|
+
|
10
|
+
var internals = {};
|
11
|
+
|
12
|
+
|
13
|
+
// Test shortcuts
|
14
|
+
|
15
|
+
var lab = exports.lab = Lab.script();
|
16
|
+
var expect = Code.expect;
|
17
|
+
var describe = lab.experiment;
|
18
|
+
var it = lab.test;
|
19
|
+
|
20
|
+
|
21
|
+
describe('merge()', function () {
|
22
|
+
|
23
|
+
it('can merge two objects with the same key', function (done) {
|
24
|
+
|
25
|
+
expect(Utils.merge({ a: 'b' }, { a: 'c' })).to.deep.equal({ a: ['b', 'c'] });
|
26
|
+
done();
|
27
|
+
});
|
28
|
+
});
|
@@ -0,0 +1,35 @@
|
|
1
|
+
1.0.2 / 2014-09-08
|
2
|
+
==================
|
3
|
+
|
4
|
+
* Support Node.js 0.6
|
5
|
+
|
6
|
+
1.0.1 / 2014-09-07
|
7
|
+
==================
|
8
|
+
|
9
|
+
* Move repository to jshttp
|
10
|
+
|
11
|
+
1.0.0 / 2013-12-11
|
12
|
+
==================
|
13
|
+
|
14
|
+
* Add repository to package.json
|
15
|
+
* Add MIT license
|
16
|
+
|
17
|
+
0.0.4 / 2012-06-17
|
18
|
+
==================
|
19
|
+
|
20
|
+
* Change ret -1 for unsatisfiable and -2 when invalid
|
21
|
+
|
22
|
+
0.0.3 / 2012-06-17
|
23
|
+
==================
|
24
|
+
|
25
|
+
* Fix last-byte-pos default to len - 1
|
26
|
+
|
27
|
+
0.0.2 / 2012-06-14
|
28
|
+
==================
|
29
|
+
|
30
|
+
* Add `.type`
|
31
|
+
|
32
|
+
0.0.1 / 2012-06-11
|
33
|
+
==================
|
34
|
+
|
35
|
+
* Initial release
|
@@ -0,0 +1,22 @@
|
|
1
|
+
(The MIT License)
|
2
|
+
|
3
|
+
Copyright (c) 2012-2014 TJ Holowaychuk <vision-media.ca>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
'Software'), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
19
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
20
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
21
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
22
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# range-parser
|
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
|
+
Range header field parser.
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
```
|
14
|
+
$ npm install range-parser
|
15
|
+
```
|
16
|
+
|
17
|
+
## Examples
|
18
|
+
|
19
|
+
```js
|
20
|
+
assert(-1 == parse(200, 'bytes=500-20'));
|
21
|
+
assert(-2 == parse(200, 'bytes=malformed'));
|
22
|
+
parse(200, 'bytes=0-499').should.eql(arr('bytes', [{ start: 0, end: 199 }]));
|
23
|
+
parse(1000, 'bytes=0-499').should.eql(arr('bytes', [{ start: 0, end: 499 }]));
|
24
|
+
parse(1000, 'bytes=40-80').should.eql(arr('bytes', [{ start: 40, end: 80 }]));
|
25
|
+
parse(1000, 'bytes=-500').should.eql(arr('bytes', [{ start: 500, end: 999 }]));
|
26
|
+
parse(1000, 'bytes=-400').should.eql(arr('bytes', [{ start: 600, end: 999 }]));
|
27
|
+
parse(1000, 'bytes=500-').should.eql(arr('bytes', [{ start: 500, end: 999 }]));
|
28
|
+
parse(1000, 'bytes=400-').should.eql(arr('bytes', [{ start: 400, end: 999 }]));
|
29
|
+
parse(1000, 'bytes=0-0').should.eql(arr('bytes', [{ start: 0, end: 0 }]));
|
30
|
+
parse(1000, 'bytes=-1').should.eql(arr('bytes', [{ start: 999, end: 999 }]));
|
31
|
+
parse(1000, 'items=0-5').should.eql(arr('items', [{ start: 0, end: 5 }]));
|
32
|
+
parse(1000, 'bytes=40-80,-1').should.eql(arr('bytes', [{ start: 40, end: 80 }, { start: 999, end: 999 }]));
|
33
|
+
```
|
34
|
+
|
35
|
+
## License
|
36
|
+
|
37
|
+
[MIT](LICENSE)
|
38
|
+
|
39
|
+
[npm-image]: https://img.shields.io/npm/v/range-parser.svg?style=flat
|
40
|
+
[npm-url]: https://npmjs.org/package/range-parser
|
41
|
+
[node-version-image]: https://img.shields.io/badge/node.js-%3E%3D_0.6-brightgreen.svg?style=flat
|
42
|
+
[node-version-url]: http://nodejs.org/download/
|
43
|
+
[travis-image]: https://img.shields.io/travis/jshttp/range-parser.svg?style=flat
|
44
|
+
[travis-url]: https://travis-ci.org/jshttp/range-parser
|
45
|
+
[coveralls-image]: https://img.shields.io/coveralls/jshttp/range-parser.svg?style=flat
|
46
|
+
[coveralls-url]: https://coveralls.io/r/jshttp/range-parser
|
47
|
+
[downloads-image]: https://img.shields.io/npm/dm/range-parser.svg?style=flat
|
48
|
+
[downloads-url]: https://npmjs.org/package/range-parser
|
@@ -0,0 +1,49 @@
|
|
1
|
+
|
2
|
+
/**
|
3
|
+
* Parse "Range" header `str` relative to the given file `size`.
|
4
|
+
*
|
5
|
+
* @param {Number} size
|
6
|
+
* @param {String} str
|
7
|
+
* @return {Array}
|
8
|
+
* @api public
|
9
|
+
*/
|
10
|
+
|
11
|
+
module.exports = function(size, str){
|
12
|
+
var valid = true;
|
13
|
+
var i = str.indexOf('=');
|
14
|
+
|
15
|
+
if (-1 == i) return -2;
|
16
|
+
|
17
|
+
var arr = str.slice(i + 1).split(',').map(function(range){
|
18
|
+
var range = range.split('-')
|
19
|
+
, start = parseInt(range[0], 10)
|
20
|
+
, end = parseInt(range[1], 10);
|
21
|
+
|
22
|
+
// -nnn
|
23
|
+
if (isNaN(start)) {
|
24
|
+
start = size - end;
|
25
|
+
end = size - 1;
|
26
|
+
// nnn-
|
27
|
+
} else if (isNaN(end)) {
|
28
|
+
end = size - 1;
|
29
|
+
}
|
30
|
+
|
31
|
+
// limit last-byte-pos to current length
|
32
|
+
if (end > size - 1) end = size - 1;
|
33
|
+
|
34
|
+
// invalid
|
35
|
+
if (isNaN(start)
|
36
|
+
|| isNaN(end)
|
37
|
+
|| start > end
|
38
|
+
|| start < 0) valid = false;
|
39
|
+
|
40
|
+
return {
|
41
|
+
start: start,
|
42
|
+
end: end
|
43
|
+
};
|
44
|
+
});
|
45
|
+
|
46
|
+
arr.type = str.slice(0, i);
|
47
|
+
|
48
|
+
return valid ? arr : -1;
|
49
|
+
};
|
@@ -0,0 +1,76 @@
|
|
1
|
+
{
|
2
|
+
"name": "range-parser",
|
3
|
+
"author": {
|
4
|
+
"name": "TJ Holowaychuk",
|
5
|
+
"email": "tj@vision-media.ca",
|
6
|
+
"url": "http://tjholowaychuk.com"
|
7
|
+
},
|
8
|
+
"description": "Range header field string parser",
|
9
|
+
"version": "1.0.2",
|
10
|
+
"license": "MIT",
|
11
|
+
"keywords": [
|
12
|
+
"range",
|
13
|
+
"parser",
|
14
|
+
"http"
|
15
|
+
],
|
16
|
+
"repository": {
|
17
|
+
"type": "git",
|
18
|
+
"url": "git+https://github.com/jshttp/range-parser.git"
|
19
|
+
},
|
20
|
+
"devDependencies": {
|
21
|
+
"istanbul": "0",
|
22
|
+
"mocha": "1",
|
23
|
+
"should": "2"
|
24
|
+
},
|
25
|
+
"files": [
|
26
|
+
"HISTORY.md",
|
27
|
+
"LICENSE",
|
28
|
+
"index.js"
|
29
|
+
],
|
30
|
+
"engines": {
|
31
|
+
"node": ">= 0.6"
|
32
|
+
},
|
33
|
+
"scripts": {
|
34
|
+
"test": "mocha --reporter spec --require should",
|
35
|
+
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --require should",
|
36
|
+
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot --require should"
|
37
|
+
},
|
38
|
+
"gitHead": "ae23b02ce705b56e7f7c48e832d41fa710227ecc",
|
39
|
+
"bugs": {
|
40
|
+
"url": "https://github.com/jshttp/range-parser/issues"
|
41
|
+
},
|
42
|
+
"homepage": "https://github.com/jshttp/range-parser",
|
43
|
+
"_id": "range-parser@1.0.2",
|
44
|
+
"_shasum": "06a12a42e5131ba8e457cd892044867f2344e549",
|
45
|
+
"_from": "range-parser@>=1.0.2 <1.1.0",
|
46
|
+
"_npmVersion": "1.4.21",
|
47
|
+
"_npmUser": {
|
48
|
+
"name": "dougwilson",
|
49
|
+
"email": "doug@somethingdoug.com"
|
50
|
+
},
|
51
|
+
"maintainers": [
|
52
|
+
{
|
53
|
+
"name": "tjholowaychuk",
|
54
|
+
"email": "tj@vision-media.ca"
|
55
|
+
},
|
56
|
+
{
|
57
|
+
"name": "jonathanong",
|
58
|
+
"email": "jonathanrichardong@gmail.com"
|
59
|
+
},
|
60
|
+
{
|
61
|
+
"name": "dougwilson",
|
62
|
+
"email": "doug@somethingdoug.com"
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"name": "jongleberry",
|
66
|
+
"email": "jonathanrichardong@gmail.com"
|
67
|
+
}
|
68
|
+
],
|
69
|
+
"dist": {
|
70
|
+
"shasum": "06a12a42e5131ba8e457cd892044867f2344e549",
|
71
|
+
"tarball": "http://registry.npmjs.org/range-parser/-/range-parser-1.0.2.tgz"
|
72
|
+
},
|
73
|
+
"directories": {},
|
74
|
+
"_resolved": "http://registry.npmjs.org/range-parser/-/range-parser-1.0.2.tgz",
|
75
|
+
"readme": "ERROR: No README data found!"
|
76
|
+
}
|