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,443 @@
|
|
1
|
+
/*!
|
2
|
+
* content-disposition
|
3
|
+
* Copyright(c) 2014 Douglas Christopher Wilson
|
4
|
+
* MIT Licensed
|
5
|
+
*/
|
6
|
+
|
7
|
+
/**
|
8
|
+
* Module exports.
|
9
|
+
*/
|
10
|
+
|
11
|
+
module.exports = contentDisposition
|
12
|
+
module.exports.parse = parse
|
13
|
+
|
14
|
+
/**
|
15
|
+
* Module dependencies.
|
16
|
+
*/
|
17
|
+
|
18
|
+
var basename = require('path').basename
|
19
|
+
|
20
|
+
/**
|
21
|
+
* RegExp to match non attr-char, *after* encodeURIComponent (i.e. not including "%")
|
22
|
+
*/
|
23
|
+
|
24
|
+
var encodeUriAttrCharRegExp = /[\x00-\x20"'\(\)*,\/:;<=>?@\[\\\]\{\}\x7f]/g
|
25
|
+
|
26
|
+
/**
|
27
|
+
* RegExp to match percent encoding escape.
|
28
|
+
*/
|
29
|
+
|
30
|
+
var hexEscapeRegExp = /%[0-9A-Fa-f]{2}/
|
31
|
+
var hexEscapeReplaceRegExp = /%([0-9A-Fa-f]{2})/g
|
32
|
+
|
33
|
+
/**
|
34
|
+
* RegExp to match non-latin1 characters.
|
35
|
+
*/
|
36
|
+
|
37
|
+
var nonLatin1RegExp = /[^\x20-\x7e\xa0-\xff]/g
|
38
|
+
|
39
|
+
/**
|
40
|
+
* RegExp to match quoted-pair in RFC 2616
|
41
|
+
*
|
42
|
+
* quoted-pair = "\" CHAR
|
43
|
+
* CHAR = <any US-ASCII character (octets 0 - 127)>
|
44
|
+
*/
|
45
|
+
|
46
|
+
var qescRegExp = /\\([\u0000-\u007f])/g;
|
47
|
+
|
48
|
+
/**
|
49
|
+
* RegExp to match chars that must be quoted-pair in RFC 2616
|
50
|
+
*/
|
51
|
+
|
52
|
+
var quoteRegExp = /([\\"])/g
|
53
|
+
|
54
|
+
/**
|
55
|
+
* RegExp for various RFC 2616 grammar
|
56
|
+
*
|
57
|
+
* parameter = token "=" ( token | quoted-string )
|
58
|
+
* token = 1*<any CHAR except CTLs or separators>
|
59
|
+
* separators = "(" | ")" | "<" | ">" | "@"
|
60
|
+
* | "," | ";" | ":" | "\" | <">
|
61
|
+
* | "/" | "[" | "]" | "?" | "="
|
62
|
+
* | "{" | "}" | SP | HT
|
63
|
+
* quoted-string = ( <"> *(qdtext | quoted-pair ) <"> )
|
64
|
+
* qdtext = <any TEXT except <">>
|
65
|
+
* quoted-pair = "\" CHAR
|
66
|
+
* CHAR = <any US-ASCII character (octets 0 - 127)>
|
67
|
+
* TEXT = <any OCTET except CTLs, but including LWS>
|
68
|
+
* LWS = [CRLF] 1*( SP | HT )
|
69
|
+
* CRLF = CR LF
|
70
|
+
* CR = <US-ASCII CR, carriage return (13)>
|
71
|
+
* LF = <US-ASCII LF, linefeed (10)>
|
72
|
+
* SP = <US-ASCII SP, space (32)>
|
73
|
+
* HT = <US-ASCII HT, horizontal-tab (9)>
|
74
|
+
* CTL = <any US-ASCII control character (octets 0 - 31) and DEL (127)>
|
75
|
+
* OCTET = <any 8-bit sequence of data>
|
76
|
+
*/
|
77
|
+
|
78
|
+
var paramRegExp = /; *([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *= *("(?:[ !\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) */g
|
79
|
+
var textRegExp = /^[\x20-\x7e\x80-\xff]+$/
|
80
|
+
var tokenRegExp = /^[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+$/
|
81
|
+
|
82
|
+
/**
|
83
|
+
* RegExp for various RFC 5987 grammar
|
84
|
+
*
|
85
|
+
* ext-value = charset "'" [ language ] "'" value-chars
|
86
|
+
* charset = "UTF-8" / "ISO-8859-1" / mime-charset
|
87
|
+
* mime-charset = 1*mime-charsetc
|
88
|
+
* mime-charsetc = ALPHA / DIGIT
|
89
|
+
* / "!" / "#" / "$" / "%" / "&"
|
90
|
+
* / "+" / "-" / "^" / "_" / "`"
|
91
|
+
* / "{" / "}" / "~"
|
92
|
+
* language = ( 2*3ALPHA [ extlang ] )
|
93
|
+
* / 4ALPHA
|
94
|
+
* / 5*8ALPHA
|
95
|
+
* extlang = *3( "-" 3ALPHA )
|
96
|
+
* value-chars = *( pct-encoded / attr-char )
|
97
|
+
* pct-encoded = "%" HEXDIG HEXDIG
|
98
|
+
* attr-char = ALPHA / DIGIT
|
99
|
+
* / "!" / "#" / "$" / "&" / "+" / "-" / "."
|
100
|
+
* / "^" / "_" / "`" / "|" / "~"
|
101
|
+
*/
|
102
|
+
|
103
|
+
var extValueRegExp = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+\-\.^_`|~])+)$/
|
104
|
+
|
105
|
+
/**
|
106
|
+
* RegExp for various RFC 6266 grammar
|
107
|
+
*
|
108
|
+
* disposition-type = "inline" | "attachment" | disp-ext-type
|
109
|
+
* disp-ext-type = token
|
110
|
+
* disposition-parm = filename-parm | disp-ext-parm
|
111
|
+
* filename-parm = "filename" "=" value
|
112
|
+
* | "filename*" "=" ext-value
|
113
|
+
* disp-ext-parm = token "=" value
|
114
|
+
* | ext-token "=" ext-value
|
115
|
+
* ext-token = <the characters in token, followed by "*">
|
116
|
+
*/
|
117
|
+
|
118
|
+
var dispositionTypeRegExp = /^([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *(?:$|;)/
|
119
|
+
|
120
|
+
/**
|
121
|
+
* Create an attachment Content-Disposition header.
|
122
|
+
*
|
123
|
+
* @param {string} [filename]
|
124
|
+
* @param {object} [options]
|
125
|
+
* @param {string} [options.type=attachment]
|
126
|
+
* @param {string|boolean} [options.fallback=true]
|
127
|
+
* @return {string}
|
128
|
+
* @api public
|
129
|
+
*/
|
130
|
+
|
131
|
+
function contentDisposition(filename, options) {
|
132
|
+
var opts = options || {}
|
133
|
+
|
134
|
+
// get type
|
135
|
+
var type = opts.type || 'attachment'
|
136
|
+
|
137
|
+
// get parameters
|
138
|
+
var params = createparams(filename, opts.fallback)
|
139
|
+
|
140
|
+
// format into string
|
141
|
+
return format(new ContentDisposition(type, params))
|
142
|
+
}
|
143
|
+
|
144
|
+
/**
|
145
|
+
* Create parameters object from filename and fallback.
|
146
|
+
*
|
147
|
+
* @param {string} [filename]
|
148
|
+
* @param {string|boolean} [fallback=true]
|
149
|
+
* @return {object}
|
150
|
+
* @api private
|
151
|
+
*/
|
152
|
+
|
153
|
+
function createparams(filename, fallback) {
|
154
|
+
if (filename === undefined) {
|
155
|
+
return
|
156
|
+
}
|
157
|
+
|
158
|
+
var params = {}
|
159
|
+
|
160
|
+
if (typeof filename !== 'string') {
|
161
|
+
throw new TypeError('filename must be a string')
|
162
|
+
}
|
163
|
+
|
164
|
+
// fallback defaults to true
|
165
|
+
if (fallback === undefined) {
|
166
|
+
fallback = true
|
167
|
+
}
|
168
|
+
|
169
|
+
if (typeof fallback !== 'string' && typeof fallback !== 'boolean') {
|
170
|
+
throw new TypeError('fallback must be a string or boolean')
|
171
|
+
}
|
172
|
+
|
173
|
+
if (typeof fallback === 'string' && nonLatin1RegExp.test(fallback)) {
|
174
|
+
throw new TypeError('fallback must be ISO-8859-1 string')
|
175
|
+
}
|
176
|
+
|
177
|
+
// restrict to file base name
|
178
|
+
var name = basename(filename)
|
179
|
+
|
180
|
+
// determine if name is suitable for quoted string
|
181
|
+
var isQuotedString = textRegExp.test(name)
|
182
|
+
|
183
|
+
// generate fallback name
|
184
|
+
var fallbackName = typeof fallback !== 'string'
|
185
|
+
? fallback && getlatin1(name)
|
186
|
+
: basename(fallback)
|
187
|
+
var hasFallback = typeof fallbackName === 'string' && fallbackName !== name
|
188
|
+
|
189
|
+
// set extended filename parameter
|
190
|
+
if (hasFallback || !isQuotedString || hexEscapeRegExp.test(name)) {
|
191
|
+
params['filename*'] = name
|
192
|
+
}
|
193
|
+
|
194
|
+
// set filename parameter
|
195
|
+
if (isQuotedString || hasFallback) {
|
196
|
+
params.filename = hasFallback
|
197
|
+
? fallbackName
|
198
|
+
: name
|
199
|
+
}
|
200
|
+
|
201
|
+
return params
|
202
|
+
}
|
203
|
+
|
204
|
+
/**
|
205
|
+
* Format object to Content-Disposition header.
|
206
|
+
*
|
207
|
+
* @param {object} obj
|
208
|
+
* @param {string} obj.type
|
209
|
+
* @param {object} [obj.parameters]
|
210
|
+
* @return {string}
|
211
|
+
* @api private
|
212
|
+
*/
|
213
|
+
|
214
|
+
function format(obj) {
|
215
|
+
var parameters = obj.parameters
|
216
|
+
var type = obj.type
|
217
|
+
|
218
|
+
if (!type || typeof type !== 'string' || !tokenRegExp.test(type)) {
|
219
|
+
throw new TypeError('invalid type')
|
220
|
+
}
|
221
|
+
|
222
|
+
// start with normalized type
|
223
|
+
var string = String(type).toLowerCase()
|
224
|
+
|
225
|
+
// append parameters
|
226
|
+
if (parameters && typeof parameters === 'object') {
|
227
|
+
var param
|
228
|
+
var params = Object.keys(parameters).sort()
|
229
|
+
|
230
|
+
for (var i = 0; i < params.length; i++) {
|
231
|
+
param = params[i]
|
232
|
+
|
233
|
+
var val = param.substr(-1) === '*'
|
234
|
+
? ustring(parameters[param])
|
235
|
+
: qstring(parameters[param])
|
236
|
+
|
237
|
+
string += '; ' + param + '=' + val
|
238
|
+
}
|
239
|
+
}
|
240
|
+
|
241
|
+
return string
|
242
|
+
}
|
243
|
+
|
244
|
+
/**
|
245
|
+
* Decode a RFC 6987 field value (gracefully).
|
246
|
+
*
|
247
|
+
* @param {string} str
|
248
|
+
* @return {string}
|
249
|
+
* @api private
|
250
|
+
*/
|
251
|
+
|
252
|
+
function decodefield(str) {
|
253
|
+
var match = extValueRegExp.exec(str)
|
254
|
+
|
255
|
+
if (!match) {
|
256
|
+
throw new TypeError('invalid extended field value')
|
257
|
+
}
|
258
|
+
|
259
|
+
var charset = match[1].toLowerCase()
|
260
|
+
var encoded = match[2]
|
261
|
+
var value
|
262
|
+
|
263
|
+
// to binary string
|
264
|
+
var binary = encoded.replace(hexEscapeReplaceRegExp, pdecode)
|
265
|
+
|
266
|
+
switch (charset) {
|
267
|
+
case 'iso-8859-1':
|
268
|
+
value = getlatin1(binary)
|
269
|
+
break
|
270
|
+
case 'utf-8':
|
271
|
+
value = new Buffer(binary, 'binary').toString('utf8')
|
272
|
+
break
|
273
|
+
default:
|
274
|
+
throw new TypeError('unsupported charset in extended field')
|
275
|
+
}
|
276
|
+
|
277
|
+
return value
|
278
|
+
}
|
279
|
+
|
280
|
+
/**
|
281
|
+
* Get ISO-8859-1 version of string.
|
282
|
+
*
|
283
|
+
* @param {string} val
|
284
|
+
* @return {string}
|
285
|
+
* @api private
|
286
|
+
*/
|
287
|
+
|
288
|
+
function getlatin1(val) {
|
289
|
+
// simple Unicode -> ISO-8859-1 transformation
|
290
|
+
return String(val).replace(nonLatin1RegExp, '?')
|
291
|
+
}
|
292
|
+
|
293
|
+
/**
|
294
|
+
* Parse Content-Disposition header string.
|
295
|
+
*
|
296
|
+
* @param {string} string
|
297
|
+
* @return {object}
|
298
|
+
* @api private
|
299
|
+
*/
|
300
|
+
|
301
|
+
function parse(string) {
|
302
|
+
if (!string || typeof string !== 'string') {
|
303
|
+
throw new TypeError('argument string is required')
|
304
|
+
}
|
305
|
+
|
306
|
+
var match = dispositionTypeRegExp.exec(string)
|
307
|
+
|
308
|
+
if (!match) {
|
309
|
+
throw new TypeError('invalid type format')
|
310
|
+
}
|
311
|
+
|
312
|
+
// normalize type
|
313
|
+
var index = match[0].length
|
314
|
+
var type = match[1].toLowerCase()
|
315
|
+
|
316
|
+
var key
|
317
|
+
var names = []
|
318
|
+
var params = {}
|
319
|
+
var value
|
320
|
+
|
321
|
+
// calculate index to start at
|
322
|
+
index = paramRegExp.lastIndex = match[0].substr(-1) === ';'
|
323
|
+
? index - 1
|
324
|
+
: index
|
325
|
+
|
326
|
+
// match parameters
|
327
|
+
while (match = paramRegExp.exec(string)) {
|
328
|
+
if (match.index !== index) {
|
329
|
+
throw new TypeError('invalid parameter format')
|
330
|
+
}
|
331
|
+
|
332
|
+
index += match[0].length
|
333
|
+
key = match[1].toLowerCase()
|
334
|
+
value = match[2]
|
335
|
+
|
336
|
+
if (names.indexOf(key) !== -1) {
|
337
|
+
throw new TypeError('invalid duplicate parameter')
|
338
|
+
}
|
339
|
+
|
340
|
+
names.push(key)
|
341
|
+
|
342
|
+
if (key.indexOf('*') + 1 === key.length) {
|
343
|
+
// decode extended value
|
344
|
+
key = key.slice(0, -1)
|
345
|
+
value = decodefield(value)
|
346
|
+
|
347
|
+
// overwrite existing value
|
348
|
+
params[key] = value
|
349
|
+
continue
|
350
|
+
}
|
351
|
+
|
352
|
+
if (typeof params[key] === 'string') {
|
353
|
+
continue
|
354
|
+
}
|
355
|
+
|
356
|
+
if (value[0] === '"') {
|
357
|
+
// remove quotes and escapes
|
358
|
+
value = value
|
359
|
+
.substr(1, value.length - 2)
|
360
|
+
.replace(qescRegExp, '$1')
|
361
|
+
}
|
362
|
+
|
363
|
+
params[key] = value
|
364
|
+
}
|
365
|
+
|
366
|
+
if (index !== -1 && index !== string.length) {
|
367
|
+
throw new TypeError('invalid parameter format')
|
368
|
+
}
|
369
|
+
|
370
|
+
return new ContentDisposition(type, params)
|
371
|
+
}
|
372
|
+
|
373
|
+
/**
|
374
|
+
* Percent decode a single character.
|
375
|
+
*
|
376
|
+
* @param {string} str
|
377
|
+
* @param {string} hex
|
378
|
+
* @return {string}
|
379
|
+
* @api private
|
380
|
+
*/
|
381
|
+
|
382
|
+
function pdecode(str, hex) {
|
383
|
+
return String.fromCharCode(parseInt(hex, 16))
|
384
|
+
}
|
385
|
+
|
386
|
+
/**
|
387
|
+
* Percent encode a single character.
|
388
|
+
*
|
389
|
+
* @param {string} char
|
390
|
+
* @return {string}
|
391
|
+
* @api private
|
392
|
+
*/
|
393
|
+
|
394
|
+
function pencode(char) {
|
395
|
+
var hex = String(char)
|
396
|
+
.charCodeAt(0)
|
397
|
+
.toString(16)
|
398
|
+
.toUpperCase()
|
399
|
+
return hex.length === 1
|
400
|
+
? '%0' + hex
|
401
|
+
: '%' + hex
|
402
|
+
}
|
403
|
+
|
404
|
+
/**
|
405
|
+
* Quote a string for HTTP.
|
406
|
+
*
|
407
|
+
* @param {string} val
|
408
|
+
* @return {string}
|
409
|
+
* @api private
|
410
|
+
*/
|
411
|
+
|
412
|
+
function qstring(val) {
|
413
|
+
var str = String(val)
|
414
|
+
|
415
|
+
return '"' + str.replace(quoteRegExp, '\\$1') + '"'
|
416
|
+
}
|
417
|
+
|
418
|
+
/**
|
419
|
+
* Encode a Unicode string for HTTP (RFC 5987).
|
420
|
+
*
|
421
|
+
* @param {string} val
|
422
|
+
* @return {string}
|
423
|
+
* @api private
|
424
|
+
*/
|
425
|
+
|
426
|
+
function ustring(val) {
|
427
|
+
var str = String(val)
|
428
|
+
|
429
|
+
// percent encode as UTF-8
|
430
|
+
var encoded = encodeURIComponent(str)
|
431
|
+
.replace(encodeUriAttrCharRegExp, pencode)
|
432
|
+
|
433
|
+
return 'UTF-8\'\'' + encoded
|
434
|
+
}
|
435
|
+
|
436
|
+
/**
|
437
|
+
* Class for parsed Content-Disposition header for v8 optimization
|
438
|
+
*/
|
439
|
+
|
440
|
+
function ContentDisposition(type, parameters) {
|
441
|
+
this.type = type
|
442
|
+
this.parameters = parameters
|
443
|
+
}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
{
|
2
|
+
"name": "content-disposition",
|
3
|
+
"description": "Create and parse Content-Disposition header",
|
4
|
+
"version": "0.5.0",
|
5
|
+
"contributors": [
|
6
|
+
{
|
7
|
+
"name": "Douglas Christopher Wilson",
|
8
|
+
"email": "doug@somethingdoug.com"
|
9
|
+
}
|
10
|
+
],
|
11
|
+
"license": "MIT",
|
12
|
+
"keywords": [
|
13
|
+
"content-disposition",
|
14
|
+
"http",
|
15
|
+
"rfc6266",
|
16
|
+
"res"
|
17
|
+
],
|
18
|
+
"repository": {
|
19
|
+
"type": "git",
|
20
|
+
"url": "git+https://github.com/jshttp/content-disposition.git"
|
21
|
+
},
|
22
|
+
"devDependencies": {
|
23
|
+
"istanbul": "0.3.2",
|
24
|
+
"mocha": "~1.21.4"
|
25
|
+
},
|
26
|
+
"files": [
|
27
|
+
"LICENSE",
|
28
|
+
"HISTORY.md",
|
29
|
+
"README.md",
|
30
|
+
"index.js"
|
31
|
+
],
|
32
|
+
"engines": {
|
33
|
+
"node": ">= 0.6"
|
34
|
+
},
|
35
|
+
"scripts": {
|
36
|
+
"test": "mocha --reporter spec --bail --check-leaks test/",
|
37
|
+
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
|
38
|
+
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
|
39
|
+
},
|
40
|
+
"gitHead": "f3c915f0c9d9f5ec79713dba24c8c6181b73305d",
|
41
|
+
"bugs": {
|
42
|
+
"url": "https://github.com/jshttp/content-disposition/issues"
|
43
|
+
},
|
44
|
+
"homepage": "https://github.com/jshttp/content-disposition",
|
45
|
+
"_id": "content-disposition@0.5.0",
|
46
|
+
"_shasum": "4284fe6ae0630874639e44e80a418c2934135e9e",
|
47
|
+
"_from": "content-disposition@0.5.0",
|
48
|
+
"_npmVersion": "1.4.21",
|
49
|
+
"_npmUser": {
|
50
|
+
"name": "dougwilson",
|
51
|
+
"email": "doug@somethingdoug.com"
|
52
|
+
},
|
53
|
+
"maintainers": [
|
54
|
+
{
|
55
|
+
"name": "dougwilson",
|
56
|
+
"email": "doug@somethingdoug.com"
|
57
|
+
}
|
58
|
+
],
|
59
|
+
"dist": {
|
60
|
+
"shasum": "4284fe6ae0630874639e44e80a418c2934135e9e",
|
61
|
+
"tarball": "http://registry.npmjs.org/content-disposition/-/content-disposition-0.5.0.tgz"
|
62
|
+
},
|
63
|
+
"directories": {},
|
64
|
+
"_resolved": "http://registry.npmjs.org/content-disposition/-/content-disposition-0.5.0.tgz",
|
65
|
+
"readme": "ERROR: No README data found!"
|
66
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
(The MIT License)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Douglas Christopher Wilson
|
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,92 @@
|
|
1
|
+
# content-type
|
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
|
+
Create and parse HTTP Content-Type header according to RFC 7231
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
```sh
|
14
|
+
$ npm install content-type
|
15
|
+
```
|
16
|
+
|
17
|
+
## API
|
18
|
+
|
19
|
+
```js
|
20
|
+
var contentType = require('content-type')
|
21
|
+
```
|
22
|
+
|
23
|
+
### contentType.parse(string)
|
24
|
+
|
25
|
+
```js
|
26
|
+
var obj = contentType.parse('image/svg+xml; charset=utf-8')
|
27
|
+
```
|
28
|
+
|
29
|
+
Parse a content type string. This will return an object with the following
|
30
|
+
properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`):
|
31
|
+
|
32
|
+
- `type`: The media type (the type and subtype, always lower case).
|
33
|
+
Example: `'image/svg+xml'`
|
34
|
+
|
35
|
+
- `parameters`: An object of the parameters in the media type (name of parameter
|
36
|
+
always lower case). Example: `{charset: 'utf-8'}`
|
37
|
+
|
38
|
+
Throws a `TypeError` if the string is missing or invalid.
|
39
|
+
|
40
|
+
### contentType.parse(req)
|
41
|
+
|
42
|
+
```js
|
43
|
+
var obj = contentType.parse(req)
|
44
|
+
```
|
45
|
+
|
46
|
+
Parse the `content-type` header from the given `req`. Short-cut for
|
47
|
+
`contentType.parse(req.headers['content-type'])`.
|
48
|
+
|
49
|
+
Throws a `TypeError` if the `Content-Type` header is missing or invalid.
|
50
|
+
|
51
|
+
### contentType.parse(res)
|
52
|
+
|
53
|
+
```js
|
54
|
+
var obj = contentType.parse(res)
|
55
|
+
```
|
56
|
+
|
57
|
+
Parse the `content-type` header set on the given `res`. Short-cut for
|
58
|
+
`contentType.parse(res.getHeader('content-type'))`.
|
59
|
+
|
60
|
+
Throws a `TypeError` if the `Content-Type` header is missing or invalid.
|
61
|
+
|
62
|
+
### contentType.format(obj)
|
63
|
+
|
64
|
+
```js
|
65
|
+
var str = contentType.format({type: 'image/svg+xml'})
|
66
|
+
```
|
67
|
+
|
68
|
+
Format an object into a content type string. This will return a string of the
|
69
|
+
content type for the given object with the following properties (examples are
|
70
|
+
shown that produce the string `'image/svg+xml; charset=utf-8'`):
|
71
|
+
|
72
|
+
- `type`: The media type (will be lower-cased). Example: `'image/svg+xml'`
|
73
|
+
|
74
|
+
- `parameters`: An object of the parameters in the media type (name of the
|
75
|
+
parameter will be lower-cased). Example: `{charset: 'utf-8'}`
|
76
|
+
|
77
|
+
Throws a `TypeError` if the object contains an invalid type or parameter names.
|
78
|
+
|
79
|
+
## License
|
80
|
+
|
81
|
+
[MIT](LICENSE)
|
82
|
+
|
83
|
+
[npm-image]: https://img.shields.io/npm/v/content-type.svg
|
84
|
+
[npm-url]: https://npmjs.org/package/content-type
|
85
|
+
[node-version-image]: https://img.shields.io/node/v/content-type.svg
|
86
|
+
[node-version-url]: http://nodejs.org/download/
|
87
|
+
[travis-image]: https://img.shields.io/travis/jshttp/content-type/master.svg
|
88
|
+
[travis-url]: https://travis-ci.org/jshttp/content-type
|
89
|
+
[coveralls-image]: https://img.shields.io/coveralls/jshttp/content-type/master.svg
|
90
|
+
[coveralls-url]: https://coveralls.io/r/jshttp/content-type
|
91
|
+
[downloads-image]: https://img.shields.io/npm/dm/content-type.svg
|
92
|
+
[downloads-url]: https://npmjs.org/package/content-type
|