@umijs/bundler-webpack 3.5.18 → 4.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/bin/bundler-webpack.js +1 -2
- package/client/client/client.js +202 -0
- package/client/constants.js +12 -0
- package/client/utils/formatWebpackMessages.js +92 -0
- package/compiled/@svgr/webpack/LICENSE +7 -0
- package/compiled/@svgr/webpack/index.js +266 -0
- package/compiled/@svgr/webpack/package.json +1 -0
- package/compiled/autoprefixer/LICENSE +20 -0
- package/compiled/autoprefixer/browserslist/index.d.ts +172 -0
- package/compiled/autoprefixer/index.js +9 -0
- package/compiled/autoprefixer/lib/autoprefixer.d.ts +95 -0
- package/compiled/autoprefixer/package.json +1 -0
- package/compiled/autoprefixer/postcss/lib/at-rule.d.ts +106 -0
- package/compiled/autoprefixer/postcss/lib/comment.d.ts +56 -0
- package/compiled/autoprefixer/postcss/lib/container.d.ts +442 -0
- package/compiled/autoprefixer/postcss/lib/css-syntax-error.d.ts +192 -0
- package/compiled/autoprefixer/postcss/lib/declaration.d.ts +124 -0
- package/compiled/autoprefixer/postcss/lib/document.d.ts +57 -0
- package/compiled/autoprefixer/postcss/lib/input.d.ts +130 -0
- package/compiled/autoprefixer/postcss/lib/lazy-result.d.ts +175 -0
- package/compiled/autoprefixer/postcss/lib/list.d.ts +51 -0
- package/compiled/autoprefixer/postcss/lib/node.d.ts +444 -0
- package/compiled/autoprefixer/postcss/lib/postcss.d.ts +472 -0
- package/compiled/autoprefixer/postcss/lib/previous-map.d.ts +72 -0
- package/compiled/autoprefixer/postcss/lib/processor.d.ts +101 -0
- package/compiled/autoprefixer/postcss/lib/result.d.ts +195 -0
- package/compiled/autoprefixer/postcss/lib/root.d.ts +73 -0
- package/compiled/autoprefixer/postcss/lib/rule.d.ts +104 -0
- package/compiled/autoprefixer/postcss/lib/warning.d.ts +104 -0
- package/compiled/autoprefixer/source-map-js/source-map.d.ts +98 -0
- package/compiled/babel-loader/LICENSE +22 -0
- package/compiled/babel-loader/index.js +3 -0
- package/compiled/babel-loader/package.json +1 -0
- package/compiled/compression/LICENSE +23 -0
- package/compiled/compression/index.js +57 -0
- package/compiled/compression/package.json +1 -0
- package/compiled/connect-history-api-fallback/LICENSE +21 -0
- package/compiled/connect-history-api-fallback/index.js +1 -0
- package/compiled/connect-history-api-fallback/package.json +1 -0
- package/{lib/webpack/plugins/mini-css-extract-plugin → compiled/copy-webpack-plugin}/LICENSE +0 -0
- package/compiled/copy-webpack-plugin/index.js +46 -0
- package/compiled/copy-webpack-plugin/package.json +1 -0
- package/{lib/webpack/plugins/terser-webpack-plugin → compiled/css-loader}/LICENSE +0 -0
- package/compiled/css-loader/api.js +102 -0
- package/compiled/css-loader/getUrl.js +29 -0
- package/compiled/css-loader/index.js +2 -0
- package/compiled/css-loader/noSourceMaps.js +5 -0
- package/compiled/css-loader/package.json +1 -0
- package/compiled/css-loader/sourceMaps.js +22 -0
- package/compiled/css-minimizer-webpack-plugin/LICENSE +20 -0
- package/compiled/css-minimizer-webpack-plugin/index.js +3 -0
- package/compiled/css-minimizer-webpack-plugin/minify.js +72 -0
- package/compiled/css-minimizer-webpack-plugin/package.json +1 -0
- package/compiled/css-minimizer-webpack-plugin/utils.js +166 -0
- package/compiled/cssnano/index.js +192 -0
- package/compiled/cssnano/package.json +1 -0
- package/compiled/express/LICENSE +24 -0
- package/compiled/express/body-parser/index.d.ts +104 -0
- package/compiled/express/connect/index.d.ts +93 -0
- package/compiled/express/express-serve-static-core/index.d.ts +1252 -0
- package/compiled/express/index.d.ts +133 -0
- package/compiled/express/index.js +338 -0
- package/compiled/express/mime/index.d.ts +35 -0
- package/compiled/express/package.json +1 -0
- package/compiled/express/qs/index.d.ts +62 -0
- package/compiled/express/range-parser/index.d.ts +35 -0
- package/compiled/express/serve-static/index.d.ts +108 -0
- package/compiled/http-proxy-middleware/LICENSE +22 -0
- package/compiled/http-proxy-middleware/dist/index.d.ts +4 -0
- package/compiled/http-proxy-middleware/dist/types.d.ts +54 -0
- package/compiled/http-proxy-middleware/http-proxy/index.d.ts +226 -0
- package/compiled/http-proxy-middleware/index.js +66 -0
- package/compiled/http-proxy-middleware/package.json +1 -0
- package/compiled/less/index.js +31 -0
- package/compiled/less/package.json +1 -0
- package/compiled/less-loader/LICENSE +20 -0
- package/compiled/less-loader/index.js +1 -0
- package/compiled/less-loader/package.json +1 -0
- package/compiled/mini-css-extract-plugin/LICENSE +20 -0
- package/{lib/webpack/plugins/mini-css-extract-plugin/src → compiled/mini-css-extract-plugin}/hmr/hotModuleReplacement.js +50 -52
- package/compiled/mini-css-extract-plugin/hmr/normalize-url.js +35 -0
- package/compiled/mini-css-extract-plugin/index.js +11606 -0
- package/compiled/mini-css-extract-plugin/loader-options.json +32 -0
- package/compiled/mini-css-extract-plugin/loader.js +315 -0
- package/compiled/mini-css-extract-plugin/package.json +1 -0
- package/compiled/mini-css-extract-plugin/utils.js +154 -0
- package/compiled/postcss-flexbugs-fixes/LICENSE +20 -0
- package/compiled/postcss-flexbugs-fixes/index.js +1 -0
- package/compiled/postcss-flexbugs-fixes/package.json +1 -0
- package/compiled/postcss-loader/LICENSE +20 -0
- package/compiled/postcss-loader/index.js +1 -0
- package/compiled/postcss-loader/package.json +1 -0
- package/compiled/purgecss-webpack-plugin/LICENSE +21 -0
- package/compiled/purgecss-webpack-plugin/index.js +7781 -0
- package/compiled/purgecss-webpack-plugin/package.json +1 -0
- package/compiled/react-refresh/index.js +19 -0
- package/compiled/sass-loader/LICENSE +20 -0
- package/compiled/sass-loader/index.js +1 -0
- package/compiled/sass-loader/package.json +1 -0
- package/compiled/schema-utils/LICENSE +20 -0
- package/compiled/schema-utils/ajv/lib/ajv.d.ts +397 -0
- package/compiled/schema-utils/declarations/ValidationError.d.ts +74 -0
- package/compiled/schema-utils/declarations/index.d.ts +3 -0
- package/compiled/schema-utils/declarations/validate.d.ts +37 -0
- package/compiled/schema-utils/index.js +3 -0
- package/compiled/schema-utils/json-schema/index.d.ts +751 -0
- package/compiled/schema-utils/package.json +1 -0
- package/compiled/speed-measure-webpack-plugin/LICENSE +21 -0
- package/compiled/speed-measure-webpack-plugin/index.js +1 -0
- package/compiled/speed-measure-webpack-plugin/package.json +1 -0
- package/compiled/style-loader/LICENSE +20 -0
- package/compiled/style-loader/index.js +1 -0
- package/compiled/style-loader/package.json +1 -0
- package/compiled/style-loader/runtime/injectStylesIntoLinkTag.js +29 -0
- package/compiled/style-loader/runtime/injectStylesIntoStyleTag.js +104 -0
- package/compiled/style-loader/runtime/insertBySelector.js +39 -0
- package/compiled/style-loader/runtime/insertStyleElement.js +11 -0
- package/compiled/style-loader/runtime/isEqualLocals.js +35 -0
- package/compiled/style-loader/runtime/isOldIE.js +19 -0
- package/compiled/style-loader/runtime/setAttributesWithAttributes.js +16 -0
- package/compiled/style-loader/runtime/setAttributesWithAttributesAndNonce.js +10 -0
- package/compiled/style-loader/runtime/setAttributesWithoutAttributes.js +12 -0
- package/compiled/style-loader/runtime/singletonStyleDomAPI.js +93 -0
- package/compiled/style-loader/runtime/styleDomAPI.js +70 -0
- package/compiled/style-loader/runtime/styleTagTransform.js +16 -0
- package/compiled/svgo-loader/LICENSE +22 -0
- package/compiled/svgo-loader/index.js +4 -0
- package/compiled/svgo-loader/package.json +1 -0
- package/compiled/swc-loader/LICENSE +25 -0
- package/compiled/swc-loader/index.js +1 -0
- package/compiled/swc-loader/package.json +1 -0
- package/compiled/tapable/LICENSE +21 -0
- package/compiled/tapable/index.js +1 -0
- package/compiled/tapable/package.json +1 -0
- package/compiled/tapable/tapable.d.ts +116 -0
- package/compiled/terser/LICENSE +29 -0
- package/compiled/terser/index.js +1 -0
- package/compiled/terser/mappings.wasm +0 -0
- package/compiled/terser/package.json +1 -0
- package/compiled/terser/source-map/source-map.d.ts +369 -0
- package/compiled/terser/tools/terser.d.ts +207 -0
- package/compiled/terser-webpack-plugin/LICENSE +20 -0
- package/compiled/terser-webpack-plugin/ajv/lib/ajv.d.ts +397 -0
- package/compiled/terser-webpack-plugin/index.js +15142 -0
- package/compiled/terser-webpack-plugin/jest-worker/build/index.d.ts +49 -0
- package/compiled/terser-webpack-plugin/jest-worker/build/types.d.ts +142 -0
- package/compiled/terser-webpack-plugin/json-schema/index.d.ts +751 -0
- package/compiled/terser-webpack-plugin/minify.js +43 -0
- package/compiled/terser-webpack-plugin/package.json +1 -0
- package/compiled/terser-webpack-plugin/schema-utils/declarations/ValidationError.d.ts +74 -0
- package/compiled/terser-webpack-plugin/schema-utils/declarations/index.d.ts +3 -0
- package/compiled/terser-webpack-plugin/schema-utils/declarations/validate.d.ts +37 -0
- package/compiled/terser-webpack-plugin/source-map/source-map.d.ts +98 -0
- package/compiled/terser-webpack-plugin/types/cjs.d.ts +3 -0
- package/compiled/terser-webpack-plugin/types/index.d.ts +295 -0
- package/compiled/terser-webpack-plugin/types/utils.d.ts +105 -0
- package/compiled/terser-webpack-plugin/utils.js +594 -0
- package/compiled/url-loader/LICENSE +20 -0
- package/compiled/url-loader/index.js +15 -0
- package/compiled/url-loader/package.json +1 -0
- package/compiled/webpack/Chunk.js +1 -0
- package/compiled/webpack/Compilation.js +1 -0
- package/compiled/webpack/HotModuleReplacement.runtime.js +394 -0
- package/compiled/webpack/JavascriptHotModuleReplacement.runtime.js +462 -0
- package/compiled/webpack/LICENSE +20 -0
- package/compiled/webpack/LibraryTemplatePlugin.js +1 -0
- package/compiled/webpack/LoaderTargetPlugin.js +1 -0
- package/compiled/webpack/ModuleFilenameHelpers.js +1 -0
- package/compiled/webpack/NormalModule.js +1 -0
- package/compiled/webpack/RuntimeGlobals.js +1 -0
- package/compiled/webpack/RuntimeModule.js +1 -0
- package/compiled/webpack/SingleEntryPlugin.js +1 -0
- package/compiled/webpack/Template.js +1 -0
- package/compiled/webpack/ajv/lib/ajv.d.ts +397 -0
- package/compiled/webpack/deepImports.json +12 -0
- package/compiled/webpack/index.js +162861 -0
- package/compiled/webpack/json-schema/index.d.ts +751 -0
- package/compiled/webpack/lazy-compilation-node.js +40 -0
- package/compiled/webpack/lazy-compilation-web.js +74 -0
- package/compiled/webpack/package.json +5 -0
- package/compiled/webpack/schema-utils/declarations/ValidationError.d.ts +74 -0
- package/compiled/webpack/schema-utils/declarations/index.d.ts +3 -0
- package/compiled/webpack/schema-utils/declarations/validate.d.ts +37 -0
- package/compiled/webpack/types.d.ts +12664 -0
- package/compiled/webpack-5-chain/LICENSE +373 -0
- package/compiled/webpack-5-chain/index.js +1 -0
- package/compiled/webpack-5-chain/package.json +1 -0
- package/compiled/webpack-5-chain/types/index.d.ts +543 -0
- package/compiled/webpack-bundle-analyzer/LICENSE +20 -0
- package/compiled/webpack-bundle-analyzer/index.js +30 -0
- package/compiled/webpack-bundle-analyzer/package.json +1 -0
- package/compiled/webpack-bundle-analyzer/public/viewer.js +16 -0
- package/compiled/webpack-bundle-analyzer/public/viewer.js.LICENSE.txt +10 -0
- package/compiled/webpack-bundle-analyzer/public/viewer.js.map +1 -0
- package/compiled/webpack-dev-middleware/LICENSE +20 -0
- package/compiled/webpack-dev-middleware/index.js +21 -0
- package/compiled/webpack-dev-middleware/package.json +1 -0
- package/compiled/webpack-sources/LICENSE +21 -0
- package/compiled/webpack-sources/index.d.ts +20 -0
- package/compiled/webpack-sources/index.js +1 -0
- package/compiled/webpack-sources/lib/CachedSource.d.ts +18 -0
- package/compiled/webpack-sources/lib/CompatSource.d.ts +9 -0
- package/compiled/webpack-sources/lib/ConcatSource.d.ts +22 -0
- package/compiled/webpack-sources/lib/OriginalSource.d.ts +18 -0
- package/compiled/webpack-sources/lib/PrefixSource.d.ts +12 -0
- package/compiled/webpack-sources/lib/RawSource.d.ts +13 -0
- package/compiled/webpack-sources/lib/ReplaceSource.d.ts +35 -0
- package/compiled/webpack-sources/lib/SizeOnlySource.d.ts +7 -0
- package/compiled/webpack-sources/lib/Source.d.ts +45 -0
- package/compiled/webpack-sources/lib/SourceMapSource.d.ts +22 -0
- package/compiled/webpack-sources/lib/index.d.ts +60 -0
- package/compiled/webpack-sources/package.json +1 -0
- package/compiled/webpack-sources/source-list-map/index.d.ts +91 -0
- package/compiled/webpack-sources/source-map/source-map.d.ts +369 -0
- package/compiled/ws/LICENSE +19 -0
- package/compiled/ws/index.d.ts +359 -0
- package/compiled/ws/index.js +1 -0
- package/compiled/ws/package.json +1 -0
- package/dist/build.d.ts +17 -0
- package/dist/build.js +72 -0
- package/{lib → dist}/cli.d.ts +0 -0
- package/dist/cli.js +93 -0
- package/{lib/webpackHotDevClient/webpackHotDevClient.d.ts → dist/client/client.d.ts} +0 -0
- package/dist/client/client.js +239 -0
- package/dist/config/_sampleFeature.d.ts +10 -0
- package/dist/config/_sampleFeature.js +22 -0
- package/dist/config/assetRules.d.ts +11 -0
- package/dist/config/assetRules.js +69 -0
- package/dist/config/bundleAnalyzerPlugin.d.ts +10 -0
- package/dist/config/bundleAnalyzerPlugin.js +30 -0
- package/dist/config/compressPlugin.d.ts +10 -0
- package/dist/config/compressPlugin.js +77 -0
- package/dist/config/config.d.ts +20 -0
- package/dist/config/config.js +178 -0
- package/dist/config/copyPlugin.d.ts +10 -0
- package/dist/config/copyPlugin.js +49 -0
- package/dist/config/cssRules.d.ts +11 -0
- package/dist/config/cssRules.js +98 -0
- package/dist/config/definePlugin.d.ts +15 -0
- package/dist/config/definePlugin.js +45 -0
- package/dist/config/fastRefreshPlugin.d.ts +12 -0
- package/dist/config/fastRefreshPlugin.js +34 -0
- package/dist/config/ignorePlugin.d.ts +10 -0
- package/dist/config/ignorePlugin.js +27 -0
- package/dist/config/javaScriptRules.d.ts +14 -0
- package/dist/config/javaScriptRules.js +155 -0
- package/dist/config/miniCSSExtractPlugin.d.ts +10 -0
- package/dist/config/miniCSSExtractPlugin.js +34 -0
- package/dist/config/nodePolyfill.d.ts +10 -0
- package/dist/config/nodePolyfill.js +34 -0
- package/dist/config/progressPlugin.d.ts +11 -0
- package/dist/config/progressPlugin.js +27 -0
- package/dist/config/purgecssWebpackPlugin.d.ts +10 -0
- package/dist/config/purgecssWebpackPlugin.js +32 -0
- package/dist/config/speedMeasureWebpackPlugin.d.ts +6 -0
- package/dist/config/speedMeasureWebpackPlugin.js +34 -0
- package/dist/config/svgRules.d.ts +11 -0
- package/dist/config/svgRules.js +43 -0
- package/dist/constants.d.ts +11 -0
- package/dist/constants.js +15 -0
- package/dist/dev.d.ts +19 -0
- package/dist/dev.js +87 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +16 -0
- package/dist/plugins/ESBuildCSSMinifyPlugin.d.ts +11 -0
- package/dist/plugins/ESBuildCSSMinifyPlugin.js +65 -0
- package/dist/plugins/ProgressPlugin.d.ts +15 -0
- package/dist/plugins/ProgressPlugin.js +44 -0
- package/dist/plugins/_SamplePlugin.d.ts +9 -0
- package/dist/plugins/_SamplePlugin.js +14 -0
- package/dist/requireHook.d.ts +1 -0
- package/dist/requireHook.js +31 -0
- package/dist/schema.d.ts +3 -0
- package/dist/schema.js +72 -0
- package/dist/server/server.d.ts +16 -0
- package/dist/server/server.js +158 -0
- package/dist/server/ws.d.ts +8 -0
- package/dist/server/ws.js +42 -0
- package/dist/swcPlugins/autoCSSModules.d.ts +8 -0
- package/dist/swcPlugins/autoCSSModules.js +35 -0
- package/dist/types.d.ts +100 -0
- package/dist/types.js +29 -0
- package/dist/utils/browsersList.d.ts +5 -0
- package/dist/utils/browsersList.js +10 -0
- package/dist/utils/depMatch.d.ts +6 -0
- package/dist/utils/depMatch.js +46 -0
- package/dist/utils/formatWebpackMessages.d.ts +12 -0
- package/dist/utils/formatWebpackMessages.js +100 -0
- package/package.json +170 -42
- package/bundled/css/hotModuleReplacement.js +0 -1203
- package/bundled/js/webpackHotDevClient.js +0 -13386
- package/lib/DevCompileDonePlugin.d.ts +0 -10
- package/lib/DevCompileDonePlugin.js +0 -53
- package/lib/cli.js +0 -184
- package/lib/getConfig/css.d.ts +0 -22
- package/lib/getConfig/css.js +0 -186
- package/lib/getConfig/getConfig.d.ts +0 -26
- package/lib/getConfig/getConfig.js +0 -578
- package/lib/getConfig/nodeModulesTransform.d.ts +0 -13
- package/lib/getConfig/nodeModulesTransform.js +0 -141
- package/lib/getConfig/pkgMatch.d.ts +0 -2
- package/lib/getConfig/pkgMatch.js +0 -58
- package/lib/getConfig/resolveDefine.d.ts +0 -5
- package/lib/getConfig/resolveDefine.js +0 -53
- package/lib/getConfig/runtimePublicPathEntry.d.ts +0 -1
- package/lib/getConfig/runtimePublicPathEntry.js +0 -3
- package/lib/getConfig/terserOptions.d.ts +0 -41
- package/lib/getConfig/terserOptions.js +0 -64
- package/lib/index.d.ts +0 -34
- package/lib/index.js +0 -314
- package/lib/requireHook.d.ts +0 -3
- package/lib/requireHook.js +0 -51
- package/lib/webpack/plugins/mini-css-extract-plugin/src/CssDependency.js +0 -94
- package/lib/webpack/plugins/mini-css-extract-plugin/src/CssDependencyTemplate.js +0 -26
- package/lib/webpack/plugins/mini-css-extract-plugin/src/CssLoadingRuntimeModule.js +0 -93
- package/lib/webpack/plugins/mini-css-extract-plugin/src/CssModule.js +0 -164
- package/lib/webpack/plugins/mini-css-extract-plugin/src/CssModuleFactory.js +0 -32
- package/lib/webpack/plugins/mini-css-extract-plugin/src/cjs.js +0 -15
- package/lib/webpack/plugins/mini-css-extract-plugin/src/index.js +0 -542
- package/lib/webpack/plugins/mini-css-extract-plugin/src/loader.js +0 -319
- package/lib/webpack/plugins/mini-css-extract-plugin/src/utils.js +0 -97
- package/lib/webpack/plugins/mini-css-extract-plugin.d.ts +0 -1
- package/lib/webpack/plugins/mini-css-extract-plugin.js +0 -15
- package/lib/webpack/plugins/terser-webpack-plugin/package.json +0 -3
- package/lib/webpack/plugins/terser-webpack-plugin/src/Webpack4Cache.js +0 -187
- package/lib/webpack/plugins/terser-webpack-plugin/src/Webpack5Cache.js +0 -61
- package/lib/webpack/plugins/terser-webpack-plugin/src/index.js +0 -683
- package/lib/webpack/plugins/terser-webpack-plugin/src/minify.js +0 -197
- package/lib/webpack/plugins/terser-webpack-plugin.d.ts +0 -1
- package/lib/webpack/plugins/terser-webpack-plugin.js +0 -15
- package/lib/webpackHotDevClient/formatWebpackMessages.d.ts +0 -11
- package/lib/webpackHotDevClient/formatWebpackMessages.js +0 -127
- package/lib/webpackHotDevClient/webpackHotDevClient.js +0 -311
|
@@ -1,1203 +0,0 @@
|
|
|
1
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
2
|
-
return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
3
|
-
};
|
|
4
|
-
|
|
5
|
-
// ../../node_modules/url/util.js
|
|
6
|
-
var require_util = __commonJS({
|
|
7
|
-
"../../node_modules/url/util.js"(exports2, module2) {
|
|
8
|
-
"use strict";
|
|
9
|
-
module2.exports = {
|
|
10
|
-
isString: function(arg) {
|
|
11
|
-
return typeof arg === "string";
|
|
12
|
-
},
|
|
13
|
-
isObject: function(arg) {
|
|
14
|
-
return typeof arg === "object" && arg !== null;
|
|
15
|
-
},
|
|
16
|
-
isNull: function(arg) {
|
|
17
|
-
return arg === null;
|
|
18
|
-
},
|
|
19
|
-
isNullOrUndefined: function(arg) {
|
|
20
|
-
return arg == null;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
// ../../node_modules/url/node_modules/querystring/decode.js
|
|
27
|
-
var require_decode = __commonJS({
|
|
28
|
-
"../../node_modules/url/node_modules/querystring/decode.js"(exports2, module2) {
|
|
29
|
-
"use strict";
|
|
30
|
-
function hasOwnProperty(obj, prop) {
|
|
31
|
-
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
32
|
-
}
|
|
33
|
-
module2.exports = function(qs, sep, eq, options) {
|
|
34
|
-
sep = sep || "&";
|
|
35
|
-
eq = eq || "=";
|
|
36
|
-
var obj = {};
|
|
37
|
-
if (typeof qs !== "string" || qs.length === 0) {
|
|
38
|
-
return obj;
|
|
39
|
-
}
|
|
40
|
-
var regexp = /\+/g;
|
|
41
|
-
qs = qs.split(sep);
|
|
42
|
-
var maxKeys = 1e3;
|
|
43
|
-
if (options && typeof options.maxKeys === "number") {
|
|
44
|
-
maxKeys = options.maxKeys;
|
|
45
|
-
}
|
|
46
|
-
var len = qs.length;
|
|
47
|
-
if (maxKeys > 0 && len > maxKeys) {
|
|
48
|
-
len = maxKeys;
|
|
49
|
-
}
|
|
50
|
-
for (var i = 0; i < len; ++i) {
|
|
51
|
-
var x = qs[i].replace(regexp, "%20"), idx = x.indexOf(eq), kstr, vstr, k, v;
|
|
52
|
-
if (idx >= 0) {
|
|
53
|
-
kstr = x.substr(0, idx);
|
|
54
|
-
vstr = x.substr(idx + 1);
|
|
55
|
-
} else {
|
|
56
|
-
kstr = x;
|
|
57
|
-
vstr = "";
|
|
58
|
-
}
|
|
59
|
-
k = decodeURIComponent(kstr);
|
|
60
|
-
v = decodeURIComponent(vstr);
|
|
61
|
-
if (!hasOwnProperty(obj, k)) {
|
|
62
|
-
obj[k] = v;
|
|
63
|
-
} else if (Array.isArray(obj[k])) {
|
|
64
|
-
obj[k].push(v);
|
|
65
|
-
} else {
|
|
66
|
-
obj[k] = [obj[k], v];
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return obj;
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
// ../../node_modules/url/node_modules/querystring/encode.js
|
|
75
|
-
var require_encode = __commonJS({
|
|
76
|
-
"../../node_modules/url/node_modules/querystring/encode.js"(exports2, module2) {
|
|
77
|
-
"use strict";
|
|
78
|
-
var stringifyPrimitive = function(v) {
|
|
79
|
-
switch (typeof v) {
|
|
80
|
-
case "string":
|
|
81
|
-
return v;
|
|
82
|
-
case "boolean":
|
|
83
|
-
return v ? "true" : "false";
|
|
84
|
-
case "number":
|
|
85
|
-
return isFinite(v) ? v : "";
|
|
86
|
-
default:
|
|
87
|
-
return "";
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
module2.exports = function(obj, sep, eq, name) {
|
|
91
|
-
sep = sep || "&";
|
|
92
|
-
eq = eq || "=";
|
|
93
|
-
if (obj === null) {
|
|
94
|
-
obj = void 0;
|
|
95
|
-
}
|
|
96
|
-
if (typeof obj === "object") {
|
|
97
|
-
return Object.keys(obj).map(function(k) {
|
|
98
|
-
var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
|
|
99
|
-
if (Array.isArray(obj[k])) {
|
|
100
|
-
return obj[k].map(function(v) {
|
|
101
|
-
return ks + encodeURIComponent(stringifyPrimitive(v));
|
|
102
|
-
}).join(sep);
|
|
103
|
-
} else {
|
|
104
|
-
return ks + encodeURIComponent(stringifyPrimitive(obj[k]));
|
|
105
|
-
}
|
|
106
|
-
}).join(sep);
|
|
107
|
-
}
|
|
108
|
-
if (!name)
|
|
109
|
-
return "";
|
|
110
|
-
return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj));
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
// ../../node_modules/url/node_modules/querystring/index.js
|
|
116
|
-
var require_querystring = __commonJS({
|
|
117
|
-
"../../node_modules/url/node_modules/querystring/index.js"(exports2) {
|
|
118
|
-
"use strict";
|
|
119
|
-
exports2.decode = exports2.parse = require_decode();
|
|
120
|
-
exports2.encode = exports2.stringify = require_encode();
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
// ../../node_modules/url/url.js
|
|
125
|
-
var require_url = __commonJS({
|
|
126
|
-
"../../node_modules/url/url.js"(exports2) {
|
|
127
|
-
"use strict";
|
|
128
|
-
var punycode = require("punycode");
|
|
129
|
-
var util = require_util();
|
|
130
|
-
exports2.parse = urlParse;
|
|
131
|
-
exports2.resolve = urlResolve;
|
|
132
|
-
exports2.resolveObject = urlResolveObject;
|
|
133
|
-
exports2.format = urlFormat;
|
|
134
|
-
exports2.Url = Url;
|
|
135
|
-
function Url() {
|
|
136
|
-
this.protocol = null;
|
|
137
|
-
this.slashes = null;
|
|
138
|
-
this.auth = null;
|
|
139
|
-
this.host = null;
|
|
140
|
-
this.port = null;
|
|
141
|
-
this.hostname = null;
|
|
142
|
-
this.hash = null;
|
|
143
|
-
this.search = null;
|
|
144
|
-
this.query = null;
|
|
145
|
-
this.pathname = null;
|
|
146
|
-
this.path = null;
|
|
147
|
-
this.href = null;
|
|
148
|
-
}
|
|
149
|
-
var protocolPattern = /^([a-z0-9.+-]+:)/i;
|
|
150
|
-
var portPattern = /:[0-9]*$/;
|
|
151
|
-
var simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/;
|
|
152
|
-
var delims = ["<", ">", '"', "`", " ", "\r", "\n", " "];
|
|
153
|
-
var unwise = ["{", "}", "|", "\\", "^", "`"].concat(delims);
|
|
154
|
-
var autoEscape = ["'"].concat(unwise);
|
|
155
|
-
var nonHostChars = ["%", "/", "?", ";", "#"].concat(autoEscape);
|
|
156
|
-
var hostEndingChars = ["/", "?", "#"];
|
|
157
|
-
var hostnameMaxLen = 255;
|
|
158
|
-
var hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/;
|
|
159
|
-
var hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/;
|
|
160
|
-
var unsafeProtocol = {
|
|
161
|
-
"javascript": true,
|
|
162
|
-
"javascript:": true
|
|
163
|
-
};
|
|
164
|
-
var hostlessProtocol = {
|
|
165
|
-
"javascript": true,
|
|
166
|
-
"javascript:": true
|
|
167
|
-
};
|
|
168
|
-
var slashedProtocol = {
|
|
169
|
-
"http": true,
|
|
170
|
-
"https": true,
|
|
171
|
-
"ftp": true,
|
|
172
|
-
"gopher": true,
|
|
173
|
-
"file": true,
|
|
174
|
-
"http:": true,
|
|
175
|
-
"https:": true,
|
|
176
|
-
"ftp:": true,
|
|
177
|
-
"gopher:": true,
|
|
178
|
-
"file:": true
|
|
179
|
-
};
|
|
180
|
-
var querystring = require_querystring();
|
|
181
|
-
function urlParse(url, parseQueryString, slashesDenoteHost) {
|
|
182
|
-
if (url && util.isObject(url) && url instanceof Url)
|
|
183
|
-
return url;
|
|
184
|
-
var u = new Url();
|
|
185
|
-
u.parse(url, parseQueryString, slashesDenoteHost);
|
|
186
|
-
return u;
|
|
187
|
-
}
|
|
188
|
-
Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
|
|
189
|
-
if (!util.isString(url)) {
|
|
190
|
-
throw new TypeError("Parameter 'url' must be a string, not " + typeof url);
|
|
191
|
-
}
|
|
192
|
-
var queryIndex = url.indexOf("?"), splitter = queryIndex !== -1 && queryIndex < url.indexOf("#") ? "?" : "#", uSplit = url.split(splitter), slashRegex = /\\/g;
|
|
193
|
-
uSplit[0] = uSplit[0].replace(slashRegex, "/");
|
|
194
|
-
url = uSplit.join(splitter);
|
|
195
|
-
var rest = url;
|
|
196
|
-
rest = rest.trim();
|
|
197
|
-
if (!slashesDenoteHost && url.split("#").length === 1) {
|
|
198
|
-
var simplePath = simplePathPattern.exec(rest);
|
|
199
|
-
if (simplePath) {
|
|
200
|
-
this.path = rest;
|
|
201
|
-
this.href = rest;
|
|
202
|
-
this.pathname = simplePath[1];
|
|
203
|
-
if (simplePath[2]) {
|
|
204
|
-
this.search = simplePath[2];
|
|
205
|
-
if (parseQueryString) {
|
|
206
|
-
this.query = querystring.parse(this.search.substr(1));
|
|
207
|
-
} else {
|
|
208
|
-
this.query = this.search.substr(1);
|
|
209
|
-
}
|
|
210
|
-
} else if (parseQueryString) {
|
|
211
|
-
this.search = "";
|
|
212
|
-
this.query = {};
|
|
213
|
-
}
|
|
214
|
-
return this;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
var proto = protocolPattern.exec(rest);
|
|
218
|
-
if (proto) {
|
|
219
|
-
proto = proto[0];
|
|
220
|
-
var lowerProto = proto.toLowerCase();
|
|
221
|
-
this.protocol = lowerProto;
|
|
222
|
-
rest = rest.substr(proto.length);
|
|
223
|
-
}
|
|
224
|
-
if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
|
|
225
|
-
var slashes = rest.substr(0, 2) === "//";
|
|
226
|
-
if (slashes && !(proto && hostlessProtocol[proto])) {
|
|
227
|
-
rest = rest.substr(2);
|
|
228
|
-
this.slashes = true;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {
|
|
232
|
-
var hostEnd = -1;
|
|
233
|
-
for (var i = 0; i < hostEndingChars.length; i++) {
|
|
234
|
-
var hec = rest.indexOf(hostEndingChars[i]);
|
|
235
|
-
if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
|
|
236
|
-
hostEnd = hec;
|
|
237
|
-
}
|
|
238
|
-
var auth, atSign;
|
|
239
|
-
if (hostEnd === -1) {
|
|
240
|
-
atSign = rest.lastIndexOf("@");
|
|
241
|
-
} else {
|
|
242
|
-
atSign = rest.lastIndexOf("@", hostEnd);
|
|
243
|
-
}
|
|
244
|
-
if (atSign !== -1) {
|
|
245
|
-
auth = rest.slice(0, atSign);
|
|
246
|
-
rest = rest.slice(atSign + 1);
|
|
247
|
-
this.auth = decodeURIComponent(auth);
|
|
248
|
-
}
|
|
249
|
-
hostEnd = -1;
|
|
250
|
-
for (var i = 0; i < nonHostChars.length; i++) {
|
|
251
|
-
var hec = rest.indexOf(nonHostChars[i]);
|
|
252
|
-
if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))
|
|
253
|
-
hostEnd = hec;
|
|
254
|
-
}
|
|
255
|
-
if (hostEnd === -1)
|
|
256
|
-
hostEnd = rest.length;
|
|
257
|
-
this.host = rest.slice(0, hostEnd);
|
|
258
|
-
rest = rest.slice(hostEnd);
|
|
259
|
-
this.parseHost();
|
|
260
|
-
this.hostname = this.hostname || "";
|
|
261
|
-
var ipv6Hostname = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
|
|
262
|
-
if (!ipv6Hostname) {
|
|
263
|
-
var hostparts = this.hostname.split(/\./);
|
|
264
|
-
for (var i = 0, l = hostparts.length; i < l; i++) {
|
|
265
|
-
var part = hostparts[i];
|
|
266
|
-
if (!part)
|
|
267
|
-
continue;
|
|
268
|
-
if (!part.match(hostnamePartPattern)) {
|
|
269
|
-
var newpart = "";
|
|
270
|
-
for (var j = 0, k = part.length; j < k; j++) {
|
|
271
|
-
if (part.charCodeAt(j) > 127) {
|
|
272
|
-
newpart += "x";
|
|
273
|
-
} else {
|
|
274
|
-
newpart += part[j];
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
if (!newpart.match(hostnamePartPattern)) {
|
|
278
|
-
var validParts = hostparts.slice(0, i);
|
|
279
|
-
var notHost = hostparts.slice(i + 1);
|
|
280
|
-
var bit = part.match(hostnamePartStart);
|
|
281
|
-
if (bit) {
|
|
282
|
-
validParts.push(bit[1]);
|
|
283
|
-
notHost.unshift(bit[2]);
|
|
284
|
-
}
|
|
285
|
-
if (notHost.length) {
|
|
286
|
-
rest = "/" + notHost.join(".") + rest;
|
|
287
|
-
}
|
|
288
|
-
this.hostname = validParts.join(".");
|
|
289
|
-
break;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
if (this.hostname.length > hostnameMaxLen) {
|
|
295
|
-
this.hostname = "";
|
|
296
|
-
} else {
|
|
297
|
-
this.hostname = this.hostname.toLowerCase();
|
|
298
|
-
}
|
|
299
|
-
if (!ipv6Hostname) {
|
|
300
|
-
this.hostname = punycode.toASCII(this.hostname);
|
|
301
|
-
}
|
|
302
|
-
var p = this.port ? ":" + this.port : "";
|
|
303
|
-
var h = this.hostname || "";
|
|
304
|
-
this.host = h + p;
|
|
305
|
-
this.href += this.host;
|
|
306
|
-
if (ipv6Hostname) {
|
|
307
|
-
this.hostname = this.hostname.substr(1, this.hostname.length - 2);
|
|
308
|
-
if (rest[0] !== "/") {
|
|
309
|
-
rest = "/" + rest;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
if (!unsafeProtocol[lowerProto]) {
|
|
314
|
-
for (var i = 0, l = autoEscape.length; i < l; i++) {
|
|
315
|
-
var ae = autoEscape[i];
|
|
316
|
-
if (rest.indexOf(ae) === -1)
|
|
317
|
-
continue;
|
|
318
|
-
var esc = encodeURIComponent(ae);
|
|
319
|
-
if (esc === ae) {
|
|
320
|
-
esc = escape(ae);
|
|
321
|
-
}
|
|
322
|
-
rest = rest.split(ae).join(esc);
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
var hash = rest.indexOf("#");
|
|
326
|
-
if (hash !== -1) {
|
|
327
|
-
this.hash = rest.substr(hash);
|
|
328
|
-
rest = rest.slice(0, hash);
|
|
329
|
-
}
|
|
330
|
-
var qm = rest.indexOf("?");
|
|
331
|
-
if (qm !== -1) {
|
|
332
|
-
this.search = rest.substr(qm);
|
|
333
|
-
this.query = rest.substr(qm + 1);
|
|
334
|
-
if (parseQueryString) {
|
|
335
|
-
this.query = querystring.parse(this.query);
|
|
336
|
-
}
|
|
337
|
-
rest = rest.slice(0, qm);
|
|
338
|
-
} else if (parseQueryString) {
|
|
339
|
-
this.search = "";
|
|
340
|
-
this.query = {};
|
|
341
|
-
}
|
|
342
|
-
if (rest)
|
|
343
|
-
this.pathname = rest;
|
|
344
|
-
if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) {
|
|
345
|
-
this.pathname = "/";
|
|
346
|
-
}
|
|
347
|
-
if (this.pathname || this.search) {
|
|
348
|
-
var p = this.pathname || "";
|
|
349
|
-
var s = this.search || "";
|
|
350
|
-
this.path = p + s;
|
|
351
|
-
}
|
|
352
|
-
this.href = this.format();
|
|
353
|
-
return this;
|
|
354
|
-
};
|
|
355
|
-
function urlFormat(obj) {
|
|
356
|
-
if (util.isString(obj))
|
|
357
|
-
obj = urlParse(obj);
|
|
358
|
-
if (!(obj instanceof Url))
|
|
359
|
-
return Url.prototype.format.call(obj);
|
|
360
|
-
return obj.format();
|
|
361
|
-
}
|
|
362
|
-
Url.prototype.format = function() {
|
|
363
|
-
var auth = this.auth || "";
|
|
364
|
-
if (auth) {
|
|
365
|
-
auth = encodeURIComponent(auth);
|
|
366
|
-
auth = auth.replace(/%3A/i, ":");
|
|
367
|
-
auth += "@";
|
|
368
|
-
}
|
|
369
|
-
var protocol = this.protocol || "", pathname = this.pathname || "", hash = this.hash || "", host = false, query = "";
|
|
370
|
-
if (this.host) {
|
|
371
|
-
host = auth + this.host;
|
|
372
|
-
} else if (this.hostname) {
|
|
373
|
-
host = auth + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]");
|
|
374
|
-
if (this.port) {
|
|
375
|
-
host += ":" + this.port;
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
if (this.query && util.isObject(this.query) && Object.keys(this.query).length) {
|
|
379
|
-
query = querystring.stringify(this.query);
|
|
380
|
-
}
|
|
381
|
-
var search = this.search || query && "?" + query || "";
|
|
382
|
-
if (protocol && protocol.substr(-1) !== ":")
|
|
383
|
-
protocol += ":";
|
|
384
|
-
if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== false) {
|
|
385
|
-
host = "//" + (host || "");
|
|
386
|
-
if (pathname && pathname.charAt(0) !== "/")
|
|
387
|
-
pathname = "/" + pathname;
|
|
388
|
-
} else if (!host) {
|
|
389
|
-
host = "";
|
|
390
|
-
}
|
|
391
|
-
if (hash && hash.charAt(0) !== "#")
|
|
392
|
-
hash = "#" + hash;
|
|
393
|
-
if (search && search.charAt(0) !== "?")
|
|
394
|
-
search = "?" + search;
|
|
395
|
-
pathname = pathname.replace(/[?#]/g, function(match) {
|
|
396
|
-
return encodeURIComponent(match);
|
|
397
|
-
});
|
|
398
|
-
search = search.replace("#", "%23");
|
|
399
|
-
return protocol + host + pathname + search + hash;
|
|
400
|
-
};
|
|
401
|
-
function urlResolve(source, relative) {
|
|
402
|
-
return urlParse(source, false, true).resolve(relative);
|
|
403
|
-
}
|
|
404
|
-
Url.prototype.resolve = function(relative) {
|
|
405
|
-
return this.resolveObject(urlParse(relative, false, true)).format();
|
|
406
|
-
};
|
|
407
|
-
function urlResolveObject(source, relative) {
|
|
408
|
-
if (!source)
|
|
409
|
-
return relative;
|
|
410
|
-
return urlParse(source, false, true).resolveObject(relative);
|
|
411
|
-
}
|
|
412
|
-
Url.prototype.resolveObject = function(relative) {
|
|
413
|
-
if (util.isString(relative)) {
|
|
414
|
-
var rel = new Url();
|
|
415
|
-
rel.parse(relative, false, true);
|
|
416
|
-
relative = rel;
|
|
417
|
-
}
|
|
418
|
-
var result = new Url();
|
|
419
|
-
var tkeys = Object.keys(this);
|
|
420
|
-
for (var tk = 0; tk < tkeys.length; tk++) {
|
|
421
|
-
var tkey = tkeys[tk];
|
|
422
|
-
result[tkey] = this[tkey];
|
|
423
|
-
}
|
|
424
|
-
result.hash = relative.hash;
|
|
425
|
-
if (relative.href === "") {
|
|
426
|
-
result.href = result.format();
|
|
427
|
-
return result;
|
|
428
|
-
}
|
|
429
|
-
if (relative.slashes && !relative.protocol) {
|
|
430
|
-
var rkeys = Object.keys(relative);
|
|
431
|
-
for (var rk = 0; rk < rkeys.length; rk++) {
|
|
432
|
-
var rkey = rkeys[rk];
|
|
433
|
-
if (rkey !== "protocol")
|
|
434
|
-
result[rkey] = relative[rkey];
|
|
435
|
-
}
|
|
436
|
-
if (slashedProtocol[result.protocol] && result.hostname && !result.pathname) {
|
|
437
|
-
result.path = result.pathname = "/";
|
|
438
|
-
}
|
|
439
|
-
result.href = result.format();
|
|
440
|
-
return result;
|
|
441
|
-
}
|
|
442
|
-
if (relative.protocol && relative.protocol !== result.protocol) {
|
|
443
|
-
if (!slashedProtocol[relative.protocol]) {
|
|
444
|
-
var keys = Object.keys(relative);
|
|
445
|
-
for (var v = 0; v < keys.length; v++) {
|
|
446
|
-
var k = keys[v];
|
|
447
|
-
result[k] = relative[k];
|
|
448
|
-
}
|
|
449
|
-
result.href = result.format();
|
|
450
|
-
return result;
|
|
451
|
-
}
|
|
452
|
-
result.protocol = relative.protocol;
|
|
453
|
-
if (!relative.host && !hostlessProtocol[relative.protocol]) {
|
|
454
|
-
var relPath = (relative.pathname || "").split("/");
|
|
455
|
-
while (relPath.length && !(relative.host = relPath.shift()))
|
|
456
|
-
;
|
|
457
|
-
if (!relative.host)
|
|
458
|
-
relative.host = "";
|
|
459
|
-
if (!relative.hostname)
|
|
460
|
-
relative.hostname = "";
|
|
461
|
-
if (relPath[0] !== "")
|
|
462
|
-
relPath.unshift("");
|
|
463
|
-
if (relPath.length < 2)
|
|
464
|
-
relPath.unshift("");
|
|
465
|
-
result.pathname = relPath.join("/");
|
|
466
|
-
} else {
|
|
467
|
-
result.pathname = relative.pathname;
|
|
468
|
-
}
|
|
469
|
-
result.search = relative.search;
|
|
470
|
-
result.query = relative.query;
|
|
471
|
-
result.host = relative.host || "";
|
|
472
|
-
result.auth = relative.auth;
|
|
473
|
-
result.hostname = relative.hostname || relative.host;
|
|
474
|
-
result.port = relative.port;
|
|
475
|
-
if (result.pathname || result.search) {
|
|
476
|
-
var p = result.pathname || "";
|
|
477
|
-
var s = result.search || "";
|
|
478
|
-
result.path = p + s;
|
|
479
|
-
}
|
|
480
|
-
result.slashes = result.slashes || relative.slashes;
|
|
481
|
-
result.href = result.format();
|
|
482
|
-
return result;
|
|
483
|
-
}
|
|
484
|
-
var isSourceAbs = result.pathname && result.pathname.charAt(0) === "/", isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === "/", mustEndAbs = isRelAbs || isSourceAbs || result.host && relative.pathname, removeAllDots = mustEndAbs, srcPath = result.pathname && result.pathname.split("/") || [], relPath = relative.pathname && relative.pathname.split("/") || [], psychotic = result.protocol && !slashedProtocol[result.protocol];
|
|
485
|
-
if (psychotic) {
|
|
486
|
-
result.hostname = "";
|
|
487
|
-
result.port = null;
|
|
488
|
-
if (result.host) {
|
|
489
|
-
if (srcPath[0] === "")
|
|
490
|
-
srcPath[0] = result.host;
|
|
491
|
-
else
|
|
492
|
-
srcPath.unshift(result.host);
|
|
493
|
-
}
|
|
494
|
-
result.host = "";
|
|
495
|
-
if (relative.protocol) {
|
|
496
|
-
relative.hostname = null;
|
|
497
|
-
relative.port = null;
|
|
498
|
-
if (relative.host) {
|
|
499
|
-
if (relPath[0] === "")
|
|
500
|
-
relPath[0] = relative.host;
|
|
501
|
-
else
|
|
502
|
-
relPath.unshift(relative.host);
|
|
503
|
-
}
|
|
504
|
-
relative.host = null;
|
|
505
|
-
}
|
|
506
|
-
mustEndAbs = mustEndAbs && (relPath[0] === "" || srcPath[0] === "");
|
|
507
|
-
}
|
|
508
|
-
if (isRelAbs) {
|
|
509
|
-
result.host = relative.host || relative.host === "" ? relative.host : result.host;
|
|
510
|
-
result.hostname = relative.hostname || relative.hostname === "" ? relative.hostname : result.hostname;
|
|
511
|
-
result.search = relative.search;
|
|
512
|
-
result.query = relative.query;
|
|
513
|
-
srcPath = relPath;
|
|
514
|
-
} else if (relPath.length) {
|
|
515
|
-
if (!srcPath)
|
|
516
|
-
srcPath = [];
|
|
517
|
-
srcPath.pop();
|
|
518
|
-
srcPath = srcPath.concat(relPath);
|
|
519
|
-
result.search = relative.search;
|
|
520
|
-
result.query = relative.query;
|
|
521
|
-
} else if (!util.isNullOrUndefined(relative.search)) {
|
|
522
|
-
if (psychotic) {
|
|
523
|
-
result.hostname = result.host = srcPath.shift();
|
|
524
|
-
var authInHost = result.host && result.host.indexOf("@") > 0 ? result.host.split("@") : false;
|
|
525
|
-
if (authInHost) {
|
|
526
|
-
result.auth = authInHost.shift();
|
|
527
|
-
result.host = result.hostname = authInHost.shift();
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
result.search = relative.search;
|
|
531
|
-
result.query = relative.query;
|
|
532
|
-
if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
|
|
533
|
-
result.path = (result.pathname ? result.pathname : "") + (result.search ? result.search : "");
|
|
534
|
-
}
|
|
535
|
-
result.href = result.format();
|
|
536
|
-
return result;
|
|
537
|
-
}
|
|
538
|
-
if (!srcPath.length) {
|
|
539
|
-
result.pathname = null;
|
|
540
|
-
if (result.search) {
|
|
541
|
-
result.path = "/" + result.search;
|
|
542
|
-
} else {
|
|
543
|
-
result.path = null;
|
|
544
|
-
}
|
|
545
|
-
result.href = result.format();
|
|
546
|
-
return result;
|
|
547
|
-
}
|
|
548
|
-
var last = srcPath.slice(-1)[0];
|
|
549
|
-
var hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === "." || last === "..") || last === "";
|
|
550
|
-
var up = 0;
|
|
551
|
-
for (var i = srcPath.length; i >= 0; i--) {
|
|
552
|
-
last = srcPath[i];
|
|
553
|
-
if (last === ".") {
|
|
554
|
-
srcPath.splice(i, 1);
|
|
555
|
-
} else if (last === "..") {
|
|
556
|
-
srcPath.splice(i, 1);
|
|
557
|
-
up++;
|
|
558
|
-
} else if (up) {
|
|
559
|
-
srcPath.splice(i, 1);
|
|
560
|
-
up--;
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
if (!mustEndAbs && !removeAllDots) {
|
|
564
|
-
for (; up--; up) {
|
|
565
|
-
srcPath.unshift("..");
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
if (mustEndAbs && srcPath[0] !== "" && (!srcPath[0] || srcPath[0].charAt(0) !== "/")) {
|
|
569
|
-
srcPath.unshift("");
|
|
570
|
-
}
|
|
571
|
-
if (hasTrailingSlash && srcPath.join("/").substr(-1) !== "/") {
|
|
572
|
-
srcPath.push("");
|
|
573
|
-
}
|
|
574
|
-
var isAbsolute = srcPath[0] === "" || srcPath[0] && srcPath[0].charAt(0) === "/";
|
|
575
|
-
if (psychotic) {
|
|
576
|
-
result.hostname = result.host = isAbsolute ? "" : srcPath.length ? srcPath.shift() : "";
|
|
577
|
-
var authInHost = result.host && result.host.indexOf("@") > 0 ? result.host.split("@") : false;
|
|
578
|
-
if (authInHost) {
|
|
579
|
-
result.auth = authInHost.shift();
|
|
580
|
-
result.host = result.hostname = authInHost.shift();
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
mustEndAbs = mustEndAbs || result.host && srcPath.length;
|
|
584
|
-
if (mustEndAbs && !isAbsolute) {
|
|
585
|
-
srcPath.unshift("");
|
|
586
|
-
}
|
|
587
|
-
if (!srcPath.length) {
|
|
588
|
-
result.pathname = null;
|
|
589
|
-
result.path = null;
|
|
590
|
-
} else {
|
|
591
|
-
result.pathname = srcPath.join("/");
|
|
592
|
-
}
|
|
593
|
-
if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
|
|
594
|
-
result.path = (result.pathname ? result.pathname : "") + (result.search ? result.search : "");
|
|
595
|
-
}
|
|
596
|
-
result.auth = relative.auth || result.auth;
|
|
597
|
-
result.slashes = result.slashes || relative.slashes;
|
|
598
|
-
result.href = result.format();
|
|
599
|
-
return result;
|
|
600
|
-
};
|
|
601
|
-
Url.prototype.parseHost = function() {
|
|
602
|
-
var host = this.host;
|
|
603
|
-
var port = portPattern.exec(host);
|
|
604
|
-
if (port) {
|
|
605
|
-
port = port[0];
|
|
606
|
-
if (port !== ":") {
|
|
607
|
-
this.port = port.substr(1);
|
|
608
|
-
}
|
|
609
|
-
host = host.substr(0, host.length - port.length);
|
|
610
|
-
}
|
|
611
|
-
if (host)
|
|
612
|
-
this.hostname = host;
|
|
613
|
-
};
|
|
614
|
-
}
|
|
615
|
-
});
|
|
616
|
-
|
|
617
|
-
// node_modules/strict-uri-encode/index.js
|
|
618
|
-
var require_strict_uri_encode = __commonJS({
|
|
619
|
-
"node_modules/strict-uri-encode/index.js"(exports2, module2) {
|
|
620
|
-
"use strict";
|
|
621
|
-
module2.exports = function(str) {
|
|
622
|
-
return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
|
|
623
|
-
return "%" + c.charCodeAt(0).toString(16).toUpperCase();
|
|
624
|
-
});
|
|
625
|
-
};
|
|
626
|
-
}
|
|
627
|
-
});
|
|
628
|
-
|
|
629
|
-
// ../../node_modules/object-assign/index.js
|
|
630
|
-
var require_object_assign = __commonJS({
|
|
631
|
-
"../../node_modules/object-assign/index.js"(exports2, module2) {
|
|
632
|
-
"use strict";
|
|
633
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
634
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
635
|
-
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
636
|
-
function toObject(val) {
|
|
637
|
-
if (val === null || val === void 0) {
|
|
638
|
-
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
639
|
-
}
|
|
640
|
-
return Object(val);
|
|
641
|
-
}
|
|
642
|
-
function shouldUseNative() {
|
|
643
|
-
try {
|
|
644
|
-
if (!Object.assign) {
|
|
645
|
-
return false;
|
|
646
|
-
}
|
|
647
|
-
var test1 = new String("abc");
|
|
648
|
-
test1[5] = "de";
|
|
649
|
-
if (Object.getOwnPropertyNames(test1)[0] === "5") {
|
|
650
|
-
return false;
|
|
651
|
-
}
|
|
652
|
-
var test2 = {};
|
|
653
|
-
for (var i = 0; i < 10; i++) {
|
|
654
|
-
test2["_" + String.fromCharCode(i)] = i;
|
|
655
|
-
}
|
|
656
|
-
var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
|
|
657
|
-
return test2[n];
|
|
658
|
-
});
|
|
659
|
-
if (order2.join("") !== "0123456789") {
|
|
660
|
-
return false;
|
|
661
|
-
}
|
|
662
|
-
var test3 = {};
|
|
663
|
-
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
|
|
664
|
-
test3[letter] = letter;
|
|
665
|
-
});
|
|
666
|
-
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
|
|
667
|
-
return false;
|
|
668
|
-
}
|
|
669
|
-
return true;
|
|
670
|
-
} catch (err) {
|
|
671
|
-
return false;
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
module2.exports = shouldUseNative() ? Object.assign : function(target, source) {
|
|
675
|
-
var from;
|
|
676
|
-
var to = toObject(target);
|
|
677
|
-
var symbols;
|
|
678
|
-
for (var s = 1; s < arguments.length; s++) {
|
|
679
|
-
from = Object(arguments[s]);
|
|
680
|
-
for (var key in from) {
|
|
681
|
-
if (hasOwnProperty.call(from, key)) {
|
|
682
|
-
to[key] = from[key];
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
if (getOwnPropertySymbols) {
|
|
686
|
-
symbols = getOwnPropertySymbols(from);
|
|
687
|
-
for (var i = 0; i < symbols.length; i++) {
|
|
688
|
-
if (propIsEnumerable.call(from, symbols[i])) {
|
|
689
|
-
to[symbols[i]] = from[symbols[i]];
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
return to;
|
|
695
|
-
};
|
|
696
|
-
}
|
|
697
|
-
});
|
|
698
|
-
|
|
699
|
-
// node_modules/query-string/index.js
|
|
700
|
-
var require_query_string = __commonJS({
|
|
701
|
-
"node_modules/query-string/index.js"(exports2) {
|
|
702
|
-
"use strict";
|
|
703
|
-
var strictUriEncode = require_strict_uri_encode();
|
|
704
|
-
var objectAssign = require_object_assign();
|
|
705
|
-
function encoderForArrayFormat(opts) {
|
|
706
|
-
switch (opts.arrayFormat) {
|
|
707
|
-
case "index":
|
|
708
|
-
return function(key, value, index) {
|
|
709
|
-
return value === null ? [
|
|
710
|
-
encode(key, opts),
|
|
711
|
-
"[",
|
|
712
|
-
index,
|
|
713
|
-
"]"
|
|
714
|
-
].join("") : [
|
|
715
|
-
encode(key, opts),
|
|
716
|
-
"[",
|
|
717
|
-
encode(index, opts),
|
|
718
|
-
"]=",
|
|
719
|
-
encode(value, opts)
|
|
720
|
-
].join("");
|
|
721
|
-
};
|
|
722
|
-
case "bracket":
|
|
723
|
-
return function(key, value) {
|
|
724
|
-
return value === null ? encode(key, opts) : [
|
|
725
|
-
encode(key, opts),
|
|
726
|
-
"[]=",
|
|
727
|
-
encode(value, opts)
|
|
728
|
-
].join("");
|
|
729
|
-
};
|
|
730
|
-
default:
|
|
731
|
-
return function(key, value) {
|
|
732
|
-
return value === null ? encode(key, opts) : [
|
|
733
|
-
encode(key, opts),
|
|
734
|
-
"=",
|
|
735
|
-
encode(value, opts)
|
|
736
|
-
].join("");
|
|
737
|
-
};
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
function parserForArrayFormat(opts) {
|
|
741
|
-
var result;
|
|
742
|
-
switch (opts.arrayFormat) {
|
|
743
|
-
case "index":
|
|
744
|
-
return function(key, value, accumulator) {
|
|
745
|
-
result = /\[(\d*)\]$/.exec(key);
|
|
746
|
-
key = key.replace(/\[\d*\]$/, "");
|
|
747
|
-
if (!result) {
|
|
748
|
-
accumulator[key] = value;
|
|
749
|
-
return;
|
|
750
|
-
}
|
|
751
|
-
if (accumulator[key] === void 0) {
|
|
752
|
-
accumulator[key] = {};
|
|
753
|
-
}
|
|
754
|
-
accumulator[key][result[1]] = value;
|
|
755
|
-
};
|
|
756
|
-
case "bracket":
|
|
757
|
-
return function(key, value, accumulator) {
|
|
758
|
-
result = /(\[\])$/.exec(key);
|
|
759
|
-
key = key.replace(/\[\]$/, "");
|
|
760
|
-
if (!result) {
|
|
761
|
-
accumulator[key] = value;
|
|
762
|
-
return;
|
|
763
|
-
} else if (accumulator[key] === void 0) {
|
|
764
|
-
accumulator[key] = [value];
|
|
765
|
-
return;
|
|
766
|
-
}
|
|
767
|
-
accumulator[key] = [].concat(accumulator[key], value);
|
|
768
|
-
};
|
|
769
|
-
default:
|
|
770
|
-
return function(key, value, accumulator) {
|
|
771
|
-
if (accumulator[key] === void 0) {
|
|
772
|
-
accumulator[key] = value;
|
|
773
|
-
return;
|
|
774
|
-
}
|
|
775
|
-
accumulator[key] = [].concat(accumulator[key], value);
|
|
776
|
-
};
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
function encode(value, opts) {
|
|
780
|
-
if (opts.encode) {
|
|
781
|
-
return opts.strict ? strictUriEncode(value) : encodeURIComponent(value);
|
|
782
|
-
}
|
|
783
|
-
return value;
|
|
784
|
-
}
|
|
785
|
-
function keysSorter(input) {
|
|
786
|
-
if (Array.isArray(input)) {
|
|
787
|
-
return input.sort();
|
|
788
|
-
} else if (typeof input === "object") {
|
|
789
|
-
return keysSorter(Object.keys(input)).sort(function(a, b) {
|
|
790
|
-
return Number(a) - Number(b);
|
|
791
|
-
}).map(function(key) {
|
|
792
|
-
return input[key];
|
|
793
|
-
});
|
|
794
|
-
}
|
|
795
|
-
return input;
|
|
796
|
-
}
|
|
797
|
-
exports2.extract = function(str) {
|
|
798
|
-
return str.split("?")[1] || "";
|
|
799
|
-
};
|
|
800
|
-
exports2.parse = function(str, opts) {
|
|
801
|
-
opts = objectAssign({ arrayFormat: "none" }, opts);
|
|
802
|
-
var formatter = parserForArrayFormat(opts);
|
|
803
|
-
var ret = Object.create(null);
|
|
804
|
-
if (typeof str !== "string") {
|
|
805
|
-
return ret;
|
|
806
|
-
}
|
|
807
|
-
str = str.trim().replace(/^(\?|#|&)/, "");
|
|
808
|
-
if (!str) {
|
|
809
|
-
return ret;
|
|
810
|
-
}
|
|
811
|
-
str.split("&").forEach(function(param) {
|
|
812
|
-
var parts = param.replace(/\+/g, " ").split("=");
|
|
813
|
-
var key = parts.shift();
|
|
814
|
-
var val = parts.length > 0 ? parts.join("=") : void 0;
|
|
815
|
-
val = val === void 0 ? null : decodeURIComponent(val);
|
|
816
|
-
formatter(decodeURIComponent(key), val, ret);
|
|
817
|
-
});
|
|
818
|
-
return Object.keys(ret).sort().reduce(function(result, key) {
|
|
819
|
-
var val = ret[key];
|
|
820
|
-
if (Boolean(val) && typeof val === "object" && !Array.isArray(val)) {
|
|
821
|
-
result[key] = keysSorter(val);
|
|
822
|
-
} else {
|
|
823
|
-
result[key] = val;
|
|
824
|
-
}
|
|
825
|
-
return result;
|
|
826
|
-
}, Object.create(null));
|
|
827
|
-
};
|
|
828
|
-
exports2.stringify = function(obj, opts) {
|
|
829
|
-
var defaults = {
|
|
830
|
-
encode: true,
|
|
831
|
-
strict: true,
|
|
832
|
-
arrayFormat: "none"
|
|
833
|
-
};
|
|
834
|
-
opts = objectAssign(defaults, opts);
|
|
835
|
-
var formatter = encoderForArrayFormat(opts);
|
|
836
|
-
return obj ? Object.keys(obj).sort().map(function(key) {
|
|
837
|
-
var val = obj[key];
|
|
838
|
-
if (val === void 0) {
|
|
839
|
-
return "";
|
|
840
|
-
}
|
|
841
|
-
if (val === null) {
|
|
842
|
-
return encode(key, opts);
|
|
843
|
-
}
|
|
844
|
-
if (Array.isArray(val)) {
|
|
845
|
-
var result = [];
|
|
846
|
-
val.slice().forEach(function(val2) {
|
|
847
|
-
if (val2 === void 0) {
|
|
848
|
-
return;
|
|
849
|
-
}
|
|
850
|
-
result.push(formatter(key, val2, result.length));
|
|
851
|
-
});
|
|
852
|
-
return result.join("&");
|
|
853
|
-
}
|
|
854
|
-
return encode(key, opts) + "=" + encode(val, opts);
|
|
855
|
-
}).filter(function(x) {
|
|
856
|
-
return x.length > 0;
|
|
857
|
-
}).join("&") : "";
|
|
858
|
-
};
|
|
859
|
-
}
|
|
860
|
-
});
|
|
861
|
-
|
|
862
|
-
// ../../node_modules/prepend-http/index.js
|
|
863
|
-
var require_prepend_http = __commonJS({
|
|
864
|
-
"../../node_modules/prepend-http/index.js"(exports2, module2) {
|
|
865
|
-
"use strict";
|
|
866
|
-
module2.exports = function(url) {
|
|
867
|
-
if (typeof url !== "string") {
|
|
868
|
-
throw new TypeError("Expected a string, got " + typeof url);
|
|
869
|
-
}
|
|
870
|
-
url = url.trim();
|
|
871
|
-
if (/^\.*\/|^(?!localhost)\w+:/.test(url)) {
|
|
872
|
-
return url;
|
|
873
|
-
}
|
|
874
|
-
return url.replace(/^(?!(?:\w+:)?\/\/)/, "http://");
|
|
875
|
-
};
|
|
876
|
-
}
|
|
877
|
-
});
|
|
878
|
-
|
|
879
|
-
// ../../node_modules/is-plain-obj/index.js
|
|
880
|
-
var require_is_plain_obj = __commonJS({
|
|
881
|
-
"../../node_modules/is-plain-obj/index.js"(exports2, module2) {
|
|
882
|
-
"use strict";
|
|
883
|
-
var toString = Object.prototype.toString;
|
|
884
|
-
module2.exports = function(x) {
|
|
885
|
-
var prototype;
|
|
886
|
-
return toString.call(x) === "[object Object]" && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({}));
|
|
887
|
-
};
|
|
888
|
-
}
|
|
889
|
-
});
|
|
890
|
-
|
|
891
|
-
// node_modules/sort-keys/index.js
|
|
892
|
-
var require_sort_keys = __commonJS({
|
|
893
|
-
"node_modules/sort-keys/index.js"(exports2, module2) {
|
|
894
|
-
"use strict";
|
|
895
|
-
var isPlainObj = require_is_plain_obj();
|
|
896
|
-
module2.exports = function(obj, opts) {
|
|
897
|
-
if (!isPlainObj(obj)) {
|
|
898
|
-
throw new TypeError("Expected a plain object");
|
|
899
|
-
}
|
|
900
|
-
opts = opts || {};
|
|
901
|
-
if (typeof opts === "function") {
|
|
902
|
-
opts = { compare: opts };
|
|
903
|
-
}
|
|
904
|
-
var deep = opts.deep;
|
|
905
|
-
var seenInput = [];
|
|
906
|
-
var seenOutput = [];
|
|
907
|
-
var sortKeys = function(x) {
|
|
908
|
-
var seenIndex = seenInput.indexOf(x);
|
|
909
|
-
if (seenIndex !== -1) {
|
|
910
|
-
return seenOutput[seenIndex];
|
|
911
|
-
}
|
|
912
|
-
var ret = {};
|
|
913
|
-
var keys = Object.keys(x).sort(opts.compare);
|
|
914
|
-
seenInput.push(x);
|
|
915
|
-
seenOutput.push(ret);
|
|
916
|
-
for (var i = 0; i < keys.length; i++) {
|
|
917
|
-
var key = keys[i];
|
|
918
|
-
var val = x[key];
|
|
919
|
-
ret[key] = deep && isPlainObj(val) ? sortKeys(val) : val;
|
|
920
|
-
}
|
|
921
|
-
return ret;
|
|
922
|
-
};
|
|
923
|
-
return sortKeys(obj);
|
|
924
|
-
};
|
|
925
|
-
}
|
|
926
|
-
});
|
|
927
|
-
|
|
928
|
-
// node_modules/normalize-url/index.js
|
|
929
|
-
var require_normalize_url = __commonJS({
|
|
930
|
-
"node_modules/normalize-url/index.js"(exports2, module2) {
|
|
931
|
-
"use strict";
|
|
932
|
-
var url = require_url();
|
|
933
|
-
var punycode = require("punycode");
|
|
934
|
-
var queryString = require_query_string();
|
|
935
|
-
var prependHttp = require_prepend_http();
|
|
936
|
-
var sortKeys = require_sort_keys();
|
|
937
|
-
var objectAssign = require_object_assign();
|
|
938
|
-
var DEFAULT_PORTS = {
|
|
939
|
-
"http:": 80,
|
|
940
|
-
"https:": 443,
|
|
941
|
-
"ftp:": 21
|
|
942
|
-
};
|
|
943
|
-
var slashedProtocol = {
|
|
944
|
-
"http": true,
|
|
945
|
-
"https": true,
|
|
946
|
-
"ftp": true,
|
|
947
|
-
"gopher": true,
|
|
948
|
-
"file": true,
|
|
949
|
-
"http:": true,
|
|
950
|
-
"https:": true,
|
|
951
|
-
"ftp:": true,
|
|
952
|
-
"gopher:": true,
|
|
953
|
-
"file:": true
|
|
954
|
-
};
|
|
955
|
-
function testParameter(name, filters) {
|
|
956
|
-
return filters.some(function(filter) {
|
|
957
|
-
return filter instanceof RegExp ? filter.test(name) : filter === name;
|
|
958
|
-
});
|
|
959
|
-
}
|
|
960
|
-
module2.exports = function(str, opts) {
|
|
961
|
-
opts = objectAssign({
|
|
962
|
-
normalizeProtocol: true,
|
|
963
|
-
normalizeHttps: false,
|
|
964
|
-
stripFragment: true,
|
|
965
|
-
stripWWW: true,
|
|
966
|
-
removeQueryParameters: [/^utm_\w+/i],
|
|
967
|
-
removeTrailingSlash: true,
|
|
968
|
-
removeDirectoryIndex: false
|
|
969
|
-
}, opts);
|
|
970
|
-
if (typeof str !== "string") {
|
|
971
|
-
throw new TypeError("Expected a string");
|
|
972
|
-
}
|
|
973
|
-
var hasRelativeProtocol = str.indexOf("//") === 0;
|
|
974
|
-
str = prependHttp(str.trim()).replace(/^\/\//, "http://");
|
|
975
|
-
var urlObj = url.parse(str);
|
|
976
|
-
if (opts.normalizeHttps && urlObj.protocol === "https:") {
|
|
977
|
-
urlObj.protocol = "http:";
|
|
978
|
-
}
|
|
979
|
-
if (!urlObj.hostname && !urlObj.pathname) {
|
|
980
|
-
throw new Error("Invalid URL");
|
|
981
|
-
}
|
|
982
|
-
delete urlObj.host;
|
|
983
|
-
delete urlObj.query;
|
|
984
|
-
if (opts.stripFragment) {
|
|
985
|
-
delete urlObj.hash;
|
|
986
|
-
}
|
|
987
|
-
var port = DEFAULT_PORTS[urlObj.protocol];
|
|
988
|
-
if (Number(urlObj.port) === port) {
|
|
989
|
-
delete urlObj.port;
|
|
990
|
-
}
|
|
991
|
-
if (urlObj.pathname) {
|
|
992
|
-
urlObj.pathname = urlObj.pathname.replace(/\/{2,}/g, "/");
|
|
993
|
-
}
|
|
994
|
-
if (urlObj.pathname) {
|
|
995
|
-
urlObj.pathname = decodeURI(urlObj.pathname);
|
|
996
|
-
}
|
|
997
|
-
if (opts.removeDirectoryIndex === true) {
|
|
998
|
-
opts.removeDirectoryIndex = [/^index\.[a-z]+$/];
|
|
999
|
-
}
|
|
1000
|
-
if (Array.isArray(opts.removeDirectoryIndex) && opts.removeDirectoryIndex.length) {
|
|
1001
|
-
var pathComponents = urlObj.pathname.split("/");
|
|
1002
|
-
var lastComponent = pathComponents[pathComponents.length - 1];
|
|
1003
|
-
if (testParameter(lastComponent, opts.removeDirectoryIndex)) {
|
|
1004
|
-
pathComponents = pathComponents.slice(0, pathComponents.length - 1);
|
|
1005
|
-
urlObj.pathname = pathComponents.slice(1).join("/") + "/";
|
|
1006
|
-
}
|
|
1007
|
-
}
|
|
1008
|
-
if (slashedProtocol[urlObj.protocol]) {
|
|
1009
|
-
var domain = urlObj.protocol + "//" + urlObj.hostname;
|
|
1010
|
-
var relative = url.resolve(domain, urlObj.pathname);
|
|
1011
|
-
urlObj.pathname = relative.replace(domain, "");
|
|
1012
|
-
}
|
|
1013
|
-
if (urlObj.hostname) {
|
|
1014
|
-
urlObj.hostname = punycode.toUnicode(urlObj.hostname).toLowerCase();
|
|
1015
|
-
urlObj.hostname = urlObj.hostname.replace(/\.$/, "");
|
|
1016
|
-
if (opts.stripWWW) {
|
|
1017
|
-
urlObj.hostname = urlObj.hostname.replace(/^www\./, "");
|
|
1018
|
-
}
|
|
1019
|
-
}
|
|
1020
|
-
if (urlObj.search === "?") {
|
|
1021
|
-
delete urlObj.search;
|
|
1022
|
-
}
|
|
1023
|
-
var queryParameters = queryString.parse(urlObj.search);
|
|
1024
|
-
if (Array.isArray(opts.removeQueryParameters)) {
|
|
1025
|
-
for (var key in queryParameters) {
|
|
1026
|
-
if (testParameter(key, opts.removeQueryParameters)) {
|
|
1027
|
-
delete queryParameters[key];
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
urlObj.search = queryString.stringify(sortKeys(queryParameters));
|
|
1032
|
-
urlObj.search = decodeURIComponent(urlObj.search);
|
|
1033
|
-
str = url.format(urlObj);
|
|
1034
|
-
if (opts.removeTrailingSlash || urlObj.pathname === "/") {
|
|
1035
|
-
str = str.replace(/\/$/, "");
|
|
1036
|
-
}
|
|
1037
|
-
if (hasRelativeProtocol && !opts.normalizeProtocol) {
|
|
1038
|
-
str = str.replace(/^http:\/\//, "//");
|
|
1039
|
-
}
|
|
1040
|
-
return str;
|
|
1041
|
-
};
|
|
1042
|
-
}
|
|
1043
|
-
});
|
|
1044
|
-
|
|
1045
|
-
// src/webpack/plugins/mini-css-extract-plugin/src/hmr/hotModuleReplacement.js
|
|
1046
|
-
var normalizeUrl = require_normalize_url();
|
|
1047
|
-
var srcByModuleId = Object.create(null);
|
|
1048
|
-
var noDocument = typeof document === "undefined";
|
|
1049
|
-
var forEach = Array.prototype.forEach;
|
|
1050
|
-
function debounce(fn, time) {
|
|
1051
|
-
let timeout = 0;
|
|
1052
|
-
return function() {
|
|
1053
|
-
const self = this;
|
|
1054
|
-
const args = arguments;
|
|
1055
|
-
const functionCall = function functionCall2() {
|
|
1056
|
-
return fn.apply(self, args);
|
|
1057
|
-
};
|
|
1058
|
-
clearTimeout(timeout);
|
|
1059
|
-
timeout = setTimeout(functionCall, time);
|
|
1060
|
-
};
|
|
1061
|
-
}
|
|
1062
|
-
function noop() {
|
|
1063
|
-
}
|
|
1064
|
-
function getCurrentScriptUrl(moduleId) {
|
|
1065
|
-
let src = srcByModuleId[moduleId];
|
|
1066
|
-
if (!src) {
|
|
1067
|
-
if (document.currentScript) {
|
|
1068
|
-
src = document.currentScript.src;
|
|
1069
|
-
} else {
|
|
1070
|
-
const scripts = document.getElementsByTagName("script");
|
|
1071
|
-
const lastScriptTag = scripts[scripts.length - 1];
|
|
1072
|
-
if (lastScriptTag) {
|
|
1073
|
-
src = lastScriptTag.src;
|
|
1074
|
-
}
|
|
1075
|
-
}
|
|
1076
|
-
srcByModuleId[moduleId] = src;
|
|
1077
|
-
}
|
|
1078
|
-
return function(fileMap) {
|
|
1079
|
-
if (!src) {
|
|
1080
|
-
return null;
|
|
1081
|
-
}
|
|
1082
|
-
const splitResult = src.split(/([^\\/]+)\.js$/);
|
|
1083
|
-
const filename = splitResult && splitResult[1];
|
|
1084
|
-
if (!filename) {
|
|
1085
|
-
return [src.replace(".js", ".css")];
|
|
1086
|
-
}
|
|
1087
|
-
if (!fileMap) {
|
|
1088
|
-
return [src.replace(".js", ".css")];
|
|
1089
|
-
}
|
|
1090
|
-
return fileMap.split(",").map(function(mapRule) {
|
|
1091
|
-
const reg = new RegExp("${filename}\\.js$", "g");
|
|
1092
|
-
return normalizeUrl(src.replace(reg, mapRule.replace(/{fileName}/g, filename) + ".css"), { stripWWW: false });
|
|
1093
|
-
});
|
|
1094
|
-
};
|
|
1095
|
-
}
|
|
1096
|
-
function updateCss(el, url) {
|
|
1097
|
-
if (!url) {
|
|
1098
|
-
if (!el.href) {
|
|
1099
|
-
return;
|
|
1100
|
-
}
|
|
1101
|
-
url = el.href.split("?")[0];
|
|
1102
|
-
}
|
|
1103
|
-
if (!isUrlRequest(url)) {
|
|
1104
|
-
return;
|
|
1105
|
-
}
|
|
1106
|
-
if (el.isLoaded === false) {
|
|
1107
|
-
return;
|
|
1108
|
-
}
|
|
1109
|
-
if (!url || !(url.indexOf(".css") > -1)) {
|
|
1110
|
-
return;
|
|
1111
|
-
}
|
|
1112
|
-
el.visited = true;
|
|
1113
|
-
const newEl = el.cloneNode();
|
|
1114
|
-
newEl.isLoaded = false;
|
|
1115
|
-
newEl.addEventListener("load", function() {
|
|
1116
|
-
newEl.isLoaded = true;
|
|
1117
|
-
el.parentNode.removeChild(el);
|
|
1118
|
-
});
|
|
1119
|
-
newEl.addEventListener("error", function() {
|
|
1120
|
-
newEl.isLoaded = true;
|
|
1121
|
-
el.parentNode.removeChild(el);
|
|
1122
|
-
});
|
|
1123
|
-
newEl.href = url + "?" + Date.now();
|
|
1124
|
-
if (el.nextSibling) {
|
|
1125
|
-
el.parentNode.insertBefore(newEl, el.nextSibling);
|
|
1126
|
-
} else {
|
|
1127
|
-
el.parentNode.appendChild(newEl);
|
|
1128
|
-
}
|
|
1129
|
-
}
|
|
1130
|
-
function getReloadUrl(href, src) {
|
|
1131
|
-
let ret;
|
|
1132
|
-
href = normalizeUrl(href, { stripWWW: false });
|
|
1133
|
-
src.some(function(url) {
|
|
1134
|
-
if (href.indexOf(src) > -1) {
|
|
1135
|
-
ret = url;
|
|
1136
|
-
}
|
|
1137
|
-
});
|
|
1138
|
-
return ret;
|
|
1139
|
-
}
|
|
1140
|
-
function reloadStyle(src) {
|
|
1141
|
-
const elements = document.querySelectorAll("link");
|
|
1142
|
-
let loaded = false;
|
|
1143
|
-
forEach.call(elements, function(el) {
|
|
1144
|
-
if (!el.href) {
|
|
1145
|
-
return;
|
|
1146
|
-
}
|
|
1147
|
-
const url = getReloadUrl(el.href, src);
|
|
1148
|
-
if (!isUrlRequest(url)) {
|
|
1149
|
-
return;
|
|
1150
|
-
}
|
|
1151
|
-
if (el.visited === true) {
|
|
1152
|
-
return;
|
|
1153
|
-
}
|
|
1154
|
-
if (url) {
|
|
1155
|
-
updateCss(el, url);
|
|
1156
|
-
loaded = true;
|
|
1157
|
-
}
|
|
1158
|
-
});
|
|
1159
|
-
return loaded;
|
|
1160
|
-
}
|
|
1161
|
-
function reloadAll() {
|
|
1162
|
-
const elements = document.querySelectorAll("link");
|
|
1163
|
-
forEach.call(elements, function(el) {
|
|
1164
|
-
if (el.visited === true) {
|
|
1165
|
-
return;
|
|
1166
|
-
}
|
|
1167
|
-
updateCss(el);
|
|
1168
|
-
});
|
|
1169
|
-
}
|
|
1170
|
-
function isUrlRequest(url) {
|
|
1171
|
-
if (!/^https?:/i.test(url)) {
|
|
1172
|
-
return false;
|
|
1173
|
-
}
|
|
1174
|
-
return true;
|
|
1175
|
-
}
|
|
1176
|
-
module.exports = function(moduleId, options) {
|
|
1177
|
-
if (noDocument) {
|
|
1178
|
-
console.log("no window.document found, will not HMR CSS");
|
|
1179
|
-
return noop;
|
|
1180
|
-
}
|
|
1181
|
-
const getScriptSrc = getCurrentScriptUrl(moduleId);
|
|
1182
|
-
function update() {
|
|
1183
|
-
const src = getScriptSrc(options.filename);
|
|
1184
|
-
const reloaded = reloadStyle(src);
|
|
1185
|
-
if (options.locals) {
|
|
1186
|
-
console.log("[HMR] Detected local css modules. Reload all css");
|
|
1187
|
-
reloadAll();
|
|
1188
|
-
return;
|
|
1189
|
-
}
|
|
1190
|
-
if (reloaded && !options.reloadAll) {
|
|
1191
|
-
console.log("[HMR] css reload %s", src.join(" "));
|
|
1192
|
-
} else {
|
|
1193
|
-
console.log("[HMR] Reload all css");
|
|
1194
|
-
reloadAll();
|
|
1195
|
-
}
|
|
1196
|
-
}
|
|
1197
|
-
return debounce(update, 50);
|
|
1198
|
-
};
|
|
1199
|
-
/*
|
|
1200
|
-
object-assign
|
|
1201
|
-
(c) Sindre Sorhus
|
|
1202
|
-
@license MIT
|
|
1203
|
-
*/
|