@modern-js/utils 1.7.3 → 1.7.6
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +21 -0
- package/compiled/nanoid/index.d.ts +91 -0
- package/compiled/nanoid/index.js +1 -0
- package/compiled/nanoid/license +20 -0
- package/compiled/nanoid/package.json +1 -0
- package/compiled/tsconfig-paths/index.js +1 -0
- package/compiled/tsconfig-paths/lib/config-loader.d.ts +33 -0
- package/compiled/tsconfig-paths/lib/filesystem.d.ts +33 -0
- package/compiled/tsconfig-paths/lib/index.d.ts +5 -0
- package/compiled/tsconfig-paths/lib/mapping-entry.d.ts +17 -0
- package/compiled/tsconfig-paths/lib/match-path-async.d.ts +21 -0
- package/compiled/tsconfig-paths/lib/match-path-sync.d.ts +30 -0
- package/compiled/tsconfig-paths/lib/options.d.ts +4 -0
- package/compiled/tsconfig-paths/lib/register.d.ts +6 -0
- package/compiled/tsconfig-paths/lib/try-path.d.ts +15 -0
- package/compiled/tsconfig-paths/lib/tsconfig-loader.d.ts +28 -0
- package/compiled/tsconfig-paths/license +21 -0
- package/compiled/tsconfig-paths/package.json +1 -0
- package/compiled/webpack-chain/index.js +1 -0
- package/compiled/webpack-chain/license +373 -0
- package/compiled/webpack-chain/package.json +1 -0
- package/compiled/webpack-chain/types/index.d.ts +388 -0
- package/dist/chainId.d.ts +116 -0
- package/dist/chainId.js +118 -0
- package/dist/compiled.d.ts +3 -1
- package/dist/compiled.js +3 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/monorepo.js +11 -7
- package/dist/prettyInstructions.d.ts +3 -0
- package/dist/prettyInstructions.js +11 -4
- package/package.json +13 -6
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,26 @@
|
|
1
1
|
# @modern-js/utils
|
2
2
|
|
3
|
+
## 1.7.6
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 6451a098: fix: cyclic dependencies of @modern-js/core and @moden-js/webpack
|
8
|
+
- d5a2cfd8: fix(utils): isModernjsMonorepo should return false if there is no package.json
|
9
|
+
- 437367c6: fix(server): hmr not working when using proxy
|
10
|
+
|
11
|
+
## 1.7.5
|
12
|
+
|
13
|
+
### Patch Changes
|
14
|
+
|
15
|
+
- 33de0f7ec: fix type export
|
16
|
+
|
17
|
+
## 1.7.4
|
18
|
+
|
19
|
+
### Patch Changes
|
20
|
+
|
21
|
+
- b8cfc42cd: feat: prebundle tsconfig-paths and nanoid
|
22
|
+
- 804a5bb8a: fix(utils): isPnpmWorkspaces not work
|
23
|
+
|
3
24
|
## 1.7.3
|
4
25
|
|
5
26
|
### Patch Changes
|
@@ -0,0 +1,91 @@
|
|
1
|
+
/**
|
2
|
+
* Generate secure URL-friendly unique ID.
|
3
|
+
*
|
4
|
+
* By default, the ID will have 21 symbols to have a collision probability
|
5
|
+
* similar to UUID v4.
|
6
|
+
*
|
7
|
+
* ```js
|
8
|
+
* import { nanoid } from './nanoid'
|
9
|
+
* model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL"
|
10
|
+
* ```
|
11
|
+
*
|
12
|
+
* @param size Size of the ID. The default size is 21.
|
13
|
+
* @returns A random string.
|
14
|
+
*/
|
15
|
+
export function nanoid(size?: number): string
|
16
|
+
|
17
|
+
/**
|
18
|
+
* Generate secure unique ID with custom alphabet.
|
19
|
+
*
|
20
|
+
* Alphabet must contain 256 symbols or less. Otherwise, the generator
|
21
|
+
* will not be secure.
|
22
|
+
*
|
23
|
+
* @param alphabet Alphabet used to generate the ID.
|
24
|
+
* @param defaultSize Size of the ID. The default size is 21.
|
25
|
+
* @returns A random string generator.
|
26
|
+
*
|
27
|
+
* ```js
|
28
|
+
* const { customAlphabet } = require('nanoid')
|
29
|
+
* const nanoid = customAlphabet('0123456789абвгдеё', 5)
|
30
|
+
* nanoid() //=> "8ё56а"
|
31
|
+
* ```
|
32
|
+
*/
|
33
|
+
export function customAlphabet(
|
34
|
+
alphabet: string,
|
35
|
+
defaultSize?: number
|
36
|
+
): (size?: number) => string
|
37
|
+
|
38
|
+
/**
|
39
|
+
* Generate unique ID with custom random generator and alphabet.
|
40
|
+
*
|
41
|
+
* Alphabet must contain 256 symbols or less. Otherwise, the generator
|
42
|
+
* will not be secure.
|
43
|
+
*
|
44
|
+
* ```js
|
45
|
+
* import { customRandom } from './nanoid/format'
|
46
|
+
*
|
47
|
+
* const nanoid = customRandom('abcdef', 5, size => {
|
48
|
+
* const random = []
|
49
|
+
* for (let i = 0; i < size; i++) {
|
50
|
+
* random.push(randomByte())
|
51
|
+
* }
|
52
|
+
* return random
|
53
|
+
* })
|
54
|
+
*
|
55
|
+
* nanoid() //=> "fbaef"
|
56
|
+
* ```
|
57
|
+
*
|
58
|
+
* @param alphabet Alphabet used to generate a random string.
|
59
|
+
* @param size Size of the random string.
|
60
|
+
* @param random A random bytes generator.
|
61
|
+
* @returns A random string generator.
|
62
|
+
*/
|
63
|
+
export function customRandom(
|
64
|
+
alphabet: string,
|
65
|
+
size: number,
|
66
|
+
random: (bytes: number) => Uint8Array
|
67
|
+
): () => string
|
68
|
+
|
69
|
+
/**
|
70
|
+
* URL safe symbols.
|
71
|
+
*
|
72
|
+
* ```js
|
73
|
+
* import { urlAlphabet } from './nanoid'
|
74
|
+
* const nanoid = customAlphabet(urlAlphabet, 10)
|
75
|
+
* nanoid() //=> "Uakgb_J5m9"
|
76
|
+
* ```
|
77
|
+
*/
|
78
|
+
export const urlAlphabet: string
|
79
|
+
|
80
|
+
/**
|
81
|
+
* Generate an array of random bytes collected from hardware noise.
|
82
|
+
*
|
83
|
+
* ```js
|
84
|
+
* import { customRandom, random } from './nanoid'
|
85
|
+
* const nanoid = customRandom("abcdef", 5, random)
|
86
|
+
* ```
|
87
|
+
*
|
88
|
+
* @param bytes Size of the array.
|
89
|
+
* @returns An array of random bytes.
|
90
|
+
*/
|
91
|
+
export function random(bytes: number): Uint8Array
|
@@ -0,0 +1 @@
|
|
1
|
+
(()=>{var e={113:e=>{"use strict";e.exports=require("crypto")},495:(e,r,t)=>{let l=t(113);let{urlAlphabet:a}=t(240);const n=128;let _,u;let fillPool=e=>{if(!_||_.length<e){_=Buffer.allocUnsafe(e*n);l.randomFillSync(_);u=0}else if(u+e>_.length){l.randomFillSync(_);u=0}u+=e};let random=e=>{fillPool(e-=0);return _.subarray(u-e,u)};let customRandom=(e,r,t)=>{let l=(2<<31-Math.clz32(e.length-1|1))-1;let a=Math.ceil(1.6*l*r/e.length);return(n=r)=>{let _="";while(true){let r=t(a);let u=a;while(u--){_+=e[r[u]&l]||"";if(_.length===n)return _}}}};let customAlphabet=(e,r=21)=>customRandom(e,r,random);let nanoid=(e=21)=>{fillPool(e-=0);let r="";for(let t=u-e;t<u;t++){r+=a[_[t]&63]}return r};e.exports={nanoid:nanoid,customAlphabet:customAlphabet,customRandom:customRandom,urlAlphabet:a,random:random}},240:e=>{let r="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";e.exports={urlAlphabet:r}}};var r={};function __nccwpck_require__(t){var l=r[t];if(l!==undefined){return l.exports}var a=r[t]={exports:{}};var n=true;try{e[t](a,a.exports,__nccwpck_require__);n=false}finally{if(n)delete r[t]}return a.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var t=__nccwpck_require__(495);module.exports=t})();
|
@@ -0,0 +1,20 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright 2017 Andrey Sitnik <andrey@sitnik.ru>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
7
|
+
the Software without restriction, including without limitation the rights to
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1 @@
|
|
1
|
+
{"name":"nanoid","author":"Andrey Sitnik <andrey@sitnik.ru>","version":"3.3.4","license":"MIT","types":"./index.d.ts"}
|
@@ -0,0 +1 @@
|
|
1
|
+
(()=>{"use strict";var e={308:e=>{e.exports=e=>{if(typeof e!=="string"){throw new TypeError("Expected a string, got "+typeof e)}if(e.charCodeAt(0)===65279){return e.slice(1)}return e}},57:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.configLoader=t.loadConfig=void 0;var n=r(429);var i=r(17);var a=r(175);function loadConfig(e){if(e===void 0){e=a.options.cwd}return configLoader({cwd:e})}t.loadConfig=loadConfig;function configLoader(e){var t=e.cwd,r=e.explicitParams,a=e.tsConfigLoader,o=a===void 0?n.tsConfigLoader:a;if(r){var s=i.isAbsolute(r.baseUrl)?r.baseUrl:i.join(t,r.baseUrl);return{resultType:"success",configFileAbsolutePath:"",baseUrl:r.baseUrl,absoluteBaseUrl:s,paths:r.paths,mainFields:r.mainFields,addMatchAll:r.addMatchAll}}var u=o({cwd:t,getEnv:function(e){return process.env[e]}});if(!u.tsConfigPath){return{resultType:"failed",message:"Couldn't find tsconfig.json"}}if(!u.baseUrl){return{resultType:"failed",message:"Missing baseUrl in compilerOptions"}}var f=i.dirname(u.tsConfigPath);var c=i.join(f,u.baseUrl);return{resultType:"success",configFileAbsolutePath:u.tsConfigPath,baseUrl:u.baseUrl,absoluteBaseUrl:c,paths:u.paths||{}}}t.configLoader=configLoader},182:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.removeExtension=t.fileExistsAsync=t.readJsonFromDiskAsync=t.readJsonFromDiskSync=t.fileExistsSync=void 0;var n=r(147);function fileExistsSync(e){try{var t=n.statSync(e);return t.isFile()}catch(e){return false}}t.fileExistsSync=fileExistsSync;function readJsonFromDiskSync(e){if(!n.existsSync(e)){return undefined}return require(e)}t.readJsonFromDiskSync=readJsonFromDiskSync;function readJsonFromDiskAsync(e,t){n.readFile(e,"utf8",(function(e,r){if(e||!r){return t()}var n=JSON.parse(r);return t(undefined,n)}))}t.readJsonFromDiskAsync=readJsonFromDiskAsync;function fileExistsAsync(e,t){n.stat(e,(function(e,r){if(e){return t(undefined,false)}t(undefined,r?r.isFile():false)}))}t.fileExistsAsync=fileExistsAsync;function removeExtension(e){return e.substring(0,e.lastIndexOf("."))||e}t.removeExtension=removeExtension},462:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.getAbsoluteMappingEntries=void 0;var n=r(17);function getAbsoluteMappingEntries(e,t,r){var i=sortByLongestPrefix(Object.keys(t));var a=[];for(var o=0,s=i;o<s.length;o++){var u=s[o];a.push({pattern:u,paths:t[u].map((function(t){return n.join(e,t)}))})}if(!t["*"]&&r){a.push({pattern:"*",paths:["".concat(e.replace(/\/$/,""),"/*")]})}return a}t.getAbsoluteMappingEntries=getAbsoluteMappingEntries;function sortByLongestPrefix(e){return e.concat().sort((function(e,t){return getPrefixLength(t)-getPrefixLength(e)}))}function getPrefixLength(e){var t=e.indexOf("*");return e.substr(0,t).length}},29:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.matchFromAbsolutePathsAsync=t.createMatchPathAsync=void 0;var n=r(17);var i=r(306);var a=r(462);var o=r(182);function createMatchPathAsync(e,t,r,n){if(r===void 0){r=["main"]}if(n===void 0){n=true}var i=a.getAbsoluteMappingEntries(e,t,n);return function(e,t,n,a,o){return matchFromAbsolutePathsAsync(i,e,t,n,a,o,r)}}t.createMatchPathAsync=createMatchPathAsync;function matchFromAbsolutePathsAsync(e,t,r,n,a,s,u){if(r===void 0){r=o.readJsonFromDiskAsync}if(n===void 0){n=o.fileExistsAsync}if(a===void 0){a=Object.keys(require.extensions)}if(u===void 0){u=["main"]}var f=i.getPathsToTry(a,e,t);if(!f){return s()}findFirstExistingPath(f,r,n,s,0,u)}t.matchFromAbsolutePathsAsync=matchFromAbsolutePathsAsync;function findFirstExistingMainFieldMappedFile(e,t,r,i,a,o){if(o===void 0){o=0}if(o>=t.length){return a(undefined,undefined)}var tryNext=function(){return findFirstExistingMainFieldMappedFile(e,t,r,i,a,o+1)};var s=e[t[o]];if(typeof s!=="string"){return tryNext()}var u=n.join(n.dirname(r),s);i(u,(function(e,t){if(e){return a(e)}if(t){return a(undefined,u)}return tryNext()}))}function findFirstExistingPath(e,t,r,n,a,o){if(a===void 0){a=0}if(o===void 0){o=["main"]}var s=e[a];if(s.type==="file"||s.type==="extension"||s.type==="index"){r(s.path,(function(u,f){if(u){return n(u)}if(f){return n(undefined,i.getStrippedPath(s))}if(a===e.length-1){return n()}return findFirstExistingPath(e,t,r,n,a+1,o)}))}else if(s.type==="package"){t(s.path,(function(i,u){if(i){return n(i)}if(u){return findFirstExistingMainFieldMappedFile(u,o,s.path,r,(function(i,s){if(i){return n(i)}if(s){return n(undefined,s)}return findFirstExistingPath(e,t,r,n,a+1,o)}))}return findFirstExistingPath(e,t,r,n,a+1,o)}))}else{i.exhaustiveTypeException(s.type)}}},920:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.matchFromAbsolutePaths=t.createMatchPath=void 0;var n=r(17);var i=r(182);var a=r(462);var o=r(306);function createMatchPath(e,t,r,n){if(r===void 0){r=["main"]}if(n===void 0){n=true}var i=a.getAbsoluteMappingEntries(e,t,n);return function(e,t,n,a){return matchFromAbsolutePaths(i,e,t,n,a,r)}}t.createMatchPath=createMatchPath;function matchFromAbsolutePaths(e,t,r,n,a,s){if(r===void 0){r=i.readJsonFromDiskSync}if(n===void 0){n=i.fileExistsSync}if(a===void 0){a=Object.keys(require.extensions)}if(s===void 0){s=["main"]}var u=o.getPathsToTry(a,e,t);if(!u){return undefined}return findFirstExistingPath(u,r,n,s)}t.matchFromAbsolutePaths=matchFromAbsolutePaths;function findFirstExistingMainFieldMappedFile(e,t,r,i){for(var a=0;a<t.length;a++){var o=t[a];var s=e[o];if(s&&typeof s==="string"){var u=n.join(n.dirname(r),s);if(i(u)){return u}}}return undefined}function findFirstExistingPath(e,t,r,n){if(t===void 0){t=i.readJsonFromDiskSync}if(n===void 0){n=["main"]}for(var a=0,s=e;a<s.length;a++){var u=s[a];if(u.type==="file"||u.type==="extension"||u.type==="index"){if(r(u.path)){return o.getStrippedPath(u)}}else if(u.type==="package"){var f=t(u.path);if(f){var c=findFirstExistingMainFieldMappedFile(f,n,u.path,r);if(c){return c}}}else{o.exhaustiveTypeException(u.type)}}return undefined}},175:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.options=void 0;var n=r(227);var i=n(process.argv.slice(2),{string:["project"],alias:{project:["P"]}});var a=i&&i.project;t.options={cwd:a||process.cwd()}},41:function(e,t,r){var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++){if(a||!(n in t)){if(!a)a=Array.prototype.slice.call(t,0,n);a[n]=t[n]}}return e.concat(a||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.register=void 0;var i=r(920);var a=r(57);var o=r(175);var noOp=function(){return void 0};function getCoreModules(e){e=e||["assert","buffer","child_process","cluster","crypto","dgram","dns","domain","events","fs","http","https","net","os","path","punycode","querystring","readline","stream","string_decoder","tls","tty","url","util","v8","vm","zlib"];var t={};for(var r=0,n=e;r<n.length;r++){var i=n[r];t[i]=true}return t}function register(e){var t=(0,a.configLoader)({cwd:o.options.cwd,explicitParams:e});if(t.resultType==="failed"){console.warn("".concat(t.message,". tsconfig-paths will be skipped"));return noOp}var s=(0,i.createMatchPath)(t.absoluteBaseUrl,t.paths,t.mainFields,t.addMatchAll);var u=r(188);var f=u._resolveFilename;var c=getCoreModules(u.builtinModules);u._resolveFilename=function(e,t){var r=c.hasOwnProperty(e);if(!r){var i=s(e);if(i){var a=n([i],[].slice.call(arguments,1),true);return f.apply(this,a)}}return f.apply(this,arguments)};return function(){u._resolveFilename=f}}t.register=register},306:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.exhaustiveTypeException=t.getStrippedPath=t.getPathsToTry=void 0;var n=r(17);var i=r(17);var a=r(182);function getPathsToTry(e,t,r){if(!t||!r||r[0]==="."){return undefined}var i=[];for(var a=0,o=t;a<o.length;a++){var s=o[a];var u=s.pattern===r?"":matchStar(s.pattern,r);if(u!==undefined){var _loop_1=function(t){var r=t.replace("*",u);i.push({type:"file",path:r});i.push.apply(i,e.map((function(e){return{type:"extension",path:r+e}})));i.push({type:"package",path:n.join(r,"/package.json")});var a=n.join(r,"/index");i.push.apply(i,e.map((function(e){return{type:"index",path:a+e}})))};for(var f=0,c=s.paths;f<c.length;f++){var d=c[f];_loop_1(d)}}}return i.length===0?undefined:i}t.getPathsToTry=getPathsToTry;function getStrippedPath(e){return e.type==="index"?(0,i.dirname)(e.path):e.type==="file"?e.path:e.type==="extension"?(0,a.removeExtension)(e.path):e.type==="package"?e.path:exhaustiveTypeException(e.type)}t.getStrippedPath=getStrippedPath;function exhaustiveTypeException(e){throw new Error("Unknown type ".concat(e))}t.exhaustiveTypeException=exhaustiveTypeException;function matchStar(e,t){if(t.length<e.length){return undefined}if(e==="*"){return t}var r=e.indexOf("*");if(r===-1){return undefined}var n=e.substring(0,r);var i=e.substring(r+1);if(t.substr(0,r)!==n){return undefined}if(t.substr(t.length-i.length)!==i){return undefined}return t.substr(r,t.length-i.length)}},429:function(e,t,r){var n=this&&this.__assign||function(){n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:true});t.loadTsconfig=t.walkForTsConfig=t.tsConfigLoader=void 0;var i=r(17);var a=r(147);var o=r(278);var s=r(308);function tsConfigLoader(e){var t=e.getEnv,r=e.cwd,n=e.loadSync,i=n===void 0?loadSyncDefault:n;var a=t("TS_NODE_PROJECT");var o=t("TS_NODE_BASEURL");var s=i(r,a,o);return s}t.tsConfigLoader=tsConfigLoader;function loadSyncDefault(e,t,r){var n=resolveConfigPath(e,t);if(!n){return{tsConfigPath:undefined,baseUrl:undefined,paths:undefined}}var i=loadTsconfig(n);return{tsConfigPath:n,baseUrl:r||i&&i.compilerOptions&&i.compilerOptions.baseUrl,paths:i&&i.compilerOptions&&i.compilerOptions.paths}}function resolveConfigPath(e,t){if(t){var r=a.lstatSync(t).isDirectory()?i.resolve(t,"./tsconfig.json"):i.resolve(e,t);return r}if(a.statSync(e).isFile()){return i.resolve(e)}var n=walkForTsConfig(e);return n?i.resolve(n):undefined}function walkForTsConfig(e,t){if(t===void 0){t=a.existsSync}var r=i.join(e,"./tsconfig.json");if(t(r)){return r}var n=i.join(e,"../");if(e===n){return undefined}return walkForTsConfig(n,t)}t.walkForTsConfig=walkForTsConfig;function loadTsconfig(e,t,r){if(t===void 0){t=a.existsSync}if(r===void 0){r=function(e){return a.readFileSync(e,"utf8")}}if(!t(e)){return undefined}var u=r(e);var f=s(u);var c=o.parse(f);var d=c.extends;if(d){if(typeof d==="string"&&d.indexOf(".json")===-1){d+=".json"}var l=i.dirname(e);var p=i.join(l,d);if(d.indexOf("/")!==-1&&d.indexOf(".")!==-1&&!t(p)){p=i.join(l,"node_modules",d)}var v=loadTsconfig(p,t,r)||{};if(v.compilerOptions&&v.compilerOptions.baseUrl){var h=i.dirname(d);v.compilerOptions.baseUrl=i.join(h,v.compilerOptions.baseUrl)}return n(n(n({},v),c),{compilerOptions:n(n({},v.compilerOptions),c.compilerOptions)})}return c}t.loadTsconfig=loadTsconfig},278:e=>{e.exports=require("../json5")},227:e=>{e.exports=require("../minimist")},147:e=>{e.exports=require("fs")},188:e=>{e.exports=require("module")},17:e=>{e.exports=require("path")}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var i=t[r]={exports:{}};var a=true;try{e[r].call(i.exports,i,i.exports,__nccwpck_require__);a=false}finally{if(a)delete t[r]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r={};(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:true});e.loadConfig=e.register=e.matchFromAbsolutePathsAsync=e.createMatchPathAsync=e.matchFromAbsolutePaths=e.createMatchPath=void 0;var t=__nccwpck_require__(920);Object.defineProperty(e,"createMatchPath",{enumerable:true,get:function(){return t.createMatchPath}});Object.defineProperty(e,"matchFromAbsolutePaths",{enumerable:true,get:function(){return t.matchFromAbsolutePaths}});var n=__nccwpck_require__(29);Object.defineProperty(e,"createMatchPathAsync",{enumerable:true,get:function(){return n.createMatchPathAsync}});Object.defineProperty(e,"matchFromAbsolutePathsAsync",{enumerable:true,get:function(){return n.matchFromAbsolutePathsAsync}});var i=__nccwpck_require__(41);Object.defineProperty(e,"register",{enumerable:true,get:function(){return i.register}});var a=__nccwpck_require__(57);Object.defineProperty(e,"loadConfig",{enumerable:true,get:function(){return a.loadConfig}})})();module.exports=r})();
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import * as TsConfigLoader2 from "./tsconfig-loader";
|
2
|
+
export interface ExplicitParams {
|
3
|
+
baseUrl: string;
|
4
|
+
paths: {
|
5
|
+
[key: string]: Array<string>;
|
6
|
+
};
|
7
|
+
mainFields?: Array<string>;
|
8
|
+
addMatchAll?: boolean;
|
9
|
+
}
|
10
|
+
export declare type TsConfigLoader = (params: TsConfigLoader2.TsConfigLoaderParams) => TsConfigLoader2.TsConfigLoaderResult;
|
11
|
+
export interface ConfigLoaderParams {
|
12
|
+
cwd: string;
|
13
|
+
explicitParams?: ExplicitParams;
|
14
|
+
tsConfigLoader?: TsConfigLoader;
|
15
|
+
}
|
16
|
+
export interface ConfigLoaderSuccessResult {
|
17
|
+
resultType: "success";
|
18
|
+
configFileAbsolutePath: string;
|
19
|
+
baseUrl: string;
|
20
|
+
absoluteBaseUrl: string;
|
21
|
+
paths: {
|
22
|
+
[key: string]: Array<string>;
|
23
|
+
};
|
24
|
+
mainFields?: Array<string>;
|
25
|
+
addMatchAll?: boolean;
|
26
|
+
}
|
27
|
+
export interface ConfigLoaderFailResult {
|
28
|
+
resultType: "failed";
|
29
|
+
message: string;
|
30
|
+
}
|
31
|
+
export declare type ConfigLoaderResult = ConfigLoaderSuccessResult | ConfigLoaderFailResult;
|
32
|
+
export declare function loadConfig(cwd?: string): ConfigLoaderResult;
|
33
|
+
export declare function configLoader({ cwd, explicitParams, tsConfigLoader, }: ConfigLoaderParams): ConfigLoaderResult;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/**
|
2
|
+
* Typing for the fields of package.json we care about
|
3
|
+
*/
|
4
|
+
export interface PackageJson {
|
5
|
+
[key: string]: string;
|
6
|
+
}
|
7
|
+
/**
|
8
|
+
* A function that json from a file
|
9
|
+
*/
|
10
|
+
export interface ReadJsonSync {
|
11
|
+
(packageJsonPath: string): any | undefined;
|
12
|
+
}
|
13
|
+
export interface FileExistsSync {
|
14
|
+
(name: string): boolean;
|
15
|
+
}
|
16
|
+
export interface FileExistsAsync {
|
17
|
+
(path: string, callback: (err?: Error, exists?: boolean) => void): void;
|
18
|
+
}
|
19
|
+
export interface ReadJsonAsyncCallback {
|
20
|
+
(err?: Error, content?: any): void;
|
21
|
+
}
|
22
|
+
export interface ReadJsonAsync {
|
23
|
+
(path: string, callback: ReadJsonAsyncCallback): void;
|
24
|
+
}
|
25
|
+
export declare function fileExistsSync(path: string): boolean;
|
26
|
+
/**
|
27
|
+
* Reads package.json from disk
|
28
|
+
* @param file Path to package.json
|
29
|
+
*/
|
30
|
+
export declare function readJsonFromDiskSync(packageJsonPath: string): any | undefined;
|
31
|
+
export declare function readJsonFromDiskAsync(path: string, callback: (err?: Error, content?: any) => void): void;
|
32
|
+
export declare function fileExistsAsync(path2: string, callback2: (err?: Error, exists?: boolean) => void): void;
|
33
|
+
export declare function removeExtension(path: string): string;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
export { createMatchPath, matchFromAbsolutePaths, MatchPath, } from "./match-path-sync";
|
2
|
+
export { createMatchPathAsync, matchFromAbsolutePathsAsync, MatchPathAsync, } from "./match-path-async";
|
3
|
+
export { register } from "./register";
|
4
|
+
export { loadConfig, ConfigLoaderResult, ConfigLoaderSuccessResult, ConfigLoaderFailResult, } from "./config-loader";
|
5
|
+
export { ReadJsonSync, ReadJsonAsync, FileExistsSync, FileExistsAsync, } from "./filesystem";
|
@@ -0,0 +1,17 @@
|
|
1
|
+
export interface MappingEntry {
|
2
|
+
readonly pattern: string;
|
3
|
+
readonly paths: ReadonlyArray<string>;
|
4
|
+
}
|
5
|
+
export interface Paths {
|
6
|
+
readonly [key: string]: ReadonlyArray<string>;
|
7
|
+
}
|
8
|
+
/**
|
9
|
+
* Converts an absolute baseUrl and paths to an array of absolute mapping entries.
|
10
|
+
* The array is sorted by longest prefix.
|
11
|
+
* Having an array with entries allows us to keep a sorting order rather than
|
12
|
+
* sort by keys each time we use the mappings.
|
13
|
+
* @param absoluteBaseUrl
|
14
|
+
* @param paths
|
15
|
+
* @param addMatchAll
|
16
|
+
*/
|
17
|
+
export declare function getAbsoluteMappingEntries(absoluteBaseUrl: string, paths: Paths, addMatchAll: boolean): ReadonlyArray<MappingEntry>;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import * as MappingEntry from "./mapping-entry";
|
2
|
+
import * as Filesystem from "./filesystem";
|
3
|
+
/**
|
4
|
+
* Function that can match a path async
|
5
|
+
*/
|
6
|
+
export interface MatchPathAsync {
|
7
|
+
(requestedModule: string, readJson: Filesystem.ReadJsonAsync | undefined, fileExists: Filesystem.FileExistsAsync | undefined, extensions: ReadonlyArray<string> | undefined, callback: MatchPathAsyncCallback): void;
|
8
|
+
}
|
9
|
+
export interface MatchPathAsyncCallback {
|
10
|
+
(err?: Error, path?: string): void;
|
11
|
+
}
|
12
|
+
/**
|
13
|
+
* See the sync version for docs.
|
14
|
+
*/
|
15
|
+
export declare function createMatchPathAsync(absoluteBaseUrl: string, paths: {
|
16
|
+
[key: string]: Array<string>;
|
17
|
+
}, mainFields?: string[], addMatchAll?: boolean): MatchPathAsync;
|
18
|
+
/**
|
19
|
+
* See the sync version for docs.
|
20
|
+
*/
|
21
|
+
export declare function matchFromAbsolutePathsAsync(absolutePathMappings: ReadonlyArray<MappingEntry.MappingEntry>, requestedModule: string, readJson: Filesystem.ReadJsonAsync | undefined, fileExists: Filesystem.FileExistsAsync | undefined, extensions: readonly string[] | undefined, callback: MatchPathAsyncCallback, mainFields?: string[]): void;
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import * as Filesystem from "./filesystem";
|
2
|
+
import * as MappingEntry from "./mapping-entry";
|
3
|
+
/**
|
4
|
+
* Function that can match a path
|
5
|
+
*/
|
6
|
+
export interface MatchPath {
|
7
|
+
(requestedModule: string, readJson?: Filesystem.ReadJsonSync, fileExists?: (name: string) => boolean, extensions?: ReadonlyArray<string>): string | undefined;
|
8
|
+
}
|
9
|
+
/**
|
10
|
+
* Creates a function that can resolve paths according to tsconfig paths property.
|
11
|
+
* @param absoluteBaseUrl Absolute version of baseUrl as specified in tsconfig.
|
12
|
+
* @param paths The paths as specified in tsconfig.
|
13
|
+
* @param mainFields A list of package.json field names to try when resolving module files.
|
14
|
+
* @param addMatchAll Add a match-all "*" rule if none is present
|
15
|
+
* @returns a function that can resolve paths.
|
16
|
+
*/
|
17
|
+
export declare function createMatchPath(absoluteBaseUrl: string, paths: {
|
18
|
+
[key: string]: Array<string>;
|
19
|
+
}, mainFields?: string[], addMatchAll?: boolean): MatchPath;
|
20
|
+
/**
|
21
|
+
* Finds a path from tsconfig that matches a module load request.
|
22
|
+
* @param absolutePathMappings The paths to try as specified in tsconfig but resolved to absolute form.
|
23
|
+
* @param requestedModule The required module name.
|
24
|
+
* @param readJson Function that can read json from a path (useful for testing).
|
25
|
+
* @param fileExists Function that checks for existence of a file at a path (useful for testing).
|
26
|
+
* @param extensions File extensions to probe for (useful for testing).
|
27
|
+
* @param mainFields A list of package.json field names to try when resolving module files.
|
28
|
+
* @returns the found path, or undefined if no path was found.
|
29
|
+
*/
|
30
|
+
export declare function matchFromAbsolutePaths(absolutePathMappings: ReadonlyArray<MappingEntry.MappingEntry>, requestedModule: string, readJson?: Filesystem.ReadJsonSync, fileExists?: Filesystem.FileExistsSync, extensions?: Array<string>, mainFields?: string[]): string | undefined;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { ExplicitParams } from "./config-loader";
|
2
|
+
/**
|
3
|
+
* Installs a custom module load function that can adhere to paths in tsconfig.
|
4
|
+
* Returns a function to undo paths registration.
|
5
|
+
*/
|
6
|
+
export declare function register(explicitParams: ExplicitParams): () => void;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { MappingEntry } from "./mapping-entry";
|
2
|
+
export interface TryPath {
|
3
|
+
readonly type: "file" | "extension" | "index" | "package";
|
4
|
+
readonly path: string;
|
5
|
+
}
|
6
|
+
/**
|
7
|
+
* Builds a list of all physical paths to try by:
|
8
|
+
* 1. Check for file named exactly as request.
|
9
|
+
* 2. Check for files named as request ending in any of the extensions.
|
10
|
+
* 3. Check for file specified in package.json's main property.
|
11
|
+
* 4. Check for files named as request ending in "index" with any of the extensions.
|
12
|
+
*/
|
13
|
+
export declare function getPathsToTry(extensions: ReadonlyArray<string>, absolutePathMappings: ReadonlyArray<MappingEntry>, requestedModule: string): ReadonlyArray<TryPath> | undefined;
|
14
|
+
export declare function getStrippedPath(tryPath: TryPath): string;
|
15
|
+
export declare function exhaustiveTypeException(check: never): never;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
/**
|
2
|
+
* Typing for the parts of tsconfig that we care about
|
3
|
+
*/
|
4
|
+
export interface Tsconfig {
|
5
|
+
extends?: string;
|
6
|
+
compilerOptions?: {
|
7
|
+
baseUrl?: string;
|
8
|
+
paths?: {
|
9
|
+
[key: string]: Array<string>;
|
10
|
+
};
|
11
|
+
strict?: boolean;
|
12
|
+
};
|
13
|
+
}
|
14
|
+
export interface TsConfigLoaderResult {
|
15
|
+
tsConfigPath: string | undefined;
|
16
|
+
baseUrl: string | undefined;
|
17
|
+
paths: {
|
18
|
+
[key: string]: Array<string>;
|
19
|
+
} | undefined;
|
20
|
+
}
|
21
|
+
export interface TsConfigLoaderParams {
|
22
|
+
getEnv: (key: string) => string | undefined;
|
23
|
+
cwd: string;
|
24
|
+
loadSync?(cwd: string, filename?: string, baseUrl?: string): TsConfigLoaderResult;
|
25
|
+
}
|
26
|
+
export declare function tsConfigLoader({ getEnv, cwd, loadSync, }: TsConfigLoaderParams): TsConfigLoaderResult;
|
27
|
+
export declare function walkForTsConfig(directory: string, existsSync?: (path: string) => boolean): string | undefined;
|
28
|
+
export declare function loadTsconfig(configFilePath: string, existsSync?: (path: string) => boolean, readFileSync?: (filename: string) => string): Tsconfig | undefined;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Jonas Kello
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -0,0 +1 @@
|
|
1
|
+
{"name":"tsconfig-paths","author":"Jonas Kello","version":"3.14.1","license":"MIT","types":"lib/index.d.ts"}
|
@@ -0,0 +1 @@
|
|
1
|
+
(()=>{var e={256:function(e){(function(t,s){true?e.exports=s():0})(this,(function(){"use strict";var e=function isMergeableObject(e){return isNonNullObject(e)&&!isSpecial(e)};function isNonNullObject(e){return!!e&&typeof e==="object"}function isSpecial(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||isReactElement(e)}var t=typeof Symbol==="function"&&Symbol.for;var s=t?Symbol.for("react.element"):60103;function isReactElement(e){return e.$$typeof===s}function emptyTarget(e){return Array.isArray(e)?[]:{}}function cloneIfNecessary(t,s){var n=s&&s.clone===true;return n&&e(t)?deepmerge(emptyTarget(t),t,s):t}function defaultArrayMerge(t,s,n){var i=t.slice();s.forEach((function(s,r){if(typeof i[r]==="undefined"){i[r]=cloneIfNecessary(s,n)}else if(e(s)){i[r]=deepmerge(t[r],s,n)}else if(t.indexOf(s)===-1){i.push(cloneIfNecessary(s,n))}}));return i}function mergeObject(t,s,n){var i={};if(e(t)){Object.keys(t).forEach((function(e){i[e]=cloneIfNecessary(t[e],n)}))}Object.keys(s).forEach((function(r){if(!e(s[r])||!t[r]){i[r]=cloneIfNecessary(s[r],n)}else{i[r]=deepmerge(t[r],s[r],n)}}));return i}function deepmerge(e,t,s){var n=Array.isArray(t);var i=Array.isArray(e);var r=s||{arrayMerge:defaultArrayMerge};var o=n===i;if(!o){return cloneIfNecessary(t,s)}else if(n){var u=r.arrayMerge||defaultArrayMerge;return u(e,t,s)}else{return mergeObject(e,t,s)}}deepmerge.all=function deepmergeAll(e,t){if(!Array.isArray(e)||e.length<2){throw new Error("first argument should be an array with at least two elements")}return e.reduce((function(e,s){return deepmerge(e,s,t)}))};var n=deepmerge;return n}))},210:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.arrayToString=void 0;const arrayToString=(e,t,s)=>{const n=e.map((function(e,n){const i=s(e,n);if(i===undefined)return String(i);return t+i.split("\n").join(`\n${t}`)})).join(t?",\n":",");const i=t&&n?"\n":"";return`[${i}${n}${i}]`};t.arrayToString=arrayToString},262:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.FunctionParser=t.dedentFunction=t.functionToString=t.USED_METHOD_KEY=void 0;const n=s(893);const i={" "(){}}[" "].toString().charAt(0)==='"';const r={Function:"function ",GeneratorFunction:"function* ",AsyncFunction:"async function ",AsyncGeneratorFunction:"async function* "};const o={Function:"",GeneratorFunction:"*",AsyncFunction:"async ",AsyncGeneratorFunction:"async *"};const u=new Set(("case delete else in instanceof new return throw typeof void "+", ; : + - ! ~ & | ^ * / % < > ? =").split(" "));t.USED_METHOD_KEY=new WeakSet;const functionToString=(e,s,n,i)=>{const r=typeof i==="string"?i:undefined;if(r!==undefined)t.USED_METHOD_KEY.add(e);return new FunctionParser(e,s,n,r).stringify()};t.functionToString=functionToString;function dedentFunction(e){let t;for(const s of e.split("\n").slice(1)){const n=/^[\s\t]+/.exec(s);if(!n)return e;const[i]=n;if(t===undefined)t=i;else if(i.length<t.length)t=i}return t?e.split(`\n${t}`).join("\n"):e}t.dedentFunction=dedentFunction;class FunctionParser{constructor(e,t,s,i){this.fn=e;this.indent=t;this.next=s;this.key=i;this.pos=0;this.hadKeyword=false;this.fnString=Function.prototype.toString.call(e);this.fnType=e.constructor.name;this.keyQuote=i===undefined?"":n.quoteKey(i,s);this.keyPrefix=i===undefined?"":`${this.keyQuote}:${t?" ":""}`;this.isMethodCandidate=i===undefined?false:this.fn.name===""||this.fn.name===i}stringify(){const e=this.tryParse();if(!e){return`${this.keyPrefix}void ${this.next(this.fnString)}`}return dedentFunction(e)}getPrefix(){if(this.isMethodCandidate&&!this.hadKeyword){return o[this.fnType]+this.keyQuote}return this.keyPrefix+r[this.fnType]}tryParse(){if(this.fnString[this.fnString.length-1]!=="}"){return this.keyPrefix+this.fnString}if(this.fn.name){const e=this.tryStrippingName();if(e)return e}const e=this.pos;if(this.consumeSyntax()==="class")return this.fnString;this.pos=e;if(this.tryParsePrefixTokens()){const e=this.tryStrippingName();if(e)return e;let t=this.pos;switch(this.consumeSyntax("WORD_LIKE")){case"WORD_LIKE":if(this.isMethodCandidate&&!this.hadKeyword){t=this.pos}case"()":if(this.fnString.substr(this.pos,2)==="=>"){return this.keyPrefix+this.fnString}this.pos=t;case'"':case"'":case"[]":return this.getPrefix()+this.fnString.substr(this.pos)}}}tryStrippingName(){if(i){return}let e=this.pos;const t=this.fnString.substr(this.pos,this.fn.name.length);if(t===this.fn.name){this.pos+=t.length;if(this.consumeSyntax()==="()"&&this.consumeSyntax()==="{}"&&this.pos===this.fnString.length){if(this.isMethodCandidate||!n.isValidVariableName(t)){e+=t.length}return this.getPrefix()+this.fnString.substr(e)}}this.pos=e}tryParsePrefixTokens(){let e=this.pos;this.hadKeyword=false;switch(this.fnType){case"AsyncFunction":if(this.consumeSyntax()!=="async")return false;e=this.pos;case"Function":if(this.consumeSyntax()==="function"){this.hadKeyword=true}else{this.pos=e}return true;case"AsyncGeneratorFunction":if(this.consumeSyntax()!=="async")return false;case"GeneratorFunction":let t=this.consumeSyntax();if(t==="function"){t=this.consumeSyntax();this.hadKeyword=true}return t==="*"}}consumeSyntax(e){const t=this.consumeMatch(/^(?:([A-Za-z_0-9$\xA0-\uFFFF]+)|=>|\+\+|\-\-|.)/);if(!t)return;const[s,n]=t;this.consumeWhitespace();if(n)return e||n;switch(s){case"(":return this.consumeSyntaxUntil("(",")");case"[":return this.consumeSyntaxUntil("[","]");case"{":return this.consumeSyntaxUntil("{","}");case"`":return this.consumeTemplate();case'"':return this.consumeRegExp(/^(?:[^\\"]|\\.)*"/,'"');case"'":return this.consumeRegExp(/^(?:[^\\']|\\.)*'/,"'")}return s}consumeSyntaxUntil(e,t){let s=true;for(;;){const n=this.consumeSyntax();if(n===t)return e+t;if(!n||n===")"||n==="]"||n==="}")return;if(n==="/"&&s&&this.consumeMatch(/^(?:\\.|[^\\\/\n[]|\[(?:\\.|[^\]])*\])+\/[a-z]*/)){s=false;this.consumeWhitespace()}else{s=u.has(n)}}}consumeMatch(e){const t=e.exec(this.fnString.substr(this.pos));if(t)this.pos+=t[0].length;return t}consumeRegExp(e,t){const s=e.exec(this.fnString.substr(this.pos));if(!s)return;this.pos+=s[0].length;this.consumeWhitespace();return t}consumeTemplate(){for(;;){this.consumeMatch(/^(?:[^`$\\]|\\.|\$(?!{))*/);if(this.fnString[this.pos]==="`"){this.pos++;this.consumeWhitespace();return"`"}if(this.fnString.substr(this.pos,2)==="${"){this.pos+=2;this.consumeWhitespace();if(this.consumeSyntaxUntil("{","}"))continue}return}}consumeWhitespace(){this.consumeMatch(/^(?:\s|\/\/.*|\/\*[^]*?\*\/)*/)}}t.FunctionParser=FunctionParser},592:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.stringify=void 0;const n=s(761);const i=s(893);const r=Symbol("root");function stringify(e,t,s,n={}){const o=typeof s==="string"?s:" ".repeat(s||0);const u=[];const a=new Set;const c=new Map;const l=new Map;let h=0;const{maxDepth:f=100,references:p=false,skipUndefinedProperties:d=false,maxValues:g=1e5}=n;const m=replacerToString(t);const onNext=(e,t)=>{if(++h>g)return;if(d&&e===undefined)return;if(u.length>f)return;if(t===undefined)return m(e,o,onNext,t);u.push(t);const s=y(e,t===r?undefined:t);u.pop();return s};const y=p?(e,t)=>{if(e!==null&&(typeof e==="object"||typeof e==="function"||typeof e==="symbol")){if(c.has(e)){l.set(u.slice(1),c.get(e));return m(undefined,o,onNext,t)}c.set(e,u.slice(1))}return m(e,o,onNext,t)}:(e,t)=>{if(a.has(e))return;a.add(e);const s=m(e,o,onNext,t);a.delete(e);return s};const b=onNext(e,r);if(l.size){const e=o?" ":"";const t=o?"\n":"";let s=`var x${e}=${e}${b};${t}`;for(const[n,r]of l.entries()){const o=i.stringifyPath(n,onNext);const u=i.stringifyPath(r,onNext);s+=`x${o}${e}=${e}x${u};${t}`}return`(function${e}()${e}{${t}${s}return x;${t}}())`}return b}t.stringify=stringify;function replacerToString(e){if(!e)return n.toString;return(t,s,i,r)=>e(t,s,(e=>n.toString(e,s,i,r)),r)}},125:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.objectToString=void 0;const n=s(893);const i=s(262);const r=s(210);const objectToString=(e,t,s,n)=>{if(typeof Buffer==="function"&&Buffer.isBuffer(e)){return`Buffer.from(${s(e.toString("base64"))}, 'base64')`}if(typeof global==="object"&&e===global){return globalToString(e,t,s,n)}const i=o[Object.prototype.toString.call(e)];return i?i(e,t,s,n):undefined};t.objectToString=objectToString;const rawObjectToString=(e,t,s,r)=>{const o=t?"\n":"";const u=t?" ":"";const a=Object.keys(e).reduce((function(r,o){const a=e[o];const c=s(a,o);if(c===undefined)return r;const l=c.split("\n").join(`\n${t}`);if(i.USED_METHOD_KEY.has(a)){r.push(`${t}${l}`);return r}r.push(`${t}${n.quoteKey(o,s)}:${u}${l}`);return r}),[]).join(`,${o}`);if(a==="")return"{}";return`{${o}${a}${o}}`};const globalToString=(e,t,s)=>`Function(${s("return this")})()`;const o={"[object Array]":r.arrayToString,"[object Object]":rawObjectToString,"[object Error]":(e,t,s)=>`new Error(${s(e.message)})`,"[object Date]":e=>`new Date(${e.getTime()})`,"[object String]":(e,t,s)=>`new String(${s(e.toString())})`,"[object Number]":e=>`new Number(${e})`,"[object Boolean]":e=>`new Boolean(${e})`,"[object Set]":(e,t,s)=>`new Set(${s(Array.from(e))})`,"[object Map]":(e,t,s)=>`new Map(${s(Array.from(e))})`,"[object RegExp]":String,"[object global]":globalToString,"[object Window]":globalToString}},893:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.stringifyPath=t.quoteKey=t.isValidVariableName=t.IS_VALID_IDENTIFIER=t.quoteString=void 0;const s=/[\\\'\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;const n=new Map([["\b","\\b"],["\t","\\t"],["\n","\\n"],["\f","\\f"],["\r","\\r"],["'","\\'"],['"','\\"'],["\\","\\\\"]]);function escapeChar(e){return n.get(e)||`\\u${`0000${e.charCodeAt(0).toString(16)}`.slice(-4)}`}function quoteString(e){return`'${e.replace(s,escapeChar)}'`}t.quoteString=quoteString;const i=new Set(("break else new var case finally return void catch for switch while "+"continue function this with default if throw delete in try "+"do instanceof typeof abstract enum int short boolean export "+"interface static byte extends long super char final native synchronized "+"class float package throws const goto private transient debugger "+"implements protected volatile double import public let yield").split(" "));t.IS_VALID_IDENTIFIER=/^[A-Za-z_$][A-Za-z0-9_$]*$/;function isValidVariableName(e){return typeof e==="string"&&!i.has(e)&&t.IS_VALID_IDENTIFIER.test(e)}t.isValidVariableName=isValidVariableName;function quoteKey(e,t){return isValidVariableName(e)?e:t(e)}t.quoteKey=quoteKey;function stringifyPath(e,t){let s="";for(const n of e){if(isValidVariableName(n)){s+=`.${n}`}else{s+=`[${t(n)}]`}}return s}t.stringifyPath=stringifyPath},761:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.toString=void 0;const n=s(893);const i=s(125);const r=s(262);const o={string:n.quoteString,number:e=>Object.is(e,-0)?"-0":String(e),boolean:String,symbol:(e,t,s)=>{const n=Symbol.keyFor(e);if(n!==undefined)return`Symbol.for(${s(n)})`;return`Symbol(${s(e.description)})`},bigint:(e,t,s)=>`BigInt(${s(String(e))})`,undefined:String,object:i.objectToString,function:r.functionToString};const toString=(e,t,s,n)=>{if(e===null)return"null";return o[typeof e](e,t,s,n)};t.toString=toString},430:e=>{e.exports=class{constructor(e){this.parent=e}batch(e){e(this);return this}end(){return this.parent}}},717:(e,t,s)=>{const n=s(256);const i=s(430);e.exports=class extends i{constructor(e){super(e);this.store=new Map}extend(e){this.shorthands=e;e.forEach((e=>{this[e]=t=>this.set(e,t)}));return this}clear(){this.store.clear();return this}delete(e){this.store.delete(e);return this}order(){const e=[...this.store].reduce(((e,[t,s])=>{e[t]=s;return e}),{});const t=Object.keys(e);const s=[...t];t.forEach((t=>{if(!e[t]){return}const{__before:n,__after:i}=e[t];if(n&&s.includes(n)){s.splice(s.indexOf(t),1);s.splice(s.indexOf(n),0,t)}else if(i&&s.includes(i)){s.splice(s.indexOf(t),1);s.splice(s.indexOf(i)+1,0,t)}}));return{entries:e,order:s}}entries(){const{entries:e,order:t}=this.order();if(t.length){return e}return undefined}values(){const{entries:e,order:t}=this.order();return t.map((t=>e[t]))}get(e){return this.store.get(e)}getOrCompute(e,t){if(!this.has(e)){this.set(e,t())}return this.get(e)}has(e){return this.store.has(e)}set(e,t){this.store.set(e,t);return this}merge(e,t=[]){Object.keys(e).forEach((s=>{if(t.includes(s)){return}const i=e[s];if(!Array.isArray(i)&&typeof i!=="object"||i===null||!this.has(s)){this.set(s,i)}else{this.set(s,n(this.get(s),i))}}));return this}clean(e){return Object.keys(e).reduce(((t,s)=>{const n=e[s];if(n===undefined){return t}if(Array.isArray(n)&&!n.length){return t}if(Object.prototype.toString.call(n)==="[object Object]"&&!Object.keys(n).length){return t}t[s]=n;return t}),{})}when(e,t=Function.prototype,s=Function.prototype){if(e){t(this)}else{s(this)}return this}}},534:(e,t,s)=>{const n=s(430);e.exports=class extends n{constructor(e){super(e);this.store=new Set}add(e){this.store.add(e);return this}prepend(e){this.store=new Set([e,...this.store]);return this}clear(){this.store.clear();return this}delete(e){this.store.delete(e);return this}values(){return[...this.store]}has(e){return this.store.has(e)}merge(e){this.store=new Set([...this.store,...e]);return this}when(e,t=Function.prototype,s=Function.prototype){if(e){t(this)}else{s(this)}return this}}},555:(e,t,s)=>{const n=s(717);const i=s(534);const r=s(777);const o=s(645);const u=s(677);const a=s(138);const c=s(383);const l=s(819);const h=s(731);const f=s(2);e.exports=class extends n{constructor(){super();this.devServer=new a(this);this.entryPoints=new n(this);this.module=new l(this);this.node=new n(this);this.optimization=new h(this);this.output=new u(this);this.performance=new f(this);this.plugins=new n(this);this.resolve=new r(this);this.resolveLoader=new o(this);this.extend(["amd","bail","cache","context","devtool","externals","loader","mode","name","parallelism","profile","recordsInputPath","recordsPath","recordsOutputPath","stats","target","watch","watchOptions"])}static toString(e,{verbose:t=false,configPrefix:n="config"}={}){const{stringify:i}=s(592);return i(e,((e,s,i)=>{if(e&&e.__pluginName){const t=`/* ${n}.${e.__pluginType}('${e.__pluginName}') */\n`;const s=e.__pluginPath?`(require(${i(e.__pluginPath)}))`:e.__pluginConstructorName;if(s){const n=i(e.__pluginArgs).slice(1,-1);return`${t}new ${s}(${n})`}return t+i(e.__pluginArgs&&e.__pluginArgs.length?{args:e.__pluginArgs}:{})}if(e&&e.__ruleNames){const t=e.__ruleTypes;const s=`/* ${n}.module${e.__ruleNames.map(((e,s)=>`.${t?t[s]:"rule"}('${e}')`)).join("")}${e.__useName?`.use('${e.__useName}')`:``} */\n`;return s+i(e)}if(e&&e.__expression){return e.__expression}if(typeof e==="function"){if(!t&&e.toString().length>100){return`function () { /* omitted long function */ }`}}return i(e)}),2)}entry(e){return this.entryPoints.getOrCompute(e,(()=>new i(this)))}plugin(e){return this.plugins.getOrCompute(e,(()=>new c(this,e)))}toConfig(){const e=this.entryPoints.entries()||{};return this.clean(Object.assign(this.entries()||{},{node:this.node.entries(),output:this.output.entries(),resolve:this.resolve.toConfig(),resolveLoader:this.resolveLoader.toConfig(),devServer:this.devServer.toConfig(),module:this.module.toConfig(),optimization:this.optimization.toConfig(),plugins:this.plugins.values().map((e=>e.toConfig())),performance:this.performance.entries(),entry:Object.keys(e).reduce(((t,s)=>Object.assign(t,{[s]:e[s].values()})),{})}))}toString(t){return e.exports.toString(this.toConfig(),t)}merge(e={},t=[]){const s=["node","output","resolve","resolveLoader","devServer","optimization","performance","module"];if(!t.includes("entry")&&"entry"in e){Object.keys(e.entry).forEach((t=>this.entry(t).merge([].concat(e.entry[t]))))}if(!t.includes("plugin")&&"plugin"in e){Object.keys(e.plugin).forEach((t=>this.plugin(t).merge(e.plugin[t])))}s.forEach((s=>{if(!t.includes(s)&&s in e){this[s].merge(e[s])}}));return super.merge(e,[...t,...s,"entry","plugin"])}}},138:(e,t,s)=>{const n=s(717);const i=s(534);e.exports=class extends n{constructor(e){super(e);this.allowedHosts=new i(this);this.extend(["after","before","bonjour","clientLogLevel","color","compress","contentBase","disableHostCheck","filename","headers","historyApiFallback","host","hot","hotOnly","http2","https","index","info","inline","lazy","mimeTypes","noInfo","open","openPage","overlay","pfx","pfxPassphrase","port","proxy","progress","public","publicPath","quiet","setup","socket","sockHost","sockPath","sockPort","staticOptions","stats","stdin","useLocalIp","watchContentBase","watchOptions","writeToDisk"])}toConfig(){return this.clean({allowedHosts:this.allowedHosts.values(),...this.entries()||{}})}merge(e,t=[]){if(!t.includes("allowedHosts")&&"allowedHosts"in e){this.allowedHosts.merge(e.allowedHosts)}return super.merge(e,["allowedHosts"])}}},819:(e,t,s)=>{const n=s(717);const i=s(693);e.exports=class extends n{constructor(e){super(e);this.rules=new n(this);this.defaultRules=new n(this);this.extend(["noParse","strictExportPresence"])}defaultRule(e){return this.defaultRules.getOrCompute(e,(()=>new i(this,e,"defaultRule")))}rule(e){return this.rules.getOrCompute(e,(()=>new i(this,e,"rule")))}toConfig(){return this.clean(Object.assign(this.entries()||{},{defaultRules:this.defaultRules.values().map((e=>e.toConfig())),rules:this.rules.values().map((e=>e.toConfig()))}))}merge(e,t=[]){if(!t.includes("rule")&&"rule"in e){Object.keys(e.rule).forEach((t=>this.rule(t).merge(e.rule[t])))}if(!t.includes("defaultRule")&&"defaultRule"in e){Object.keys(e.defaultRule).forEach((t=>this.defaultRule(t).merge(e.defaultRule[t])))}return super.merge(e,["rule","defaultRule"])}}},731:(e,t,s)=>{const n=s(717);const i=s(383);e.exports=class extends n{constructor(e){super(e);this.minimizers=new n(this);this.extend(["concatenateModules","flagIncludedChunks","mergeDuplicateChunks","minimize","namedChunks","namedModules","nodeEnv","noEmitOnErrors","occurrenceOrder","portableRecords","providedExports","removeAvailableModules","removeEmptyChunks","runtimeChunk","sideEffects","splitChunks","usedExports"])}minimizer(e){if(Array.isArray(e)){throw new Error("optimization.minimizer() no longer supports being passed an array. "+"Either switch to the new syntax (https://github.com/neutrinojs/webpack-chain#config-optimization-minimizers-adding) or downgrade to webpack-chain 4. "+"If using Vue this likely means a Vue plugin has not yet been updated to support Vue CLI 4+.")}return this.minimizers.getOrCompute(e,(()=>new i(this,e,"optimization.minimizer")))}toConfig(){return this.clean(Object.assign(this.entries()||{},{minimizer:this.minimizers.values().map((e=>e.toConfig()))}))}merge(e,t=[]){if(!t.includes("minimizer")&&"minimizer"in e){Object.keys(e.minimizer).forEach((t=>this.minimizer(t).merge(e.minimizer[t])))}return super.merge(e,[...t,"minimizer"])}}},282:e=>{e.exports=e=>class extends e{before(e){if(this.__after){throw new Error(`Unable to set .before(${JSON.stringify(e)}) with existing value for .after()`)}this.__before=e;return this}after(e){if(this.__before){throw new Error(`Unable to set .after(${JSON.stringify(e)}) with existing value for .before()`)}this.__after=e;return this}merge(e,t=[]){if(e.before){this.before(e.before)}if(e.after){this.after(e.after)}return super.merge(e,[...t,"before","after"])}}},677:(e,t,s)=>{const n=s(717);e.exports=class extends n{constructor(e){super(e);this.extend(["auxiliaryComment","chunkCallbackName","chunkFilename","chunkLoadTimeout","crossOriginLoading","devtoolFallbackModuleFilenameTemplate","devtoolLineToLine","devtoolModuleFilenameTemplate","devtoolNamespace","filename","futureEmitAssets","globalObject","hashDigest","hashDigestLength","hashFunction","hashSalt","hotUpdateChunkFilename","hotUpdateFunction","hotUpdateMainFilename","jsonpFunction","library","libraryExport","libraryTarget","path","pathinfo","publicPath","sourceMapFilename","sourcePrefix","strictModuleExceptionHandling","umdNamedDefine","webassemblyModuleFilename"])}}},2:(e,t,s)=>{const n=s(717);e.exports=class extends n{constructor(e){super(e);this.extend(["assetFilter","hints","maxAssetSize","maxEntrypointSize"])}}},383:(e,t,s)=>{const n=s(717);const i=s(282);e.exports=i(class extends n{constructor(e,t,s="plugin"){super(e);this.name=t;this.type=s;this.extend(["init"]);this.init(((e,t=[])=>{if(typeof e==="function"){return new e(...t)}return e}))}use(e,t=[]){return this.set("plugin",e).set("args",t)}tap(e){if(!this.has("plugin")){throw new Error(`Cannot call .tap() on a plugin that has not yet been defined. Call ${this.type}('${this.name}').use(<Plugin>) first.`)}this.set("args",e(this.get("args")||[]));return this}set(e,t){if(e==="args"&&!Array.isArray(t)){throw new Error("args must be an array of arguments")}return super.set(e,t)}merge(e,t=[]){if("plugin"in e){this.set("plugin",e.plugin)}if("args"in e){this.set("args",e.args)}return super.merge(e,[...t,"args","plugin"])}toConfig(){const e=this.get("init");let t=this.get("plugin");const n=this.get("args");let i=null;if(t===undefined){throw new Error(`Invalid ${this.type} configuration: ${this.type}('${this.name}').use(<Plugin>) was not called to specify the plugin`)}if(typeof t==="string"){i=t;t=s(875)(i)}const r=t.__expression?`(${t.__expression})`:t.name;const o=e(t,n);Object.defineProperties(o,{__pluginName:{value:this.name},__pluginType:{value:this.type},__pluginArgs:{value:n},__pluginConstructorName:{value:r},__pluginPath:{value:i}});return o}})},777:(e,t,s)=>{const n=s(717);const i=s(534);const r=s(383);e.exports=class extends n{constructor(e){super(e);this.alias=new n(this);this.aliasFields=new i(this);this.descriptionFiles=new i(this);this.extensions=new i(this);this.mainFields=new i(this);this.mainFiles=new i(this);this.modules=new i(this);this.plugins=new n(this);this.extend(["cachePredicate","cacheWithContext","concord","enforceExtension","enforceModuleExtension","symlinks","unsafeCache"])}plugin(e){return this.plugins.getOrCompute(e,(()=>new r(this,e,"resolve.plugin")))}toConfig(){return this.clean(Object.assign(this.entries()||{},{alias:this.alias.entries(),aliasFields:this.aliasFields.values(),descriptionFiles:this.descriptionFiles.values(),extensions:this.extensions.values(),mainFields:this.mainFields.values(),mainFiles:this.mainFiles.values(),modules:this.modules.values(),plugins:this.plugins.values().map((e=>e.toConfig()))}))}merge(e,t=[]){const s=["alias","aliasFields","descriptionFiles","extensions","mainFields","mainFiles","modules"];if(!t.includes("plugin")&&"plugin"in e){Object.keys(e.plugin).forEach((t=>this.plugin(t).merge(e.plugin[t])))}s.forEach((s=>{if(!t.includes(s)&&s in e){this[s].merge(e[s])}}));return super.merge(e,[...t,...s,"plugin"])}}},645:(e,t,s)=>{const n=s(777);const i=s(534);e.exports=class extends n{constructor(e){super(e);this.moduleExtensions=new i(this);this.packageMains=new i(this)}toConfig(){return this.clean({moduleExtensions:this.moduleExtensions.values(),packageMains:this.packageMains.values(),...super.toConfig()})}merge(e,t=[]){const s=["moduleExtensions","packageMains"];s.forEach((s=>{if(!t.includes(s)&&s in e){this[s].merge(e[s])}}));return super.merge(e,[...t,...s])}}},693:(e,t,s)=>{const n=s(717);const i=s(534);const r=s(282);const o=s(993);const u=s(777);function toArray(e){return Array.isArray(e)?e:[e]}const a=r(class extends n{constructor(e,t,s="rule"){super(e);this.name=t;this.names=[];this.ruleType=s;this.ruleTypes=[];let r=this;while(r instanceof a){this.names.unshift(r.name);this.ruleTypes.unshift(r.ruleType);r=r.parent}this.uses=new n(this);this.include=new i(this);this.exclude=new i(this);this.rules=new n(this);this.oneOfs=new n(this);this.resolve=new u(this);this.extend(["enforce","issuer","parser","resource","resourceQuery","sideEffects","test","type"])}use(e){return this.uses.getOrCompute(e,(()=>new o(this,e)))}rule(e){return this.rules.getOrCompute(e,(()=>new a(this,e,"rule")))}oneOf(e){return this.oneOfs.getOrCompute(e,(()=>new a(this,e,"oneOf")))}pre(){return this.enforce("pre")}post(){return this.enforce("post")}toConfig(){const e=this.clean(Object.assign(this.entries()||{},{include:this.include.values(),exclude:this.exclude.values(),rules:this.rules.values().map((e=>e.toConfig())),oneOf:this.oneOfs.values().map((e=>e.toConfig())),use:this.uses.values().map((e=>e.toConfig())),resolve:this.resolve.toConfig()}));Object.defineProperties(e,{__ruleNames:{value:this.names},__ruleTypes:{value:this.ruleTypes}});return e}merge(e,t=[]){if(!t.includes("include")&&"include"in e){this.include.merge(toArray(e.include))}if(!t.includes("exclude")&&"exclude"in e){this.exclude.merge(toArray(e.exclude))}if(!t.includes("use")&&"use"in e){Object.keys(e.use).forEach((t=>this.use(t).merge(e.use[t])))}if(!t.includes("rules")&&"rules"in e){Object.keys(e.rules).forEach((t=>this.rule(t).merge(e.rules[t])))}if(!t.includes("oneOf")&&"oneOf"in e){Object.keys(e.oneOf).forEach((t=>this.oneOf(t).merge(e.oneOf[t])))}if(!t.includes("resolve")&&"resolve"in e){this.resolve.merge(e.resolve)}if(!t.includes("test")&&"test"in e){this.test(e.test instanceof RegExp||typeof e.test==="function"?e.test:new RegExp(e.test))}return super.merge(e,[...t,"include","exclude","use","rules","oneOf","resolve","test"])}});e.exports=a},993:(e,t,s)=>{const n=s(256);const i=s(717);const r=s(282);e.exports=r(class extends i{constructor(e,t){super(e);this.name=t;this.extend(["loader","options"])}tap(e){this.options(e(this.get("options")));return this}merge(e,t=[]){if(!t.includes("loader")&&"loader"in e){this.loader(e.loader)}if(!t.includes("options")&&"options"in e){this.options(n(this.store.get("options")||{},e.options))}return super.merge(e,[...t,"loader","options"])}toConfig(){const e=this.clean(this.entries()||{});Object.defineProperties(e,{__useName:{value:this.name},__ruleNames:{value:this.parent&&this.parent.names},__ruleTypes:{value:this.parent&&this.parent.ruleTypes}});return e}})},875:e=>{function webpackEmptyContext(e){var t=new Error("Cannot find module '"+e+"'");t.code="MODULE_NOT_FOUND";throw t}webpackEmptyContext.keys=()=>[];webpackEmptyContext.resolve=webpackEmptyContext;webpackEmptyContext.id=875;e.exports=webpackEmptyContext}};var t={};function __nccwpck_require__(s){var n=t[s];if(n!==undefined){return n.exports}var i=t[s]={exports:{}};var r=true;try{e[s].call(i.exports,i,i.exports,__nccwpck_require__);r=false}finally{if(r)delete t[s]}return i.exports}(()=>{__nccwpck_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var s=__nccwpck_require__(555);module.exports=s})();
|