dinou 9.3.0 → 10.0.1
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/CHANGELOG.md +196 -0
- package/README.md +157 -132
- package/dinou/adapters/bun.js +34 -5
- package/dinou/adapters/cloudflare.js +110 -17
- package/dinou/adapters/deno.js +46 -8
- package/dinou/adapters/netlify.js +86 -50
- package/dinou/adapters/node.js +8 -0
- package/dinou/assets.d.ts +32 -5
- package/dinou/bun/build.js +190 -106
- package/dinou/cli.js +992 -532
- package/dinou/cloudflare/build.js +187 -106
- package/dinou/compiled/autoprefixer/index.js +509 -517
- package/dinou/compiled/babel-core/index.js +738 -716
- package/dinou/compiled/babel-generator/index.js +341 -299
- package/dinou/compiled/babel-loader/index.js +766 -744
- package/dinou/compiled/babel-parser/index.js +2 -2
- package/dinou/compiled/babel-plugin-react-compiler/index.js +178 -178
- package/dinou/compiled/babel-plugin-syntax-import-meta/index.js +4 -4
- package/dinou/compiled/babel-preset-react/index.js +752 -730
- package/dinou/compiled/babel-preset-typescript/index.js +738 -716
- package/dinou/compiled/babel-traverse/index.js +463 -433
- package/dinou/compiled/babel-types/index.js +176 -176
- package/dinou/compiled/chokidar/index.js +4 -4
- package/dinou/compiled/commander/index.js +15 -15
- package/dinou/compiled/copy-webpack-plugin/index.js +433 -425
- package/dinou/compiled/css-loader/index.js +289 -289
- package/dinou/compiled/css-loader/runtime/api.js +85 -0
- package/dinou/compiled/css-loader/runtime/getUrl.js +26 -0
- package/dinou/compiled/css-loader/runtime/noSourceMaps.js +5 -0
- package/dinou/compiled/css-loader/runtime/package.json +3 -0
- package/dinou/compiled/css-loader/runtime/sourceMaps.js +16 -0
- package/dinou/compiled/fast-glob/index.js +5810 -0
- package/dinou/compiled/generic-names/index.js +16 -16
- package/dinou/compiled/mini-css-extract-plugin/{chunk-YYEJWYXE.js → chunk-R6DP5ZYM.js} +36 -36
- package/dinou/compiled/mini-css-extract-plugin/hmr/hotModuleReplacement.js +253 -0
- package/dinou/compiled/mini-css-extract-plugin/hmr/normalize-url.js +39 -0
- package/dinou/compiled/mini-css-extract-plugin/hmr/package.json +3 -0
- package/dinou/compiled/mini-css-extract-plugin/index.js +1 -1
- package/dinou/compiled/mini-css-extract-plugin/loader.js +5 -5
- package/dinou/compiled/postcss/index.js +83 -83
- package/dinou/compiled/postcss-import/index.js +147 -117
- package/dinou/compiled/postcss-modules/index.js +216 -216
- package/dinou/compiled/resolve/index.js +1224 -0
- package/dinou/compiled/rollup-plugin-babel/index.js +753 -731
- package/dinou/compiled/rollup-plugin-commonjs/index.js +43 -38
- package/dinou/compiled/rollup-plugin-delete/index.js +615 -253
- package/dinou/compiled/rollup-plugin-json/index.js +22 -18
- package/dinou/compiled/rollup-plugin-node-resolve/index.js +130 -100
- package/dinou/compiled/rollup-plugin-postcss/index.js +3299 -3277
- package/dinou/compiled/rollup-plugin-replace/index.js +34 -29
- package/dinou/compiled/tailwindcss-postcss/index.js +214 -211
- package/dinou/compiled/vendors-manifest.json +59 -83
- package/dinou/core/asset-extensions.js +482 -33
- package/dinou/core/bailout-proxy.js +21 -2
- package/dinou/core/build-static-pages.js +523 -371
- package/dinou/core/builtin-asset-extensions.js +63 -0
- package/dinou/core/cache-revalidate.js +449 -256
- package/dinou/core/cache-slot.js +289 -79
- package/dinou/core/client-webpack.jsx +470 -39
- package/dinou/core/client.jsx +402 -39
- package/dinou/core/config.js +3 -0
- package/dinou/core/copy-static-dirs.js +98 -0
- package/dinou/core/createScopedName.js +22 -4
- package/dinou/core/dinou-paths.js +1 -1
- package/dinou/core/discover-layouts.js +200 -0
- package/dinou/core/edge-ssr.js +1 -1
- package/dinou/core/ensure-vendor-mode.js +78 -19
- package/dinou/core/env.js +544 -0
- package/dinou/core/export-static.js +41 -9
- package/dinou/core/generate-route-types.js +989 -95
- package/dinou/core/generate-static-rsc.js +5 -6
- package/dinou/core/generate-static.js +45 -6
- package/dinou/core/get-abs-path-with-ext.js +217 -75
- package/dinou/core/get-asset-from-manifest.js +19 -8
- package/dinou/core/get-error-jsx.js +4 -5
- package/dinou/core/get-file-path-and-dynamic-params.js +561 -338
- package/dinou/core/get-jsx.js +220 -53
- package/dinou/core/handler.js +1647 -466
- package/dinou/core/import-module.js +7 -0
- package/dinou/core/layout-functions.js +72 -13
- package/dinou/core/link.jsx +34 -6
- package/dinou/core/load-dinou-config.js +520 -89
- package/dinou/core/manifest-provider.js +4 -14
- package/dinou/core/navigation-utils.js +141 -3
- package/dinou/core/navigation.js +134 -50
- package/dinou/core/node-middleware-runner.js +165 -0
- package/dinou/core/postcss-pipeline.js +236 -0
- package/dinou/core/ppr-context.js +114 -22
- package/dinou/core/ppr-runtime.js +391 -127
- package/dinou/core/redirect.jsx +1 -1
- package/dinou/core/render-jsx-to-client-jsx.js +216 -48
- package/dinou/core/request-context.js +59 -3
- package/dinou/core/resolve-contextual-dinou.js +523 -0
- package/dinou/core/resolve-setup-files.js +85 -27
- package/dinou/core/revalidating.js +10 -2
- package/dinou/core/route-generator.js +6 -2
- package/dinou/core/rsc-renderer.js +4 -1
- package/dinou/core/run-ssg.js +6 -0
- package/dinou/core/runtime-env.js +265 -0
- package/dinou/core/server-css-modules-plugin.js +155 -0
- package/dinou/core/server-function-proxy-webpack.js +27 -2
- package/dinou/core/server-function-proxy.js +27 -2
- package/dinou/core/slot.js +47 -2
- package/dinou/core/static-assets.js +503 -0
- package/dinou/core/storage-adapter.js +452 -24
- package/dinou/core/transform-server-functions.js +272 -24
- package/dinou/core/tsconfig-aliases.js +964 -0
- package/dinou/core/uneject.js +640 -0
- package/dinou/core/url-resolver.js +1 -1
- package/dinou/core/vfs.js +11 -2
- package/dinou/css.d.ts +4 -1
- package/dinou/deno/build.js +205 -153
- package/dinou/deno/seed-kv.js +4 -0
- package/dinou/env.d.ts +22 -2
- package/dinou/esbuild/build.js +40 -50
- package/dinou/esbuild/dev.js +33 -7
- package/dinou/esbuild/helpers-esbuild/get-config-esbuild-prod.js +41 -16
- package/dinou/esbuild/helpers-esbuild/get-config-esbuild.js +51 -49
- package/dinou/esbuild/helpers-esbuild/get-esbuild-entries.js +73 -60
- package/dinou/esbuild/helpers-esbuild/swc-disk-cache.js +35 -16
- package/dinou/esbuild/helpers-esbuild/write.js +13 -3
- package/dinou/esbuild/plugins-esbuild/assets-plugin.js +100 -238
- package/dinou/esbuild/plugins-esbuild/babel-react-compiler-plugin.js +73 -29
- package/dinou/esbuild/plugins-esbuild/css-processor-plugin.js +283 -91
- package/dinou/esbuild/plugins-esbuild/manifest-generator-plugin.js +3 -5
- package/dinou/esbuild/plugins-esbuild/react-client-manifest-plugin.js +9 -3
- package/dinou/esbuild/plugins-esbuild/server-functions-plugin.js +4 -3
- package/dinou/esbuild/plugins-esbuild/stable-chunk-names-and-maps-plugin.js +10 -1
- package/dinou/esbuild/plugins-postcss/postcss-extract-plugin.js +84 -21
- package/dinou/esbuild/react-refresh/esm-hmr/client.js +31 -10
- package/dinou/esbuild/react-refresh/esm-hmr-plugin.js +48 -18
- package/dinou/esbuild/react-refresh/is-react-refresh-boundary.js +9 -1
- package/dinou/esbuild/react-refresh/react-refresh-runtime.js +13 -7
- package/dinou/index.d.ts +1028 -88
- package/dinou/node/build.js +138 -74
- package/dinou/node/bundle-dual-engine.js +393 -131
- package/dinou/node/dev.js +1005 -275
- package/dinou/package.json +11 -34
- package/dinou/rollup/postcss.config.js +3 -4
- package/dinou/rollup/react-refresh/esm-hmr/client.js +31 -10
- package/dinou/rollup/react-refresh/react-refresh-wrap-modules.js +16 -13
- package/dinou/rollup/react-refresh/rollup-plugin-esm-hmr.js +53 -7
- package/dinou/rollup/rollup-plugins/dinou-asset-plugin.js +58 -20
- package/dinou/rollup/rollup-plugins/manifest-generator-plugin.js +16 -7
- package/dinou/rollup/rollup-plugins/rollup-plugin-react-client-manifest.js +118 -42
- package/dinou/rollup/rollup-plugins/rollup-plugin-server-functions.js +48 -36
- package/dinou/rollup/rollup.config.js +174 -101
- package/dinou/scripts/build-vendors.js +123 -33
- package/dinou/server.d.ts +126 -15
- package/dinou/webpack/helpers/get-webpack-entries.js +87 -41
- package/dinou/webpack/helpers/patch-webpack-internals.js +93 -1
- package/dinou/webpack/loaders/server-functions-loader.js +1 -1
- package/dinou/webpack/plugins/manifest-generator-plugin.js +27 -7
- package/dinou/webpack/plugins/server-functions-plugin.js +39 -12
- package/dinou/webpack/plugins/webpack-memory-plugin.js +25 -12
- package/dinou/webpack/postcss.config.js +3 -4
- package/dinou/webpack/webpack.config.js +408 -132
- package/eject.js +6 -224
- package/package.json +7 -9
- package/dinou/compiled/cross-env/index.js +0 -661
- package/dinou/compiled/dotenv/index.js +0 -375
- package/dinou/compiled/esbuild-copy-static-files/index.js +0 -63
- package/dinou/compiled/esbuild-tsconfig-paths/index.js +0 -1314
- package/dinou/compiled/rollup-plugin-copy/index.js +0 -12066
- package/dinou/compiled/rollup-plugin-tsconfig-paths/index.js +0 -569
- package/dinou/compiled/tsconfig-paths-webpack-plugin/index.js +0 -3956
|
@@ -1,3956 +0,0 @@
|
|
|
1
|
-
import { createRequire as __dinou_createRequire } from "node:module";
|
|
2
|
-
import { fileURLToPath as __dinou_fileURLToPath } from "node:url";
|
|
3
|
-
import __dinou_path from "node:path";
|
|
4
|
-
const require = __dinou_createRequire(import.meta.url);
|
|
5
|
-
const __filename = __dinou_fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = __dinou_path.dirname(__filename);
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
9
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
10
|
-
}) : x)(function(x) {
|
|
11
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
12
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
13
|
-
});
|
|
14
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
15
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
// ../node_modules/color-name/index.js
|
|
19
|
-
var require_color_name = __commonJS({
|
|
20
|
-
"../node_modules/color-name/index.js"(exports, module) {
|
|
21
|
-
"use strict";
|
|
22
|
-
module.exports = {
|
|
23
|
-
"aliceblue": [240, 248, 255],
|
|
24
|
-
"antiquewhite": [250, 235, 215],
|
|
25
|
-
"aqua": [0, 255, 255],
|
|
26
|
-
"aquamarine": [127, 255, 212],
|
|
27
|
-
"azure": [240, 255, 255],
|
|
28
|
-
"beige": [245, 245, 220],
|
|
29
|
-
"bisque": [255, 228, 196],
|
|
30
|
-
"black": [0, 0, 0],
|
|
31
|
-
"blanchedalmond": [255, 235, 205],
|
|
32
|
-
"blue": [0, 0, 255],
|
|
33
|
-
"blueviolet": [138, 43, 226],
|
|
34
|
-
"brown": [165, 42, 42],
|
|
35
|
-
"burlywood": [222, 184, 135],
|
|
36
|
-
"cadetblue": [95, 158, 160],
|
|
37
|
-
"chartreuse": [127, 255, 0],
|
|
38
|
-
"chocolate": [210, 105, 30],
|
|
39
|
-
"coral": [255, 127, 80],
|
|
40
|
-
"cornflowerblue": [100, 149, 237],
|
|
41
|
-
"cornsilk": [255, 248, 220],
|
|
42
|
-
"crimson": [220, 20, 60],
|
|
43
|
-
"cyan": [0, 255, 255],
|
|
44
|
-
"darkblue": [0, 0, 139],
|
|
45
|
-
"darkcyan": [0, 139, 139],
|
|
46
|
-
"darkgoldenrod": [184, 134, 11],
|
|
47
|
-
"darkgray": [169, 169, 169],
|
|
48
|
-
"darkgreen": [0, 100, 0],
|
|
49
|
-
"darkgrey": [169, 169, 169],
|
|
50
|
-
"darkkhaki": [189, 183, 107],
|
|
51
|
-
"darkmagenta": [139, 0, 139],
|
|
52
|
-
"darkolivegreen": [85, 107, 47],
|
|
53
|
-
"darkorange": [255, 140, 0],
|
|
54
|
-
"darkorchid": [153, 50, 204],
|
|
55
|
-
"darkred": [139, 0, 0],
|
|
56
|
-
"darksalmon": [233, 150, 122],
|
|
57
|
-
"darkseagreen": [143, 188, 143],
|
|
58
|
-
"darkslateblue": [72, 61, 139],
|
|
59
|
-
"darkslategray": [47, 79, 79],
|
|
60
|
-
"darkslategrey": [47, 79, 79],
|
|
61
|
-
"darkturquoise": [0, 206, 209],
|
|
62
|
-
"darkviolet": [148, 0, 211],
|
|
63
|
-
"deeppink": [255, 20, 147],
|
|
64
|
-
"deepskyblue": [0, 191, 255],
|
|
65
|
-
"dimgray": [105, 105, 105],
|
|
66
|
-
"dimgrey": [105, 105, 105],
|
|
67
|
-
"dodgerblue": [30, 144, 255],
|
|
68
|
-
"firebrick": [178, 34, 34],
|
|
69
|
-
"floralwhite": [255, 250, 240],
|
|
70
|
-
"forestgreen": [34, 139, 34],
|
|
71
|
-
"fuchsia": [255, 0, 255],
|
|
72
|
-
"gainsboro": [220, 220, 220],
|
|
73
|
-
"ghostwhite": [248, 248, 255],
|
|
74
|
-
"gold": [255, 215, 0],
|
|
75
|
-
"goldenrod": [218, 165, 32],
|
|
76
|
-
"gray": [128, 128, 128],
|
|
77
|
-
"green": [0, 128, 0],
|
|
78
|
-
"greenyellow": [173, 255, 47],
|
|
79
|
-
"grey": [128, 128, 128],
|
|
80
|
-
"honeydew": [240, 255, 240],
|
|
81
|
-
"hotpink": [255, 105, 180],
|
|
82
|
-
"indianred": [205, 92, 92],
|
|
83
|
-
"indigo": [75, 0, 130],
|
|
84
|
-
"ivory": [255, 255, 240],
|
|
85
|
-
"khaki": [240, 230, 140],
|
|
86
|
-
"lavender": [230, 230, 250],
|
|
87
|
-
"lavenderblush": [255, 240, 245],
|
|
88
|
-
"lawngreen": [124, 252, 0],
|
|
89
|
-
"lemonchiffon": [255, 250, 205],
|
|
90
|
-
"lightblue": [173, 216, 230],
|
|
91
|
-
"lightcoral": [240, 128, 128],
|
|
92
|
-
"lightcyan": [224, 255, 255],
|
|
93
|
-
"lightgoldenrodyellow": [250, 250, 210],
|
|
94
|
-
"lightgray": [211, 211, 211],
|
|
95
|
-
"lightgreen": [144, 238, 144],
|
|
96
|
-
"lightgrey": [211, 211, 211],
|
|
97
|
-
"lightpink": [255, 182, 193],
|
|
98
|
-
"lightsalmon": [255, 160, 122],
|
|
99
|
-
"lightseagreen": [32, 178, 170],
|
|
100
|
-
"lightskyblue": [135, 206, 250],
|
|
101
|
-
"lightslategray": [119, 136, 153],
|
|
102
|
-
"lightslategrey": [119, 136, 153],
|
|
103
|
-
"lightsteelblue": [176, 196, 222],
|
|
104
|
-
"lightyellow": [255, 255, 224],
|
|
105
|
-
"lime": [0, 255, 0],
|
|
106
|
-
"limegreen": [50, 205, 50],
|
|
107
|
-
"linen": [250, 240, 230],
|
|
108
|
-
"magenta": [255, 0, 255],
|
|
109
|
-
"maroon": [128, 0, 0],
|
|
110
|
-
"mediumaquamarine": [102, 205, 170],
|
|
111
|
-
"mediumblue": [0, 0, 205],
|
|
112
|
-
"mediumorchid": [186, 85, 211],
|
|
113
|
-
"mediumpurple": [147, 112, 219],
|
|
114
|
-
"mediumseagreen": [60, 179, 113],
|
|
115
|
-
"mediumslateblue": [123, 104, 238],
|
|
116
|
-
"mediumspringgreen": [0, 250, 154],
|
|
117
|
-
"mediumturquoise": [72, 209, 204],
|
|
118
|
-
"mediumvioletred": [199, 21, 133],
|
|
119
|
-
"midnightblue": [25, 25, 112],
|
|
120
|
-
"mintcream": [245, 255, 250],
|
|
121
|
-
"mistyrose": [255, 228, 225],
|
|
122
|
-
"moccasin": [255, 228, 181],
|
|
123
|
-
"navajowhite": [255, 222, 173],
|
|
124
|
-
"navy": [0, 0, 128],
|
|
125
|
-
"oldlace": [253, 245, 230],
|
|
126
|
-
"olive": [128, 128, 0],
|
|
127
|
-
"olivedrab": [107, 142, 35],
|
|
128
|
-
"orange": [255, 165, 0],
|
|
129
|
-
"orangered": [255, 69, 0],
|
|
130
|
-
"orchid": [218, 112, 214],
|
|
131
|
-
"palegoldenrod": [238, 232, 170],
|
|
132
|
-
"palegreen": [152, 251, 152],
|
|
133
|
-
"paleturquoise": [175, 238, 238],
|
|
134
|
-
"palevioletred": [219, 112, 147],
|
|
135
|
-
"papayawhip": [255, 239, 213],
|
|
136
|
-
"peachpuff": [255, 218, 185],
|
|
137
|
-
"peru": [205, 133, 63],
|
|
138
|
-
"pink": [255, 192, 203],
|
|
139
|
-
"plum": [221, 160, 221],
|
|
140
|
-
"powderblue": [176, 224, 230],
|
|
141
|
-
"purple": [128, 0, 128],
|
|
142
|
-
"rebeccapurple": [102, 51, 153],
|
|
143
|
-
"red": [255, 0, 0],
|
|
144
|
-
"rosybrown": [188, 143, 143],
|
|
145
|
-
"royalblue": [65, 105, 225],
|
|
146
|
-
"saddlebrown": [139, 69, 19],
|
|
147
|
-
"salmon": [250, 128, 114],
|
|
148
|
-
"sandybrown": [244, 164, 96],
|
|
149
|
-
"seagreen": [46, 139, 87],
|
|
150
|
-
"seashell": [255, 245, 238],
|
|
151
|
-
"sienna": [160, 82, 45],
|
|
152
|
-
"silver": [192, 192, 192],
|
|
153
|
-
"skyblue": [135, 206, 235],
|
|
154
|
-
"slateblue": [106, 90, 205],
|
|
155
|
-
"slategray": [112, 128, 144],
|
|
156
|
-
"slategrey": [112, 128, 144],
|
|
157
|
-
"snow": [255, 250, 250],
|
|
158
|
-
"springgreen": [0, 255, 127],
|
|
159
|
-
"steelblue": [70, 130, 180],
|
|
160
|
-
"tan": [210, 180, 140],
|
|
161
|
-
"teal": [0, 128, 128],
|
|
162
|
-
"thistle": [216, 191, 216],
|
|
163
|
-
"tomato": [255, 99, 71],
|
|
164
|
-
"turquoise": [64, 224, 208],
|
|
165
|
-
"violet": [238, 130, 238],
|
|
166
|
-
"wheat": [245, 222, 179],
|
|
167
|
-
"white": [255, 255, 255],
|
|
168
|
-
"whitesmoke": [245, 245, 245],
|
|
169
|
-
"yellow": [255, 255, 0],
|
|
170
|
-
"yellowgreen": [154, 205, 50]
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
// ../node_modules/color-convert/conversions.js
|
|
176
|
-
var require_conversions = __commonJS({
|
|
177
|
-
"../node_modules/color-convert/conversions.js"(exports, module) {
|
|
178
|
-
var cssKeywords = require_color_name();
|
|
179
|
-
var reverseKeywords = {};
|
|
180
|
-
for (const key of Object.keys(cssKeywords)) {
|
|
181
|
-
reverseKeywords[cssKeywords[key]] = key;
|
|
182
|
-
}
|
|
183
|
-
var convert = {
|
|
184
|
-
rgb: { channels: 3, labels: "rgb" },
|
|
185
|
-
hsl: { channels: 3, labels: "hsl" },
|
|
186
|
-
hsv: { channels: 3, labels: "hsv" },
|
|
187
|
-
hwb: { channels: 3, labels: "hwb" },
|
|
188
|
-
cmyk: { channels: 4, labels: "cmyk" },
|
|
189
|
-
xyz: { channels: 3, labels: "xyz" },
|
|
190
|
-
lab: { channels: 3, labels: "lab" },
|
|
191
|
-
lch: { channels: 3, labels: "lch" },
|
|
192
|
-
hex: { channels: 1, labels: ["hex"] },
|
|
193
|
-
keyword: { channels: 1, labels: ["keyword"] },
|
|
194
|
-
ansi16: { channels: 1, labels: ["ansi16"] },
|
|
195
|
-
ansi256: { channels: 1, labels: ["ansi256"] },
|
|
196
|
-
hcg: { channels: 3, labels: ["h", "c", "g"] },
|
|
197
|
-
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
198
|
-
gray: { channels: 1, labels: ["gray"] }
|
|
199
|
-
};
|
|
200
|
-
module.exports = convert;
|
|
201
|
-
for (const model of Object.keys(convert)) {
|
|
202
|
-
if (!("channels" in convert[model])) {
|
|
203
|
-
throw new Error("missing channels property: " + model);
|
|
204
|
-
}
|
|
205
|
-
if (!("labels" in convert[model])) {
|
|
206
|
-
throw new Error("missing channel labels property: " + model);
|
|
207
|
-
}
|
|
208
|
-
if (convert[model].labels.length !== convert[model].channels) {
|
|
209
|
-
throw new Error("channel and label counts mismatch: " + model);
|
|
210
|
-
}
|
|
211
|
-
const { channels, labels } = convert[model];
|
|
212
|
-
delete convert[model].channels;
|
|
213
|
-
delete convert[model].labels;
|
|
214
|
-
Object.defineProperty(convert[model], "channels", { value: channels });
|
|
215
|
-
Object.defineProperty(convert[model], "labels", { value: labels });
|
|
216
|
-
}
|
|
217
|
-
convert.rgb.hsl = function(rgb) {
|
|
218
|
-
const r = rgb[0] / 255;
|
|
219
|
-
const g = rgb[1] / 255;
|
|
220
|
-
const b = rgb[2] / 255;
|
|
221
|
-
const min = Math.min(r, g, b);
|
|
222
|
-
const max = Math.max(r, g, b);
|
|
223
|
-
const delta = max - min;
|
|
224
|
-
let h;
|
|
225
|
-
let s;
|
|
226
|
-
if (max === min) {
|
|
227
|
-
h = 0;
|
|
228
|
-
} else if (r === max) {
|
|
229
|
-
h = (g - b) / delta;
|
|
230
|
-
} else if (g === max) {
|
|
231
|
-
h = 2 + (b - r) / delta;
|
|
232
|
-
} else if (b === max) {
|
|
233
|
-
h = 4 + (r - g) / delta;
|
|
234
|
-
}
|
|
235
|
-
h = Math.min(h * 60, 360);
|
|
236
|
-
if (h < 0) {
|
|
237
|
-
h += 360;
|
|
238
|
-
}
|
|
239
|
-
const l = (min + max) / 2;
|
|
240
|
-
if (max === min) {
|
|
241
|
-
s = 0;
|
|
242
|
-
} else if (l <= 0.5) {
|
|
243
|
-
s = delta / (max + min);
|
|
244
|
-
} else {
|
|
245
|
-
s = delta / (2 - max - min);
|
|
246
|
-
}
|
|
247
|
-
return [h, s * 100, l * 100];
|
|
248
|
-
};
|
|
249
|
-
convert.rgb.hsv = function(rgb) {
|
|
250
|
-
let rdif;
|
|
251
|
-
let gdif;
|
|
252
|
-
let bdif;
|
|
253
|
-
let h;
|
|
254
|
-
let s;
|
|
255
|
-
const r = rgb[0] / 255;
|
|
256
|
-
const g = rgb[1] / 255;
|
|
257
|
-
const b = rgb[2] / 255;
|
|
258
|
-
const v = Math.max(r, g, b);
|
|
259
|
-
const diff = v - Math.min(r, g, b);
|
|
260
|
-
const diffc = function(c) {
|
|
261
|
-
return (v - c) / 6 / diff + 1 / 2;
|
|
262
|
-
};
|
|
263
|
-
if (diff === 0) {
|
|
264
|
-
h = 0;
|
|
265
|
-
s = 0;
|
|
266
|
-
} else {
|
|
267
|
-
s = diff / v;
|
|
268
|
-
rdif = diffc(r);
|
|
269
|
-
gdif = diffc(g);
|
|
270
|
-
bdif = diffc(b);
|
|
271
|
-
if (r === v) {
|
|
272
|
-
h = bdif - gdif;
|
|
273
|
-
} else if (g === v) {
|
|
274
|
-
h = 1 / 3 + rdif - bdif;
|
|
275
|
-
} else if (b === v) {
|
|
276
|
-
h = 2 / 3 + gdif - rdif;
|
|
277
|
-
}
|
|
278
|
-
if (h < 0) {
|
|
279
|
-
h += 1;
|
|
280
|
-
} else if (h > 1) {
|
|
281
|
-
h -= 1;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
return [
|
|
285
|
-
h * 360,
|
|
286
|
-
s * 100,
|
|
287
|
-
v * 100
|
|
288
|
-
];
|
|
289
|
-
};
|
|
290
|
-
convert.rgb.hwb = function(rgb) {
|
|
291
|
-
const r = rgb[0];
|
|
292
|
-
const g = rgb[1];
|
|
293
|
-
let b = rgb[2];
|
|
294
|
-
const h = convert.rgb.hsl(rgb)[0];
|
|
295
|
-
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
296
|
-
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
297
|
-
return [h, w * 100, b * 100];
|
|
298
|
-
};
|
|
299
|
-
convert.rgb.cmyk = function(rgb) {
|
|
300
|
-
const r = rgb[0] / 255;
|
|
301
|
-
const g = rgb[1] / 255;
|
|
302
|
-
const b = rgb[2] / 255;
|
|
303
|
-
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
304
|
-
const c = (1 - r - k) / (1 - k) || 0;
|
|
305
|
-
const m = (1 - g - k) / (1 - k) || 0;
|
|
306
|
-
const y = (1 - b - k) / (1 - k) || 0;
|
|
307
|
-
return [c * 100, m * 100, y * 100, k * 100];
|
|
308
|
-
};
|
|
309
|
-
function comparativeDistance(x, y) {
|
|
310
|
-
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
311
|
-
}
|
|
312
|
-
convert.rgb.keyword = function(rgb) {
|
|
313
|
-
const reversed = reverseKeywords[rgb];
|
|
314
|
-
if (reversed) {
|
|
315
|
-
return reversed;
|
|
316
|
-
}
|
|
317
|
-
let currentClosestDistance = Infinity;
|
|
318
|
-
let currentClosestKeyword;
|
|
319
|
-
for (const keyword of Object.keys(cssKeywords)) {
|
|
320
|
-
const value = cssKeywords[keyword];
|
|
321
|
-
const distance = comparativeDistance(rgb, value);
|
|
322
|
-
if (distance < currentClosestDistance) {
|
|
323
|
-
currentClosestDistance = distance;
|
|
324
|
-
currentClosestKeyword = keyword;
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
return currentClosestKeyword;
|
|
328
|
-
};
|
|
329
|
-
convert.keyword.rgb = function(keyword) {
|
|
330
|
-
return cssKeywords[keyword];
|
|
331
|
-
};
|
|
332
|
-
convert.rgb.xyz = function(rgb) {
|
|
333
|
-
let r = rgb[0] / 255;
|
|
334
|
-
let g = rgb[1] / 255;
|
|
335
|
-
let b = rgb[2] / 255;
|
|
336
|
-
r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
|
|
337
|
-
g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
|
|
338
|
-
b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
|
|
339
|
-
const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
|
|
340
|
-
const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
|
|
341
|
-
const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
|
|
342
|
-
return [x * 100, y * 100, z * 100];
|
|
343
|
-
};
|
|
344
|
-
convert.rgb.lab = function(rgb) {
|
|
345
|
-
const xyz = convert.rgb.xyz(rgb);
|
|
346
|
-
let x = xyz[0];
|
|
347
|
-
let y = xyz[1];
|
|
348
|
-
let z = xyz[2];
|
|
349
|
-
x /= 95.047;
|
|
350
|
-
y /= 100;
|
|
351
|
-
z /= 108.883;
|
|
352
|
-
x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
353
|
-
y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
354
|
-
z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
355
|
-
const l = 116 * y - 16;
|
|
356
|
-
const a = 500 * (x - y);
|
|
357
|
-
const b = 200 * (y - z);
|
|
358
|
-
return [l, a, b];
|
|
359
|
-
};
|
|
360
|
-
convert.hsl.rgb = function(hsl) {
|
|
361
|
-
const h = hsl[0] / 360;
|
|
362
|
-
const s = hsl[1] / 100;
|
|
363
|
-
const l = hsl[2] / 100;
|
|
364
|
-
let t2;
|
|
365
|
-
let t3;
|
|
366
|
-
let val;
|
|
367
|
-
if (s === 0) {
|
|
368
|
-
val = l * 255;
|
|
369
|
-
return [val, val, val];
|
|
370
|
-
}
|
|
371
|
-
if (l < 0.5) {
|
|
372
|
-
t2 = l * (1 + s);
|
|
373
|
-
} else {
|
|
374
|
-
t2 = l + s - l * s;
|
|
375
|
-
}
|
|
376
|
-
const t1 = 2 * l - t2;
|
|
377
|
-
const rgb = [0, 0, 0];
|
|
378
|
-
for (let i = 0; i < 3; i++) {
|
|
379
|
-
t3 = h + 1 / 3 * -(i - 1);
|
|
380
|
-
if (t3 < 0) {
|
|
381
|
-
t3++;
|
|
382
|
-
}
|
|
383
|
-
if (t3 > 1) {
|
|
384
|
-
t3--;
|
|
385
|
-
}
|
|
386
|
-
if (6 * t3 < 1) {
|
|
387
|
-
val = t1 + (t2 - t1) * 6 * t3;
|
|
388
|
-
} else if (2 * t3 < 1) {
|
|
389
|
-
val = t2;
|
|
390
|
-
} else if (3 * t3 < 2) {
|
|
391
|
-
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
392
|
-
} else {
|
|
393
|
-
val = t1;
|
|
394
|
-
}
|
|
395
|
-
rgb[i] = val * 255;
|
|
396
|
-
}
|
|
397
|
-
return rgb;
|
|
398
|
-
};
|
|
399
|
-
convert.hsl.hsv = function(hsl) {
|
|
400
|
-
const h = hsl[0];
|
|
401
|
-
let s = hsl[1] / 100;
|
|
402
|
-
let l = hsl[2] / 100;
|
|
403
|
-
let smin = s;
|
|
404
|
-
const lmin = Math.max(l, 0.01);
|
|
405
|
-
l *= 2;
|
|
406
|
-
s *= l <= 1 ? l : 2 - l;
|
|
407
|
-
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
408
|
-
const v = (l + s) / 2;
|
|
409
|
-
const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
|
|
410
|
-
return [h, sv * 100, v * 100];
|
|
411
|
-
};
|
|
412
|
-
convert.hsv.rgb = function(hsv) {
|
|
413
|
-
const h = hsv[0] / 60;
|
|
414
|
-
const s = hsv[1] / 100;
|
|
415
|
-
let v = hsv[2] / 100;
|
|
416
|
-
const hi = Math.floor(h) % 6;
|
|
417
|
-
const f = h - Math.floor(h);
|
|
418
|
-
const p = 255 * v * (1 - s);
|
|
419
|
-
const q = 255 * v * (1 - s * f);
|
|
420
|
-
const t = 255 * v * (1 - s * (1 - f));
|
|
421
|
-
v *= 255;
|
|
422
|
-
switch (hi) {
|
|
423
|
-
case 0:
|
|
424
|
-
return [v, t, p];
|
|
425
|
-
case 1:
|
|
426
|
-
return [q, v, p];
|
|
427
|
-
case 2:
|
|
428
|
-
return [p, v, t];
|
|
429
|
-
case 3:
|
|
430
|
-
return [p, q, v];
|
|
431
|
-
case 4:
|
|
432
|
-
return [t, p, v];
|
|
433
|
-
case 5:
|
|
434
|
-
return [v, p, q];
|
|
435
|
-
}
|
|
436
|
-
};
|
|
437
|
-
convert.hsv.hsl = function(hsv) {
|
|
438
|
-
const h = hsv[0];
|
|
439
|
-
const s = hsv[1] / 100;
|
|
440
|
-
const v = hsv[2] / 100;
|
|
441
|
-
const vmin = Math.max(v, 0.01);
|
|
442
|
-
let sl;
|
|
443
|
-
let l;
|
|
444
|
-
l = (2 - s) * v;
|
|
445
|
-
const lmin = (2 - s) * vmin;
|
|
446
|
-
sl = s * vmin;
|
|
447
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
448
|
-
sl = sl || 0;
|
|
449
|
-
l /= 2;
|
|
450
|
-
return [h, sl * 100, l * 100];
|
|
451
|
-
};
|
|
452
|
-
convert.hwb.rgb = function(hwb) {
|
|
453
|
-
const h = hwb[0] / 360;
|
|
454
|
-
let wh = hwb[1] / 100;
|
|
455
|
-
let bl = hwb[2] / 100;
|
|
456
|
-
const ratio = wh + bl;
|
|
457
|
-
let f;
|
|
458
|
-
if (ratio > 1) {
|
|
459
|
-
wh /= ratio;
|
|
460
|
-
bl /= ratio;
|
|
461
|
-
}
|
|
462
|
-
const i = Math.floor(6 * h);
|
|
463
|
-
const v = 1 - bl;
|
|
464
|
-
f = 6 * h - i;
|
|
465
|
-
if ((i & 1) !== 0) {
|
|
466
|
-
f = 1 - f;
|
|
467
|
-
}
|
|
468
|
-
const n = wh + f * (v - wh);
|
|
469
|
-
let r;
|
|
470
|
-
let g;
|
|
471
|
-
let b;
|
|
472
|
-
switch (i) {
|
|
473
|
-
default:
|
|
474
|
-
case 6:
|
|
475
|
-
case 0:
|
|
476
|
-
r = v;
|
|
477
|
-
g = n;
|
|
478
|
-
b = wh;
|
|
479
|
-
break;
|
|
480
|
-
case 1:
|
|
481
|
-
r = n;
|
|
482
|
-
g = v;
|
|
483
|
-
b = wh;
|
|
484
|
-
break;
|
|
485
|
-
case 2:
|
|
486
|
-
r = wh;
|
|
487
|
-
g = v;
|
|
488
|
-
b = n;
|
|
489
|
-
break;
|
|
490
|
-
case 3:
|
|
491
|
-
r = wh;
|
|
492
|
-
g = n;
|
|
493
|
-
b = v;
|
|
494
|
-
break;
|
|
495
|
-
case 4:
|
|
496
|
-
r = n;
|
|
497
|
-
g = wh;
|
|
498
|
-
b = v;
|
|
499
|
-
break;
|
|
500
|
-
case 5:
|
|
501
|
-
r = v;
|
|
502
|
-
g = wh;
|
|
503
|
-
b = n;
|
|
504
|
-
break;
|
|
505
|
-
}
|
|
506
|
-
return [r * 255, g * 255, b * 255];
|
|
507
|
-
};
|
|
508
|
-
convert.cmyk.rgb = function(cmyk) {
|
|
509
|
-
const c = cmyk[0] / 100;
|
|
510
|
-
const m = cmyk[1] / 100;
|
|
511
|
-
const y = cmyk[2] / 100;
|
|
512
|
-
const k = cmyk[3] / 100;
|
|
513
|
-
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
514
|
-
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
515
|
-
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
516
|
-
return [r * 255, g * 255, b * 255];
|
|
517
|
-
};
|
|
518
|
-
convert.xyz.rgb = function(xyz) {
|
|
519
|
-
const x = xyz[0] / 100;
|
|
520
|
-
const y = xyz[1] / 100;
|
|
521
|
-
const z = xyz[2] / 100;
|
|
522
|
-
let r;
|
|
523
|
-
let g;
|
|
524
|
-
let b;
|
|
525
|
-
r = x * 3.2406 + y * -1.5372 + z * -0.4986;
|
|
526
|
-
g = x * -0.9689 + y * 1.8758 + z * 0.0415;
|
|
527
|
-
b = x * 0.0557 + y * -0.204 + z * 1.057;
|
|
528
|
-
r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
|
|
529
|
-
g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
|
|
530
|
-
b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
|
|
531
|
-
r = Math.min(Math.max(0, r), 1);
|
|
532
|
-
g = Math.min(Math.max(0, g), 1);
|
|
533
|
-
b = Math.min(Math.max(0, b), 1);
|
|
534
|
-
return [r * 255, g * 255, b * 255];
|
|
535
|
-
};
|
|
536
|
-
convert.xyz.lab = function(xyz) {
|
|
537
|
-
let x = xyz[0];
|
|
538
|
-
let y = xyz[1];
|
|
539
|
-
let z = xyz[2];
|
|
540
|
-
x /= 95.047;
|
|
541
|
-
y /= 100;
|
|
542
|
-
z /= 108.883;
|
|
543
|
-
x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
544
|
-
y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
545
|
-
z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
546
|
-
const l = 116 * y - 16;
|
|
547
|
-
const a = 500 * (x - y);
|
|
548
|
-
const b = 200 * (y - z);
|
|
549
|
-
return [l, a, b];
|
|
550
|
-
};
|
|
551
|
-
convert.lab.xyz = function(lab) {
|
|
552
|
-
const l = lab[0];
|
|
553
|
-
const a = lab[1];
|
|
554
|
-
const b = lab[2];
|
|
555
|
-
let x;
|
|
556
|
-
let y;
|
|
557
|
-
let z;
|
|
558
|
-
y = (l + 16) / 116;
|
|
559
|
-
x = a / 500 + y;
|
|
560
|
-
z = y - b / 200;
|
|
561
|
-
const y2 = y ** 3;
|
|
562
|
-
const x2 = x ** 3;
|
|
563
|
-
const z2 = z ** 3;
|
|
564
|
-
y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
|
|
565
|
-
x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
|
|
566
|
-
z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
|
|
567
|
-
x *= 95.047;
|
|
568
|
-
y *= 100;
|
|
569
|
-
z *= 108.883;
|
|
570
|
-
return [x, y, z];
|
|
571
|
-
};
|
|
572
|
-
convert.lab.lch = function(lab) {
|
|
573
|
-
const l = lab[0];
|
|
574
|
-
const a = lab[1];
|
|
575
|
-
const b = lab[2];
|
|
576
|
-
let h;
|
|
577
|
-
const hr = Math.atan2(b, a);
|
|
578
|
-
h = hr * 360 / 2 / Math.PI;
|
|
579
|
-
if (h < 0) {
|
|
580
|
-
h += 360;
|
|
581
|
-
}
|
|
582
|
-
const c = Math.sqrt(a * a + b * b);
|
|
583
|
-
return [l, c, h];
|
|
584
|
-
};
|
|
585
|
-
convert.lch.lab = function(lch) {
|
|
586
|
-
const l = lch[0];
|
|
587
|
-
const c = lch[1];
|
|
588
|
-
const h = lch[2];
|
|
589
|
-
const hr = h / 360 * 2 * Math.PI;
|
|
590
|
-
const a = c * Math.cos(hr);
|
|
591
|
-
const b = c * Math.sin(hr);
|
|
592
|
-
return [l, a, b];
|
|
593
|
-
};
|
|
594
|
-
convert.rgb.ansi16 = function(args, saturation = null) {
|
|
595
|
-
const [r, g, b] = args;
|
|
596
|
-
let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
|
597
|
-
value = Math.round(value / 50);
|
|
598
|
-
if (value === 0) {
|
|
599
|
-
return 30;
|
|
600
|
-
}
|
|
601
|
-
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
602
|
-
if (value === 2) {
|
|
603
|
-
ansi += 60;
|
|
604
|
-
}
|
|
605
|
-
return ansi;
|
|
606
|
-
};
|
|
607
|
-
convert.hsv.ansi16 = function(args) {
|
|
608
|
-
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
609
|
-
};
|
|
610
|
-
convert.rgb.ansi256 = function(args) {
|
|
611
|
-
const r = args[0];
|
|
612
|
-
const g = args[1];
|
|
613
|
-
const b = args[2];
|
|
614
|
-
if (r === g && g === b) {
|
|
615
|
-
if (r < 8) {
|
|
616
|
-
return 16;
|
|
617
|
-
}
|
|
618
|
-
if (r > 248) {
|
|
619
|
-
return 231;
|
|
620
|
-
}
|
|
621
|
-
return Math.round((r - 8) / 247 * 24) + 232;
|
|
622
|
-
}
|
|
623
|
-
const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
624
|
-
return ansi;
|
|
625
|
-
};
|
|
626
|
-
convert.ansi16.rgb = function(args) {
|
|
627
|
-
let color = args % 10;
|
|
628
|
-
if (color === 0 || color === 7) {
|
|
629
|
-
if (args > 50) {
|
|
630
|
-
color += 3.5;
|
|
631
|
-
}
|
|
632
|
-
color = color / 10.5 * 255;
|
|
633
|
-
return [color, color, color];
|
|
634
|
-
}
|
|
635
|
-
const mult = (~~(args > 50) + 1) * 0.5;
|
|
636
|
-
const r = (color & 1) * mult * 255;
|
|
637
|
-
const g = (color >> 1 & 1) * mult * 255;
|
|
638
|
-
const b = (color >> 2 & 1) * mult * 255;
|
|
639
|
-
return [r, g, b];
|
|
640
|
-
};
|
|
641
|
-
convert.ansi256.rgb = function(args) {
|
|
642
|
-
if (args >= 232) {
|
|
643
|
-
const c = (args - 232) * 10 + 8;
|
|
644
|
-
return [c, c, c];
|
|
645
|
-
}
|
|
646
|
-
args -= 16;
|
|
647
|
-
let rem;
|
|
648
|
-
const r = Math.floor(args / 36) / 5 * 255;
|
|
649
|
-
const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
650
|
-
const b = rem % 6 / 5 * 255;
|
|
651
|
-
return [r, g, b];
|
|
652
|
-
};
|
|
653
|
-
convert.rgb.hex = function(args) {
|
|
654
|
-
const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
|
|
655
|
-
const string = integer.toString(16).toUpperCase();
|
|
656
|
-
return "000000".substring(string.length) + string;
|
|
657
|
-
};
|
|
658
|
-
convert.hex.rgb = function(args) {
|
|
659
|
-
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
660
|
-
if (!match) {
|
|
661
|
-
return [0, 0, 0];
|
|
662
|
-
}
|
|
663
|
-
let colorString = match[0];
|
|
664
|
-
if (match[0].length === 3) {
|
|
665
|
-
colorString = colorString.split("").map((char) => {
|
|
666
|
-
return char + char;
|
|
667
|
-
}).join("");
|
|
668
|
-
}
|
|
669
|
-
const integer = parseInt(colorString, 16);
|
|
670
|
-
const r = integer >> 16 & 255;
|
|
671
|
-
const g = integer >> 8 & 255;
|
|
672
|
-
const b = integer & 255;
|
|
673
|
-
return [r, g, b];
|
|
674
|
-
};
|
|
675
|
-
convert.rgb.hcg = function(rgb) {
|
|
676
|
-
const r = rgb[0] / 255;
|
|
677
|
-
const g = rgb[1] / 255;
|
|
678
|
-
const b = rgb[2] / 255;
|
|
679
|
-
const max = Math.max(Math.max(r, g), b);
|
|
680
|
-
const min = Math.min(Math.min(r, g), b);
|
|
681
|
-
const chroma = max - min;
|
|
682
|
-
let grayscale;
|
|
683
|
-
let hue;
|
|
684
|
-
if (chroma < 1) {
|
|
685
|
-
grayscale = min / (1 - chroma);
|
|
686
|
-
} else {
|
|
687
|
-
grayscale = 0;
|
|
688
|
-
}
|
|
689
|
-
if (chroma <= 0) {
|
|
690
|
-
hue = 0;
|
|
691
|
-
} else if (max === r) {
|
|
692
|
-
hue = (g - b) / chroma % 6;
|
|
693
|
-
} else if (max === g) {
|
|
694
|
-
hue = 2 + (b - r) / chroma;
|
|
695
|
-
} else {
|
|
696
|
-
hue = 4 + (r - g) / chroma;
|
|
697
|
-
}
|
|
698
|
-
hue /= 6;
|
|
699
|
-
hue %= 1;
|
|
700
|
-
return [hue * 360, chroma * 100, grayscale * 100];
|
|
701
|
-
};
|
|
702
|
-
convert.hsl.hcg = function(hsl) {
|
|
703
|
-
const s = hsl[1] / 100;
|
|
704
|
-
const l = hsl[2] / 100;
|
|
705
|
-
const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
|
|
706
|
-
let f = 0;
|
|
707
|
-
if (c < 1) {
|
|
708
|
-
f = (l - 0.5 * c) / (1 - c);
|
|
709
|
-
}
|
|
710
|
-
return [hsl[0], c * 100, f * 100];
|
|
711
|
-
};
|
|
712
|
-
convert.hsv.hcg = function(hsv) {
|
|
713
|
-
const s = hsv[1] / 100;
|
|
714
|
-
const v = hsv[2] / 100;
|
|
715
|
-
const c = s * v;
|
|
716
|
-
let f = 0;
|
|
717
|
-
if (c < 1) {
|
|
718
|
-
f = (v - c) / (1 - c);
|
|
719
|
-
}
|
|
720
|
-
return [hsv[0], c * 100, f * 100];
|
|
721
|
-
};
|
|
722
|
-
convert.hcg.rgb = function(hcg) {
|
|
723
|
-
const h = hcg[0] / 360;
|
|
724
|
-
const c = hcg[1] / 100;
|
|
725
|
-
const g = hcg[2] / 100;
|
|
726
|
-
if (c === 0) {
|
|
727
|
-
return [g * 255, g * 255, g * 255];
|
|
728
|
-
}
|
|
729
|
-
const pure = [0, 0, 0];
|
|
730
|
-
const hi = h % 1 * 6;
|
|
731
|
-
const v = hi % 1;
|
|
732
|
-
const w = 1 - v;
|
|
733
|
-
let mg = 0;
|
|
734
|
-
switch (Math.floor(hi)) {
|
|
735
|
-
case 0:
|
|
736
|
-
pure[0] = 1;
|
|
737
|
-
pure[1] = v;
|
|
738
|
-
pure[2] = 0;
|
|
739
|
-
break;
|
|
740
|
-
case 1:
|
|
741
|
-
pure[0] = w;
|
|
742
|
-
pure[1] = 1;
|
|
743
|
-
pure[2] = 0;
|
|
744
|
-
break;
|
|
745
|
-
case 2:
|
|
746
|
-
pure[0] = 0;
|
|
747
|
-
pure[1] = 1;
|
|
748
|
-
pure[2] = v;
|
|
749
|
-
break;
|
|
750
|
-
case 3:
|
|
751
|
-
pure[0] = 0;
|
|
752
|
-
pure[1] = w;
|
|
753
|
-
pure[2] = 1;
|
|
754
|
-
break;
|
|
755
|
-
case 4:
|
|
756
|
-
pure[0] = v;
|
|
757
|
-
pure[1] = 0;
|
|
758
|
-
pure[2] = 1;
|
|
759
|
-
break;
|
|
760
|
-
default:
|
|
761
|
-
pure[0] = 1;
|
|
762
|
-
pure[1] = 0;
|
|
763
|
-
pure[2] = w;
|
|
764
|
-
}
|
|
765
|
-
mg = (1 - c) * g;
|
|
766
|
-
return [
|
|
767
|
-
(c * pure[0] + mg) * 255,
|
|
768
|
-
(c * pure[1] + mg) * 255,
|
|
769
|
-
(c * pure[2] + mg) * 255
|
|
770
|
-
];
|
|
771
|
-
};
|
|
772
|
-
convert.hcg.hsv = function(hcg) {
|
|
773
|
-
const c = hcg[1] / 100;
|
|
774
|
-
const g = hcg[2] / 100;
|
|
775
|
-
const v = c + g * (1 - c);
|
|
776
|
-
let f = 0;
|
|
777
|
-
if (v > 0) {
|
|
778
|
-
f = c / v;
|
|
779
|
-
}
|
|
780
|
-
return [hcg[0], f * 100, v * 100];
|
|
781
|
-
};
|
|
782
|
-
convert.hcg.hsl = function(hcg) {
|
|
783
|
-
const c = hcg[1] / 100;
|
|
784
|
-
const g = hcg[2] / 100;
|
|
785
|
-
const l = g * (1 - c) + 0.5 * c;
|
|
786
|
-
let s = 0;
|
|
787
|
-
if (l > 0 && l < 0.5) {
|
|
788
|
-
s = c / (2 * l);
|
|
789
|
-
} else if (l >= 0.5 && l < 1) {
|
|
790
|
-
s = c / (2 * (1 - l));
|
|
791
|
-
}
|
|
792
|
-
return [hcg[0], s * 100, l * 100];
|
|
793
|
-
};
|
|
794
|
-
convert.hcg.hwb = function(hcg) {
|
|
795
|
-
const c = hcg[1] / 100;
|
|
796
|
-
const g = hcg[2] / 100;
|
|
797
|
-
const v = c + g * (1 - c);
|
|
798
|
-
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
|
799
|
-
};
|
|
800
|
-
convert.hwb.hcg = function(hwb) {
|
|
801
|
-
const w = hwb[1] / 100;
|
|
802
|
-
const b = hwb[2] / 100;
|
|
803
|
-
const v = 1 - b;
|
|
804
|
-
const c = v - w;
|
|
805
|
-
let g = 0;
|
|
806
|
-
if (c < 1) {
|
|
807
|
-
g = (v - c) / (1 - c);
|
|
808
|
-
}
|
|
809
|
-
return [hwb[0], c * 100, g * 100];
|
|
810
|
-
};
|
|
811
|
-
convert.apple.rgb = function(apple) {
|
|
812
|
-
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
813
|
-
};
|
|
814
|
-
convert.rgb.apple = function(rgb) {
|
|
815
|
-
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
816
|
-
};
|
|
817
|
-
convert.gray.rgb = function(args) {
|
|
818
|
-
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
819
|
-
};
|
|
820
|
-
convert.gray.hsl = function(args) {
|
|
821
|
-
return [0, 0, args[0]];
|
|
822
|
-
};
|
|
823
|
-
convert.gray.hsv = convert.gray.hsl;
|
|
824
|
-
convert.gray.hwb = function(gray) {
|
|
825
|
-
return [0, 100, gray[0]];
|
|
826
|
-
};
|
|
827
|
-
convert.gray.cmyk = function(gray) {
|
|
828
|
-
return [0, 0, 0, gray[0]];
|
|
829
|
-
};
|
|
830
|
-
convert.gray.lab = function(gray) {
|
|
831
|
-
return [gray[0], 0, 0];
|
|
832
|
-
};
|
|
833
|
-
convert.gray.hex = function(gray) {
|
|
834
|
-
const val = Math.round(gray[0] / 100 * 255) & 255;
|
|
835
|
-
const integer = (val << 16) + (val << 8) + val;
|
|
836
|
-
const string = integer.toString(16).toUpperCase();
|
|
837
|
-
return "000000".substring(string.length) + string;
|
|
838
|
-
};
|
|
839
|
-
convert.rgb.gray = function(rgb) {
|
|
840
|
-
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
841
|
-
return [val / 255 * 100];
|
|
842
|
-
};
|
|
843
|
-
}
|
|
844
|
-
});
|
|
845
|
-
|
|
846
|
-
// ../node_modules/color-convert/route.js
|
|
847
|
-
var require_route = __commonJS({
|
|
848
|
-
"../node_modules/color-convert/route.js"(exports, module) {
|
|
849
|
-
var conversions = require_conversions();
|
|
850
|
-
function buildGraph() {
|
|
851
|
-
const graph = {};
|
|
852
|
-
const models = Object.keys(conversions);
|
|
853
|
-
for (let len = models.length, i = 0; i < len; i++) {
|
|
854
|
-
graph[models[i]] = {
|
|
855
|
-
// http://jsperf.com/1-vs-infinity
|
|
856
|
-
// micro-opt, but this is simple.
|
|
857
|
-
distance: -1,
|
|
858
|
-
parent: null
|
|
859
|
-
};
|
|
860
|
-
}
|
|
861
|
-
return graph;
|
|
862
|
-
}
|
|
863
|
-
function deriveBFS(fromModel) {
|
|
864
|
-
const graph = buildGraph();
|
|
865
|
-
const queue = [fromModel];
|
|
866
|
-
graph[fromModel].distance = 0;
|
|
867
|
-
while (queue.length) {
|
|
868
|
-
const current = queue.pop();
|
|
869
|
-
const adjacents = Object.keys(conversions[current]);
|
|
870
|
-
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
871
|
-
const adjacent = adjacents[i];
|
|
872
|
-
const node = graph[adjacent];
|
|
873
|
-
if (node.distance === -1) {
|
|
874
|
-
node.distance = graph[current].distance + 1;
|
|
875
|
-
node.parent = current;
|
|
876
|
-
queue.unshift(adjacent);
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
return graph;
|
|
881
|
-
}
|
|
882
|
-
function link(from, to) {
|
|
883
|
-
return function(args) {
|
|
884
|
-
return to(from(args));
|
|
885
|
-
};
|
|
886
|
-
}
|
|
887
|
-
function wrapConversion(toModel, graph) {
|
|
888
|
-
const path = [graph[toModel].parent, toModel];
|
|
889
|
-
let fn = conversions[graph[toModel].parent][toModel];
|
|
890
|
-
let cur = graph[toModel].parent;
|
|
891
|
-
while (graph[cur].parent) {
|
|
892
|
-
path.unshift(graph[cur].parent);
|
|
893
|
-
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
894
|
-
cur = graph[cur].parent;
|
|
895
|
-
}
|
|
896
|
-
fn.conversion = path;
|
|
897
|
-
return fn;
|
|
898
|
-
}
|
|
899
|
-
module.exports = function(fromModel) {
|
|
900
|
-
const graph = deriveBFS(fromModel);
|
|
901
|
-
const conversion = {};
|
|
902
|
-
const models = Object.keys(graph);
|
|
903
|
-
for (let len = models.length, i = 0; i < len; i++) {
|
|
904
|
-
const toModel = models[i];
|
|
905
|
-
const node = graph[toModel];
|
|
906
|
-
if (node.parent === null) {
|
|
907
|
-
continue;
|
|
908
|
-
}
|
|
909
|
-
conversion[toModel] = wrapConversion(toModel, graph);
|
|
910
|
-
}
|
|
911
|
-
return conversion;
|
|
912
|
-
};
|
|
913
|
-
}
|
|
914
|
-
});
|
|
915
|
-
|
|
916
|
-
// ../node_modules/color-convert/index.js
|
|
917
|
-
var require_color_convert = __commonJS({
|
|
918
|
-
"../node_modules/color-convert/index.js"(exports, module) {
|
|
919
|
-
var conversions = require_conversions();
|
|
920
|
-
var route = require_route();
|
|
921
|
-
var convert = {};
|
|
922
|
-
var models = Object.keys(conversions);
|
|
923
|
-
function wrapRaw(fn) {
|
|
924
|
-
const wrappedFn = function(...args) {
|
|
925
|
-
const arg0 = args[0];
|
|
926
|
-
if (arg0 === void 0 || arg0 === null) {
|
|
927
|
-
return arg0;
|
|
928
|
-
}
|
|
929
|
-
if (arg0.length > 1) {
|
|
930
|
-
args = arg0;
|
|
931
|
-
}
|
|
932
|
-
return fn(args);
|
|
933
|
-
};
|
|
934
|
-
if ("conversion" in fn) {
|
|
935
|
-
wrappedFn.conversion = fn.conversion;
|
|
936
|
-
}
|
|
937
|
-
return wrappedFn;
|
|
938
|
-
}
|
|
939
|
-
function wrapRounded(fn) {
|
|
940
|
-
const wrappedFn = function(...args) {
|
|
941
|
-
const arg0 = args[0];
|
|
942
|
-
if (arg0 === void 0 || arg0 === null) {
|
|
943
|
-
return arg0;
|
|
944
|
-
}
|
|
945
|
-
if (arg0.length > 1) {
|
|
946
|
-
args = arg0;
|
|
947
|
-
}
|
|
948
|
-
const result = fn(args);
|
|
949
|
-
if (typeof result === "object") {
|
|
950
|
-
for (let len = result.length, i = 0; i < len; i++) {
|
|
951
|
-
result[i] = Math.round(result[i]);
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
return result;
|
|
955
|
-
};
|
|
956
|
-
if ("conversion" in fn) {
|
|
957
|
-
wrappedFn.conversion = fn.conversion;
|
|
958
|
-
}
|
|
959
|
-
return wrappedFn;
|
|
960
|
-
}
|
|
961
|
-
models.forEach((fromModel) => {
|
|
962
|
-
convert[fromModel] = {};
|
|
963
|
-
Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
|
|
964
|
-
Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
|
|
965
|
-
const routes = route(fromModel);
|
|
966
|
-
const routeModels = Object.keys(routes);
|
|
967
|
-
routeModels.forEach((toModel) => {
|
|
968
|
-
const fn = routes[toModel];
|
|
969
|
-
convert[fromModel][toModel] = wrapRounded(fn);
|
|
970
|
-
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
971
|
-
});
|
|
972
|
-
});
|
|
973
|
-
module.exports = convert;
|
|
974
|
-
}
|
|
975
|
-
});
|
|
976
|
-
|
|
977
|
-
// ../node_modules/ansi-styles/index.js
|
|
978
|
-
var require_ansi_styles = __commonJS({
|
|
979
|
-
"../node_modules/ansi-styles/index.js"(exports, module) {
|
|
980
|
-
"use strict";
|
|
981
|
-
var wrapAnsi16 = (fn, offset) => (...args) => {
|
|
982
|
-
const code = fn(...args);
|
|
983
|
-
return `\x1B[${code + offset}m`;
|
|
984
|
-
};
|
|
985
|
-
var wrapAnsi256 = (fn, offset) => (...args) => {
|
|
986
|
-
const code = fn(...args);
|
|
987
|
-
return `\x1B[${38 + offset};5;${code}m`;
|
|
988
|
-
};
|
|
989
|
-
var wrapAnsi16m = (fn, offset) => (...args) => {
|
|
990
|
-
const rgb = fn(...args);
|
|
991
|
-
return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
992
|
-
};
|
|
993
|
-
var ansi2ansi = (n) => n;
|
|
994
|
-
var rgb2rgb = (r, g, b) => [r, g, b];
|
|
995
|
-
var setLazyProperty = (object, property, get) => {
|
|
996
|
-
Object.defineProperty(object, property, {
|
|
997
|
-
get: () => {
|
|
998
|
-
const value = get();
|
|
999
|
-
Object.defineProperty(object, property, {
|
|
1000
|
-
value,
|
|
1001
|
-
enumerable: true,
|
|
1002
|
-
configurable: true
|
|
1003
|
-
});
|
|
1004
|
-
return value;
|
|
1005
|
-
},
|
|
1006
|
-
enumerable: true,
|
|
1007
|
-
configurable: true
|
|
1008
|
-
});
|
|
1009
|
-
};
|
|
1010
|
-
var colorConvert;
|
|
1011
|
-
var makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
1012
|
-
if (colorConvert === void 0) {
|
|
1013
|
-
colorConvert = require_color_convert();
|
|
1014
|
-
}
|
|
1015
|
-
const offset = isBackground ? 10 : 0;
|
|
1016
|
-
const styles = {};
|
|
1017
|
-
for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
|
|
1018
|
-
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
1019
|
-
if (sourceSpace === targetSpace) {
|
|
1020
|
-
styles[name] = wrap(identity, offset);
|
|
1021
|
-
} else if (typeof suite === "object") {
|
|
1022
|
-
styles[name] = wrap(suite[targetSpace], offset);
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
return styles;
|
|
1026
|
-
};
|
|
1027
|
-
function assembleStyles() {
|
|
1028
|
-
const codes = /* @__PURE__ */ new Map();
|
|
1029
|
-
const styles = {
|
|
1030
|
-
modifier: {
|
|
1031
|
-
reset: [0, 0],
|
|
1032
|
-
// 21 isn't widely supported and 22 does the same thing
|
|
1033
|
-
bold: [1, 22],
|
|
1034
|
-
dim: [2, 22],
|
|
1035
|
-
italic: [3, 23],
|
|
1036
|
-
underline: [4, 24],
|
|
1037
|
-
inverse: [7, 27],
|
|
1038
|
-
hidden: [8, 28],
|
|
1039
|
-
strikethrough: [9, 29]
|
|
1040
|
-
},
|
|
1041
|
-
color: {
|
|
1042
|
-
black: [30, 39],
|
|
1043
|
-
red: [31, 39],
|
|
1044
|
-
green: [32, 39],
|
|
1045
|
-
yellow: [33, 39],
|
|
1046
|
-
blue: [34, 39],
|
|
1047
|
-
magenta: [35, 39],
|
|
1048
|
-
cyan: [36, 39],
|
|
1049
|
-
white: [37, 39],
|
|
1050
|
-
// Bright color
|
|
1051
|
-
blackBright: [90, 39],
|
|
1052
|
-
redBright: [91, 39],
|
|
1053
|
-
greenBright: [92, 39],
|
|
1054
|
-
yellowBright: [93, 39],
|
|
1055
|
-
blueBright: [94, 39],
|
|
1056
|
-
magentaBright: [95, 39],
|
|
1057
|
-
cyanBright: [96, 39],
|
|
1058
|
-
whiteBright: [97, 39]
|
|
1059
|
-
},
|
|
1060
|
-
bgColor: {
|
|
1061
|
-
bgBlack: [40, 49],
|
|
1062
|
-
bgRed: [41, 49],
|
|
1063
|
-
bgGreen: [42, 49],
|
|
1064
|
-
bgYellow: [43, 49],
|
|
1065
|
-
bgBlue: [44, 49],
|
|
1066
|
-
bgMagenta: [45, 49],
|
|
1067
|
-
bgCyan: [46, 49],
|
|
1068
|
-
bgWhite: [47, 49],
|
|
1069
|
-
// Bright color
|
|
1070
|
-
bgBlackBright: [100, 49],
|
|
1071
|
-
bgRedBright: [101, 49],
|
|
1072
|
-
bgGreenBright: [102, 49],
|
|
1073
|
-
bgYellowBright: [103, 49],
|
|
1074
|
-
bgBlueBright: [104, 49],
|
|
1075
|
-
bgMagentaBright: [105, 49],
|
|
1076
|
-
bgCyanBright: [106, 49],
|
|
1077
|
-
bgWhiteBright: [107, 49]
|
|
1078
|
-
}
|
|
1079
|
-
};
|
|
1080
|
-
styles.color.gray = styles.color.blackBright;
|
|
1081
|
-
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
|
1082
|
-
styles.color.grey = styles.color.blackBright;
|
|
1083
|
-
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
|
1084
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
|
1085
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
1086
|
-
styles[styleName] = {
|
|
1087
|
-
open: `\x1B[${style[0]}m`,
|
|
1088
|
-
close: `\x1B[${style[1]}m`
|
|
1089
|
-
};
|
|
1090
|
-
group[styleName] = styles[styleName];
|
|
1091
|
-
codes.set(style[0], style[1]);
|
|
1092
|
-
}
|
|
1093
|
-
Object.defineProperty(styles, groupName, {
|
|
1094
|
-
value: group,
|
|
1095
|
-
enumerable: false
|
|
1096
|
-
});
|
|
1097
|
-
}
|
|
1098
|
-
Object.defineProperty(styles, "codes", {
|
|
1099
|
-
value: codes,
|
|
1100
|
-
enumerable: false
|
|
1101
|
-
});
|
|
1102
|
-
styles.color.close = "\x1B[39m";
|
|
1103
|
-
styles.bgColor.close = "\x1B[49m";
|
|
1104
|
-
setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
|
|
1105
|
-
setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
|
|
1106
|
-
setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
|
|
1107
|
-
setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
|
|
1108
|
-
setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
|
|
1109
|
-
setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
|
|
1110
|
-
return styles;
|
|
1111
|
-
}
|
|
1112
|
-
Object.defineProperty(module, "exports", {
|
|
1113
|
-
enumerable: true,
|
|
1114
|
-
get: assembleStyles
|
|
1115
|
-
});
|
|
1116
|
-
}
|
|
1117
|
-
});
|
|
1118
|
-
|
|
1119
|
-
// ../node_modules/has-flag/index.js
|
|
1120
|
-
var require_has_flag = __commonJS({
|
|
1121
|
-
"../node_modules/has-flag/index.js"(exports, module) {
|
|
1122
|
-
"use strict";
|
|
1123
|
-
module.exports = (flag, argv = process.argv) => {
|
|
1124
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
1125
|
-
const position = argv.indexOf(prefix + flag);
|
|
1126
|
-
const terminatorPosition = argv.indexOf("--");
|
|
1127
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
1128
|
-
};
|
|
1129
|
-
}
|
|
1130
|
-
});
|
|
1131
|
-
|
|
1132
|
-
// ../node_modules/chalk/node_modules/supports-color/index.js
|
|
1133
|
-
var require_supports_color = __commonJS({
|
|
1134
|
-
"../node_modules/chalk/node_modules/supports-color/index.js"(exports, module) {
|
|
1135
|
-
"use strict";
|
|
1136
|
-
var os = __require("os");
|
|
1137
|
-
var tty = __require("tty");
|
|
1138
|
-
var hasFlag = require_has_flag();
|
|
1139
|
-
var { env } = process;
|
|
1140
|
-
var forceColor;
|
|
1141
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
1142
|
-
forceColor = 0;
|
|
1143
|
-
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
1144
|
-
forceColor = 1;
|
|
1145
|
-
}
|
|
1146
|
-
if ("FORCE_COLOR" in env) {
|
|
1147
|
-
if (env.FORCE_COLOR === "true") {
|
|
1148
|
-
forceColor = 1;
|
|
1149
|
-
} else if (env.FORCE_COLOR === "false") {
|
|
1150
|
-
forceColor = 0;
|
|
1151
|
-
} else {
|
|
1152
|
-
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
1153
|
-
}
|
|
1154
|
-
}
|
|
1155
|
-
function translateLevel(level) {
|
|
1156
|
-
if (level === 0) {
|
|
1157
|
-
return false;
|
|
1158
|
-
}
|
|
1159
|
-
return {
|
|
1160
|
-
level,
|
|
1161
|
-
hasBasic: true,
|
|
1162
|
-
has256: level >= 2,
|
|
1163
|
-
has16m: level >= 3
|
|
1164
|
-
};
|
|
1165
|
-
}
|
|
1166
|
-
function supportsColor(haveStream, streamIsTTY) {
|
|
1167
|
-
if (forceColor === 0) {
|
|
1168
|
-
return 0;
|
|
1169
|
-
}
|
|
1170
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
1171
|
-
return 3;
|
|
1172
|
-
}
|
|
1173
|
-
if (hasFlag("color=256")) {
|
|
1174
|
-
return 2;
|
|
1175
|
-
}
|
|
1176
|
-
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
1177
|
-
return 0;
|
|
1178
|
-
}
|
|
1179
|
-
const min = forceColor || 0;
|
|
1180
|
-
if (env.TERM === "dumb") {
|
|
1181
|
-
return min;
|
|
1182
|
-
}
|
|
1183
|
-
if (process.platform === "win32") {
|
|
1184
|
-
const osRelease = os.release().split(".");
|
|
1185
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
1186
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
1187
|
-
}
|
|
1188
|
-
return 1;
|
|
1189
|
-
}
|
|
1190
|
-
if ("CI" in env) {
|
|
1191
|
-
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
1192
|
-
return 1;
|
|
1193
|
-
}
|
|
1194
|
-
return min;
|
|
1195
|
-
}
|
|
1196
|
-
if ("TEAMCITY_VERSION" in env) {
|
|
1197
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
1198
|
-
}
|
|
1199
|
-
if (env.COLORTERM === "truecolor") {
|
|
1200
|
-
return 3;
|
|
1201
|
-
}
|
|
1202
|
-
if ("TERM_PROGRAM" in env) {
|
|
1203
|
-
const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
1204
|
-
switch (env.TERM_PROGRAM) {
|
|
1205
|
-
case "iTerm.app":
|
|
1206
|
-
return version >= 3 ? 3 : 2;
|
|
1207
|
-
case "Apple_Terminal":
|
|
1208
|
-
return 2;
|
|
1209
|
-
}
|
|
1210
|
-
}
|
|
1211
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
|
1212
|
-
return 2;
|
|
1213
|
-
}
|
|
1214
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
1215
|
-
return 1;
|
|
1216
|
-
}
|
|
1217
|
-
if ("COLORTERM" in env) {
|
|
1218
|
-
return 1;
|
|
1219
|
-
}
|
|
1220
|
-
return min;
|
|
1221
|
-
}
|
|
1222
|
-
function getSupportLevel(stream) {
|
|
1223
|
-
const level = supportsColor(stream, stream && stream.isTTY);
|
|
1224
|
-
return translateLevel(level);
|
|
1225
|
-
}
|
|
1226
|
-
module.exports = {
|
|
1227
|
-
supportsColor: getSupportLevel,
|
|
1228
|
-
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
|
1229
|
-
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
1230
|
-
};
|
|
1231
|
-
}
|
|
1232
|
-
});
|
|
1233
|
-
|
|
1234
|
-
// ../node_modules/chalk/source/util.js
|
|
1235
|
-
var require_util = __commonJS({
|
|
1236
|
-
"../node_modules/chalk/source/util.js"(exports, module) {
|
|
1237
|
-
"use strict";
|
|
1238
|
-
var stringReplaceAll = (string, substring, replacer) => {
|
|
1239
|
-
let index = string.indexOf(substring);
|
|
1240
|
-
if (index === -1) {
|
|
1241
|
-
return string;
|
|
1242
|
-
}
|
|
1243
|
-
const substringLength = substring.length;
|
|
1244
|
-
let endIndex = 0;
|
|
1245
|
-
let returnValue = "";
|
|
1246
|
-
do {
|
|
1247
|
-
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
|
1248
|
-
endIndex = index + substringLength;
|
|
1249
|
-
index = string.indexOf(substring, endIndex);
|
|
1250
|
-
} while (index !== -1);
|
|
1251
|
-
returnValue += string.substr(endIndex);
|
|
1252
|
-
return returnValue;
|
|
1253
|
-
};
|
|
1254
|
-
var stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
|
|
1255
|
-
let endIndex = 0;
|
|
1256
|
-
let returnValue = "";
|
|
1257
|
-
do {
|
|
1258
|
-
const gotCR = string[index - 1] === "\r";
|
|
1259
|
-
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
1260
|
-
endIndex = index + 1;
|
|
1261
|
-
index = string.indexOf("\n", endIndex);
|
|
1262
|
-
} while (index !== -1);
|
|
1263
|
-
returnValue += string.substr(endIndex);
|
|
1264
|
-
return returnValue;
|
|
1265
|
-
};
|
|
1266
|
-
module.exports = {
|
|
1267
|
-
stringReplaceAll,
|
|
1268
|
-
stringEncaseCRLFWithFirstIndex
|
|
1269
|
-
};
|
|
1270
|
-
}
|
|
1271
|
-
});
|
|
1272
|
-
|
|
1273
|
-
// ../node_modules/chalk/source/templates.js
|
|
1274
|
-
var require_templates = __commonJS({
|
|
1275
|
-
"../node_modules/chalk/source/templates.js"(exports, module) {
|
|
1276
|
-
"use strict";
|
|
1277
|
-
var TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
|
1278
|
-
var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
1279
|
-
var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
1280
|
-
var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
|
|
1281
|
-
var ESCAPES = /* @__PURE__ */ new Map([
|
|
1282
|
-
["n", "\n"],
|
|
1283
|
-
["r", "\r"],
|
|
1284
|
-
["t", " "],
|
|
1285
|
-
["b", "\b"],
|
|
1286
|
-
["f", "\f"],
|
|
1287
|
-
["v", "\v"],
|
|
1288
|
-
["0", "\0"],
|
|
1289
|
-
["\\", "\\"],
|
|
1290
|
-
["e", "\x1B"],
|
|
1291
|
-
["a", "\x07"]
|
|
1292
|
-
]);
|
|
1293
|
-
function unescape(c) {
|
|
1294
|
-
const u = c[0] === "u";
|
|
1295
|
-
const bracket = c[1] === "{";
|
|
1296
|
-
if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
|
|
1297
|
-
return String.fromCharCode(parseInt(c.slice(1), 16));
|
|
1298
|
-
}
|
|
1299
|
-
if (u && bracket) {
|
|
1300
|
-
return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
|
|
1301
|
-
}
|
|
1302
|
-
return ESCAPES.get(c) || c;
|
|
1303
|
-
}
|
|
1304
|
-
function parseArguments(name, arguments_) {
|
|
1305
|
-
const results = [];
|
|
1306
|
-
const chunks = arguments_.trim().split(/\s*,\s*/g);
|
|
1307
|
-
let matches;
|
|
1308
|
-
for (const chunk of chunks) {
|
|
1309
|
-
const number = Number(chunk);
|
|
1310
|
-
if (!Number.isNaN(number)) {
|
|
1311
|
-
results.push(number);
|
|
1312
|
-
} else if (matches = chunk.match(STRING_REGEX)) {
|
|
1313
|
-
results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
|
|
1314
|
-
} else {
|
|
1315
|
-
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
|
|
1316
|
-
}
|
|
1317
|
-
}
|
|
1318
|
-
return results;
|
|
1319
|
-
}
|
|
1320
|
-
function parseStyle(style) {
|
|
1321
|
-
STYLE_REGEX.lastIndex = 0;
|
|
1322
|
-
const results = [];
|
|
1323
|
-
let matches;
|
|
1324
|
-
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
|
1325
|
-
const name = matches[1];
|
|
1326
|
-
if (matches[2]) {
|
|
1327
|
-
const args = parseArguments(name, matches[2]);
|
|
1328
|
-
results.push([name].concat(args));
|
|
1329
|
-
} else {
|
|
1330
|
-
results.push([name]);
|
|
1331
|
-
}
|
|
1332
|
-
}
|
|
1333
|
-
return results;
|
|
1334
|
-
}
|
|
1335
|
-
function buildStyle(chalk, styles) {
|
|
1336
|
-
const enabled = {};
|
|
1337
|
-
for (const layer of styles) {
|
|
1338
|
-
for (const style of layer.styles) {
|
|
1339
|
-
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
1340
|
-
}
|
|
1341
|
-
}
|
|
1342
|
-
let current = chalk;
|
|
1343
|
-
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
1344
|
-
if (!Array.isArray(styles2)) {
|
|
1345
|
-
continue;
|
|
1346
|
-
}
|
|
1347
|
-
if (!(styleName in current)) {
|
|
1348
|
-
throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
1349
|
-
}
|
|
1350
|
-
current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
|
|
1351
|
-
}
|
|
1352
|
-
return current;
|
|
1353
|
-
}
|
|
1354
|
-
module.exports = (chalk, temporary) => {
|
|
1355
|
-
const styles = [];
|
|
1356
|
-
const chunks = [];
|
|
1357
|
-
let chunk = [];
|
|
1358
|
-
temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
|
|
1359
|
-
if (escapeCharacter) {
|
|
1360
|
-
chunk.push(unescape(escapeCharacter));
|
|
1361
|
-
} else if (style) {
|
|
1362
|
-
const string = chunk.join("");
|
|
1363
|
-
chunk = [];
|
|
1364
|
-
chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));
|
|
1365
|
-
styles.push({ inverse, styles: parseStyle(style) });
|
|
1366
|
-
} else if (close) {
|
|
1367
|
-
if (styles.length === 0) {
|
|
1368
|
-
throw new Error("Found extraneous } in Chalk template literal");
|
|
1369
|
-
}
|
|
1370
|
-
chunks.push(buildStyle(chalk, styles)(chunk.join("")));
|
|
1371
|
-
chunk = [];
|
|
1372
|
-
styles.pop();
|
|
1373
|
-
} else {
|
|
1374
|
-
chunk.push(character);
|
|
1375
|
-
}
|
|
1376
|
-
});
|
|
1377
|
-
chunks.push(chunk.join(""));
|
|
1378
|
-
if (styles.length > 0) {
|
|
1379
|
-
const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
|
|
1380
|
-
throw new Error(errMessage);
|
|
1381
|
-
}
|
|
1382
|
-
return chunks.join("");
|
|
1383
|
-
};
|
|
1384
|
-
}
|
|
1385
|
-
});
|
|
1386
|
-
|
|
1387
|
-
// ../node_modules/chalk/source/index.js
|
|
1388
|
-
var require_source = __commonJS({
|
|
1389
|
-
"../node_modules/chalk/source/index.js"(exports, module) {
|
|
1390
|
-
"use strict";
|
|
1391
|
-
var ansiStyles = require_ansi_styles();
|
|
1392
|
-
var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color();
|
|
1393
|
-
var {
|
|
1394
|
-
stringReplaceAll,
|
|
1395
|
-
stringEncaseCRLFWithFirstIndex
|
|
1396
|
-
} = require_util();
|
|
1397
|
-
var { isArray } = Array;
|
|
1398
|
-
var levelMapping = [
|
|
1399
|
-
"ansi",
|
|
1400
|
-
"ansi",
|
|
1401
|
-
"ansi256",
|
|
1402
|
-
"ansi16m"
|
|
1403
|
-
];
|
|
1404
|
-
var styles = /* @__PURE__ */ Object.create(null);
|
|
1405
|
-
var applyOptions = (object, options = {}) => {
|
|
1406
|
-
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
1407
|
-
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
1408
|
-
}
|
|
1409
|
-
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
1410
|
-
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
1411
|
-
};
|
|
1412
|
-
var ChalkClass = class {
|
|
1413
|
-
constructor(options) {
|
|
1414
|
-
return chalkFactory(options);
|
|
1415
|
-
}
|
|
1416
|
-
};
|
|
1417
|
-
var chalkFactory = (options) => {
|
|
1418
|
-
const chalk2 = {};
|
|
1419
|
-
applyOptions(chalk2, options);
|
|
1420
|
-
chalk2.template = (...arguments_) => chalkTag(chalk2.template, ...arguments_);
|
|
1421
|
-
Object.setPrototypeOf(chalk2, Chalk.prototype);
|
|
1422
|
-
Object.setPrototypeOf(chalk2.template, chalk2);
|
|
1423
|
-
chalk2.template.constructor = () => {
|
|
1424
|
-
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
1425
|
-
};
|
|
1426
|
-
chalk2.template.Instance = ChalkClass;
|
|
1427
|
-
return chalk2.template;
|
|
1428
|
-
};
|
|
1429
|
-
function Chalk(options) {
|
|
1430
|
-
return chalkFactory(options);
|
|
1431
|
-
}
|
|
1432
|
-
for (const [styleName, style] of Object.entries(ansiStyles)) {
|
|
1433
|
-
styles[styleName] = {
|
|
1434
|
-
get() {
|
|
1435
|
-
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
|
1436
|
-
Object.defineProperty(this, styleName, { value: builder });
|
|
1437
|
-
return builder;
|
|
1438
|
-
}
|
|
1439
|
-
};
|
|
1440
|
-
}
|
|
1441
|
-
styles.visible = {
|
|
1442
|
-
get() {
|
|
1443
|
-
const builder = createBuilder(this, this._styler, true);
|
|
1444
|
-
Object.defineProperty(this, "visible", { value: builder });
|
|
1445
|
-
return builder;
|
|
1446
|
-
}
|
|
1447
|
-
};
|
|
1448
|
-
var usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
|
1449
|
-
for (const model of usedModels) {
|
|
1450
|
-
styles[model] = {
|
|
1451
|
-
get() {
|
|
1452
|
-
const { level } = this;
|
|
1453
|
-
return function(...arguments_) {
|
|
1454
|
-
const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
|
|
1455
|
-
return createBuilder(this, styler, this._isEmpty);
|
|
1456
|
-
};
|
|
1457
|
-
}
|
|
1458
|
-
};
|
|
1459
|
-
}
|
|
1460
|
-
for (const model of usedModels) {
|
|
1461
|
-
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
1462
|
-
styles[bgModel] = {
|
|
1463
|
-
get() {
|
|
1464
|
-
const { level } = this;
|
|
1465
|
-
return function(...arguments_) {
|
|
1466
|
-
const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
|
|
1467
|
-
return createBuilder(this, styler, this._isEmpty);
|
|
1468
|
-
};
|
|
1469
|
-
}
|
|
1470
|
-
};
|
|
1471
|
-
}
|
|
1472
|
-
var proto = Object.defineProperties(() => {
|
|
1473
|
-
}, {
|
|
1474
|
-
...styles,
|
|
1475
|
-
level: {
|
|
1476
|
-
enumerable: true,
|
|
1477
|
-
get() {
|
|
1478
|
-
return this._generator.level;
|
|
1479
|
-
},
|
|
1480
|
-
set(level) {
|
|
1481
|
-
this._generator.level = level;
|
|
1482
|
-
}
|
|
1483
|
-
}
|
|
1484
|
-
});
|
|
1485
|
-
var createStyler = (open, close, parent) => {
|
|
1486
|
-
let openAll;
|
|
1487
|
-
let closeAll;
|
|
1488
|
-
if (parent === void 0) {
|
|
1489
|
-
openAll = open;
|
|
1490
|
-
closeAll = close;
|
|
1491
|
-
} else {
|
|
1492
|
-
openAll = parent.openAll + open;
|
|
1493
|
-
closeAll = close + parent.closeAll;
|
|
1494
|
-
}
|
|
1495
|
-
return {
|
|
1496
|
-
open,
|
|
1497
|
-
close,
|
|
1498
|
-
openAll,
|
|
1499
|
-
closeAll,
|
|
1500
|
-
parent
|
|
1501
|
-
};
|
|
1502
|
-
};
|
|
1503
|
-
var createBuilder = (self, _styler, _isEmpty) => {
|
|
1504
|
-
const builder = (...arguments_) => {
|
|
1505
|
-
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
|
|
1506
|
-
return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
1507
|
-
}
|
|
1508
|
-
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
1509
|
-
};
|
|
1510
|
-
Object.setPrototypeOf(builder, proto);
|
|
1511
|
-
builder._generator = self;
|
|
1512
|
-
builder._styler = _styler;
|
|
1513
|
-
builder._isEmpty = _isEmpty;
|
|
1514
|
-
return builder;
|
|
1515
|
-
};
|
|
1516
|
-
var applyStyle = (self, string) => {
|
|
1517
|
-
if (self.level <= 0 || !string) {
|
|
1518
|
-
return self._isEmpty ? "" : string;
|
|
1519
|
-
}
|
|
1520
|
-
let styler = self._styler;
|
|
1521
|
-
if (styler === void 0) {
|
|
1522
|
-
return string;
|
|
1523
|
-
}
|
|
1524
|
-
const { openAll, closeAll } = styler;
|
|
1525
|
-
if (string.indexOf("\x1B") !== -1) {
|
|
1526
|
-
while (styler !== void 0) {
|
|
1527
|
-
string = stringReplaceAll(string, styler.close, styler.open);
|
|
1528
|
-
styler = styler.parent;
|
|
1529
|
-
}
|
|
1530
|
-
}
|
|
1531
|
-
const lfIndex = string.indexOf("\n");
|
|
1532
|
-
if (lfIndex !== -1) {
|
|
1533
|
-
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
1534
|
-
}
|
|
1535
|
-
return openAll + string + closeAll;
|
|
1536
|
-
};
|
|
1537
|
-
var template;
|
|
1538
|
-
var chalkTag = (chalk2, ...strings) => {
|
|
1539
|
-
const [firstString] = strings;
|
|
1540
|
-
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
1541
|
-
return strings.join(" ");
|
|
1542
|
-
}
|
|
1543
|
-
const arguments_ = strings.slice(1);
|
|
1544
|
-
const parts = [firstString.raw[0]];
|
|
1545
|
-
for (let i = 1; i < firstString.length; i++) {
|
|
1546
|
-
parts.push(
|
|
1547
|
-
String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
|
|
1548
|
-
String(firstString.raw[i])
|
|
1549
|
-
);
|
|
1550
|
-
}
|
|
1551
|
-
if (template === void 0) {
|
|
1552
|
-
template = require_templates();
|
|
1553
|
-
}
|
|
1554
|
-
return template(chalk2, parts.join(""));
|
|
1555
|
-
};
|
|
1556
|
-
Object.defineProperties(Chalk.prototype, styles);
|
|
1557
|
-
var chalk = Chalk();
|
|
1558
|
-
chalk.supportsColor = stdoutColor;
|
|
1559
|
-
chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
1560
|
-
chalk.stderr.supportsColor = stderrColor;
|
|
1561
|
-
module.exports = chalk;
|
|
1562
|
-
}
|
|
1563
|
-
});
|
|
1564
|
-
|
|
1565
|
-
// ../node_modules/tsconfig-paths/lib/filesystem.js
|
|
1566
|
-
var require_filesystem = __commonJS({
|
|
1567
|
-
"../node_modules/tsconfig-paths/lib/filesystem.js"(exports) {
|
|
1568
|
-
"use strict";
|
|
1569
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1570
|
-
exports.removeExtension = exports.fileExistsAsync = exports.readJsonFromDiskAsync = exports.readJsonFromDiskSync = exports.fileExistsSync = void 0;
|
|
1571
|
-
var fs = __require("fs");
|
|
1572
|
-
function fileExistsSync(path) {
|
|
1573
|
-
if (!fs.existsSync(path)) {
|
|
1574
|
-
return false;
|
|
1575
|
-
}
|
|
1576
|
-
try {
|
|
1577
|
-
var stats = fs.statSync(path);
|
|
1578
|
-
return stats.isFile();
|
|
1579
|
-
} catch (err) {
|
|
1580
|
-
return false;
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1583
|
-
exports.fileExistsSync = fileExistsSync;
|
|
1584
|
-
function readJsonFromDiskSync(packageJsonPath) {
|
|
1585
|
-
if (!fs.existsSync(packageJsonPath)) {
|
|
1586
|
-
return void 0;
|
|
1587
|
-
}
|
|
1588
|
-
return __require(packageJsonPath);
|
|
1589
|
-
}
|
|
1590
|
-
exports.readJsonFromDiskSync = readJsonFromDiskSync;
|
|
1591
|
-
function readJsonFromDiskAsync(path, callback) {
|
|
1592
|
-
fs.readFile(path, "utf8", function(err, result) {
|
|
1593
|
-
if (err || !result) {
|
|
1594
|
-
return callback();
|
|
1595
|
-
}
|
|
1596
|
-
var json = JSON.parse(result);
|
|
1597
|
-
return callback(void 0, json);
|
|
1598
|
-
});
|
|
1599
|
-
}
|
|
1600
|
-
exports.readJsonFromDiskAsync = readJsonFromDiskAsync;
|
|
1601
|
-
function fileExistsAsync(path2, callback2) {
|
|
1602
|
-
fs.stat(path2, function(err, stats) {
|
|
1603
|
-
if (err) {
|
|
1604
|
-
return callback2(void 0, false);
|
|
1605
|
-
}
|
|
1606
|
-
callback2(void 0, stats ? stats.isFile() : false);
|
|
1607
|
-
});
|
|
1608
|
-
}
|
|
1609
|
-
exports.fileExistsAsync = fileExistsAsync;
|
|
1610
|
-
function removeExtension(path) {
|
|
1611
|
-
return path.substring(0, path.lastIndexOf(".")) || path;
|
|
1612
|
-
}
|
|
1613
|
-
exports.removeExtension = removeExtension;
|
|
1614
|
-
}
|
|
1615
|
-
});
|
|
1616
|
-
|
|
1617
|
-
// ../node_modules/tsconfig-paths/lib/mapping-entry.js
|
|
1618
|
-
var require_mapping_entry = __commonJS({
|
|
1619
|
-
"../node_modules/tsconfig-paths/lib/mapping-entry.js"(exports) {
|
|
1620
|
-
"use strict";
|
|
1621
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1622
|
-
exports.getAbsoluteMappingEntries = void 0;
|
|
1623
|
-
var path = __require("path");
|
|
1624
|
-
function getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll) {
|
|
1625
|
-
var sortedKeys = sortByLongestPrefix(Object.keys(paths));
|
|
1626
|
-
var absolutePaths = [];
|
|
1627
|
-
for (var _i = 0, sortedKeys_1 = sortedKeys; _i < sortedKeys_1.length; _i++) {
|
|
1628
|
-
var key = sortedKeys_1[_i];
|
|
1629
|
-
absolutePaths.push({
|
|
1630
|
-
pattern: key,
|
|
1631
|
-
paths: paths[key].map(function(pathToResolve) {
|
|
1632
|
-
return path.resolve(absoluteBaseUrl, pathToResolve);
|
|
1633
|
-
})
|
|
1634
|
-
});
|
|
1635
|
-
}
|
|
1636
|
-
if (!paths["*"] && addMatchAll) {
|
|
1637
|
-
absolutePaths.push({
|
|
1638
|
-
pattern: "*",
|
|
1639
|
-
paths: ["".concat(absoluteBaseUrl.replace(/\/$/, ""), "/*")]
|
|
1640
|
-
});
|
|
1641
|
-
}
|
|
1642
|
-
return absolutePaths;
|
|
1643
|
-
}
|
|
1644
|
-
exports.getAbsoluteMappingEntries = getAbsoluteMappingEntries;
|
|
1645
|
-
function sortByLongestPrefix(arr) {
|
|
1646
|
-
return arr.concat().sort(function(a, b) {
|
|
1647
|
-
return getPrefixLength(b) - getPrefixLength(a);
|
|
1648
|
-
});
|
|
1649
|
-
}
|
|
1650
|
-
function getPrefixLength(pattern) {
|
|
1651
|
-
var prefixLength = pattern.indexOf("*");
|
|
1652
|
-
return pattern.substr(0, prefixLength).length;
|
|
1653
|
-
}
|
|
1654
|
-
}
|
|
1655
|
-
});
|
|
1656
|
-
|
|
1657
|
-
// ../node_modules/tsconfig-paths/lib/try-path.js
|
|
1658
|
-
var require_try_path = __commonJS({
|
|
1659
|
-
"../node_modules/tsconfig-paths/lib/try-path.js"(exports) {
|
|
1660
|
-
"use strict";
|
|
1661
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1662
|
-
exports.exhaustiveTypeException = exports.getStrippedPath = exports.getPathsToTry = void 0;
|
|
1663
|
-
var path = __require("path");
|
|
1664
|
-
var path_1 = __require("path");
|
|
1665
|
-
var filesystem_1 = require_filesystem();
|
|
1666
|
-
function getPathsToTry(extensions, absolutePathMappings, requestedModule) {
|
|
1667
|
-
if (!absolutePathMappings || !requestedModule || requestedModule[0] === ".") {
|
|
1668
|
-
return void 0;
|
|
1669
|
-
}
|
|
1670
|
-
var pathsToTry = [];
|
|
1671
|
-
for (var _i = 0, absolutePathMappings_1 = absolutePathMappings; _i < absolutePathMappings_1.length; _i++) {
|
|
1672
|
-
var entry = absolutePathMappings_1[_i];
|
|
1673
|
-
var starMatch = entry.pattern === requestedModule ? "" : matchStar(entry.pattern, requestedModule);
|
|
1674
|
-
if (starMatch !== void 0) {
|
|
1675
|
-
var _loop_1 = function(physicalPathPattern2) {
|
|
1676
|
-
var physicalPath = physicalPathPattern2.replace("*", starMatch);
|
|
1677
|
-
pathsToTry.push({ type: "file", path: physicalPath });
|
|
1678
|
-
pathsToTry.push.apply(pathsToTry, extensions.map(function(e) {
|
|
1679
|
-
return { type: "extension", path: physicalPath + e };
|
|
1680
|
-
}));
|
|
1681
|
-
pathsToTry.push({
|
|
1682
|
-
type: "package",
|
|
1683
|
-
path: path.join(physicalPath, "/package.json")
|
|
1684
|
-
});
|
|
1685
|
-
var indexPath = path.join(physicalPath, "/index");
|
|
1686
|
-
pathsToTry.push.apply(pathsToTry, extensions.map(function(e) {
|
|
1687
|
-
return { type: "index", path: indexPath + e };
|
|
1688
|
-
}));
|
|
1689
|
-
};
|
|
1690
|
-
for (var _a = 0, _b = entry.paths; _a < _b.length; _a++) {
|
|
1691
|
-
var physicalPathPattern = _b[_a];
|
|
1692
|
-
_loop_1(physicalPathPattern);
|
|
1693
|
-
}
|
|
1694
|
-
}
|
|
1695
|
-
}
|
|
1696
|
-
return pathsToTry.length === 0 ? void 0 : pathsToTry;
|
|
1697
|
-
}
|
|
1698
|
-
exports.getPathsToTry = getPathsToTry;
|
|
1699
|
-
function getStrippedPath(tryPath) {
|
|
1700
|
-
return tryPath.type === "index" ? (0, path_1.dirname)(tryPath.path) : tryPath.type === "file" ? tryPath.path : tryPath.type === "extension" ? (0, filesystem_1.removeExtension)(tryPath.path) : tryPath.type === "package" ? tryPath.path : exhaustiveTypeException(tryPath.type);
|
|
1701
|
-
}
|
|
1702
|
-
exports.getStrippedPath = getStrippedPath;
|
|
1703
|
-
function exhaustiveTypeException(check) {
|
|
1704
|
-
throw new Error("Unknown type ".concat(check));
|
|
1705
|
-
}
|
|
1706
|
-
exports.exhaustiveTypeException = exhaustiveTypeException;
|
|
1707
|
-
function matchStar(pattern, search) {
|
|
1708
|
-
if (search.length < pattern.length) {
|
|
1709
|
-
return void 0;
|
|
1710
|
-
}
|
|
1711
|
-
if (pattern === "*") {
|
|
1712
|
-
return search;
|
|
1713
|
-
}
|
|
1714
|
-
var star = pattern.indexOf("*");
|
|
1715
|
-
if (star === -1) {
|
|
1716
|
-
return void 0;
|
|
1717
|
-
}
|
|
1718
|
-
var part1 = pattern.substring(0, star);
|
|
1719
|
-
var part2 = pattern.substring(star + 1);
|
|
1720
|
-
if (search.substr(0, star) !== part1) {
|
|
1721
|
-
return void 0;
|
|
1722
|
-
}
|
|
1723
|
-
if (search.substr(search.length - part2.length) !== part2) {
|
|
1724
|
-
return void 0;
|
|
1725
|
-
}
|
|
1726
|
-
return search.substr(star, search.length - part2.length);
|
|
1727
|
-
}
|
|
1728
|
-
}
|
|
1729
|
-
});
|
|
1730
|
-
|
|
1731
|
-
// ../node_modules/tsconfig-paths/lib/match-path-sync.js
|
|
1732
|
-
var require_match_path_sync = __commonJS({
|
|
1733
|
-
"../node_modules/tsconfig-paths/lib/match-path-sync.js"(exports) {
|
|
1734
|
-
"use strict";
|
|
1735
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1736
|
-
exports.matchFromAbsolutePaths = exports.createMatchPath = void 0;
|
|
1737
|
-
var path = __require("path");
|
|
1738
|
-
var Filesystem = require_filesystem();
|
|
1739
|
-
var MappingEntry = require_mapping_entry();
|
|
1740
|
-
var TryPath = require_try_path();
|
|
1741
|
-
function createMatchPath(absoluteBaseUrl, paths, mainFields, addMatchAll) {
|
|
1742
|
-
if (mainFields === void 0) {
|
|
1743
|
-
mainFields = ["main"];
|
|
1744
|
-
}
|
|
1745
|
-
if (addMatchAll === void 0) {
|
|
1746
|
-
addMatchAll = true;
|
|
1747
|
-
}
|
|
1748
|
-
var absolutePaths = MappingEntry.getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll);
|
|
1749
|
-
return function(requestedModule, readJson, fileExists, extensions) {
|
|
1750
|
-
return matchFromAbsolutePaths(absolutePaths, requestedModule, readJson, fileExists, extensions, mainFields);
|
|
1751
|
-
};
|
|
1752
|
-
}
|
|
1753
|
-
exports.createMatchPath = createMatchPath;
|
|
1754
|
-
function matchFromAbsolutePaths(absolutePathMappings, requestedModule, readJson, fileExists, extensions, mainFields) {
|
|
1755
|
-
if (readJson === void 0) {
|
|
1756
|
-
readJson = Filesystem.readJsonFromDiskSync;
|
|
1757
|
-
}
|
|
1758
|
-
if (fileExists === void 0) {
|
|
1759
|
-
fileExists = Filesystem.fileExistsSync;
|
|
1760
|
-
}
|
|
1761
|
-
if (extensions === void 0) {
|
|
1762
|
-
extensions = Object.keys(__require.extensions);
|
|
1763
|
-
}
|
|
1764
|
-
if (mainFields === void 0) {
|
|
1765
|
-
mainFields = ["main"];
|
|
1766
|
-
}
|
|
1767
|
-
var tryPaths = TryPath.getPathsToTry(extensions, absolutePathMappings, requestedModule);
|
|
1768
|
-
if (!tryPaths) {
|
|
1769
|
-
return void 0;
|
|
1770
|
-
}
|
|
1771
|
-
return findFirstExistingPath(tryPaths, readJson, fileExists, mainFields);
|
|
1772
|
-
}
|
|
1773
|
-
exports.matchFromAbsolutePaths = matchFromAbsolutePaths;
|
|
1774
|
-
function findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExists) {
|
|
1775
|
-
for (var index = 0; index < mainFields.length; index++) {
|
|
1776
|
-
var mainFieldSelector = mainFields[index];
|
|
1777
|
-
var candidateMapping = typeof mainFieldSelector === "string" ? packageJson[mainFieldSelector] : mainFieldSelector.reduce(function(obj, key) {
|
|
1778
|
-
return obj[key];
|
|
1779
|
-
}, packageJson);
|
|
1780
|
-
if (candidateMapping && typeof candidateMapping === "string") {
|
|
1781
|
-
var candidateFilePath = path.join(path.dirname(packageJsonPath), candidateMapping);
|
|
1782
|
-
if (fileExists(candidateFilePath)) {
|
|
1783
|
-
return candidateFilePath;
|
|
1784
|
-
}
|
|
1785
|
-
}
|
|
1786
|
-
}
|
|
1787
|
-
return void 0;
|
|
1788
|
-
}
|
|
1789
|
-
function findFirstExistingPath(tryPaths, readJson, fileExists, mainFields) {
|
|
1790
|
-
if (readJson === void 0) {
|
|
1791
|
-
readJson = Filesystem.readJsonFromDiskSync;
|
|
1792
|
-
}
|
|
1793
|
-
if (mainFields === void 0) {
|
|
1794
|
-
mainFields = ["main"];
|
|
1795
|
-
}
|
|
1796
|
-
for (var _i = 0, tryPaths_1 = tryPaths; _i < tryPaths_1.length; _i++) {
|
|
1797
|
-
var tryPath = tryPaths_1[_i];
|
|
1798
|
-
if (tryPath.type === "file" || tryPath.type === "extension" || tryPath.type === "index") {
|
|
1799
|
-
if (fileExists(tryPath.path)) {
|
|
1800
|
-
return TryPath.getStrippedPath(tryPath);
|
|
1801
|
-
}
|
|
1802
|
-
} else if (tryPath.type === "package") {
|
|
1803
|
-
var packageJson = readJson(tryPath.path);
|
|
1804
|
-
if (packageJson) {
|
|
1805
|
-
var mainFieldMappedFile = findFirstExistingMainFieldMappedFile(packageJson, mainFields, tryPath.path, fileExists);
|
|
1806
|
-
if (mainFieldMappedFile) {
|
|
1807
|
-
return mainFieldMappedFile;
|
|
1808
|
-
}
|
|
1809
|
-
}
|
|
1810
|
-
} else {
|
|
1811
|
-
TryPath.exhaustiveTypeException(tryPath.type);
|
|
1812
|
-
}
|
|
1813
|
-
}
|
|
1814
|
-
return void 0;
|
|
1815
|
-
}
|
|
1816
|
-
}
|
|
1817
|
-
});
|
|
1818
|
-
|
|
1819
|
-
// ../node_modules/tsconfig-paths/lib/match-path-async.js
|
|
1820
|
-
var require_match_path_async = __commonJS({
|
|
1821
|
-
"../node_modules/tsconfig-paths/lib/match-path-async.js"(exports) {
|
|
1822
|
-
"use strict";
|
|
1823
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1824
|
-
exports.matchFromAbsolutePathsAsync = exports.createMatchPathAsync = void 0;
|
|
1825
|
-
var path = __require("path");
|
|
1826
|
-
var TryPath = require_try_path();
|
|
1827
|
-
var MappingEntry = require_mapping_entry();
|
|
1828
|
-
var Filesystem = require_filesystem();
|
|
1829
|
-
function createMatchPathAsync(absoluteBaseUrl, paths, mainFields, addMatchAll) {
|
|
1830
|
-
if (mainFields === void 0) {
|
|
1831
|
-
mainFields = ["main"];
|
|
1832
|
-
}
|
|
1833
|
-
if (addMatchAll === void 0) {
|
|
1834
|
-
addMatchAll = true;
|
|
1835
|
-
}
|
|
1836
|
-
var absolutePaths = MappingEntry.getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll);
|
|
1837
|
-
return function(requestedModule, readJson, fileExists, extensions, callback) {
|
|
1838
|
-
return matchFromAbsolutePathsAsync(absolutePaths, requestedModule, readJson, fileExists, extensions, callback, mainFields);
|
|
1839
|
-
};
|
|
1840
|
-
}
|
|
1841
|
-
exports.createMatchPathAsync = createMatchPathAsync;
|
|
1842
|
-
function matchFromAbsolutePathsAsync(absolutePathMappings, requestedModule, readJson, fileExists, extensions, callback, mainFields) {
|
|
1843
|
-
if (readJson === void 0) {
|
|
1844
|
-
readJson = Filesystem.readJsonFromDiskAsync;
|
|
1845
|
-
}
|
|
1846
|
-
if (fileExists === void 0) {
|
|
1847
|
-
fileExists = Filesystem.fileExistsAsync;
|
|
1848
|
-
}
|
|
1849
|
-
if (extensions === void 0) {
|
|
1850
|
-
extensions = Object.keys(__require.extensions);
|
|
1851
|
-
}
|
|
1852
|
-
if (mainFields === void 0) {
|
|
1853
|
-
mainFields = ["main"];
|
|
1854
|
-
}
|
|
1855
|
-
var tryPaths = TryPath.getPathsToTry(extensions, absolutePathMappings, requestedModule);
|
|
1856
|
-
if (!tryPaths) {
|
|
1857
|
-
return callback();
|
|
1858
|
-
}
|
|
1859
|
-
findFirstExistingPath(tryPaths, readJson, fileExists, callback, 0, mainFields);
|
|
1860
|
-
}
|
|
1861
|
-
exports.matchFromAbsolutePathsAsync = matchFromAbsolutePathsAsync;
|
|
1862
|
-
function findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExistsAsync, doneCallback, index) {
|
|
1863
|
-
if (index === void 0) {
|
|
1864
|
-
index = 0;
|
|
1865
|
-
}
|
|
1866
|
-
if (index >= mainFields.length) {
|
|
1867
|
-
return doneCallback(void 0, void 0);
|
|
1868
|
-
}
|
|
1869
|
-
var tryNext = function() {
|
|
1870
|
-
return findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExistsAsync, doneCallback, index + 1);
|
|
1871
|
-
};
|
|
1872
|
-
var mainFieldSelector = mainFields[index];
|
|
1873
|
-
var mainFieldMapping = typeof mainFieldSelector === "string" ? packageJson[mainFieldSelector] : mainFieldSelector.reduce(function(obj, key) {
|
|
1874
|
-
return obj[key];
|
|
1875
|
-
}, packageJson);
|
|
1876
|
-
if (typeof mainFieldMapping !== "string") {
|
|
1877
|
-
return tryNext();
|
|
1878
|
-
}
|
|
1879
|
-
var mappedFilePath = path.join(path.dirname(packageJsonPath), mainFieldMapping);
|
|
1880
|
-
fileExistsAsync(mappedFilePath, function(err, exists) {
|
|
1881
|
-
if (err) {
|
|
1882
|
-
return doneCallback(err);
|
|
1883
|
-
}
|
|
1884
|
-
if (exists) {
|
|
1885
|
-
return doneCallback(void 0, mappedFilePath);
|
|
1886
|
-
}
|
|
1887
|
-
return tryNext();
|
|
1888
|
-
});
|
|
1889
|
-
}
|
|
1890
|
-
function findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index, mainFields) {
|
|
1891
|
-
if (index === void 0) {
|
|
1892
|
-
index = 0;
|
|
1893
|
-
}
|
|
1894
|
-
if (mainFields === void 0) {
|
|
1895
|
-
mainFields = ["main"];
|
|
1896
|
-
}
|
|
1897
|
-
var tryPath = tryPaths[index];
|
|
1898
|
-
if (tryPath.type === "file" || tryPath.type === "extension" || tryPath.type === "index") {
|
|
1899
|
-
fileExists(tryPath.path, function(err, exists) {
|
|
1900
|
-
if (err) {
|
|
1901
|
-
return doneCallback(err);
|
|
1902
|
-
}
|
|
1903
|
-
if (exists) {
|
|
1904
|
-
return doneCallback(void 0, TryPath.getStrippedPath(tryPath));
|
|
1905
|
-
}
|
|
1906
|
-
if (index === tryPaths.length - 1) {
|
|
1907
|
-
return doneCallback();
|
|
1908
|
-
}
|
|
1909
|
-
return findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index + 1, mainFields);
|
|
1910
|
-
});
|
|
1911
|
-
} else if (tryPath.type === "package") {
|
|
1912
|
-
readJson(tryPath.path, function(err, packageJson) {
|
|
1913
|
-
if (err) {
|
|
1914
|
-
return doneCallback(err);
|
|
1915
|
-
}
|
|
1916
|
-
if (packageJson) {
|
|
1917
|
-
return findFirstExistingMainFieldMappedFile(packageJson, mainFields, tryPath.path, fileExists, function(mainFieldErr, mainFieldMappedFile) {
|
|
1918
|
-
if (mainFieldErr) {
|
|
1919
|
-
return doneCallback(mainFieldErr);
|
|
1920
|
-
}
|
|
1921
|
-
if (mainFieldMappedFile) {
|
|
1922
|
-
return doneCallback(void 0, mainFieldMappedFile);
|
|
1923
|
-
}
|
|
1924
|
-
return findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index + 1, mainFields);
|
|
1925
|
-
});
|
|
1926
|
-
}
|
|
1927
|
-
return findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index + 1, mainFields);
|
|
1928
|
-
});
|
|
1929
|
-
} else {
|
|
1930
|
-
TryPath.exhaustiveTypeException(tryPath.type);
|
|
1931
|
-
}
|
|
1932
|
-
}
|
|
1933
|
-
}
|
|
1934
|
-
});
|
|
1935
|
-
|
|
1936
|
-
// ../node_modules/json5/lib/unicode.js
|
|
1937
|
-
var require_unicode = __commonJS({
|
|
1938
|
-
"../node_modules/json5/lib/unicode.js"(exports, module) {
|
|
1939
|
-
module.exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/;
|
|
1940
|
-
module.exports.ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
|
|
1941
|
-
module.exports.ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/;
|
|
1942
|
-
}
|
|
1943
|
-
});
|
|
1944
|
-
|
|
1945
|
-
// ../node_modules/json5/lib/util.js
|
|
1946
|
-
var require_util2 = __commonJS({
|
|
1947
|
-
"../node_modules/json5/lib/util.js"(exports, module) {
|
|
1948
|
-
var unicode = require_unicode();
|
|
1949
|
-
module.exports = {
|
|
1950
|
-
isSpaceSeparator(c) {
|
|
1951
|
-
return typeof c === "string" && unicode.Space_Separator.test(c);
|
|
1952
|
-
},
|
|
1953
|
-
isIdStartChar(c) {
|
|
1954
|
-
return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c === "$" || c === "_" || unicode.ID_Start.test(c));
|
|
1955
|
-
},
|
|
1956
|
-
isIdContinueChar(c) {
|
|
1957
|
-
return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c >= "0" && c <= "9" || c === "$" || c === "_" || c === "\u200C" || c === "\u200D" || unicode.ID_Continue.test(c));
|
|
1958
|
-
},
|
|
1959
|
-
isDigit(c) {
|
|
1960
|
-
return typeof c === "string" && /[0-9]/.test(c);
|
|
1961
|
-
},
|
|
1962
|
-
isHexDigit(c) {
|
|
1963
|
-
return typeof c === "string" && /[0-9A-Fa-f]/.test(c);
|
|
1964
|
-
}
|
|
1965
|
-
};
|
|
1966
|
-
}
|
|
1967
|
-
});
|
|
1968
|
-
|
|
1969
|
-
// ../node_modules/json5/lib/parse.js
|
|
1970
|
-
var require_parse = __commonJS({
|
|
1971
|
-
"../node_modules/json5/lib/parse.js"(exports, module) {
|
|
1972
|
-
var util = require_util2();
|
|
1973
|
-
var source;
|
|
1974
|
-
var parseState;
|
|
1975
|
-
var stack;
|
|
1976
|
-
var pos;
|
|
1977
|
-
var line;
|
|
1978
|
-
var column;
|
|
1979
|
-
var token;
|
|
1980
|
-
var key;
|
|
1981
|
-
var root;
|
|
1982
|
-
module.exports = function parse(text, reviver) {
|
|
1983
|
-
source = String(text);
|
|
1984
|
-
parseState = "start";
|
|
1985
|
-
stack = [];
|
|
1986
|
-
pos = 0;
|
|
1987
|
-
line = 1;
|
|
1988
|
-
column = 0;
|
|
1989
|
-
token = void 0;
|
|
1990
|
-
key = void 0;
|
|
1991
|
-
root = void 0;
|
|
1992
|
-
do {
|
|
1993
|
-
token = lex();
|
|
1994
|
-
parseStates[parseState]();
|
|
1995
|
-
} while (token.type !== "eof");
|
|
1996
|
-
if (typeof reviver === "function") {
|
|
1997
|
-
return internalize({ "": root }, "", reviver);
|
|
1998
|
-
}
|
|
1999
|
-
return root;
|
|
2000
|
-
};
|
|
2001
|
-
function internalize(holder, name, reviver) {
|
|
2002
|
-
const value = holder[name];
|
|
2003
|
-
if (value != null && typeof value === "object") {
|
|
2004
|
-
if (Array.isArray(value)) {
|
|
2005
|
-
for (let i = 0; i < value.length; i++) {
|
|
2006
|
-
const key2 = String(i);
|
|
2007
|
-
const replacement = internalize(value, key2, reviver);
|
|
2008
|
-
if (replacement === void 0) {
|
|
2009
|
-
delete value[key2];
|
|
2010
|
-
} else {
|
|
2011
|
-
Object.defineProperty(value, key2, {
|
|
2012
|
-
value: replacement,
|
|
2013
|
-
writable: true,
|
|
2014
|
-
enumerable: true,
|
|
2015
|
-
configurable: true
|
|
2016
|
-
});
|
|
2017
|
-
}
|
|
2018
|
-
}
|
|
2019
|
-
} else {
|
|
2020
|
-
for (const key2 in value) {
|
|
2021
|
-
const replacement = internalize(value, key2, reviver);
|
|
2022
|
-
if (replacement === void 0) {
|
|
2023
|
-
delete value[key2];
|
|
2024
|
-
} else {
|
|
2025
|
-
Object.defineProperty(value, key2, {
|
|
2026
|
-
value: replacement,
|
|
2027
|
-
writable: true,
|
|
2028
|
-
enumerable: true,
|
|
2029
|
-
configurable: true
|
|
2030
|
-
});
|
|
2031
|
-
}
|
|
2032
|
-
}
|
|
2033
|
-
}
|
|
2034
|
-
}
|
|
2035
|
-
return reviver.call(holder, name, value);
|
|
2036
|
-
}
|
|
2037
|
-
var lexState;
|
|
2038
|
-
var buffer;
|
|
2039
|
-
var doubleQuote;
|
|
2040
|
-
var sign;
|
|
2041
|
-
var c;
|
|
2042
|
-
function lex() {
|
|
2043
|
-
lexState = "default";
|
|
2044
|
-
buffer = "";
|
|
2045
|
-
doubleQuote = false;
|
|
2046
|
-
sign = 1;
|
|
2047
|
-
for (; ; ) {
|
|
2048
|
-
c = peek();
|
|
2049
|
-
const token2 = lexStates[lexState]();
|
|
2050
|
-
if (token2) {
|
|
2051
|
-
return token2;
|
|
2052
|
-
}
|
|
2053
|
-
}
|
|
2054
|
-
}
|
|
2055
|
-
function peek() {
|
|
2056
|
-
if (source[pos]) {
|
|
2057
|
-
return String.fromCodePoint(source.codePointAt(pos));
|
|
2058
|
-
}
|
|
2059
|
-
}
|
|
2060
|
-
function read() {
|
|
2061
|
-
const c2 = peek();
|
|
2062
|
-
if (c2 === "\n") {
|
|
2063
|
-
line++;
|
|
2064
|
-
column = 0;
|
|
2065
|
-
} else if (c2) {
|
|
2066
|
-
column += c2.length;
|
|
2067
|
-
} else {
|
|
2068
|
-
column++;
|
|
2069
|
-
}
|
|
2070
|
-
if (c2) {
|
|
2071
|
-
pos += c2.length;
|
|
2072
|
-
}
|
|
2073
|
-
return c2;
|
|
2074
|
-
}
|
|
2075
|
-
var lexStates = {
|
|
2076
|
-
default() {
|
|
2077
|
-
switch (c) {
|
|
2078
|
-
case " ":
|
|
2079
|
-
case "\v":
|
|
2080
|
-
case "\f":
|
|
2081
|
-
case " ":
|
|
2082
|
-
case "\xA0":
|
|
2083
|
-
case "\uFEFF":
|
|
2084
|
-
case "\n":
|
|
2085
|
-
case "\r":
|
|
2086
|
-
case "\u2028":
|
|
2087
|
-
case "\u2029":
|
|
2088
|
-
read();
|
|
2089
|
-
return;
|
|
2090
|
-
case "/":
|
|
2091
|
-
read();
|
|
2092
|
-
lexState = "comment";
|
|
2093
|
-
return;
|
|
2094
|
-
case void 0:
|
|
2095
|
-
read();
|
|
2096
|
-
return newToken("eof");
|
|
2097
|
-
}
|
|
2098
|
-
if (util.isSpaceSeparator(c)) {
|
|
2099
|
-
read();
|
|
2100
|
-
return;
|
|
2101
|
-
}
|
|
2102
|
-
return lexStates[parseState]();
|
|
2103
|
-
},
|
|
2104
|
-
comment() {
|
|
2105
|
-
switch (c) {
|
|
2106
|
-
case "*":
|
|
2107
|
-
read();
|
|
2108
|
-
lexState = "multiLineComment";
|
|
2109
|
-
return;
|
|
2110
|
-
case "/":
|
|
2111
|
-
read();
|
|
2112
|
-
lexState = "singleLineComment";
|
|
2113
|
-
return;
|
|
2114
|
-
}
|
|
2115
|
-
throw invalidChar(read());
|
|
2116
|
-
},
|
|
2117
|
-
multiLineComment() {
|
|
2118
|
-
switch (c) {
|
|
2119
|
-
case "*":
|
|
2120
|
-
read();
|
|
2121
|
-
lexState = "multiLineCommentAsterisk";
|
|
2122
|
-
return;
|
|
2123
|
-
case void 0:
|
|
2124
|
-
throw invalidChar(read());
|
|
2125
|
-
}
|
|
2126
|
-
read();
|
|
2127
|
-
},
|
|
2128
|
-
multiLineCommentAsterisk() {
|
|
2129
|
-
switch (c) {
|
|
2130
|
-
case "*":
|
|
2131
|
-
read();
|
|
2132
|
-
return;
|
|
2133
|
-
case "/":
|
|
2134
|
-
read();
|
|
2135
|
-
lexState = "default";
|
|
2136
|
-
return;
|
|
2137
|
-
case void 0:
|
|
2138
|
-
throw invalidChar(read());
|
|
2139
|
-
}
|
|
2140
|
-
read();
|
|
2141
|
-
lexState = "multiLineComment";
|
|
2142
|
-
},
|
|
2143
|
-
singleLineComment() {
|
|
2144
|
-
switch (c) {
|
|
2145
|
-
case "\n":
|
|
2146
|
-
case "\r":
|
|
2147
|
-
case "\u2028":
|
|
2148
|
-
case "\u2029":
|
|
2149
|
-
read();
|
|
2150
|
-
lexState = "default";
|
|
2151
|
-
return;
|
|
2152
|
-
case void 0:
|
|
2153
|
-
read();
|
|
2154
|
-
return newToken("eof");
|
|
2155
|
-
}
|
|
2156
|
-
read();
|
|
2157
|
-
},
|
|
2158
|
-
value() {
|
|
2159
|
-
switch (c) {
|
|
2160
|
-
case "{":
|
|
2161
|
-
case "[":
|
|
2162
|
-
return newToken("punctuator", read());
|
|
2163
|
-
case "n":
|
|
2164
|
-
read();
|
|
2165
|
-
literal("ull");
|
|
2166
|
-
return newToken("null", null);
|
|
2167
|
-
case "t":
|
|
2168
|
-
read();
|
|
2169
|
-
literal("rue");
|
|
2170
|
-
return newToken("boolean", true);
|
|
2171
|
-
case "f":
|
|
2172
|
-
read();
|
|
2173
|
-
literal("alse");
|
|
2174
|
-
return newToken("boolean", false);
|
|
2175
|
-
case "-":
|
|
2176
|
-
case "+":
|
|
2177
|
-
if (read() === "-") {
|
|
2178
|
-
sign = -1;
|
|
2179
|
-
}
|
|
2180
|
-
lexState = "sign";
|
|
2181
|
-
return;
|
|
2182
|
-
case ".":
|
|
2183
|
-
buffer = read();
|
|
2184
|
-
lexState = "decimalPointLeading";
|
|
2185
|
-
return;
|
|
2186
|
-
case "0":
|
|
2187
|
-
buffer = read();
|
|
2188
|
-
lexState = "zero";
|
|
2189
|
-
return;
|
|
2190
|
-
case "1":
|
|
2191
|
-
case "2":
|
|
2192
|
-
case "3":
|
|
2193
|
-
case "4":
|
|
2194
|
-
case "5":
|
|
2195
|
-
case "6":
|
|
2196
|
-
case "7":
|
|
2197
|
-
case "8":
|
|
2198
|
-
case "9":
|
|
2199
|
-
buffer = read();
|
|
2200
|
-
lexState = "decimalInteger";
|
|
2201
|
-
return;
|
|
2202
|
-
case "I":
|
|
2203
|
-
read();
|
|
2204
|
-
literal("nfinity");
|
|
2205
|
-
return newToken("numeric", Infinity);
|
|
2206
|
-
case "N":
|
|
2207
|
-
read();
|
|
2208
|
-
literal("aN");
|
|
2209
|
-
return newToken("numeric", NaN);
|
|
2210
|
-
case '"':
|
|
2211
|
-
case "'":
|
|
2212
|
-
doubleQuote = read() === '"';
|
|
2213
|
-
buffer = "";
|
|
2214
|
-
lexState = "string";
|
|
2215
|
-
return;
|
|
2216
|
-
}
|
|
2217
|
-
throw invalidChar(read());
|
|
2218
|
-
},
|
|
2219
|
-
identifierNameStartEscape() {
|
|
2220
|
-
if (c !== "u") {
|
|
2221
|
-
throw invalidChar(read());
|
|
2222
|
-
}
|
|
2223
|
-
read();
|
|
2224
|
-
const u = unicodeEscape();
|
|
2225
|
-
switch (u) {
|
|
2226
|
-
case "$":
|
|
2227
|
-
case "_":
|
|
2228
|
-
break;
|
|
2229
|
-
default:
|
|
2230
|
-
if (!util.isIdStartChar(u)) {
|
|
2231
|
-
throw invalidIdentifier();
|
|
2232
|
-
}
|
|
2233
|
-
break;
|
|
2234
|
-
}
|
|
2235
|
-
buffer += u;
|
|
2236
|
-
lexState = "identifierName";
|
|
2237
|
-
},
|
|
2238
|
-
identifierName() {
|
|
2239
|
-
switch (c) {
|
|
2240
|
-
case "$":
|
|
2241
|
-
case "_":
|
|
2242
|
-
case "\u200C":
|
|
2243
|
-
case "\u200D":
|
|
2244
|
-
buffer += read();
|
|
2245
|
-
return;
|
|
2246
|
-
case "\\":
|
|
2247
|
-
read();
|
|
2248
|
-
lexState = "identifierNameEscape";
|
|
2249
|
-
return;
|
|
2250
|
-
}
|
|
2251
|
-
if (util.isIdContinueChar(c)) {
|
|
2252
|
-
buffer += read();
|
|
2253
|
-
return;
|
|
2254
|
-
}
|
|
2255
|
-
return newToken("identifier", buffer);
|
|
2256
|
-
},
|
|
2257
|
-
identifierNameEscape() {
|
|
2258
|
-
if (c !== "u") {
|
|
2259
|
-
throw invalidChar(read());
|
|
2260
|
-
}
|
|
2261
|
-
read();
|
|
2262
|
-
const u = unicodeEscape();
|
|
2263
|
-
switch (u) {
|
|
2264
|
-
case "$":
|
|
2265
|
-
case "_":
|
|
2266
|
-
case "\u200C":
|
|
2267
|
-
case "\u200D":
|
|
2268
|
-
break;
|
|
2269
|
-
default:
|
|
2270
|
-
if (!util.isIdContinueChar(u)) {
|
|
2271
|
-
throw invalidIdentifier();
|
|
2272
|
-
}
|
|
2273
|
-
break;
|
|
2274
|
-
}
|
|
2275
|
-
buffer += u;
|
|
2276
|
-
lexState = "identifierName";
|
|
2277
|
-
},
|
|
2278
|
-
sign() {
|
|
2279
|
-
switch (c) {
|
|
2280
|
-
case ".":
|
|
2281
|
-
buffer = read();
|
|
2282
|
-
lexState = "decimalPointLeading";
|
|
2283
|
-
return;
|
|
2284
|
-
case "0":
|
|
2285
|
-
buffer = read();
|
|
2286
|
-
lexState = "zero";
|
|
2287
|
-
return;
|
|
2288
|
-
case "1":
|
|
2289
|
-
case "2":
|
|
2290
|
-
case "3":
|
|
2291
|
-
case "4":
|
|
2292
|
-
case "5":
|
|
2293
|
-
case "6":
|
|
2294
|
-
case "7":
|
|
2295
|
-
case "8":
|
|
2296
|
-
case "9":
|
|
2297
|
-
buffer = read();
|
|
2298
|
-
lexState = "decimalInteger";
|
|
2299
|
-
return;
|
|
2300
|
-
case "I":
|
|
2301
|
-
read();
|
|
2302
|
-
literal("nfinity");
|
|
2303
|
-
return newToken("numeric", sign * Infinity);
|
|
2304
|
-
case "N":
|
|
2305
|
-
read();
|
|
2306
|
-
literal("aN");
|
|
2307
|
-
return newToken("numeric", NaN);
|
|
2308
|
-
}
|
|
2309
|
-
throw invalidChar(read());
|
|
2310
|
-
},
|
|
2311
|
-
zero() {
|
|
2312
|
-
switch (c) {
|
|
2313
|
-
case ".":
|
|
2314
|
-
buffer += read();
|
|
2315
|
-
lexState = "decimalPoint";
|
|
2316
|
-
return;
|
|
2317
|
-
case "e":
|
|
2318
|
-
case "E":
|
|
2319
|
-
buffer += read();
|
|
2320
|
-
lexState = "decimalExponent";
|
|
2321
|
-
return;
|
|
2322
|
-
case "x":
|
|
2323
|
-
case "X":
|
|
2324
|
-
buffer += read();
|
|
2325
|
-
lexState = "hexadecimal";
|
|
2326
|
-
return;
|
|
2327
|
-
}
|
|
2328
|
-
return newToken("numeric", sign * 0);
|
|
2329
|
-
},
|
|
2330
|
-
decimalInteger() {
|
|
2331
|
-
switch (c) {
|
|
2332
|
-
case ".":
|
|
2333
|
-
buffer += read();
|
|
2334
|
-
lexState = "decimalPoint";
|
|
2335
|
-
return;
|
|
2336
|
-
case "e":
|
|
2337
|
-
case "E":
|
|
2338
|
-
buffer += read();
|
|
2339
|
-
lexState = "decimalExponent";
|
|
2340
|
-
return;
|
|
2341
|
-
}
|
|
2342
|
-
if (util.isDigit(c)) {
|
|
2343
|
-
buffer += read();
|
|
2344
|
-
return;
|
|
2345
|
-
}
|
|
2346
|
-
return newToken("numeric", sign * Number(buffer));
|
|
2347
|
-
},
|
|
2348
|
-
decimalPointLeading() {
|
|
2349
|
-
if (util.isDigit(c)) {
|
|
2350
|
-
buffer += read();
|
|
2351
|
-
lexState = "decimalFraction";
|
|
2352
|
-
return;
|
|
2353
|
-
}
|
|
2354
|
-
throw invalidChar(read());
|
|
2355
|
-
},
|
|
2356
|
-
decimalPoint() {
|
|
2357
|
-
switch (c) {
|
|
2358
|
-
case "e":
|
|
2359
|
-
case "E":
|
|
2360
|
-
buffer += read();
|
|
2361
|
-
lexState = "decimalExponent";
|
|
2362
|
-
return;
|
|
2363
|
-
}
|
|
2364
|
-
if (util.isDigit(c)) {
|
|
2365
|
-
buffer += read();
|
|
2366
|
-
lexState = "decimalFraction";
|
|
2367
|
-
return;
|
|
2368
|
-
}
|
|
2369
|
-
return newToken("numeric", sign * Number(buffer));
|
|
2370
|
-
},
|
|
2371
|
-
decimalFraction() {
|
|
2372
|
-
switch (c) {
|
|
2373
|
-
case "e":
|
|
2374
|
-
case "E":
|
|
2375
|
-
buffer += read();
|
|
2376
|
-
lexState = "decimalExponent";
|
|
2377
|
-
return;
|
|
2378
|
-
}
|
|
2379
|
-
if (util.isDigit(c)) {
|
|
2380
|
-
buffer += read();
|
|
2381
|
-
return;
|
|
2382
|
-
}
|
|
2383
|
-
return newToken("numeric", sign * Number(buffer));
|
|
2384
|
-
},
|
|
2385
|
-
decimalExponent() {
|
|
2386
|
-
switch (c) {
|
|
2387
|
-
case "+":
|
|
2388
|
-
case "-":
|
|
2389
|
-
buffer += read();
|
|
2390
|
-
lexState = "decimalExponentSign";
|
|
2391
|
-
return;
|
|
2392
|
-
}
|
|
2393
|
-
if (util.isDigit(c)) {
|
|
2394
|
-
buffer += read();
|
|
2395
|
-
lexState = "decimalExponentInteger";
|
|
2396
|
-
return;
|
|
2397
|
-
}
|
|
2398
|
-
throw invalidChar(read());
|
|
2399
|
-
},
|
|
2400
|
-
decimalExponentSign() {
|
|
2401
|
-
if (util.isDigit(c)) {
|
|
2402
|
-
buffer += read();
|
|
2403
|
-
lexState = "decimalExponentInteger";
|
|
2404
|
-
return;
|
|
2405
|
-
}
|
|
2406
|
-
throw invalidChar(read());
|
|
2407
|
-
},
|
|
2408
|
-
decimalExponentInteger() {
|
|
2409
|
-
if (util.isDigit(c)) {
|
|
2410
|
-
buffer += read();
|
|
2411
|
-
return;
|
|
2412
|
-
}
|
|
2413
|
-
return newToken("numeric", sign * Number(buffer));
|
|
2414
|
-
},
|
|
2415
|
-
hexadecimal() {
|
|
2416
|
-
if (util.isHexDigit(c)) {
|
|
2417
|
-
buffer += read();
|
|
2418
|
-
lexState = "hexadecimalInteger";
|
|
2419
|
-
return;
|
|
2420
|
-
}
|
|
2421
|
-
throw invalidChar(read());
|
|
2422
|
-
},
|
|
2423
|
-
hexadecimalInteger() {
|
|
2424
|
-
if (util.isHexDigit(c)) {
|
|
2425
|
-
buffer += read();
|
|
2426
|
-
return;
|
|
2427
|
-
}
|
|
2428
|
-
return newToken("numeric", sign * Number(buffer));
|
|
2429
|
-
},
|
|
2430
|
-
string() {
|
|
2431
|
-
switch (c) {
|
|
2432
|
-
case "\\":
|
|
2433
|
-
read();
|
|
2434
|
-
buffer += escape();
|
|
2435
|
-
return;
|
|
2436
|
-
case '"':
|
|
2437
|
-
if (doubleQuote) {
|
|
2438
|
-
read();
|
|
2439
|
-
return newToken("string", buffer);
|
|
2440
|
-
}
|
|
2441
|
-
buffer += read();
|
|
2442
|
-
return;
|
|
2443
|
-
case "'":
|
|
2444
|
-
if (!doubleQuote) {
|
|
2445
|
-
read();
|
|
2446
|
-
return newToken("string", buffer);
|
|
2447
|
-
}
|
|
2448
|
-
buffer += read();
|
|
2449
|
-
return;
|
|
2450
|
-
case "\n":
|
|
2451
|
-
case "\r":
|
|
2452
|
-
throw invalidChar(read());
|
|
2453
|
-
case "\u2028":
|
|
2454
|
-
case "\u2029":
|
|
2455
|
-
separatorChar(c);
|
|
2456
|
-
break;
|
|
2457
|
-
case void 0:
|
|
2458
|
-
throw invalidChar(read());
|
|
2459
|
-
}
|
|
2460
|
-
buffer += read();
|
|
2461
|
-
},
|
|
2462
|
-
start() {
|
|
2463
|
-
switch (c) {
|
|
2464
|
-
case "{":
|
|
2465
|
-
case "[":
|
|
2466
|
-
return newToken("punctuator", read());
|
|
2467
|
-
}
|
|
2468
|
-
lexState = "value";
|
|
2469
|
-
},
|
|
2470
|
-
beforePropertyName() {
|
|
2471
|
-
switch (c) {
|
|
2472
|
-
case "$":
|
|
2473
|
-
case "_":
|
|
2474
|
-
buffer = read();
|
|
2475
|
-
lexState = "identifierName";
|
|
2476
|
-
return;
|
|
2477
|
-
case "\\":
|
|
2478
|
-
read();
|
|
2479
|
-
lexState = "identifierNameStartEscape";
|
|
2480
|
-
return;
|
|
2481
|
-
case "}":
|
|
2482
|
-
return newToken("punctuator", read());
|
|
2483
|
-
case '"':
|
|
2484
|
-
case "'":
|
|
2485
|
-
doubleQuote = read() === '"';
|
|
2486
|
-
lexState = "string";
|
|
2487
|
-
return;
|
|
2488
|
-
}
|
|
2489
|
-
if (util.isIdStartChar(c)) {
|
|
2490
|
-
buffer += read();
|
|
2491
|
-
lexState = "identifierName";
|
|
2492
|
-
return;
|
|
2493
|
-
}
|
|
2494
|
-
throw invalidChar(read());
|
|
2495
|
-
},
|
|
2496
|
-
afterPropertyName() {
|
|
2497
|
-
if (c === ":") {
|
|
2498
|
-
return newToken("punctuator", read());
|
|
2499
|
-
}
|
|
2500
|
-
throw invalidChar(read());
|
|
2501
|
-
},
|
|
2502
|
-
beforePropertyValue() {
|
|
2503
|
-
lexState = "value";
|
|
2504
|
-
},
|
|
2505
|
-
afterPropertyValue() {
|
|
2506
|
-
switch (c) {
|
|
2507
|
-
case ",":
|
|
2508
|
-
case "}":
|
|
2509
|
-
return newToken("punctuator", read());
|
|
2510
|
-
}
|
|
2511
|
-
throw invalidChar(read());
|
|
2512
|
-
},
|
|
2513
|
-
beforeArrayValue() {
|
|
2514
|
-
if (c === "]") {
|
|
2515
|
-
return newToken("punctuator", read());
|
|
2516
|
-
}
|
|
2517
|
-
lexState = "value";
|
|
2518
|
-
},
|
|
2519
|
-
afterArrayValue() {
|
|
2520
|
-
switch (c) {
|
|
2521
|
-
case ",":
|
|
2522
|
-
case "]":
|
|
2523
|
-
return newToken("punctuator", read());
|
|
2524
|
-
}
|
|
2525
|
-
throw invalidChar(read());
|
|
2526
|
-
},
|
|
2527
|
-
end() {
|
|
2528
|
-
throw invalidChar(read());
|
|
2529
|
-
}
|
|
2530
|
-
};
|
|
2531
|
-
function newToken(type, value) {
|
|
2532
|
-
return {
|
|
2533
|
-
type,
|
|
2534
|
-
value,
|
|
2535
|
-
line,
|
|
2536
|
-
column
|
|
2537
|
-
};
|
|
2538
|
-
}
|
|
2539
|
-
function literal(s) {
|
|
2540
|
-
for (const c2 of s) {
|
|
2541
|
-
const p = peek();
|
|
2542
|
-
if (p !== c2) {
|
|
2543
|
-
throw invalidChar(read());
|
|
2544
|
-
}
|
|
2545
|
-
read();
|
|
2546
|
-
}
|
|
2547
|
-
}
|
|
2548
|
-
function escape() {
|
|
2549
|
-
const c2 = peek();
|
|
2550
|
-
switch (c2) {
|
|
2551
|
-
case "b":
|
|
2552
|
-
read();
|
|
2553
|
-
return "\b";
|
|
2554
|
-
case "f":
|
|
2555
|
-
read();
|
|
2556
|
-
return "\f";
|
|
2557
|
-
case "n":
|
|
2558
|
-
read();
|
|
2559
|
-
return "\n";
|
|
2560
|
-
case "r":
|
|
2561
|
-
read();
|
|
2562
|
-
return "\r";
|
|
2563
|
-
case "t":
|
|
2564
|
-
read();
|
|
2565
|
-
return " ";
|
|
2566
|
-
case "v":
|
|
2567
|
-
read();
|
|
2568
|
-
return "\v";
|
|
2569
|
-
case "0":
|
|
2570
|
-
read();
|
|
2571
|
-
if (util.isDigit(peek())) {
|
|
2572
|
-
throw invalidChar(read());
|
|
2573
|
-
}
|
|
2574
|
-
return "\0";
|
|
2575
|
-
case "x":
|
|
2576
|
-
read();
|
|
2577
|
-
return hexEscape();
|
|
2578
|
-
case "u":
|
|
2579
|
-
read();
|
|
2580
|
-
return unicodeEscape();
|
|
2581
|
-
case "\n":
|
|
2582
|
-
case "\u2028":
|
|
2583
|
-
case "\u2029":
|
|
2584
|
-
read();
|
|
2585
|
-
return "";
|
|
2586
|
-
case "\r":
|
|
2587
|
-
read();
|
|
2588
|
-
if (peek() === "\n") {
|
|
2589
|
-
read();
|
|
2590
|
-
}
|
|
2591
|
-
return "";
|
|
2592
|
-
case "1":
|
|
2593
|
-
case "2":
|
|
2594
|
-
case "3":
|
|
2595
|
-
case "4":
|
|
2596
|
-
case "5":
|
|
2597
|
-
case "6":
|
|
2598
|
-
case "7":
|
|
2599
|
-
case "8":
|
|
2600
|
-
case "9":
|
|
2601
|
-
throw invalidChar(read());
|
|
2602
|
-
case void 0:
|
|
2603
|
-
throw invalidChar(read());
|
|
2604
|
-
}
|
|
2605
|
-
return read();
|
|
2606
|
-
}
|
|
2607
|
-
function hexEscape() {
|
|
2608
|
-
let buffer2 = "";
|
|
2609
|
-
let c2 = peek();
|
|
2610
|
-
if (!util.isHexDigit(c2)) {
|
|
2611
|
-
throw invalidChar(read());
|
|
2612
|
-
}
|
|
2613
|
-
buffer2 += read();
|
|
2614
|
-
c2 = peek();
|
|
2615
|
-
if (!util.isHexDigit(c2)) {
|
|
2616
|
-
throw invalidChar(read());
|
|
2617
|
-
}
|
|
2618
|
-
buffer2 += read();
|
|
2619
|
-
return String.fromCodePoint(parseInt(buffer2, 16));
|
|
2620
|
-
}
|
|
2621
|
-
function unicodeEscape() {
|
|
2622
|
-
let buffer2 = "";
|
|
2623
|
-
let count = 4;
|
|
2624
|
-
while (count-- > 0) {
|
|
2625
|
-
const c2 = peek();
|
|
2626
|
-
if (!util.isHexDigit(c2)) {
|
|
2627
|
-
throw invalidChar(read());
|
|
2628
|
-
}
|
|
2629
|
-
buffer2 += read();
|
|
2630
|
-
}
|
|
2631
|
-
return String.fromCodePoint(parseInt(buffer2, 16));
|
|
2632
|
-
}
|
|
2633
|
-
var parseStates = {
|
|
2634
|
-
start() {
|
|
2635
|
-
if (token.type === "eof") {
|
|
2636
|
-
throw invalidEOF();
|
|
2637
|
-
}
|
|
2638
|
-
push();
|
|
2639
|
-
},
|
|
2640
|
-
beforePropertyName() {
|
|
2641
|
-
switch (token.type) {
|
|
2642
|
-
case "identifier":
|
|
2643
|
-
case "string":
|
|
2644
|
-
key = token.value;
|
|
2645
|
-
parseState = "afterPropertyName";
|
|
2646
|
-
return;
|
|
2647
|
-
case "punctuator":
|
|
2648
|
-
pop();
|
|
2649
|
-
return;
|
|
2650
|
-
case "eof":
|
|
2651
|
-
throw invalidEOF();
|
|
2652
|
-
}
|
|
2653
|
-
},
|
|
2654
|
-
afterPropertyName() {
|
|
2655
|
-
if (token.type === "eof") {
|
|
2656
|
-
throw invalidEOF();
|
|
2657
|
-
}
|
|
2658
|
-
parseState = "beforePropertyValue";
|
|
2659
|
-
},
|
|
2660
|
-
beforePropertyValue() {
|
|
2661
|
-
if (token.type === "eof") {
|
|
2662
|
-
throw invalidEOF();
|
|
2663
|
-
}
|
|
2664
|
-
push();
|
|
2665
|
-
},
|
|
2666
|
-
beforeArrayValue() {
|
|
2667
|
-
if (token.type === "eof") {
|
|
2668
|
-
throw invalidEOF();
|
|
2669
|
-
}
|
|
2670
|
-
if (token.type === "punctuator" && token.value === "]") {
|
|
2671
|
-
pop();
|
|
2672
|
-
return;
|
|
2673
|
-
}
|
|
2674
|
-
push();
|
|
2675
|
-
},
|
|
2676
|
-
afterPropertyValue() {
|
|
2677
|
-
if (token.type === "eof") {
|
|
2678
|
-
throw invalidEOF();
|
|
2679
|
-
}
|
|
2680
|
-
switch (token.value) {
|
|
2681
|
-
case ",":
|
|
2682
|
-
parseState = "beforePropertyName";
|
|
2683
|
-
return;
|
|
2684
|
-
case "}":
|
|
2685
|
-
pop();
|
|
2686
|
-
}
|
|
2687
|
-
},
|
|
2688
|
-
afterArrayValue() {
|
|
2689
|
-
if (token.type === "eof") {
|
|
2690
|
-
throw invalidEOF();
|
|
2691
|
-
}
|
|
2692
|
-
switch (token.value) {
|
|
2693
|
-
case ",":
|
|
2694
|
-
parseState = "beforeArrayValue";
|
|
2695
|
-
return;
|
|
2696
|
-
case "]":
|
|
2697
|
-
pop();
|
|
2698
|
-
}
|
|
2699
|
-
},
|
|
2700
|
-
end() {
|
|
2701
|
-
}
|
|
2702
|
-
};
|
|
2703
|
-
function push() {
|
|
2704
|
-
let value;
|
|
2705
|
-
switch (token.type) {
|
|
2706
|
-
case "punctuator":
|
|
2707
|
-
switch (token.value) {
|
|
2708
|
-
case "{":
|
|
2709
|
-
value = {};
|
|
2710
|
-
break;
|
|
2711
|
-
case "[":
|
|
2712
|
-
value = [];
|
|
2713
|
-
break;
|
|
2714
|
-
}
|
|
2715
|
-
break;
|
|
2716
|
-
case "null":
|
|
2717
|
-
case "boolean":
|
|
2718
|
-
case "numeric":
|
|
2719
|
-
case "string":
|
|
2720
|
-
value = token.value;
|
|
2721
|
-
break;
|
|
2722
|
-
}
|
|
2723
|
-
if (root === void 0) {
|
|
2724
|
-
root = value;
|
|
2725
|
-
} else {
|
|
2726
|
-
const parent = stack[stack.length - 1];
|
|
2727
|
-
if (Array.isArray(parent)) {
|
|
2728
|
-
parent.push(value);
|
|
2729
|
-
} else {
|
|
2730
|
-
Object.defineProperty(parent, key, {
|
|
2731
|
-
value,
|
|
2732
|
-
writable: true,
|
|
2733
|
-
enumerable: true,
|
|
2734
|
-
configurable: true
|
|
2735
|
-
});
|
|
2736
|
-
}
|
|
2737
|
-
}
|
|
2738
|
-
if (value !== null && typeof value === "object") {
|
|
2739
|
-
stack.push(value);
|
|
2740
|
-
if (Array.isArray(value)) {
|
|
2741
|
-
parseState = "beforeArrayValue";
|
|
2742
|
-
} else {
|
|
2743
|
-
parseState = "beforePropertyName";
|
|
2744
|
-
}
|
|
2745
|
-
} else {
|
|
2746
|
-
const current = stack[stack.length - 1];
|
|
2747
|
-
if (current == null) {
|
|
2748
|
-
parseState = "end";
|
|
2749
|
-
} else if (Array.isArray(current)) {
|
|
2750
|
-
parseState = "afterArrayValue";
|
|
2751
|
-
} else {
|
|
2752
|
-
parseState = "afterPropertyValue";
|
|
2753
|
-
}
|
|
2754
|
-
}
|
|
2755
|
-
}
|
|
2756
|
-
function pop() {
|
|
2757
|
-
stack.pop();
|
|
2758
|
-
const current = stack[stack.length - 1];
|
|
2759
|
-
if (current == null) {
|
|
2760
|
-
parseState = "end";
|
|
2761
|
-
} else if (Array.isArray(current)) {
|
|
2762
|
-
parseState = "afterArrayValue";
|
|
2763
|
-
} else {
|
|
2764
|
-
parseState = "afterPropertyValue";
|
|
2765
|
-
}
|
|
2766
|
-
}
|
|
2767
|
-
function invalidChar(c2) {
|
|
2768
|
-
if (c2 === void 0) {
|
|
2769
|
-
return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
|
|
2770
|
-
}
|
|
2771
|
-
return syntaxError(`JSON5: invalid character '${formatChar(c2)}' at ${line}:${column}`);
|
|
2772
|
-
}
|
|
2773
|
-
function invalidEOF() {
|
|
2774
|
-
return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
|
|
2775
|
-
}
|
|
2776
|
-
function invalidIdentifier() {
|
|
2777
|
-
column -= 5;
|
|
2778
|
-
return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`);
|
|
2779
|
-
}
|
|
2780
|
-
function separatorChar(c2) {
|
|
2781
|
-
console.warn(`JSON5: '${formatChar(c2)}' in strings is not valid ECMAScript; consider escaping`);
|
|
2782
|
-
}
|
|
2783
|
-
function formatChar(c2) {
|
|
2784
|
-
const replacements = {
|
|
2785
|
-
"'": "\\'",
|
|
2786
|
-
'"': '\\"',
|
|
2787
|
-
"\\": "\\\\",
|
|
2788
|
-
"\b": "\\b",
|
|
2789
|
-
"\f": "\\f",
|
|
2790
|
-
"\n": "\\n",
|
|
2791
|
-
"\r": "\\r",
|
|
2792
|
-
" ": "\\t",
|
|
2793
|
-
"\v": "\\v",
|
|
2794
|
-
"\0": "\\0",
|
|
2795
|
-
"\u2028": "\\u2028",
|
|
2796
|
-
"\u2029": "\\u2029"
|
|
2797
|
-
};
|
|
2798
|
-
if (replacements[c2]) {
|
|
2799
|
-
return replacements[c2];
|
|
2800
|
-
}
|
|
2801
|
-
if (c2 < " ") {
|
|
2802
|
-
const hexString = c2.charCodeAt(0).toString(16);
|
|
2803
|
-
return "\\x" + ("00" + hexString).substring(hexString.length);
|
|
2804
|
-
}
|
|
2805
|
-
return c2;
|
|
2806
|
-
}
|
|
2807
|
-
function syntaxError(message) {
|
|
2808
|
-
const err = new SyntaxError(message);
|
|
2809
|
-
err.lineNumber = line;
|
|
2810
|
-
err.columnNumber = column;
|
|
2811
|
-
return err;
|
|
2812
|
-
}
|
|
2813
|
-
}
|
|
2814
|
-
});
|
|
2815
|
-
|
|
2816
|
-
// ../node_modules/json5/lib/stringify.js
|
|
2817
|
-
var require_stringify = __commonJS({
|
|
2818
|
-
"../node_modules/json5/lib/stringify.js"(exports, module) {
|
|
2819
|
-
var util = require_util2();
|
|
2820
|
-
module.exports = function stringify(value, replacer, space) {
|
|
2821
|
-
const stack = [];
|
|
2822
|
-
let indent = "";
|
|
2823
|
-
let propertyList;
|
|
2824
|
-
let replacerFunc;
|
|
2825
|
-
let gap = "";
|
|
2826
|
-
let quote;
|
|
2827
|
-
if (replacer != null && typeof replacer === "object" && !Array.isArray(replacer)) {
|
|
2828
|
-
space = replacer.space;
|
|
2829
|
-
quote = replacer.quote;
|
|
2830
|
-
replacer = replacer.replacer;
|
|
2831
|
-
}
|
|
2832
|
-
if (typeof replacer === "function") {
|
|
2833
|
-
replacerFunc = replacer;
|
|
2834
|
-
} else if (Array.isArray(replacer)) {
|
|
2835
|
-
propertyList = [];
|
|
2836
|
-
for (const v of replacer) {
|
|
2837
|
-
let item;
|
|
2838
|
-
if (typeof v === "string") {
|
|
2839
|
-
item = v;
|
|
2840
|
-
} else if (typeof v === "number" || v instanceof String || v instanceof Number) {
|
|
2841
|
-
item = String(v);
|
|
2842
|
-
}
|
|
2843
|
-
if (item !== void 0 && propertyList.indexOf(item) < 0) {
|
|
2844
|
-
propertyList.push(item);
|
|
2845
|
-
}
|
|
2846
|
-
}
|
|
2847
|
-
}
|
|
2848
|
-
if (space instanceof Number) {
|
|
2849
|
-
space = Number(space);
|
|
2850
|
-
} else if (space instanceof String) {
|
|
2851
|
-
space = String(space);
|
|
2852
|
-
}
|
|
2853
|
-
if (typeof space === "number") {
|
|
2854
|
-
if (space > 0) {
|
|
2855
|
-
space = Math.min(10, Math.floor(space));
|
|
2856
|
-
gap = " ".substr(0, space);
|
|
2857
|
-
}
|
|
2858
|
-
} else if (typeof space === "string") {
|
|
2859
|
-
gap = space.substr(0, 10);
|
|
2860
|
-
}
|
|
2861
|
-
return serializeProperty("", { "": value });
|
|
2862
|
-
function serializeProperty(key, holder) {
|
|
2863
|
-
let value2 = holder[key];
|
|
2864
|
-
if (value2 != null) {
|
|
2865
|
-
if (typeof value2.toJSON5 === "function") {
|
|
2866
|
-
value2 = value2.toJSON5(key);
|
|
2867
|
-
} else if (typeof value2.toJSON === "function") {
|
|
2868
|
-
value2 = value2.toJSON(key);
|
|
2869
|
-
}
|
|
2870
|
-
}
|
|
2871
|
-
if (replacerFunc) {
|
|
2872
|
-
value2 = replacerFunc.call(holder, key, value2);
|
|
2873
|
-
}
|
|
2874
|
-
if (value2 instanceof Number) {
|
|
2875
|
-
value2 = Number(value2);
|
|
2876
|
-
} else if (value2 instanceof String) {
|
|
2877
|
-
value2 = String(value2);
|
|
2878
|
-
} else if (value2 instanceof Boolean) {
|
|
2879
|
-
value2 = value2.valueOf();
|
|
2880
|
-
}
|
|
2881
|
-
switch (value2) {
|
|
2882
|
-
case null:
|
|
2883
|
-
return "null";
|
|
2884
|
-
case true:
|
|
2885
|
-
return "true";
|
|
2886
|
-
case false:
|
|
2887
|
-
return "false";
|
|
2888
|
-
}
|
|
2889
|
-
if (typeof value2 === "string") {
|
|
2890
|
-
return quoteString(value2, false);
|
|
2891
|
-
}
|
|
2892
|
-
if (typeof value2 === "number") {
|
|
2893
|
-
return String(value2);
|
|
2894
|
-
}
|
|
2895
|
-
if (typeof value2 === "object") {
|
|
2896
|
-
return Array.isArray(value2) ? serializeArray(value2) : serializeObject(value2);
|
|
2897
|
-
}
|
|
2898
|
-
return void 0;
|
|
2899
|
-
}
|
|
2900
|
-
function quoteString(value2) {
|
|
2901
|
-
const quotes = {
|
|
2902
|
-
"'": 0.1,
|
|
2903
|
-
'"': 0.2
|
|
2904
|
-
};
|
|
2905
|
-
const replacements = {
|
|
2906
|
-
"'": "\\'",
|
|
2907
|
-
'"': '\\"',
|
|
2908
|
-
"\\": "\\\\",
|
|
2909
|
-
"\b": "\\b",
|
|
2910
|
-
"\f": "\\f",
|
|
2911
|
-
"\n": "\\n",
|
|
2912
|
-
"\r": "\\r",
|
|
2913
|
-
" ": "\\t",
|
|
2914
|
-
"\v": "\\v",
|
|
2915
|
-
"\0": "\\0",
|
|
2916
|
-
"\u2028": "\\u2028",
|
|
2917
|
-
"\u2029": "\\u2029"
|
|
2918
|
-
};
|
|
2919
|
-
let product = "";
|
|
2920
|
-
for (let i = 0; i < value2.length; i++) {
|
|
2921
|
-
const c = value2[i];
|
|
2922
|
-
switch (c) {
|
|
2923
|
-
case "'":
|
|
2924
|
-
case '"':
|
|
2925
|
-
quotes[c]++;
|
|
2926
|
-
product += c;
|
|
2927
|
-
continue;
|
|
2928
|
-
case "\0":
|
|
2929
|
-
if (util.isDigit(value2[i + 1])) {
|
|
2930
|
-
product += "\\x00";
|
|
2931
|
-
continue;
|
|
2932
|
-
}
|
|
2933
|
-
}
|
|
2934
|
-
if (replacements[c]) {
|
|
2935
|
-
product += replacements[c];
|
|
2936
|
-
continue;
|
|
2937
|
-
}
|
|
2938
|
-
if (c < " ") {
|
|
2939
|
-
let hexString = c.charCodeAt(0).toString(16);
|
|
2940
|
-
product += "\\x" + ("00" + hexString).substring(hexString.length);
|
|
2941
|
-
continue;
|
|
2942
|
-
}
|
|
2943
|
-
product += c;
|
|
2944
|
-
}
|
|
2945
|
-
const quoteChar = quote || Object.keys(quotes).reduce((a, b) => quotes[a] < quotes[b] ? a : b);
|
|
2946
|
-
product = product.replace(new RegExp(quoteChar, "g"), replacements[quoteChar]);
|
|
2947
|
-
return quoteChar + product + quoteChar;
|
|
2948
|
-
}
|
|
2949
|
-
function serializeObject(value2) {
|
|
2950
|
-
if (stack.indexOf(value2) >= 0) {
|
|
2951
|
-
throw TypeError("Converting circular structure to JSON5");
|
|
2952
|
-
}
|
|
2953
|
-
stack.push(value2);
|
|
2954
|
-
let stepback = indent;
|
|
2955
|
-
indent = indent + gap;
|
|
2956
|
-
let keys = propertyList || Object.keys(value2);
|
|
2957
|
-
let partial = [];
|
|
2958
|
-
for (const key of keys) {
|
|
2959
|
-
const propertyString = serializeProperty(key, value2);
|
|
2960
|
-
if (propertyString !== void 0) {
|
|
2961
|
-
let member = serializeKey(key) + ":";
|
|
2962
|
-
if (gap !== "") {
|
|
2963
|
-
member += " ";
|
|
2964
|
-
}
|
|
2965
|
-
member += propertyString;
|
|
2966
|
-
partial.push(member);
|
|
2967
|
-
}
|
|
2968
|
-
}
|
|
2969
|
-
let final;
|
|
2970
|
-
if (partial.length === 0) {
|
|
2971
|
-
final = "{}";
|
|
2972
|
-
} else {
|
|
2973
|
-
let properties;
|
|
2974
|
-
if (gap === "") {
|
|
2975
|
-
properties = partial.join(",");
|
|
2976
|
-
final = "{" + properties + "}";
|
|
2977
|
-
} else {
|
|
2978
|
-
let separator = ",\n" + indent;
|
|
2979
|
-
properties = partial.join(separator);
|
|
2980
|
-
final = "{\n" + indent + properties + ",\n" + stepback + "}";
|
|
2981
|
-
}
|
|
2982
|
-
}
|
|
2983
|
-
stack.pop();
|
|
2984
|
-
indent = stepback;
|
|
2985
|
-
return final;
|
|
2986
|
-
}
|
|
2987
|
-
function serializeKey(key) {
|
|
2988
|
-
if (key.length === 0) {
|
|
2989
|
-
return quoteString(key, true);
|
|
2990
|
-
}
|
|
2991
|
-
const firstChar = String.fromCodePoint(key.codePointAt(0));
|
|
2992
|
-
if (!util.isIdStartChar(firstChar)) {
|
|
2993
|
-
return quoteString(key, true);
|
|
2994
|
-
}
|
|
2995
|
-
for (let i = firstChar.length; i < key.length; i++) {
|
|
2996
|
-
if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {
|
|
2997
|
-
return quoteString(key, true);
|
|
2998
|
-
}
|
|
2999
|
-
}
|
|
3000
|
-
return key;
|
|
3001
|
-
}
|
|
3002
|
-
function serializeArray(value2) {
|
|
3003
|
-
if (stack.indexOf(value2) >= 0) {
|
|
3004
|
-
throw TypeError("Converting circular structure to JSON5");
|
|
3005
|
-
}
|
|
3006
|
-
stack.push(value2);
|
|
3007
|
-
let stepback = indent;
|
|
3008
|
-
indent = indent + gap;
|
|
3009
|
-
let partial = [];
|
|
3010
|
-
for (let i = 0; i < value2.length; i++) {
|
|
3011
|
-
const propertyString = serializeProperty(String(i), value2);
|
|
3012
|
-
partial.push(propertyString !== void 0 ? propertyString : "null");
|
|
3013
|
-
}
|
|
3014
|
-
let final;
|
|
3015
|
-
if (partial.length === 0) {
|
|
3016
|
-
final = "[]";
|
|
3017
|
-
} else {
|
|
3018
|
-
if (gap === "") {
|
|
3019
|
-
let properties = partial.join(",");
|
|
3020
|
-
final = "[" + properties + "]";
|
|
3021
|
-
} else {
|
|
3022
|
-
let separator = ",\n" + indent;
|
|
3023
|
-
let properties = partial.join(separator);
|
|
3024
|
-
final = "[\n" + indent + properties + ",\n" + stepback + "]";
|
|
3025
|
-
}
|
|
3026
|
-
}
|
|
3027
|
-
stack.pop();
|
|
3028
|
-
indent = stepback;
|
|
3029
|
-
return final;
|
|
3030
|
-
}
|
|
3031
|
-
};
|
|
3032
|
-
}
|
|
3033
|
-
});
|
|
3034
|
-
|
|
3035
|
-
// ../node_modules/json5/lib/index.js
|
|
3036
|
-
var require_lib = __commonJS({
|
|
3037
|
-
"../node_modules/json5/lib/index.js"(exports, module) {
|
|
3038
|
-
var parse = require_parse();
|
|
3039
|
-
var stringify = require_stringify();
|
|
3040
|
-
var JSON5 = {
|
|
3041
|
-
parse,
|
|
3042
|
-
stringify
|
|
3043
|
-
};
|
|
3044
|
-
module.exports = JSON5;
|
|
3045
|
-
}
|
|
3046
|
-
});
|
|
3047
|
-
|
|
3048
|
-
// ../node_modules/strip-bom/index.js
|
|
3049
|
-
var require_strip_bom = __commonJS({
|
|
3050
|
-
"../node_modules/strip-bom/index.js"(exports, module) {
|
|
3051
|
-
"use strict";
|
|
3052
|
-
module.exports = (x) => {
|
|
3053
|
-
if (typeof x !== "string") {
|
|
3054
|
-
throw new TypeError("Expected a string, got " + typeof x);
|
|
3055
|
-
}
|
|
3056
|
-
if (x.charCodeAt(0) === 65279) {
|
|
3057
|
-
return x.slice(1);
|
|
3058
|
-
}
|
|
3059
|
-
return x;
|
|
3060
|
-
};
|
|
3061
|
-
}
|
|
3062
|
-
});
|
|
3063
|
-
|
|
3064
|
-
// ../node_modules/tsconfig-paths/lib/tsconfig-loader.js
|
|
3065
|
-
var require_tsconfig_loader = __commonJS({
|
|
3066
|
-
"../node_modules/tsconfig-paths/lib/tsconfig-loader.js"(exports) {
|
|
3067
|
-
"use strict";
|
|
3068
|
-
var __assign = exports && exports.__assign || function() {
|
|
3069
|
-
__assign = Object.assign || function(t) {
|
|
3070
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
3071
|
-
s = arguments[i];
|
|
3072
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
3073
|
-
t[p] = s[p];
|
|
3074
|
-
}
|
|
3075
|
-
return t;
|
|
3076
|
-
};
|
|
3077
|
-
return __assign.apply(this, arguments);
|
|
3078
|
-
};
|
|
3079
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3080
|
-
exports.loadTsconfig = exports.walkForTsConfig = exports.tsConfigLoader = void 0;
|
|
3081
|
-
var path = __require("path");
|
|
3082
|
-
var fs = __require("fs");
|
|
3083
|
-
var JSON5 = require_lib();
|
|
3084
|
-
var StripBom = require_strip_bom();
|
|
3085
|
-
function tsConfigLoader(_a) {
|
|
3086
|
-
var getEnv = _a.getEnv, cwd = _a.cwd, _b = _a.loadSync, loadSync = _b === void 0 ? loadSyncDefault : _b;
|
|
3087
|
-
var TS_NODE_PROJECT = getEnv("TS_NODE_PROJECT");
|
|
3088
|
-
var TS_NODE_BASEURL = getEnv("TS_NODE_BASEURL");
|
|
3089
|
-
var loadResult = loadSync(cwd, TS_NODE_PROJECT, TS_NODE_BASEURL);
|
|
3090
|
-
return loadResult;
|
|
3091
|
-
}
|
|
3092
|
-
exports.tsConfigLoader = tsConfigLoader;
|
|
3093
|
-
function loadSyncDefault(cwd, filename, baseUrl) {
|
|
3094
|
-
var configPath = resolveConfigPath(cwd, filename);
|
|
3095
|
-
if (!configPath) {
|
|
3096
|
-
return {
|
|
3097
|
-
tsConfigPath: void 0,
|
|
3098
|
-
baseUrl: void 0,
|
|
3099
|
-
paths: void 0
|
|
3100
|
-
};
|
|
3101
|
-
}
|
|
3102
|
-
var config = loadTsconfig(configPath);
|
|
3103
|
-
return {
|
|
3104
|
-
tsConfigPath: configPath,
|
|
3105
|
-
baseUrl: baseUrl || config && config.compilerOptions && config.compilerOptions.baseUrl,
|
|
3106
|
-
paths: config && config.compilerOptions && config.compilerOptions.paths
|
|
3107
|
-
};
|
|
3108
|
-
}
|
|
3109
|
-
function resolveConfigPath(cwd, filename) {
|
|
3110
|
-
if (filename) {
|
|
3111
|
-
var absolutePath = fs.lstatSync(filename).isDirectory() ? path.resolve(filename, "./tsconfig.json") : path.resolve(cwd, filename);
|
|
3112
|
-
return absolutePath;
|
|
3113
|
-
}
|
|
3114
|
-
if (fs.statSync(cwd).isFile()) {
|
|
3115
|
-
return path.resolve(cwd);
|
|
3116
|
-
}
|
|
3117
|
-
var configAbsolutePath = walkForTsConfig(cwd);
|
|
3118
|
-
return configAbsolutePath ? path.resolve(configAbsolutePath) : void 0;
|
|
3119
|
-
}
|
|
3120
|
-
function walkForTsConfig(directory, readdirSync) {
|
|
3121
|
-
if (readdirSync === void 0) {
|
|
3122
|
-
readdirSync = fs.readdirSync;
|
|
3123
|
-
}
|
|
3124
|
-
var files = readdirSync(directory);
|
|
3125
|
-
var filesToCheck = ["tsconfig.json", "jsconfig.json"];
|
|
3126
|
-
for (var _i = 0, filesToCheck_1 = filesToCheck; _i < filesToCheck_1.length; _i++) {
|
|
3127
|
-
var fileToCheck = filesToCheck_1[_i];
|
|
3128
|
-
if (files.indexOf(fileToCheck) !== -1) {
|
|
3129
|
-
return path.join(directory, fileToCheck);
|
|
3130
|
-
}
|
|
3131
|
-
}
|
|
3132
|
-
var parentDirectory = path.dirname(directory);
|
|
3133
|
-
if (directory === parentDirectory) {
|
|
3134
|
-
return void 0;
|
|
3135
|
-
}
|
|
3136
|
-
return walkForTsConfig(parentDirectory, readdirSync);
|
|
3137
|
-
}
|
|
3138
|
-
exports.walkForTsConfig = walkForTsConfig;
|
|
3139
|
-
function loadTsconfig(configFilePath, existsSync, readFileSync) {
|
|
3140
|
-
if (existsSync === void 0) {
|
|
3141
|
-
existsSync = fs.existsSync;
|
|
3142
|
-
}
|
|
3143
|
-
if (readFileSync === void 0) {
|
|
3144
|
-
readFileSync = function(filename) {
|
|
3145
|
-
return fs.readFileSync(filename, "utf8");
|
|
3146
|
-
};
|
|
3147
|
-
}
|
|
3148
|
-
if (!existsSync(configFilePath)) {
|
|
3149
|
-
return void 0;
|
|
3150
|
-
}
|
|
3151
|
-
var configString = readFileSync(configFilePath);
|
|
3152
|
-
var cleanedJson = StripBom(configString);
|
|
3153
|
-
var config;
|
|
3154
|
-
try {
|
|
3155
|
-
config = JSON5.parse(cleanedJson);
|
|
3156
|
-
} catch (e) {
|
|
3157
|
-
throw new Error("".concat(configFilePath, " is malformed ").concat(e.message));
|
|
3158
|
-
}
|
|
3159
|
-
var extendedConfig = config.extends;
|
|
3160
|
-
if (extendedConfig) {
|
|
3161
|
-
var base = void 0;
|
|
3162
|
-
if (Array.isArray(extendedConfig)) {
|
|
3163
|
-
base = extendedConfig.reduce(function(currBase, extendedConfigElement) {
|
|
3164
|
-
return mergeTsconfigs(currBase, loadTsconfigFromExtends(configFilePath, extendedConfigElement, existsSync, readFileSync));
|
|
3165
|
-
}, {});
|
|
3166
|
-
} else {
|
|
3167
|
-
base = loadTsconfigFromExtends(configFilePath, extendedConfig, existsSync, readFileSync);
|
|
3168
|
-
}
|
|
3169
|
-
return mergeTsconfigs(base, config);
|
|
3170
|
-
}
|
|
3171
|
-
return config;
|
|
3172
|
-
}
|
|
3173
|
-
exports.loadTsconfig = loadTsconfig;
|
|
3174
|
-
function loadTsconfigFromExtends(configFilePath, extendedConfigValue, existsSync, readFileSync) {
|
|
3175
|
-
var _a;
|
|
3176
|
-
if (typeof extendedConfigValue === "string" && extendedConfigValue.indexOf(".json") === -1) {
|
|
3177
|
-
extendedConfigValue += ".json";
|
|
3178
|
-
}
|
|
3179
|
-
var currentDir = path.dirname(configFilePath);
|
|
3180
|
-
var extendedConfigPath = path.join(currentDir, extendedConfigValue);
|
|
3181
|
-
if (extendedConfigValue.indexOf("/") !== -1 && extendedConfigValue.indexOf(".") !== -1 && !existsSync(extendedConfigPath)) {
|
|
3182
|
-
extendedConfigPath = path.join(currentDir, "node_modules", extendedConfigValue);
|
|
3183
|
-
}
|
|
3184
|
-
var config = loadTsconfig(extendedConfigPath, existsSync, readFileSync) || {};
|
|
3185
|
-
if ((_a = config.compilerOptions) === null || _a === void 0 ? void 0 : _a.baseUrl) {
|
|
3186
|
-
var extendsDir = path.dirname(extendedConfigValue);
|
|
3187
|
-
config.compilerOptions.baseUrl = path.join(extendsDir, config.compilerOptions.baseUrl);
|
|
3188
|
-
}
|
|
3189
|
-
return config;
|
|
3190
|
-
}
|
|
3191
|
-
function mergeTsconfigs(base, config) {
|
|
3192
|
-
base = base || {};
|
|
3193
|
-
config = config || {};
|
|
3194
|
-
return __assign(__assign(__assign({}, base), config), { compilerOptions: __assign(__assign({}, base.compilerOptions), config.compilerOptions) });
|
|
3195
|
-
}
|
|
3196
|
-
}
|
|
3197
|
-
});
|
|
3198
|
-
|
|
3199
|
-
// ../node_modules/tsconfig-paths/lib/config-loader.js
|
|
3200
|
-
var require_config_loader = __commonJS({
|
|
3201
|
-
"../node_modules/tsconfig-paths/lib/config-loader.js"(exports) {
|
|
3202
|
-
"use strict";
|
|
3203
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3204
|
-
exports.configLoader = exports.loadConfig = void 0;
|
|
3205
|
-
var TsConfigLoader2 = require_tsconfig_loader();
|
|
3206
|
-
var path = __require("path");
|
|
3207
|
-
function loadConfig(cwd) {
|
|
3208
|
-
if (cwd === void 0) {
|
|
3209
|
-
cwd = process.cwd();
|
|
3210
|
-
}
|
|
3211
|
-
return configLoader({ cwd });
|
|
3212
|
-
}
|
|
3213
|
-
exports.loadConfig = loadConfig;
|
|
3214
|
-
function configLoader(_a) {
|
|
3215
|
-
var cwd = _a.cwd, explicitParams = _a.explicitParams, _b = _a.tsConfigLoader, tsConfigLoader = _b === void 0 ? TsConfigLoader2.tsConfigLoader : _b;
|
|
3216
|
-
if (explicitParams) {
|
|
3217
|
-
var absoluteBaseUrl = path.isAbsolute(explicitParams.baseUrl) ? explicitParams.baseUrl : path.join(cwd, explicitParams.baseUrl);
|
|
3218
|
-
return {
|
|
3219
|
-
resultType: "success",
|
|
3220
|
-
configFileAbsolutePath: "",
|
|
3221
|
-
baseUrl: explicitParams.baseUrl,
|
|
3222
|
-
absoluteBaseUrl,
|
|
3223
|
-
paths: explicitParams.paths,
|
|
3224
|
-
mainFields: explicitParams.mainFields,
|
|
3225
|
-
addMatchAll: explicitParams.addMatchAll
|
|
3226
|
-
};
|
|
3227
|
-
}
|
|
3228
|
-
var loadResult = tsConfigLoader({
|
|
3229
|
-
cwd,
|
|
3230
|
-
getEnv: function(key) {
|
|
3231
|
-
return process.env[key];
|
|
3232
|
-
}
|
|
3233
|
-
});
|
|
3234
|
-
if (!loadResult.tsConfigPath) {
|
|
3235
|
-
return {
|
|
3236
|
-
resultType: "failed",
|
|
3237
|
-
message: "Couldn't find tsconfig.json"
|
|
3238
|
-
};
|
|
3239
|
-
}
|
|
3240
|
-
return {
|
|
3241
|
-
resultType: "success",
|
|
3242
|
-
configFileAbsolutePath: loadResult.tsConfigPath,
|
|
3243
|
-
baseUrl: loadResult.baseUrl,
|
|
3244
|
-
absoluteBaseUrl: path.resolve(path.dirname(loadResult.tsConfigPath), loadResult.baseUrl || ""),
|
|
3245
|
-
paths: loadResult.paths || {},
|
|
3246
|
-
addMatchAll: loadResult.baseUrl !== void 0
|
|
3247
|
-
};
|
|
3248
|
-
}
|
|
3249
|
-
exports.configLoader = configLoader;
|
|
3250
|
-
}
|
|
3251
|
-
});
|
|
3252
|
-
|
|
3253
|
-
// ../node_modules/minimist/index.js
|
|
3254
|
-
var require_minimist = __commonJS({
|
|
3255
|
-
"../node_modules/minimist/index.js"(exports, module) {
|
|
3256
|
-
"use strict";
|
|
3257
|
-
function hasKey(obj, keys) {
|
|
3258
|
-
var o = obj;
|
|
3259
|
-
keys.slice(0, -1).forEach(function(key2) {
|
|
3260
|
-
o = o[key2] || {};
|
|
3261
|
-
});
|
|
3262
|
-
var key = keys[keys.length - 1];
|
|
3263
|
-
return key in o;
|
|
3264
|
-
}
|
|
3265
|
-
function isNumber(x) {
|
|
3266
|
-
if (typeof x === "number") {
|
|
3267
|
-
return true;
|
|
3268
|
-
}
|
|
3269
|
-
if (/^0x[0-9a-f]+$/i.test(x)) {
|
|
3270
|
-
return true;
|
|
3271
|
-
}
|
|
3272
|
-
return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
|
|
3273
|
-
}
|
|
3274
|
-
function isConstructorOrProto(obj, key) {
|
|
3275
|
-
return key === "constructor" && typeof obj[key] === "function" || key === "__proto__";
|
|
3276
|
-
}
|
|
3277
|
-
module.exports = function(args, opts) {
|
|
3278
|
-
if (!opts) {
|
|
3279
|
-
opts = {};
|
|
3280
|
-
}
|
|
3281
|
-
var flags = {
|
|
3282
|
-
bools: {},
|
|
3283
|
-
strings: {},
|
|
3284
|
-
unknownFn: null
|
|
3285
|
-
};
|
|
3286
|
-
if (typeof opts.unknown === "function") {
|
|
3287
|
-
flags.unknownFn = opts.unknown;
|
|
3288
|
-
}
|
|
3289
|
-
if (typeof opts.boolean === "boolean" && opts.boolean) {
|
|
3290
|
-
flags.allBools = true;
|
|
3291
|
-
} else {
|
|
3292
|
-
[].concat(opts.boolean).filter(Boolean).forEach(function(key2) {
|
|
3293
|
-
flags.bools[key2] = true;
|
|
3294
|
-
});
|
|
3295
|
-
}
|
|
3296
|
-
var aliases = {};
|
|
3297
|
-
function aliasIsBoolean(key2) {
|
|
3298
|
-
return aliases[key2].some(function(x) {
|
|
3299
|
-
return flags.bools[x];
|
|
3300
|
-
});
|
|
3301
|
-
}
|
|
3302
|
-
Object.keys(opts.alias || {}).forEach(function(key2) {
|
|
3303
|
-
aliases[key2] = [].concat(opts.alias[key2]);
|
|
3304
|
-
aliases[key2].forEach(function(x) {
|
|
3305
|
-
aliases[x] = [key2].concat(aliases[key2].filter(function(y) {
|
|
3306
|
-
return x !== y;
|
|
3307
|
-
}));
|
|
3308
|
-
});
|
|
3309
|
-
});
|
|
3310
|
-
[].concat(opts.string).filter(Boolean).forEach(function(key2) {
|
|
3311
|
-
flags.strings[key2] = true;
|
|
3312
|
-
if (aliases[key2]) {
|
|
3313
|
-
[].concat(aliases[key2]).forEach(function(k) {
|
|
3314
|
-
flags.strings[k] = true;
|
|
3315
|
-
});
|
|
3316
|
-
}
|
|
3317
|
-
});
|
|
3318
|
-
var defaults = opts.default || {};
|
|
3319
|
-
var argv = { _: [] };
|
|
3320
|
-
function argDefined(key2, arg2) {
|
|
3321
|
-
return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key2] || flags.bools[key2] || aliases[key2];
|
|
3322
|
-
}
|
|
3323
|
-
function setKey(obj, keys, value2) {
|
|
3324
|
-
var o = obj;
|
|
3325
|
-
for (var i2 = 0; i2 < keys.length - 1; i2++) {
|
|
3326
|
-
var key2 = keys[i2];
|
|
3327
|
-
if (isConstructorOrProto(o, key2)) {
|
|
3328
|
-
return;
|
|
3329
|
-
}
|
|
3330
|
-
if (o[key2] === void 0) {
|
|
3331
|
-
o[key2] = {};
|
|
3332
|
-
}
|
|
3333
|
-
if (o[key2] === Object.prototype || o[key2] === Number.prototype || o[key2] === String.prototype) {
|
|
3334
|
-
o[key2] = {};
|
|
3335
|
-
}
|
|
3336
|
-
if (o[key2] === Array.prototype) {
|
|
3337
|
-
o[key2] = [];
|
|
3338
|
-
}
|
|
3339
|
-
o = o[key2];
|
|
3340
|
-
}
|
|
3341
|
-
var lastKey = keys[keys.length - 1];
|
|
3342
|
-
if (isConstructorOrProto(o, lastKey)) {
|
|
3343
|
-
return;
|
|
3344
|
-
}
|
|
3345
|
-
if (o === Object.prototype || o === Number.prototype || o === String.prototype) {
|
|
3346
|
-
o = {};
|
|
3347
|
-
}
|
|
3348
|
-
if (o === Array.prototype) {
|
|
3349
|
-
o = [];
|
|
3350
|
-
}
|
|
3351
|
-
if (o[lastKey] === void 0 || flags.bools[lastKey] || typeof o[lastKey] === "boolean") {
|
|
3352
|
-
o[lastKey] = value2;
|
|
3353
|
-
} else if (Array.isArray(o[lastKey])) {
|
|
3354
|
-
o[lastKey].push(value2);
|
|
3355
|
-
} else {
|
|
3356
|
-
o[lastKey] = [o[lastKey], value2];
|
|
3357
|
-
}
|
|
3358
|
-
}
|
|
3359
|
-
function setArg(key2, val, arg2) {
|
|
3360
|
-
if (arg2 && flags.unknownFn && !argDefined(key2, arg2)) {
|
|
3361
|
-
if (flags.unknownFn(arg2) === false) {
|
|
3362
|
-
return;
|
|
3363
|
-
}
|
|
3364
|
-
}
|
|
3365
|
-
var value2 = !flags.strings[key2] && isNumber(val) ? Number(val) : val;
|
|
3366
|
-
setKey(argv, key2.split("."), value2);
|
|
3367
|
-
(aliases[key2] || []).forEach(function(x) {
|
|
3368
|
-
setKey(argv, x.split("."), value2);
|
|
3369
|
-
});
|
|
3370
|
-
}
|
|
3371
|
-
Object.keys(flags.bools).forEach(function(key2) {
|
|
3372
|
-
setArg(key2, defaults[key2] === void 0 ? false : defaults[key2]);
|
|
3373
|
-
});
|
|
3374
|
-
var notFlags = [];
|
|
3375
|
-
if (args.indexOf("--") !== -1) {
|
|
3376
|
-
notFlags = args.slice(args.indexOf("--") + 1);
|
|
3377
|
-
args = args.slice(0, args.indexOf("--"));
|
|
3378
|
-
}
|
|
3379
|
-
for (var i = 0; i < args.length; i++) {
|
|
3380
|
-
var arg = args[i];
|
|
3381
|
-
var key;
|
|
3382
|
-
var next;
|
|
3383
|
-
if (/^--.+=/.test(arg)) {
|
|
3384
|
-
var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
|
|
3385
|
-
key = m[1];
|
|
3386
|
-
var value = m[2];
|
|
3387
|
-
if (flags.bools[key]) {
|
|
3388
|
-
value = value !== "false";
|
|
3389
|
-
}
|
|
3390
|
-
setArg(key, value, arg);
|
|
3391
|
-
} else if (/^--no-.+/.test(arg)) {
|
|
3392
|
-
key = arg.match(/^--no-(.+)/)[1];
|
|
3393
|
-
setArg(key, false, arg);
|
|
3394
|
-
} else if (/^--.+/.test(arg)) {
|
|
3395
|
-
key = arg.match(/^--(.+)/)[1];
|
|
3396
|
-
next = args[i + 1];
|
|
3397
|
-
if (next !== void 0 && !/^(-|--)[^-]/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) {
|
|
3398
|
-
setArg(key, next, arg);
|
|
3399
|
-
i += 1;
|
|
3400
|
-
} else if (/^(true|false)$/.test(next)) {
|
|
3401
|
-
setArg(key, next === "true", arg);
|
|
3402
|
-
i += 1;
|
|
3403
|
-
} else {
|
|
3404
|
-
setArg(key, flags.strings[key] ? "" : true, arg);
|
|
3405
|
-
}
|
|
3406
|
-
} else if (/^-[^-]+/.test(arg)) {
|
|
3407
|
-
var letters = arg.slice(1, -1).split("");
|
|
3408
|
-
var broken = false;
|
|
3409
|
-
for (var j = 0; j < letters.length; j++) {
|
|
3410
|
-
next = arg.slice(j + 2);
|
|
3411
|
-
if (next === "-") {
|
|
3412
|
-
setArg(letters[j], next, arg);
|
|
3413
|
-
continue;
|
|
3414
|
-
}
|
|
3415
|
-
if (/[A-Za-z]/.test(letters[j]) && next[0] === "=") {
|
|
3416
|
-
setArg(letters[j], next.slice(1), arg);
|
|
3417
|
-
broken = true;
|
|
3418
|
-
break;
|
|
3419
|
-
}
|
|
3420
|
-
if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
|
|
3421
|
-
setArg(letters[j], next, arg);
|
|
3422
|
-
broken = true;
|
|
3423
|
-
break;
|
|
3424
|
-
}
|
|
3425
|
-
if (letters[j + 1] && letters[j + 1].match(/\W/)) {
|
|
3426
|
-
setArg(letters[j], arg.slice(j + 2), arg);
|
|
3427
|
-
broken = true;
|
|
3428
|
-
break;
|
|
3429
|
-
} else {
|
|
3430
|
-
setArg(letters[j], flags.strings[letters[j]] ? "" : true, arg);
|
|
3431
|
-
}
|
|
3432
|
-
}
|
|
3433
|
-
key = arg.slice(-1)[0];
|
|
3434
|
-
if (!broken && key !== "-") {
|
|
3435
|
-
if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) {
|
|
3436
|
-
setArg(key, args[i + 1], arg);
|
|
3437
|
-
i += 1;
|
|
3438
|
-
} else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {
|
|
3439
|
-
setArg(key, args[i + 1] === "true", arg);
|
|
3440
|
-
i += 1;
|
|
3441
|
-
} else {
|
|
3442
|
-
setArg(key, flags.strings[key] ? "" : true, arg);
|
|
3443
|
-
}
|
|
3444
|
-
}
|
|
3445
|
-
} else {
|
|
3446
|
-
if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
|
|
3447
|
-
argv._.push(flags.strings._ || !isNumber(arg) ? arg : Number(arg));
|
|
3448
|
-
}
|
|
3449
|
-
if (opts.stopEarly) {
|
|
3450
|
-
argv._.push.apply(argv._, args.slice(i + 1));
|
|
3451
|
-
break;
|
|
3452
|
-
}
|
|
3453
|
-
}
|
|
3454
|
-
}
|
|
3455
|
-
Object.keys(defaults).forEach(function(k) {
|
|
3456
|
-
if (!hasKey(argv, k.split("."))) {
|
|
3457
|
-
setKey(argv, k.split("."), defaults[k]);
|
|
3458
|
-
(aliases[k] || []).forEach(function(x) {
|
|
3459
|
-
setKey(argv, x.split("."), defaults[k]);
|
|
3460
|
-
});
|
|
3461
|
-
}
|
|
3462
|
-
});
|
|
3463
|
-
if (opts["--"]) {
|
|
3464
|
-
argv["--"] = notFlags.slice();
|
|
3465
|
-
} else {
|
|
3466
|
-
notFlags.forEach(function(k) {
|
|
3467
|
-
argv._.push(k);
|
|
3468
|
-
});
|
|
3469
|
-
}
|
|
3470
|
-
return argv;
|
|
3471
|
-
};
|
|
3472
|
-
}
|
|
3473
|
-
});
|
|
3474
|
-
|
|
3475
|
-
// ../node_modules/tsconfig-paths/lib/register.js
|
|
3476
|
-
var require_register = __commonJS({
|
|
3477
|
-
"../node_modules/tsconfig-paths/lib/register.js"(exports) {
|
|
3478
|
-
"use strict";
|
|
3479
|
-
var __spreadArray = exports && exports.__spreadArray || function(to, from, pack) {
|
|
3480
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3481
|
-
if (ar || !(i in from)) {
|
|
3482
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
3483
|
-
ar[i] = from[i];
|
|
3484
|
-
}
|
|
3485
|
-
}
|
|
3486
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
3487
|
-
};
|
|
3488
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3489
|
-
exports.register = void 0;
|
|
3490
|
-
var match_path_sync_1 = require_match_path_sync();
|
|
3491
|
-
var config_loader_1 = require_config_loader();
|
|
3492
|
-
var noOp = function() {
|
|
3493
|
-
return void 0;
|
|
3494
|
-
};
|
|
3495
|
-
function getCoreModules(builtinModules) {
|
|
3496
|
-
builtinModules = builtinModules || [
|
|
3497
|
-
"assert",
|
|
3498
|
-
"buffer",
|
|
3499
|
-
"child_process",
|
|
3500
|
-
"cluster",
|
|
3501
|
-
"crypto",
|
|
3502
|
-
"dgram",
|
|
3503
|
-
"dns",
|
|
3504
|
-
"domain",
|
|
3505
|
-
"events",
|
|
3506
|
-
"fs",
|
|
3507
|
-
"http",
|
|
3508
|
-
"https",
|
|
3509
|
-
"net",
|
|
3510
|
-
"os",
|
|
3511
|
-
"path",
|
|
3512
|
-
"punycode",
|
|
3513
|
-
"querystring",
|
|
3514
|
-
"readline",
|
|
3515
|
-
"stream",
|
|
3516
|
-
"string_decoder",
|
|
3517
|
-
"tls",
|
|
3518
|
-
"tty",
|
|
3519
|
-
"url",
|
|
3520
|
-
"util",
|
|
3521
|
-
"v8",
|
|
3522
|
-
"vm",
|
|
3523
|
-
"zlib"
|
|
3524
|
-
];
|
|
3525
|
-
var coreModules = {};
|
|
3526
|
-
for (var _i = 0, builtinModules_1 = builtinModules; _i < builtinModules_1.length; _i++) {
|
|
3527
|
-
var module_1 = builtinModules_1[_i];
|
|
3528
|
-
coreModules[module_1] = true;
|
|
3529
|
-
}
|
|
3530
|
-
return coreModules;
|
|
3531
|
-
}
|
|
3532
|
-
function register(params) {
|
|
3533
|
-
var cwd;
|
|
3534
|
-
var explicitParams;
|
|
3535
|
-
if (params) {
|
|
3536
|
-
cwd = params.cwd;
|
|
3537
|
-
if (params.baseUrl || params.paths) {
|
|
3538
|
-
explicitParams = params;
|
|
3539
|
-
}
|
|
3540
|
-
} else {
|
|
3541
|
-
var minimist = require_minimist();
|
|
3542
|
-
var argv = minimist(process.argv.slice(2), {
|
|
3543
|
-
// eslint-disable-next-line id-denylist
|
|
3544
|
-
string: ["project"],
|
|
3545
|
-
alias: {
|
|
3546
|
-
project: ["P"]
|
|
3547
|
-
}
|
|
3548
|
-
});
|
|
3549
|
-
cwd = argv.project;
|
|
3550
|
-
}
|
|
3551
|
-
var configLoaderResult = (0, config_loader_1.configLoader)({
|
|
3552
|
-
cwd: cwd !== null && cwd !== void 0 ? cwd : process.cwd(),
|
|
3553
|
-
explicitParams
|
|
3554
|
-
});
|
|
3555
|
-
if (configLoaderResult.resultType === "failed") {
|
|
3556
|
-
console.warn("".concat(configLoaderResult.message, ". tsconfig-paths will be skipped"));
|
|
3557
|
-
return noOp;
|
|
3558
|
-
}
|
|
3559
|
-
var matchPath = (0, match_path_sync_1.createMatchPath)(configLoaderResult.absoluteBaseUrl, configLoaderResult.paths, configLoaderResult.mainFields, configLoaderResult.addMatchAll);
|
|
3560
|
-
var Module = __require("module");
|
|
3561
|
-
var originalResolveFilename = Module._resolveFilename;
|
|
3562
|
-
var coreModules = getCoreModules(Module.builtinModules);
|
|
3563
|
-
Module._resolveFilename = function(request, _parent) {
|
|
3564
|
-
var isCoreModule = coreModules.hasOwnProperty(request);
|
|
3565
|
-
if (!isCoreModule) {
|
|
3566
|
-
var found = matchPath(request);
|
|
3567
|
-
if (found) {
|
|
3568
|
-
var modifiedArguments = __spreadArray([found], [].slice.call(arguments, 1), true);
|
|
3569
|
-
return originalResolveFilename.apply(this, modifiedArguments);
|
|
3570
|
-
}
|
|
3571
|
-
}
|
|
3572
|
-
return originalResolveFilename.apply(this, arguments);
|
|
3573
|
-
};
|
|
3574
|
-
return function() {
|
|
3575
|
-
Module._resolveFilename = originalResolveFilename;
|
|
3576
|
-
};
|
|
3577
|
-
}
|
|
3578
|
-
exports.register = register;
|
|
3579
|
-
}
|
|
3580
|
-
});
|
|
3581
|
-
|
|
3582
|
-
// ../node_modules/tsconfig-paths/lib/index.js
|
|
3583
|
-
var require_lib2 = __commonJS({
|
|
3584
|
-
"../node_modules/tsconfig-paths/lib/index.js"(exports) {
|
|
3585
|
-
"use strict";
|
|
3586
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3587
|
-
exports.loadConfig = exports.register = exports.matchFromAbsolutePathsAsync = exports.createMatchPathAsync = exports.matchFromAbsolutePaths = exports.createMatchPath = void 0;
|
|
3588
|
-
var match_path_sync_1 = require_match_path_sync();
|
|
3589
|
-
Object.defineProperty(exports, "createMatchPath", { enumerable: true, get: function() {
|
|
3590
|
-
return match_path_sync_1.createMatchPath;
|
|
3591
|
-
} });
|
|
3592
|
-
Object.defineProperty(exports, "matchFromAbsolutePaths", { enumerable: true, get: function() {
|
|
3593
|
-
return match_path_sync_1.matchFromAbsolutePaths;
|
|
3594
|
-
} });
|
|
3595
|
-
var match_path_async_1 = require_match_path_async();
|
|
3596
|
-
Object.defineProperty(exports, "createMatchPathAsync", { enumerable: true, get: function() {
|
|
3597
|
-
return match_path_async_1.createMatchPathAsync;
|
|
3598
|
-
} });
|
|
3599
|
-
Object.defineProperty(exports, "matchFromAbsolutePathsAsync", { enumerable: true, get: function() {
|
|
3600
|
-
return match_path_async_1.matchFromAbsolutePathsAsync;
|
|
3601
|
-
} });
|
|
3602
|
-
var register_1 = require_register();
|
|
3603
|
-
Object.defineProperty(exports, "register", { enumerable: true, get: function() {
|
|
3604
|
-
return register_1.register;
|
|
3605
|
-
} });
|
|
3606
|
-
var config_loader_1 = require_config_loader();
|
|
3607
|
-
Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function() {
|
|
3608
|
-
return config_loader_1.loadConfig;
|
|
3609
|
-
} });
|
|
3610
|
-
}
|
|
3611
|
-
});
|
|
3612
|
-
|
|
3613
|
-
// ../node_modules/tsconfig-paths-webpack-plugin/lib/options.js
|
|
3614
|
-
var require_options = __commonJS({
|
|
3615
|
-
"../node_modules/tsconfig-paths-webpack-plugin/lib/options.js"(exports) {
|
|
3616
|
-
"use strict";
|
|
3617
|
-
var __assign = exports && exports.__assign || function() {
|
|
3618
|
-
__assign = Object.assign || function(t) {
|
|
3619
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
3620
|
-
s = arguments[i];
|
|
3621
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
3622
|
-
t[p] = s[p];
|
|
3623
|
-
}
|
|
3624
|
-
return t;
|
|
3625
|
-
};
|
|
3626
|
-
return __assign.apply(this, arguments);
|
|
3627
|
-
};
|
|
3628
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3629
|
-
exports.getOptions = void 0;
|
|
3630
|
-
var validOptions = [
|
|
3631
|
-
"configFile",
|
|
3632
|
-
"extensions",
|
|
3633
|
-
"baseUrl",
|
|
3634
|
-
"silent",
|
|
3635
|
-
"logLevel",
|
|
3636
|
-
"logInfoToStdOut",
|
|
3637
|
-
"context",
|
|
3638
|
-
"mainFields",
|
|
3639
|
-
"references"
|
|
3640
|
-
];
|
|
3641
|
-
function getOptions(rawOptions) {
|
|
3642
|
-
validateOptions(rawOptions);
|
|
3643
|
-
var options = makeOptions(rawOptions);
|
|
3644
|
-
return options;
|
|
3645
|
-
}
|
|
3646
|
-
exports.getOptions = getOptions;
|
|
3647
|
-
function validateOptions(rawOptions) {
|
|
3648
|
-
var loaderOptionKeys = Object.keys(rawOptions);
|
|
3649
|
-
for (var i = 0; i < loaderOptionKeys.length; i++) {
|
|
3650
|
-
var option = loaderOptionKeys[i];
|
|
3651
|
-
var isUnexpectedOption = validOptions.indexOf(option) === -1;
|
|
3652
|
-
if (isUnexpectedOption) {
|
|
3653
|
-
throw new Error("tsconfig-paths-webpack-plugin was supplied with an unexpected loader option: ".concat(option, "\nPlease take a look at the options you are supplying; the following are valid options:\n").concat(validOptions.join(" / "), "\n"));
|
|
3654
|
-
}
|
|
3655
|
-
}
|
|
3656
|
-
}
|
|
3657
|
-
function makeOptions(rawOptions) {
|
|
3658
|
-
var options = __assign(__assign({}, {
|
|
3659
|
-
configFile: "tsconfig.json",
|
|
3660
|
-
extensions: [".ts", ".tsx"],
|
|
3661
|
-
baseUrl: void 0,
|
|
3662
|
-
silent: false,
|
|
3663
|
-
logLevel: "WARN",
|
|
3664
|
-
logInfoToStdOut: false,
|
|
3665
|
-
context: void 0,
|
|
3666
|
-
colors: true,
|
|
3667
|
-
mainFields: ["main"],
|
|
3668
|
-
references: void 0
|
|
3669
|
-
}), rawOptions);
|
|
3670
|
-
var options2 = __assign(__assign({}, options), { logLevel: options.logLevel.toUpperCase() });
|
|
3671
|
-
return options2;
|
|
3672
|
-
}
|
|
3673
|
-
}
|
|
3674
|
-
});
|
|
3675
|
-
|
|
3676
|
-
// ../node_modules/tsconfig-paths-webpack-plugin/lib/logger.js
|
|
3677
|
-
var require_logger = __commonJS({
|
|
3678
|
-
"../node_modules/tsconfig-paths-webpack-plugin/lib/logger.js"(exports) {
|
|
3679
|
-
"use strict";
|
|
3680
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3681
|
-
exports.makeLogger = void 0;
|
|
3682
|
-
var console_1 = __require("console");
|
|
3683
|
-
var LogLevel;
|
|
3684
|
-
(function(LogLevel2) {
|
|
3685
|
-
LogLevel2[LogLevel2["INFO"] = 1] = "INFO";
|
|
3686
|
-
LogLevel2[LogLevel2["WARN"] = 2] = "WARN";
|
|
3687
|
-
LogLevel2[LogLevel2["ERROR"] = 3] = "ERROR";
|
|
3688
|
-
})(LogLevel || (LogLevel = {}));
|
|
3689
|
-
var stderrConsole = new console_1.Console(process.stderr);
|
|
3690
|
-
var stdoutConsole = new console_1.Console(process.stdout);
|
|
3691
|
-
var doNothingLogger = function(_message) {
|
|
3692
|
-
};
|
|
3693
|
-
var makeLoggerFunc = function(options) {
|
|
3694
|
-
return options.silent ? function(_whereToLog, _message) {
|
|
3695
|
-
} : function(whereToLog, message) {
|
|
3696
|
-
return whereToLog.log(message);
|
|
3697
|
-
};
|
|
3698
|
-
};
|
|
3699
|
-
var makeExternalLogger = function(loaderOptions, logger) {
|
|
3700
|
-
return function(message) {
|
|
3701
|
-
return logger(loaderOptions.logInfoToStdOut ? stdoutConsole : stderrConsole, message);
|
|
3702
|
-
};
|
|
3703
|
-
};
|
|
3704
|
-
var makeLogInfo = function(options, logger, green) {
|
|
3705
|
-
return LogLevel[options.logLevel] <= LogLevel.INFO ? function(message) {
|
|
3706
|
-
return logger(options.logInfoToStdOut ? stdoutConsole : stderrConsole, green(message));
|
|
3707
|
-
} : doNothingLogger;
|
|
3708
|
-
};
|
|
3709
|
-
var makeLogError = function(options, logger, red) {
|
|
3710
|
-
return LogLevel[options.logLevel] <= LogLevel.ERROR ? function(message) {
|
|
3711
|
-
return logger(stderrConsole, red(message));
|
|
3712
|
-
} : doNothingLogger;
|
|
3713
|
-
};
|
|
3714
|
-
var makeLogWarning = function(options, logger, yellow) {
|
|
3715
|
-
return LogLevel[options.logLevel] <= LogLevel.WARN ? function(message) {
|
|
3716
|
-
return logger(stderrConsole, yellow(message));
|
|
3717
|
-
} : doNothingLogger;
|
|
3718
|
-
};
|
|
3719
|
-
function makeLogger(options, colors) {
|
|
3720
|
-
var logger = makeLoggerFunc(options);
|
|
3721
|
-
return {
|
|
3722
|
-
log: makeExternalLogger(options, logger),
|
|
3723
|
-
logInfo: makeLogInfo(options, logger, colors.green),
|
|
3724
|
-
logWarning: makeLogWarning(options, logger, colors.yellow),
|
|
3725
|
-
logError: makeLogError(options, logger, colors.red)
|
|
3726
|
-
};
|
|
3727
|
-
}
|
|
3728
|
-
exports.makeLogger = makeLogger;
|
|
3729
|
-
}
|
|
3730
|
-
});
|
|
3731
|
-
|
|
3732
|
-
// ../node_modules/tsconfig-paths-webpack-plugin/lib/plugin.js
|
|
3733
|
-
var require_plugin = __commonJS({
|
|
3734
|
-
"../node_modules/tsconfig-paths-webpack-plugin/lib/plugin.js"(exports) {
|
|
3735
|
-
"use strict";
|
|
3736
|
-
var __assign = exports && exports.__assign || function() {
|
|
3737
|
-
__assign = Object.assign || function(t) {
|
|
3738
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
3739
|
-
s = arguments[i];
|
|
3740
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
3741
|
-
t[p] = s[p];
|
|
3742
|
-
}
|
|
3743
|
-
return t;
|
|
3744
|
-
};
|
|
3745
|
-
return __assign.apply(this, arguments);
|
|
3746
|
-
};
|
|
3747
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3748
|
-
exports.TsconfigPathsPlugin = void 0;
|
|
3749
|
-
var chalk = require_source();
|
|
3750
|
-
var TsconfigPaths = require_lib2();
|
|
3751
|
-
var path = __require("path");
|
|
3752
|
-
var Options = require_options();
|
|
3753
|
-
var Logger = require_logger();
|
|
3754
|
-
var getInnerRequest = __require("enhanced-resolve/lib/getInnerRequest");
|
|
3755
|
-
var TsconfigPathsPlugin = (
|
|
3756
|
-
/** @class */
|
|
3757
|
-
(function() {
|
|
3758
|
-
function TsconfigPathsPlugin2(rawOptions) {
|
|
3759
|
-
if (rawOptions === void 0) {
|
|
3760
|
-
rawOptions = {};
|
|
3761
|
-
}
|
|
3762
|
-
var _this = this;
|
|
3763
|
-
this.source = "described-resolve";
|
|
3764
|
-
this.target = "resolve";
|
|
3765
|
-
var options = Options.getOptions(rawOptions);
|
|
3766
|
-
this.extensions = options.extensions;
|
|
3767
|
-
this.referenceMatchMap = {};
|
|
3768
|
-
this.log = Logger.makeLogger(options, new chalk.Instance({ level: options.colors ? void 0 : 0 }));
|
|
3769
|
-
var context = options.context || process.cwd();
|
|
3770
|
-
var loadFrom = options.configFile || context;
|
|
3771
|
-
var loadResult = loadConfig(loadFrom, this.log);
|
|
3772
|
-
if (loadResult.resultType === "success") {
|
|
3773
|
-
this.baseUrl = options.baseUrl || loadResult.baseUrl;
|
|
3774
|
-
this.absoluteBaseUrl = options.baseUrl ? path.resolve(options.baseUrl) : loadResult.absoluteBaseUrl;
|
|
3775
|
-
this.matchPath = TsconfigPaths.createMatchPathAsync(this.absoluteBaseUrl, loadResult.paths, options.mainFields);
|
|
3776
|
-
if (options.references) {
|
|
3777
|
-
options.references.reduce(function(pathMap, reference) {
|
|
3778
|
-
if (reference) {
|
|
3779
|
-
var referenceResult = loadConfig(reference, _this.log);
|
|
3780
|
-
if (referenceResult.resultType === "success") {
|
|
3781
|
-
var paths = referenceResult.paths, absoluteBaseUrl = referenceResult.absoluteBaseUrl;
|
|
3782
|
-
pathMap[absoluteBaseUrl] = TsconfigPaths.createMatchPathAsync(absoluteBaseUrl, paths, options.mainFields);
|
|
3783
|
-
}
|
|
3784
|
-
}
|
|
3785
|
-
return pathMap;
|
|
3786
|
-
}, this.referenceMatchMap);
|
|
3787
|
-
}
|
|
3788
|
-
}
|
|
3789
|
-
}
|
|
3790
|
-
TsconfigPathsPlugin2.prototype.apply = function(resolver) {
|
|
3791
|
-
if (!resolver) {
|
|
3792
|
-
this.log.logWarning("tsconfig-paths-webpack-plugin: Found no resolver, not applying tsconfig-paths-webpack-plugin");
|
|
3793
|
-
return;
|
|
3794
|
-
}
|
|
3795
|
-
if (!("fileSystem" in resolver)) {
|
|
3796
|
-
this.log.logWarning("tsconfig-paths-webpack-plugin: No file system found on resolver. Please make sure you've placed the plugin in the correct part of the configuration. This plugin is a resolver plugin and should be placed in the resolve part of the Webpack configuration.");
|
|
3797
|
-
return;
|
|
3798
|
-
}
|
|
3799
|
-
if ("getHook" in resolver && typeof resolver.getHook === "function") {
|
|
3800
|
-
resolver.getHook(this.source).tapAsync({ name: "TsconfigPathsPlugin" }, createPluginCallback(this.referenceMatchMap, this.matchPath, resolver, this.absoluteBaseUrl, resolver.getHook(this.target), this.extensions));
|
|
3801
|
-
} else if ("plugin" in resolver) {
|
|
3802
|
-
var legacyResolver = resolver;
|
|
3803
|
-
legacyResolver.plugin(this.source, createPluginLegacy(this.matchPath, resolver, this.absoluteBaseUrl, this.target, this.extensions));
|
|
3804
|
-
}
|
|
3805
|
-
};
|
|
3806
|
-
return TsconfigPathsPlugin2;
|
|
3807
|
-
})()
|
|
3808
|
-
);
|
|
3809
|
-
exports.TsconfigPathsPlugin = TsconfigPathsPlugin;
|
|
3810
|
-
function loadConfig(configPath, logger) {
|
|
3811
|
-
var loadResult = TsconfigPaths.loadConfig(configPath);
|
|
3812
|
-
if (loadResult.resultType === "failed") {
|
|
3813
|
-
logger.logError("Failed to load ".concat(configPath, ": ").concat(loadResult.message));
|
|
3814
|
-
} else {
|
|
3815
|
-
logger.logInfo("tsconfig-paths-webpack-plugin: Using config file at ".concat(loadResult.configFileAbsolutePath));
|
|
3816
|
-
}
|
|
3817
|
-
return loadResult;
|
|
3818
|
-
}
|
|
3819
|
-
function createPluginCallback(referenceMatchMap, baseMatchPath, resolver, baseAbsoluteBaseUrl, hook, extensions) {
|
|
3820
|
-
var fileExistAsync = createFileExistAsync(resolver.fileSystem);
|
|
3821
|
-
var readJsonAsync = createReadJsonAsync(resolver.fileSystem);
|
|
3822
|
-
return function(request, resolveContext, callback) {
|
|
3823
|
-
var _a, _b;
|
|
3824
|
-
var innerRequest = getInnerRequest(resolver, request);
|
|
3825
|
-
if (!innerRequest || ((_a = request === null || request === void 0 ? void 0 : request.request) === null || _a === void 0 ? void 0 : _a.startsWith(".")) || ((_b = request === null || request === void 0 ? void 0 : request.request) === null || _b === void 0 ? void 0 : _b.startsWith(".."))) {
|
|
3826
|
-
return callback();
|
|
3827
|
-
}
|
|
3828
|
-
var absoluteBaseUrl = baseAbsoluteBaseUrl;
|
|
3829
|
-
if (typeof request.path === "string" && request.path !== baseAbsoluteBaseUrl) {
|
|
3830
|
-
if (referenceMatchMap[request.path]) {
|
|
3831
|
-
absoluteBaseUrl = request.path;
|
|
3832
|
-
} else {
|
|
3833
|
-
var referenceUrl = Object.keys(referenceMatchMap).find(function(refBaseUrl) {
|
|
3834
|
-
var relative = path.relative(refBaseUrl, request.path || "");
|
|
3835
|
-
return relative && !relative.startsWith("..") && !path.isAbsolute(relative);
|
|
3836
|
-
});
|
|
3837
|
-
if (referenceUrl) {
|
|
3838
|
-
absoluteBaseUrl = referenceUrl;
|
|
3839
|
-
}
|
|
3840
|
-
}
|
|
3841
|
-
}
|
|
3842
|
-
var matchPath = referenceMatchMap[absoluteBaseUrl] || baseMatchPath;
|
|
3843
|
-
matchPath(innerRequest, readJsonAsync, fileExistAsync, extensions, function(err, foundMatch) {
|
|
3844
|
-
if (err) {
|
|
3845
|
-
return callback(err);
|
|
3846
|
-
}
|
|
3847
|
-
if (!foundMatch) {
|
|
3848
|
-
return callback();
|
|
3849
|
-
}
|
|
3850
|
-
var newRequest = __assign(__assign({}, request), { request: foundMatch, path: absoluteBaseUrl });
|
|
3851
|
-
var createInnerContext = __require("enhanced-resolve/lib/createInnerContext");
|
|
3852
|
-
return resolver.doResolve(
|
|
3853
|
-
hook,
|
|
3854
|
-
newRequest,
|
|
3855
|
-
"Resolved request '".concat(innerRequest, "' to '").concat(foundMatch, "' using tsconfig.json paths mapping"),
|
|
3856
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3857
|
-
createInnerContext(__assign({}, resolveContext)),
|
|
3858
|
-
function(err2, result2) {
|
|
3859
|
-
if (err2) {
|
|
3860
|
-
return callback(err2);
|
|
3861
|
-
}
|
|
3862
|
-
if (result2 === void 0) {
|
|
3863
|
-
return callback(void 0, void 0);
|
|
3864
|
-
}
|
|
3865
|
-
callback(void 0, result2);
|
|
3866
|
-
}
|
|
3867
|
-
);
|
|
3868
|
-
});
|
|
3869
|
-
};
|
|
3870
|
-
}
|
|
3871
|
-
function createPluginLegacy(matchPath, resolver, absoluteBaseUrl, target, extensions) {
|
|
3872
|
-
var fileExistAsync = createFileExistAsync(resolver.fileSystem);
|
|
3873
|
-
var readJsonAsync = createReadJsonAsync(resolver.fileSystem);
|
|
3874
|
-
return function(request, callback) {
|
|
3875
|
-
var innerRequest = getInnerRequest(resolver, request);
|
|
3876
|
-
if (!innerRequest || innerRequest.startsWith(".") || innerRequest.startsWith("..")) {
|
|
3877
|
-
return callback();
|
|
3878
|
-
}
|
|
3879
|
-
matchPath(innerRequest, readJsonAsync, fileExistAsync, extensions, function(err, foundMatch) {
|
|
3880
|
-
if (err) {
|
|
3881
|
-
return callback(err);
|
|
3882
|
-
}
|
|
3883
|
-
if (!foundMatch) {
|
|
3884
|
-
return callback();
|
|
3885
|
-
}
|
|
3886
|
-
var newRequest = __assign(__assign({}, request), { request: foundMatch, path: absoluteBaseUrl });
|
|
3887
|
-
var createInnerCallback = __require("enhanced-resolve/lib/createInnerCallback");
|
|
3888
|
-
return resolver.doResolve(target, newRequest, "Resolved request '".concat(innerRequest, "' to '").concat(foundMatch, "' using tsconfig.json paths mapping"), createInnerCallback(function(err2, result2) {
|
|
3889
|
-
if (arguments.length > 0) {
|
|
3890
|
-
return callback(err2, result2);
|
|
3891
|
-
}
|
|
3892
|
-
callback(void 0, void 0);
|
|
3893
|
-
}, callback));
|
|
3894
|
-
});
|
|
3895
|
-
};
|
|
3896
|
-
}
|
|
3897
|
-
function readJson(fileSystem, path2, callback) {
|
|
3898
|
-
if ("readJson" in fileSystem && fileSystem.readJson) {
|
|
3899
|
-
return fileSystem.readJson(path2, callback);
|
|
3900
|
-
}
|
|
3901
|
-
fileSystem.readFile(path2, function(err, buf) {
|
|
3902
|
-
if (err) {
|
|
3903
|
-
return callback(err);
|
|
3904
|
-
}
|
|
3905
|
-
var data;
|
|
3906
|
-
try {
|
|
3907
|
-
data = JSON.parse(buf.toString("utf-8"));
|
|
3908
|
-
} catch (e) {
|
|
3909
|
-
return callback(e);
|
|
3910
|
-
}
|
|
3911
|
-
return callback(void 0, data);
|
|
3912
|
-
});
|
|
3913
|
-
}
|
|
3914
|
-
function createReadJsonAsync(filesystem) {
|
|
3915
|
-
return function(path2, callback2) {
|
|
3916
|
-
readJson(filesystem, path2, function(err, json) {
|
|
3917
|
-
if (err || !json) {
|
|
3918
|
-
callback2();
|
|
3919
|
-
return;
|
|
3920
|
-
}
|
|
3921
|
-
callback2(void 0, json);
|
|
3922
|
-
});
|
|
3923
|
-
};
|
|
3924
|
-
}
|
|
3925
|
-
function createFileExistAsync(filesystem) {
|
|
3926
|
-
return function(path2, callback2) {
|
|
3927
|
-
filesystem.stat(path2, function(err, stats) {
|
|
3928
|
-
if (err) {
|
|
3929
|
-
callback2(void 0, false);
|
|
3930
|
-
return;
|
|
3931
|
-
}
|
|
3932
|
-
callback2(void 0, stats ? stats.isFile() : false);
|
|
3933
|
-
});
|
|
3934
|
-
};
|
|
3935
|
-
}
|
|
3936
|
-
}
|
|
3937
|
-
});
|
|
3938
|
-
|
|
3939
|
-
// ../node_modules/tsconfig-paths-webpack-plugin/lib/index.js
|
|
3940
|
-
var require_lib3 = __commonJS({
|
|
3941
|
-
"../node_modules/tsconfig-paths-webpack-plugin/lib/index.js"(exports, module) {
|
|
3942
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3943
|
-
exports.TsconfigPathsPlugin = void 0;
|
|
3944
|
-
var plugin_1 = require_plugin();
|
|
3945
|
-
Object.defineProperty(exports, "TsconfigPathsPlugin", { enumerable: true, get: function() {
|
|
3946
|
-
return plugin_1.TsconfigPathsPlugin;
|
|
3947
|
-
} });
|
|
3948
|
-
var plugin_2 = require_plugin();
|
|
3949
|
-
exports.default = plugin_2.TsconfigPathsPlugin;
|
|
3950
|
-
var theClass = require_plugin().TsconfigPathsPlugin;
|
|
3951
|
-
theClass.TsconfigPathsPlugin = plugin_2.TsconfigPathsPlugin;
|
|
3952
|
-
theClass.default = plugin_2.TsconfigPathsPlugin;
|
|
3953
|
-
module.exports = theClass;
|
|
3954
|
-
}
|
|
3955
|
-
});
|
|
3956
|
-
export default require_lib3();
|