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,176 @@
|
|
1
|
+
/*!
|
2
|
+
* express
|
3
|
+
* Copyright(c) 2009-2013 TJ Holowaychuk
|
4
|
+
* Copyright(c) 2013 Roman Shtylman
|
5
|
+
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
6
|
+
* MIT Licensed
|
7
|
+
*/
|
8
|
+
|
9
|
+
'use strict';
|
10
|
+
|
11
|
+
/**
|
12
|
+
* Module dependencies.
|
13
|
+
* @private
|
14
|
+
*/
|
15
|
+
|
16
|
+
var pathRegexp = require('path-to-regexp');
|
17
|
+
var debug = require('debug')('express:router:layer');
|
18
|
+
|
19
|
+
/**
|
20
|
+
* Module variables.
|
21
|
+
* @private
|
22
|
+
*/
|
23
|
+
|
24
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
25
|
+
|
26
|
+
/**
|
27
|
+
* Module exports.
|
28
|
+
* @public
|
29
|
+
*/
|
30
|
+
|
31
|
+
module.exports = Layer;
|
32
|
+
|
33
|
+
function Layer(path, options, fn) {
|
34
|
+
if (!(this instanceof Layer)) {
|
35
|
+
return new Layer(path, options, fn);
|
36
|
+
}
|
37
|
+
|
38
|
+
debug('new %s', path);
|
39
|
+
var opts = options || {};
|
40
|
+
|
41
|
+
this.handle = fn;
|
42
|
+
this.name = fn.name || '<anonymous>';
|
43
|
+
this.params = undefined;
|
44
|
+
this.path = undefined;
|
45
|
+
this.regexp = pathRegexp(path, this.keys = [], opts);
|
46
|
+
|
47
|
+
if (path === '/' && opts.end === false) {
|
48
|
+
this.regexp.fast_slash = true;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
/**
|
53
|
+
* Handle the error for the layer.
|
54
|
+
*
|
55
|
+
* @param {Error} error
|
56
|
+
* @param {Request} req
|
57
|
+
* @param {Response} res
|
58
|
+
* @param {function} next
|
59
|
+
* @api private
|
60
|
+
*/
|
61
|
+
|
62
|
+
Layer.prototype.handle_error = function handle_error(error, req, res, next) {
|
63
|
+
var fn = this.handle;
|
64
|
+
|
65
|
+
if (fn.length !== 4) {
|
66
|
+
// not a standard error handler
|
67
|
+
return next(error);
|
68
|
+
}
|
69
|
+
|
70
|
+
try {
|
71
|
+
fn(error, req, res, next);
|
72
|
+
} catch (err) {
|
73
|
+
next(err);
|
74
|
+
}
|
75
|
+
};
|
76
|
+
|
77
|
+
/**
|
78
|
+
* Handle the request for the layer.
|
79
|
+
*
|
80
|
+
* @param {Request} req
|
81
|
+
* @param {Response} res
|
82
|
+
* @param {function} next
|
83
|
+
* @api private
|
84
|
+
*/
|
85
|
+
|
86
|
+
Layer.prototype.handle_request = function handle(req, res, next) {
|
87
|
+
var fn = this.handle;
|
88
|
+
|
89
|
+
if (fn.length > 3) {
|
90
|
+
// not a standard request handler
|
91
|
+
return next();
|
92
|
+
}
|
93
|
+
|
94
|
+
try {
|
95
|
+
fn(req, res, next);
|
96
|
+
} catch (err) {
|
97
|
+
next(err);
|
98
|
+
}
|
99
|
+
};
|
100
|
+
|
101
|
+
/**
|
102
|
+
* Check if this route matches `path`, if so
|
103
|
+
* populate `.params`.
|
104
|
+
*
|
105
|
+
* @param {String} path
|
106
|
+
* @return {Boolean}
|
107
|
+
* @api private
|
108
|
+
*/
|
109
|
+
|
110
|
+
Layer.prototype.match = function match(path) {
|
111
|
+
if (path == null) {
|
112
|
+
// no path, nothing matches
|
113
|
+
this.params = undefined;
|
114
|
+
this.path = undefined;
|
115
|
+
return false;
|
116
|
+
}
|
117
|
+
|
118
|
+
if (this.regexp.fast_slash) {
|
119
|
+
// fast path non-ending match for / (everything matches)
|
120
|
+
this.params = {};
|
121
|
+
this.path = '';
|
122
|
+
return true;
|
123
|
+
}
|
124
|
+
|
125
|
+
var m = this.regexp.exec(path);
|
126
|
+
|
127
|
+
if (!m) {
|
128
|
+
this.params = undefined;
|
129
|
+
this.path = undefined;
|
130
|
+
return false;
|
131
|
+
}
|
132
|
+
|
133
|
+
// store values
|
134
|
+
this.params = {};
|
135
|
+
this.path = m[0];
|
136
|
+
|
137
|
+
var keys = this.keys;
|
138
|
+
var params = this.params;
|
139
|
+
|
140
|
+
for (var i = 1; i < m.length; i++) {
|
141
|
+
var key = keys[i - 1];
|
142
|
+
var prop = key.name;
|
143
|
+
var val = decode_param(m[i]);
|
144
|
+
|
145
|
+
if (val !== undefined || !(hasOwnProperty.call(params, prop))) {
|
146
|
+
params[prop] = val;
|
147
|
+
}
|
148
|
+
}
|
149
|
+
|
150
|
+
return true;
|
151
|
+
};
|
152
|
+
|
153
|
+
/**
|
154
|
+
* Decode param value.
|
155
|
+
*
|
156
|
+
* @param {string} val
|
157
|
+
* @return {string}
|
158
|
+
* @private
|
159
|
+
*/
|
160
|
+
|
161
|
+
function decode_param(val) {
|
162
|
+
if (typeof val !== 'string' || val.length === 0) {
|
163
|
+
return val;
|
164
|
+
}
|
165
|
+
|
166
|
+
try {
|
167
|
+
return decodeURIComponent(val);
|
168
|
+
} catch (err) {
|
169
|
+
if (err instanceof URIError) {
|
170
|
+
err.message = 'Failed to decode param \'' + val + '\'';
|
171
|
+
err.status = err.statusCode = 400;
|
172
|
+
}
|
173
|
+
|
174
|
+
throw err;
|
175
|
+
}
|
176
|
+
}
|
@@ -0,0 +1,210 @@
|
|
1
|
+
/*!
|
2
|
+
* express
|
3
|
+
* Copyright(c) 2009-2013 TJ Holowaychuk
|
4
|
+
* Copyright(c) 2013 Roman Shtylman
|
5
|
+
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
6
|
+
* MIT Licensed
|
7
|
+
*/
|
8
|
+
|
9
|
+
'use strict';
|
10
|
+
|
11
|
+
/**
|
12
|
+
* Module dependencies.
|
13
|
+
* @private
|
14
|
+
*/
|
15
|
+
|
16
|
+
var debug = require('debug')('express:router:route');
|
17
|
+
var flatten = require('array-flatten');
|
18
|
+
var Layer = require('./layer');
|
19
|
+
var methods = require('methods');
|
20
|
+
|
21
|
+
/**
|
22
|
+
* Module variables.
|
23
|
+
* @private
|
24
|
+
*/
|
25
|
+
|
26
|
+
var slice = Array.prototype.slice;
|
27
|
+
var toString = Object.prototype.toString;
|
28
|
+
|
29
|
+
/**
|
30
|
+
* Module exports.
|
31
|
+
* @public
|
32
|
+
*/
|
33
|
+
|
34
|
+
module.exports = Route;
|
35
|
+
|
36
|
+
/**
|
37
|
+
* Initialize `Route` with the given `path`,
|
38
|
+
*
|
39
|
+
* @param {String} path
|
40
|
+
* @public
|
41
|
+
*/
|
42
|
+
|
43
|
+
function Route(path) {
|
44
|
+
this.path = path;
|
45
|
+
this.stack = [];
|
46
|
+
|
47
|
+
debug('new %s', path);
|
48
|
+
|
49
|
+
// route handlers for various http methods
|
50
|
+
this.methods = {};
|
51
|
+
}
|
52
|
+
|
53
|
+
/**
|
54
|
+
* Determine if the route handles a given method.
|
55
|
+
* @private
|
56
|
+
*/
|
57
|
+
|
58
|
+
Route.prototype._handles_method = function _handles_method(method) {
|
59
|
+
if (this.methods._all) {
|
60
|
+
return true;
|
61
|
+
}
|
62
|
+
|
63
|
+
var name = method.toLowerCase();
|
64
|
+
|
65
|
+
if (name === 'head' && !this.methods['head']) {
|
66
|
+
name = 'get';
|
67
|
+
}
|
68
|
+
|
69
|
+
return Boolean(this.methods[name]);
|
70
|
+
};
|
71
|
+
|
72
|
+
/**
|
73
|
+
* @return {Array} supported HTTP methods
|
74
|
+
* @private
|
75
|
+
*/
|
76
|
+
|
77
|
+
Route.prototype._options = function _options() {
|
78
|
+
var methods = Object.keys(this.methods);
|
79
|
+
|
80
|
+
// append automatic head
|
81
|
+
if (this.methods.get && !this.methods.head) {
|
82
|
+
methods.push('head');
|
83
|
+
}
|
84
|
+
|
85
|
+
for (var i = 0; i < methods.length; i++) {
|
86
|
+
// make upper case
|
87
|
+
methods[i] = methods[i].toUpperCase();
|
88
|
+
}
|
89
|
+
|
90
|
+
return methods;
|
91
|
+
};
|
92
|
+
|
93
|
+
/**
|
94
|
+
* dispatch req, res into this route
|
95
|
+
* @private
|
96
|
+
*/
|
97
|
+
|
98
|
+
Route.prototype.dispatch = function dispatch(req, res, done) {
|
99
|
+
var idx = 0;
|
100
|
+
var stack = this.stack;
|
101
|
+
if (stack.length === 0) {
|
102
|
+
return done();
|
103
|
+
}
|
104
|
+
|
105
|
+
var method = req.method.toLowerCase();
|
106
|
+
if (method === 'head' && !this.methods['head']) {
|
107
|
+
method = 'get';
|
108
|
+
}
|
109
|
+
|
110
|
+
req.route = this;
|
111
|
+
|
112
|
+
next();
|
113
|
+
|
114
|
+
function next(err) {
|
115
|
+
if (err && err === 'route') {
|
116
|
+
return done();
|
117
|
+
}
|
118
|
+
|
119
|
+
var layer = stack[idx++];
|
120
|
+
if (!layer) {
|
121
|
+
return done(err);
|
122
|
+
}
|
123
|
+
|
124
|
+
if (layer.method && layer.method !== method) {
|
125
|
+
return next(err);
|
126
|
+
}
|
127
|
+
|
128
|
+
if (err) {
|
129
|
+
layer.handle_error(err, req, res, next);
|
130
|
+
} else {
|
131
|
+
layer.handle_request(req, res, next);
|
132
|
+
}
|
133
|
+
}
|
134
|
+
};
|
135
|
+
|
136
|
+
/**
|
137
|
+
* Add a handler for all HTTP verbs to this route.
|
138
|
+
*
|
139
|
+
* Behaves just like middleware and can respond or call `next`
|
140
|
+
* to continue processing.
|
141
|
+
*
|
142
|
+
* You can use multiple `.all` call to add multiple handlers.
|
143
|
+
*
|
144
|
+
* function check_something(req, res, next){
|
145
|
+
* next();
|
146
|
+
* };
|
147
|
+
*
|
148
|
+
* function validate_user(req, res, next){
|
149
|
+
* next();
|
150
|
+
* };
|
151
|
+
*
|
152
|
+
* route
|
153
|
+
* .all(validate_user)
|
154
|
+
* .all(check_something)
|
155
|
+
* .get(function(req, res, next){
|
156
|
+
* res.send('hello world');
|
157
|
+
* });
|
158
|
+
*
|
159
|
+
* @param {function} handler
|
160
|
+
* @return {Route} for chaining
|
161
|
+
* @api public
|
162
|
+
*/
|
163
|
+
|
164
|
+
Route.prototype.all = function all() {
|
165
|
+
var handles = flatten(slice.call(arguments));
|
166
|
+
|
167
|
+
for (var i = 0; i < handles.length; i++) {
|
168
|
+
var handle = handles[i];
|
169
|
+
|
170
|
+
if (typeof handle !== 'function') {
|
171
|
+
var type = toString.call(handle);
|
172
|
+
var msg = 'Route.all() requires callback functions but got a ' + type;
|
173
|
+
throw new TypeError(msg);
|
174
|
+
}
|
175
|
+
|
176
|
+
var layer = Layer('/', {}, handle);
|
177
|
+
layer.method = undefined;
|
178
|
+
|
179
|
+
this.methods._all = true;
|
180
|
+
this.stack.push(layer);
|
181
|
+
}
|
182
|
+
|
183
|
+
return this;
|
184
|
+
};
|
185
|
+
|
186
|
+
methods.forEach(function(method){
|
187
|
+
Route.prototype[method] = function(){
|
188
|
+
var handles = flatten(slice.call(arguments));
|
189
|
+
|
190
|
+
for (var i = 0; i < handles.length; i++) {
|
191
|
+
var handle = handles[i];
|
192
|
+
|
193
|
+
if (typeof handle !== 'function') {
|
194
|
+
var type = toString.call(handle);
|
195
|
+
var msg = 'Route.' + method + '() requires callback functions but got a ' + type;
|
196
|
+
throw new Error(msg);
|
197
|
+
}
|
198
|
+
|
199
|
+
debug('%s %s', method, this.path);
|
200
|
+
|
201
|
+
var layer = Layer('/', {}, handle);
|
202
|
+
layer.method = method;
|
203
|
+
|
204
|
+
this.methods[method] = true;
|
205
|
+
this.stack.push(layer);
|
206
|
+
}
|
207
|
+
|
208
|
+
return this;
|
209
|
+
};
|
210
|
+
});
|
@@ -0,0 +1,300 @@
|
|
1
|
+
/*!
|
2
|
+
* express
|
3
|
+
* Copyright(c) 2009-2013 TJ Holowaychuk
|
4
|
+
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
5
|
+
* MIT Licensed
|
6
|
+
*/
|
7
|
+
|
8
|
+
'use strict';
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Module dependencies.
|
12
|
+
* @api private
|
13
|
+
*/
|
14
|
+
|
15
|
+
var contentDisposition = require('content-disposition');
|
16
|
+
var contentType = require('content-type');
|
17
|
+
var deprecate = require('depd')('express');
|
18
|
+
var flatten = require('array-flatten');
|
19
|
+
var mime = require('send').mime;
|
20
|
+
var basename = require('path').basename;
|
21
|
+
var etag = require('etag');
|
22
|
+
var proxyaddr = require('proxy-addr');
|
23
|
+
var qs = require('qs');
|
24
|
+
var querystring = require('querystring');
|
25
|
+
|
26
|
+
/**
|
27
|
+
* Return strong ETag for `body`.
|
28
|
+
*
|
29
|
+
* @param {String|Buffer} body
|
30
|
+
* @param {String} [encoding]
|
31
|
+
* @return {String}
|
32
|
+
* @api private
|
33
|
+
*/
|
34
|
+
|
35
|
+
exports.etag = function (body, encoding) {
|
36
|
+
var buf = !Buffer.isBuffer(body)
|
37
|
+
? new Buffer(body, encoding)
|
38
|
+
: body;
|
39
|
+
|
40
|
+
return etag(buf, {weak: false});
|
41
|
+
};
|
42
|
+
|
43
|
+
/**
|
44
|
+
* Return weak ETag for `body`.
|
45
|
+
*
|
46
|
+
* @param {String|Buffer} body
|
47
|
+
* @param {String} [encoding]
|
48
|
+
* @return {String}
|
49
|
+
* @api private
|
50
|
+
*/
|
51
|
+
|
52
|
+
exports.wetag = function wetag(body, encoding){
|
53
|
+
var buf = !Buffer.isBuffer(body)
|
54
|
+
? new Buffer(body, encoding)
|
55
|
+
: body;
|
56
|
+
|
57
|
+
return etag(buf, {weak: true});
|
58
|
+
};
|
59
|
+
|
60
|
+
/**
|
61
|
+
* Check if `path` looks absolute.
|
62
|
+
*
|
63
|
+
* @param {String} path
|
64
|
+
* @return {Boolean}
|
65
|
+
* @api private
|
66
|
+
*/
|
67
|
+
|
68
|
+
exports.isAbsolute = function(path){
|
69
|
+
if ('/' == path[0]) return true;
|
70
|
+
if (':' == path[1] && '\\' == path[2]) return true;
|
71
|
+
if ('\\\\' == path.substring(0, 2)) return true; // Microsoft Azure absolute path
|
72
|
+
};
|
73
|
+
|
74
|
+
/**
|
75
|
+
* Flatten the given `arr`.
|
76
|
+
*
|
77
|
+
* @param {Array} arr
|
78
|
+
* @return {Array}
|
79
|
+
* @api private
|
80
|
+
*/
|
81
|
+
|
82
|
+
exports.flatten = deprecate.function(flatten,
|
83
|
+
'utils.flatten: use array-flatten npm module instead');
|
84
|
+
|
85
|
+
/**
|
86
|
+
* Normalize the given `type`, for example "html" becomes "text/html".
|
87
|
+
*
|
88
|
+
* @param {String} type
|
89
|
+
* @return {Object}
|
90
|
+
* @api private
|
91
|
+
*/
|
92
|
+
|
93
|
+
exports.normalizeType = function(type){
|
94
|
+
return ~type.indexOf('/')
|
95
|
+
? acceptParams(type)
|
96
|
+
: { value: mime.lookup(type), params: {} };
|
97
|
+
};
|
98
|
+
|
99
|
+
/**
|
100
|
+
* Normalize `types`, for example "html" becomes "text/html".
|
101
|
+
*
|
102
|
+
* @param {Array} types
|
103
|
+
* @return {Array}
|
104
|
+
* @api private
|
105
|
+
*/
|
106
|
+
|
107
|
+
exports.normalizeTypes = function(types){
|
108
|
+
var ret = [];
|
109
|
+
|
110
|
+
for (var i = 0; i < types.length; ++i) {
|
111
|
+
ret.push(exports.normalizeType(types[i]));
|
112
|
+
}
|
113
|
+
|
114
|
+
return ret;
|
115
|
+
};
|
116
|
+
|
117
|
+
/**
|
118
|
+
* Generate Content-Disposition header appropriate for the filename.
|
119
|
+
* non-ascii filenames are urlencoded and a filename* parameter is added
|
120
|
+
*
|
121
|
+
* @param {String} filename
|
122
|
+
* @return {String}
|
123
|
+
* @api private
|
124
|
+
*/
|
125
|
+
|
126
|
+
exports.contentDisposition = deprecate.function(contentDisposition,
|
127
|
+
'utils.contentDisposition: use content-disposition npm module instead');
|
128
|
+
|
129
|
+
/**
|
130
|
+
* Parse accept params `str` returning an
|
131
|
+
* object with `.value`, `.quality` and `.params`.
|
132
|
+
* also includes `.originalIndex` for stable sorting
|
133
|
+
*
|
134
|
+
* @param {String} str
|
135
|
+
* @return {Object}
|
136
|
+
* @api private
|
137
|
+
*/
|
138
|
+
|
139
|
+
function acceptParams(str, index) {
|
140
|
+
var parts = str.split(/ *; */);
|
141
|
+
var ret = { value: parts[0], quality: 1, params: {}, originalIndex: index };
|
142
|
+
|
143
|
+
for (var i = 1; i < parts.length; ++i) {
|
144
|
+
var pms = parts[i].split(/ *= */);
|
145
|
+
if ('q' == pms[0]) {
|
146
|
+
ret.quality = parseFloat(pms[1]);
|
147
|
+
} else {
|
148
|
+
ret.params[pms[0]] = pms[1];
|
149
|
+
}
|
150
|
+
}
|
151
|
+
|
152
|
+
return ret;
|
153
|
+
}
|
154
|
+
|
155
|
+
/**
|
156
|
+
* Compile "etag" value to function.
|
157
|
+
*
|
158
|
+
* @param {Boolean|String|Function} val
|
159
|
+
* @return {Function}
|
160
|
+
* @api private
|
161
|
+
*/
|
162
|
+
|
163
|
+
exports.compileETag = function(val) {
|
164
|
+
var fn;
|
165
|
+
|
166
|
+
if (typeof val === 'function') {
|
167
|
+
return val;
|
168
|
+
}
|
169
|
+
|
170
|
+
switch (val) {
|
171
|
+
case true:
|
172
|
+
fn = exports.wetag;
|
173
|
+
break;
|
174
|
+
case false:
|
175
|
+
break;
|
176
|
+
case 'strong':
|
177
|
+
fn = exports.etag;
|
178
|
+
break;
|
179
|
+
case 'weak':
|
180
|
+
fn = exports.wetag;
|
181
|
+
break;
|
182
|
+
default:
|
183
|
+
throw new TypeError('unknown value for etag function: ' + val);
|
184
|
+
}
|
185
|
+
|
186
|
+
return fn;
|
187
|
+
}
|
188
|
+
|
189
|
+
/**
|
190
|
+
* Compile "query parser" value to function.
|
191
|
+
*
|
192
|
+
* @param {String|Function} val
|
193
|
+
* @return {Function}
|
194
|
+
* @api private
|
195
|
+
*/
|
196
|
+
|
197
|
+
exports.compileQueryParser = function compileQueryParser(val) {
|
198
|
+
var fn;
|
199
|
+
|
200
|
+
if (typeof val === 'function') {
|
201
|
+
return val;
|
202
|
+
}
|
203
|
+
|
204
|
+
switch (val) {
|
205
|
+
case true:
|
206
|
+
fn = querystring.parse;
|
207
|
+
break;
|
208
|
+
case false:
|
209
|
+
fn = newObject;
|
210
|
+
break;
|
211
|
+
case 'extended':
|
212
|
+
fn = parseExtendedQueryString;
|
213
|
+
break;
|
214
|
+
case 'simple':
|
215
|
+
fn = querystring.parse;
|
216
|
+
break;
|
217
|
+
default:
|
218
|
+
throw new TypeError('unknown value for query parser function: ' + val);
|
219
|
+
}
|
220
|
+
|
221
|
+
return fn;
|
222
|
+
}
|
223
|
+
|
224
|
+
/**
|
225
|
+
* Compile "proxy trust" value to function.
|
226
|
+
*
|
227
|
+
* @param {Boolean|String|Number|Array|Function} val
|
228
|
+
* @return {Function}
|
229
|
+
* @api private
|
230
|
+
*/
|
231
|
+
|
232
|
+
exports.compileTrust = function(val) {
|
233
|
+
if (typeof val === 'function') return val;
|
234
|
+
|
235
|
+
if (val === true) {
|
236
|
+
// Support plain true/false
|
237
|
+
return function(){ return true };
|
238
|
+
}
|
239
|
+
|
240
|
+
if (typeof val === 'number') {
|
241
|
+
// Support trusting hop count
|
242
|
+
return function(a, i){ return i < val };
|
243
|
+
}
|
244
|
+
|
245
|
+
if (typeof val === 'string') {
|
246
|
+
// Support comma-separated values
|
247
|
+
val = val.split(/ *, */);
|
248
|
+
}
|
249
|
+
|
250
|
+
return proxyaddr.compile(val || []);
|
251
|
+
}
|
252
|
+
|
253
|
+
/**
|
254
|
+
* Set the charset in a given Content-Type string.
|
255
|
+
*
|
256
|
+
* @param {String} type
|
257
|
+
* @param {String} charset
|
258
|
+
* @return {String}
|
259
|
+
* @api private
|
260
|
+
*/
|
261
|
+
|
262
|
+
exports.setCharset = function setCharset(type, charset) {
|
263
|
+
if (!type || !charset) {
|
264
|
+
return type;
|
265
|
+
}
|
266
|
+
|
267
|
+
// parse type
|
268
|
+
var parsed = contentType.parse(type);
|
269
|
+
|
270
|
+
// set charset
|
271
|
+
parsed.parameters.charset = charset;
|
272
|
+
|
273
|
+
// format type
|
274
|
+
return contentType.format(parsed);
|
275
|
+
};
|
276
|
+
|
277
|
+
/**
|
278
|
+
* Parse an extended query string with qs.
|
279
|
+
*
|
280
|
+
* @return {Object}
|
281
|
+
* @private
|
282
|
+
*/
|
283
|
+
|
284
|
+
function parseExtendedQueryString(str) {
|
285
|
+
return qs.parse(str, {
|
286
|
+
allowDots: false,
|
287
|
+
allowPrototypes: true
|
288
|
+
});
|
289
|
+
}
|
290
|
+
|
291
|
+
/**
|
292
|
+
* Return new empty object.
|
293
|
+
*
|
294
|
+
* @return {Object}
|
295
|
+
* @api private
|
296
|
+
*/
|
297
|
+
|
298
|
+
function newObject() {
|
299
|
+
return {};
|
300
|
+
}
|