@umijs/utils 4.0.0-beta.8 → 4.0.0-canary-20240513.3
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/compiled/@ampproject/remapping/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts +70 -0
- package/compiled/@ampproject/remapping/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts +12 -0
- package/compiled/@ampproject/remapping/@jridgewell/gen-mapping/dist/types/types.d.ts +35 -0
- package/compiled/@ampproject/remapping/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts +16 -0
- package/compiled/@ampproject/remapping/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts +74 -0
- package/compiled/@ampproject/remapping/@jridgewell/trace-mapping/dist/types/types.d.ts +92 -0
- package/compiled/@ampproject/remapping/LICENSE +202 -0
- package/compiled/@ampproject/remapping/dist/types/remapping.d.ts +19 -0
- package/compiled/@ampproject/remapping/dist/types/source-map.d.ts +17 -0
- package/compiled/@ampproject/remapping/dist/types/types.d.ts +14 -0
- package/compiled/@ampproject/remapping/index.js +1 -0
- package/compiled/@ampproject/remapping/package.json +1 -0
- package/compiled/@clack/prompts/LICENSE +23 -0
- package/compiled/@clack/prompts/dist/index.d.ts +38 -0
- package/compiled/@clack/prompts/index.js +1 -0
- package/compiled/@clack/prompts/package.json +1 -0
- package/compiled/@hapi/joi/index.d.ts +2218 -0
- package/compiled/@hapi/joi/index.js +1 -0
- package/compiled/@hapi/joi/package.json +1 -0
- package/compiled/axios/index.d.ts +29 -14
- package/compiled/axios/index.js +1 -1
- package/compiled/chalk/LICENSE +1 -1
- package/compiled/chalk/index.js +1 -1
- package/compiled/chalk/package.json +1 -1
- package/compiled/chalk/source/index.d.ts +318 -0
- package/compiled/chalk/source/vendor/supports-color/index.d.ts +55 -0
- package/compiled/color/color-convert/conversions.d.ts +87 -87
- package/compiled/color/color-convert/index.d.ts +75 -60
- package/compiled/color/color-convert/route.d.ts +271 -271
- package/compiled/color/index.d.ts +118 -121
- package/compiled/color/index.js +1 -1
- package/compiled/color/package.json +1 -4
- package/compiled/debug/LICENSE +10 -9
- package/compiled/debug/index.js +1 -1
- package/compiled/debug/package.json +1 -1
- package/compiled/execa/index.d.ts +467 -445
- package/compiled/execa/index.js +1 -1
- package/compiled/fastest-levenshtein/index.js +1 -0
- package/compiled/fastest-levenshtein/mod.d.ts +3 -0
- package/compiled/fastest-levenshtein/package.json +1 -0
- package/compiled/filesize/LICENSE +28 -0
- package/compiled/filesize/filesize.d.ts +131 -0
- package/compiled/filesize/index.js +8 -0
- package/compiled/filesize/package.json +1 -0
- package/compiled/filesize/types/filesize.d.ts +46 -0
- package/compiled/fs-extra/index.d.ts +930 -253
- package/compiled/fs-extra/index.js +1 -1
- package/compiled/fs-extra/jsonfile/index.d.ts +78 -0
- package/compiled/fs-extra/package.json +1 -1
- package/compiled/glob/LICENSE +1 -7
- package/compiled/glob/index.d.ts +3 -1
- package/compiled/glob/index.js +1 -1
- package/compiled/glob/package.json +1 -1
- package/compiled/gzip-size/LICENSE +9 -0
- package/compiled/gzip-size/index.d.ts +103 -0
- package/compiled/gzip-size/index.js +1 -0
- package/compiled/gzip-size/package.json +1 -0
- package/compiled/lodash/common/array.d.ts +0 -0
- package/compiled/lodash/common/collection.d.ts +0 -0
- package/compiled/lodash/common/common.d.ts +0 -0
- package/compiled/lodash/common/date.d.ts +0 -0
- package/compiled/lodash/common/function.d.ts +0 -0
- package/compiled/lodash/common/lang.d.ts +0 -0
- package/compiled/lodash/common/math.d.ts +0 -0
- package/compiled/lodash/common/number.d.ts +0 -0
- package/compiled/lodash/common/object.d.ts +0 -0
- package/compiled/lodash/common/seq.d.ts +0 -0
- package/compiled/lodash/common/string.d.ts +0 -0
- package/compiled/lodash/common/util.d.ts +0 -0
- package/compiled/magic-string/LICENSE +7 -0
- package/compiled/magic-string/index.d.ts +250 -0
- package/compiled/magic-string/index.js +1 -0
- package/compiled/magic-string/package.json +1 -0
- package/compiled/pirates/LICENSE +21 -0
- package/compiled/pirates/index.d.ts +82 -0
- package/compiled/pirates/index.js +1 -0
- package/compiled/pirates/package.json +1 -0
- package/compiled/pkg-up/LICENSE +1 -1
- package/compiled/pkg-up/index.d.ts +55 -44
- package/compiled/pkg-up/index.js +1 -1
- package/compiled/pkg-up/package.json +1 -1
- package/compiled/portfinder/index.js +1 -1
- package/compiled/portfinder/lib/portfinder.d.ts +16 -1
- package/compiled/portfinder/package.json +1 -1
- package/compiled/prettier/index.d.ts +568 -679
- package/compiled/prettier/index.js +62 -274
- package/compiled/prettier/package.json +1 -5
- package/compiled/resolve/index.js +1 -1
- package/compiled/semver/classes/range.d.ts +1 -1
- package/compiled/semver/classes/semver.d.ts +1 -1
- package/compiled/semver/functions/compare-build.d.ts +6 -1
- package/compiled/semver/functions/diff.d.ts +1 -5
- package/compiled/semver/functions/satisfies.d.ts +1 -1
- package/compiled/semver/index.d.ts +3 -0
- package/compiled/semver/index.js +1 -1
- package/compiled/semver/package.json +1 -1
- package/compiled/semver/ranges/gtr.d.ts +1 -1
- package/compiled/semver/ranges/intersects.d.ts +1 -1
- package/compiled/semver/ranges/ltr.d.ts +1 -1
- package/compiled/semver/ranges/max-satisfying.d.ts +1 -1
- package/compiled/semver/ranges/min-satisfying.d.ts +1 -1
- package/compiled/semver/ranges/outside.d.ts +1 -1
- package/compiled/semver/ranges/subset.d.ts +1 -5
- package/compiled/semver/ranges/valid.d.ts +1 -1
- package/compiled/strip-ansi/LICENSE +1 -1
- package/compiled/strip-ansi/index.d.ts +2 -4
- package/compiled/strip-ansi/index.js +1 -1
- package/compiled/strip-ansi/package.json +1 -1
- package/compiled/tar/LICENSE +15 -0
- package/compiled/tar/index.d.ts +943 -0
- package/compiled/tar/index.js +1 -0
- package/compiled/tar/minipass/index.d.ts +150 -0
- package/compiled/tar/package.json +1 -0
- package/compiled/tsconfig-paths/LICENSE +21 -0
- package/compiled/tsconfig-paths/index.js +1 -0
- package/compiled/tsconfig-paths/lib/index.d.ts +5 -0
- package/compiled/tsconfig-paths/package.json +1 -0
- package/compiled/yargs-parser/index.js +1 -1
- package/compiled/yargs-parser/package.json +1 -1
- package/compiled/zod/LICENSE +21 -0
- package/compiled/zod/index.d.ts +2 -0
- package/compiled/zod/index.js +1 -0
- package/compiled/zod/lib/ZodError.d.ts +159 -0
- package/compiled/zod/lib/__tests__/Mocker.d.ts +17 -0
- package/compiled/zod/lib/benchmarks/discriminatedUnion.d.ts +5 -0
- package/compiled/zod/lib/benchmarks/index.d.ts +1 -0
- package/compiled/zod/lib/benchmarks/object.d.ts +5 -0
- package/compiled/zod/lib/benchmarks/primitives.d.ts +5 -0
- package/compiled/zod/lib/benchmarks/realworld.d.ts +5 -0
- package/compiled/zod/lib/benchmarks/string.d.ts +5 -0
- package/compiled/zod/lib/benchmarks/union.d.ts +5 -0
- package/compiled/zod/lib/errors.d.ts +5 -0
- package/compiled/zod/lib/external.d.ts +6 -0
- package/compiled/zod/lib/helpers/enumUtil.d.ts +8 -0
- package/compiled/zod/lib/helpers/errorUtil.d.ts +9 -0
- package/compiled/zod/lib/helpers/parseUtil.d.ts +78 -0
- package/compiled/zod/lib/helpers/partialUtil.d.ts +8 -0
- package/compiled/zod/lib/helpers/typeAliases.d.ts +2 -0
- package/compiled/zod/lib/helpers/util.d.ts +47 -0
- package/compiled/zod/lib/index.d.ts +4 -0
- package/compiled/zod/lib/locales/en.d.ts +3 -0
- package/compiled/zod/lib/types.d.ts +975 -0
- package/compiled/zod/package.json +1 -0
- package/dist/BaseGenerator/BaseGenerator.d.ts +3 -3
- package/dist/BaseGenerator/BaseGenerator.js +78 -54
- package/dist/BaseGenerator/generateFile.d.ts +2 -1
- package/dist/BaseGenerator/generateFile.js +49 -22
- package/dist/Generator/Generator.d.ts +18 -14
- package/dist/Generator/Generator.js +97 -70
- package/dist/aliasUtils/getAliasValue.d.ts +4 -0
- package/dist/aliasUtils/getAliasValue.js +66 -0
- package/dist/aliasUtils/index.d.ts +2 -0
- package/dist/aliasUtils/index.js +32 -0
- package/dist/aliasUtils/parseCircleAlias.d.ts +4 -0
- package/dist/aliasUtils/parseCircleAlias.js +66 -0
- package/dist/getCorejsVersion.d.ts +1 -0
- package/dist/getCorejsVersion.js +35 -0
- package/dist/getDevBanner.d.ts +5 -0
- package/dist/getDevBanner.js +81 -0
- package/dist/getFileGitIno.d.ts +47 -0
- package/dist/getFileGitIno.js +130 -0
- package/dist/getGitInfo.d.ts +6 -0
- package/dist/getGitInfo.js +50 -0
- package/dist/importLazy.js +42 -14
- package/dist/index.d.ts +26 -3
- package/dist/index.js +185 -86
- package/dist/installDeps.js +69 -37
- package/dist/isJavaScriptFile.d.ts +1 -0
- package/dist/isJavaScriptFile.js +32 -0
- package/dist/isLocalDev.d.ts +4 -0
- package/dist/isLocalDev.js +36 -0
- package/dist/isMonorepo.d.ts +5 -0
- package/dist/isMonorepo.js +44 -0
- package/dist/isStyleFile.d.ts +5 -0
- package/dist/isStyleFile.js +44 -0
- package/dist/logger.d.ts +13 -6
- package/dist/logger.js +166 -25
- package/dist/node.d.ts +4 -0
- package/dist/node.js +61 -0
- package/dist/npmClient.d.ts +3 -2
- package/dist/npmClient.js +86 -40
- package/dist/printHelp.d.ts +2 -0
- package/dist/printHelp.js +64 -0
- package/dist/randomColor/randomColor.js +47 -16
- package/dist/readDirFiles.d.ts +9 -0
- package/dist/readDirFiles.js +62 -0
- package/dist/register.d.ts +1 -0
- package/dist/register.js +75 -37
- package/dist/setNoDeprecation.d.ts +1 -0
- package/dist/setNoDeprecation.js +31 -0
- package/dist/tryPaths.d.ts +1 -0
- package/dist/tryPaths.js +35 -0
- package/dist/updatePackageJSON.js +50 -19
- package/dist/winPath.js +33 -9
- package/dist/zod/isZodSchema.d.ts +2 -0
- package/dist/zod/isZodSchema.js +31 -0
- package/package.json +70 -44
package/compiled/execa/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){var e={184:function(e,t,n){"use strict";const r=n(622);const o=n(129);const i=n(178);const s=n(614);const a=n(799);const c=n(390);const d=n(362);const u=n(442);const{spawnedKill:l,spawnedCancel:f,setupTimeout:p,validateTimeout:m,setExitHandler:g}=n(485);const{handleInput:x,getSpawnedResult:b,makeAllStream:h,validateInputSync:S}=n(717);const{mergePromise:y,getSpawnedPromise:I}=n(740);const{joinCommand:w,parseCommand:v,getEscapedCommand:G}=n(453);const T=1e3*1e3*100;const getEnv=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:o})=>{const i=t?{...process.env,...e}:e;if(n){return a.env({env:i,cwd:r,execPath:o})}return i};const handleArguments=(e,t,n={})=>{const o=i._parse(e,t,n);e=o.command;t=o.args;n=o.options;n={maxBuffer:T,buffer:true,stripFinalNewline:true,extendEnv:true,preferLocal:false,localDir:n.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:true,cleanup:true,all:false,windowsHide:true,...n};n.env=getEnv(n);n.stdio=u(n);if(process.platform==="win32"&&r.basename(e,".exe")==="cmd"){t.unshift("/q")}return{file:e,args:t,options:n,parsed:o}};const handleOutput=(e,t,n)=>{if(typeof t!=="string"&&!Buffer.isBuffer(t)){return n===undefined?undefined:""}if(e.stripFinalNewline){return s(t)}return t};const execa=(e,t,n)=>{const r=handleArguments(e,t,n);const i=w(e,t);const s=G(e,t);m(r.options);let a;try{a=o.spawn(r.file,r.args,r.options)}catch(e){const t=new o.ChildProcess;const n=Promise.reject(d({error:e,stdout:"",stderr:"",all:"",command:i,escapedCommand:s,parsed:r,timedOut:false,isCanceled:false,killed:false}));return y(t,n)}const u=I(a);const S=p(a,r.options,u);const v=g(a,r.options,S);const T={isCanceled:false};a.kill=l.bind(null,a.kill.bind(a));a.cancel=f.bind(null,a,T);const handlePromise=async()=>{const[{error:e,exitCode:t,signal:n,timedOut:o},c,u,l]=await b(a,r.options,v);const f=handleOutput(r.options,c);const p=handleOutput(r.options,u);const m=handleOutput(r.options,l);if(e||t!==0||n!==null){const c=d({error:e,exitCode:t,signal:n,stdout:f,stderr:p,all:m,command:i,escapedCommand:s,parsed:r,timedOut:o,isCanceled:T.isCanceled,killed:a.killed});if(!r.options.reject){return c}throw c}return{command:i,escapedCommand:s,exitCode:0,stdout:f,stderr:p,all:m,failed:false,timedOut:false,isCanceled:false,killed:false}};const C=c(handlePromise);x(a,r.options.input);a.all=h(a,r.options);return y(a,C)};e.exports=execa;e.exports.sync=(e,t,n)=>{const r=handleArguments(e,t,n);const i=w(e,t);const s=G(e,t);S(r.options);let a;try{a=o.spawnSync(r.file,r.args,r.options)}catch(e){throw d({error:e,stdout:"",stderr:"",all:"",command:i,escapedCommand:s,parsed:r,timedOut:false,isCanceled:false,killed:false})}const c=handleOutput(r.options,a.stdout,a.error);const u=handleOutput(r.options,a.stderr,a.error);if(a.error||a.status!==0||a.signal!==null){const e=d({stdout:c,stderr:u,error:a.error,signal:a.signal,exitCode:a.status,command:i,escapedCommand:s,parsed:r,timedOut:a.error&&a.error.code==="ETIMEDOUT",isCanceled:false,killed:a.signal!==null});if(!r.options.reject){return e}throw e}return{command:i,escapedCommand:s,exitCode:0,stdout:c,stderr:u,failed:false,timedOut:false,isCanceled:false,killed:false}};e.exports.command=(e,t)=>{const[n,...r]=v(e);return execa(n,r,t)};e.exports.commandSync=(e,t)=>{const[n,...r]=v(e);return execa.sync(n,r,t)};e.exports.node=(e,t,n={})=>{if(t&&!Array.isArray(t)&&typeof t==="object"){n=t;t=[]}const r=u.node(n);const o=process.execArgv.filter((e=>!e.startsWith("--inspect")));const{nodePath:i=process.execPath,nodeOptions:s=o}=n;return execa(i,[...s,e,...Array.isArray(t)?t:[]],{...n,stdin:undefined,stdout:undefined,stderr:undefined,stdio:r,shell:false})}},453:function(e){"use strict";const normalizeArgs=(e,t=[])=>{if(!Array.isArray(t)){return[e]}return[e,...t]};const t=/^[\w.-]+$/;const n=/"/g;const escapeArg=e=>{if(typeof e!=="string"||t.test(e)){return e}return`"${e.replace(n,'\\"')}"`};const joinCommand=(e,t)=>normalizeArgs(e,t).join(" ");const getEscapedCommand=(e,t)=>normalizeArgs(e,t).map((e=>escapeArg(e))).join(" ");const r=/ +/g;const parseCommand=e=>{const t=[];for(const n of e.trim().split(r)){const e=t[t.length-1];if(e&&e.endsWith("\\")){t[t.length-1]=`${e.slice(0,-1)} ${n}`}else{t.push(n)}}return t};e.exports={joinCommand:joinCommand,getEscapedCommand:getEscapedCommand,parseCommand:parseCommand}},362:function(e,t,n){"use strict";const{signalsByName:r}=n(410);const getErrorPrefix=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:o,exitCode:i,isCanceled:s})=>{if(e){return`timed out after ${t} milliseconds`}if(s){return"was canceled"}if(n!==undefined){return`failed with ${n}`}if(r!==undefined){return`was killed with ${r} (${o})`}if(i!==undefined){return`failed with exit code ${i}`}return"failed"};const makeError=({stdout:e,stderr:t,all:n,error:o,signal:i,exitCode:s,command:a,escapedCommand:c,timedOut:d,isCanceled:u,killed:l,parsed:{options:{timeout:f}}})=>{s=s===null?undefined:s;i=i===null?undefined:i;const p=i===undefined?undefined:r[i].description;const m=o&&o.code;const g=getErrorPrefix({timedOut:d,timeout:f,errorCode:m,signal:i,signalDescription:p,exitCode:s,isCanceled:u});const x=`Command ${g}: ${a}`;const b=Object.prototype.toString.call(o)==="[object Error]";const h=b?`${x}\n${o.message}`:x;const S=[h,t,e].filter(Boolean).join("\n");if(b){o.originalMessage=o.message;o.message=S}else{o=new Error(S)}o.shortMessage=h;o.command=a;o.escapedCommand=c;o.exitCode=s;o.signal=i;o.signalDescription=p;o.stdout=e;o.stderr=t;if(n!==undefined){o.all=n}if("bufferedData"in o){delete o.bufferedData}o.failed=true;o.timedOut=Boolean(d);o.isCanceled=u;o.killed=l&&!d;return o};e.exports=makeError},485:function(e,t,n){"use strict";const r=n(87);const o=n(370);const i=1e3*5;const spawnedKill=(e,t="SIGTERM",n={})=>{const r=e(t);setKillTimeout(e,t,n,r);return r};const setKillTimeout=(e,t,n,r)=>{if(!shouldForceKill(t,n,r)){return}const o=getForceKillAfterTimeout(n);const i=setTimeout((()=>{e("SIGKILL")}),o);if(i.unref){i.unref()}};const shouldForceKill=(e,{forceKillAfterTimeout:t},n)=>isSigterm(e)&&t!==false&&n;const isSigterm=e=>e===r.constants.signals.SIGTERM||typeof e==="string"&&e.toUpperCase()==="SIGTERM";const getForceKillAfterTimeout=({forceKillAfterTimeout:e=true})=>{if(e===true){return i}if(!Number.isFinite(e)||e<0){throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)}return e};const spawnedCancel=(e,t)=>{const n=e.kill();if(n){t.isCanceled=true}};const timeoutKill=(e,t,n)=>{e.kill(t);n(Object.assign(new Error("Timed out"),{timedOut:true,signal:t}))};const setupTimeout=(e,{timeout:t,killSignal:n="SIGTERM"},r)=>{if(t===0||t===undefined){return r}let o;const i=new Promise(((r,i)=>{o=setTimeout((()=>{timeoutKill(e,n,i)}),t)}));const s=r.finally((()=>{clearTimeout(o)}));return Promise.race([i,s])};const validateTimeout=({timeout:e})=>{if(e!==undefined&&(!Number.isFinite(e)||e<0)){throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)}};const setExitHandler=async(e,{cleanup:t,detached:n},r)=>{if(!t||n){return r}const i=o((()=>{e.kill()}));return r.finally((()=>{i()}))};e.exports={spawnedKill:spawnedKill,spawnedCancel:spawnedCancel,setupTimeout:setupTimeout,validateTimeout:validateTimeout,setExitHandler:setExitHandler}},740:function(e){"use strict";const t=(async()=>{})().constructor.prototype;const n=["then","catch","finally"].map((e=>[e,Reflect.getOwnPropertyDescriptor(t,e)]));const mergePromise=(e,t)=>{for(const[r,o]of n){const n=typeof t==="function"?(...e)=>Reflect.apply(o.value,t(),e):o.value.bind(t);Reflect.defineProperty(e,r,{...o,value:n})}return e};const getSpawnedPromise=e=>new Promise(((t,n)=>{e.on("exit",((e,n)=>{t({exitCode:e,signal:n})}));e.on("error",(e=>{n(e)}));if(e.stdin){e.stdin.on("error",(e=>{n(e)}))}}));e.exports={mergePromise:mergePromise,getSpawnedPromise:getSpawnedPromise}},442:function(e){"use strict";const t=["stdin","stdout","stderr"];const hasAlias=e=>t.some((t=>e[t]!==undefined));const normalizeStdio=e=>{if(!e){return}const{stdio:n}=e;if(n===undefined){return t.map((t=>e[t]))}if(hasAlias(e)){throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${t.map((e=>`\`${e}\``)).join(", ")}`)}if(typeof n==="string"){return n}if(!Array.isArray(n)){throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof n}\``)}const r=Math.max(n.length,t.length);return Array.from({length:r},((e,t)=>n[t]))};e.exports=normalizeStdio;e.exports.node=e=>{const t=normalizeStdio(e);if(t==="ipc"){return"ipc"}if(t===undefined||typeof t==="string"){return[t,t,t,"ipc"]}if(t.includes("ipc")){return t}return[...t,"ipc"]}},717:function(e,t,n){"use strict";const r=n(8);const o=n(122);const i=n(450);const handleInput=(e,t)=>{if(t===undefined||e.stdin===undefined){return}if(r(t)){t.pipe(e.stdin)}else{e.stdin.end(t)}};const makeAllStream=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr){return}const n=i();if(e.stdout){n.add(e.stdout)}if(e.stderr){n.add(e.stderr)}return n};const getBufferedData=async(e,t)=>{if(!e){return}e.destroy();try{return await t}catch(e){return e.bufferedData}};const getStreamPromise=(e,{encoding:t,buffer:n,maxBuffer:r})=>{if(!e||!n){return}if(t){return o(e,{encoding:t,maxBuffer:r})}return o.buffer(e,{maxBuffer:r})};const getSpawnedResult=async({stdout:e,stderr:t,all:n},{encoding:r,buffer:o,maxBuffer:i},s)=>{const a=getStreamPromise(e,{encoding:r,buffer:o,maxBuffer:i});const c=getStreamPromise(t,{encoding:r,buffer:o,maxBuffer:i});const d=getStreamPromise(n,{encoding:r,buffer:o,maxBuffer:i*2});try{return await Promise.all([s,a,c,d])}catch(r){return Promise.all([{error:r,signal:r.signal,timedOut:r.timedOut},getBufferedData(e,a),getBufferedData(t,c),getBufferedData(n,d)])}};const validateInputSync=({input:e})=>{if(r(e)){throw new TypeError("The `input` option cannot be a stream in sync mode")}};e.exports={handleInput:handleInput,makeAllStream:makeAllStream,getSpawnedResult:getSpawnedResult,validateInputSync:validateInputSync}},57:function(e,t,n){"use strict";const{PassThrough:r}=n(413);e.exports=e=>{e={...e};const{array:t}=e;let{encoding:n}=e;const o=n==="buffer";let i=false;if(t){i=!(n||o)}else{n=n||"utf8"}if(o){n=null}const s=new r({objectMode:i});if(n){s.setEncoding(n)}let a=0;const c=[];s.on("data",(e=>{c.push(e);if(i){a=c.length}else{a+=e.length}}));s.getBufferedValue=()=>{if(t){return c}return o?Buffer.concat(c,a):c.join("")};s.getBufferedLength=()=>a;return s}},122:function(e,t,n){"use strict";const{constants:r}=n(293);const o=n(413);const{promisify:i}=n(669);const s=n(57);const a=i(o.pipeline);class MaxBufferError extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}async function getStream(e,t){if(!e){throw new Error("Expected a stream")}t={maxBuffer:Infinity,...t};const{maxBuffer:n}=t;const o=s(t);await new Promise(((t,i)=>{const rejectPromise=e=>{if(e&&o.getBufferedLength()<=r.MAX_LENGTH){e.bufferedData=o.getBufferedValue()}i(e)};(async()=>{try{await a(e,o);t()}catch(e){rejectPromise(e)}})();o.on("data",(()=>{if(o.getBufferedLength()>n){rejectPromise(new MaxBufferError)}}))}));return o.getBufferedValue()}e.exports=getStream;e.exports.buffer=(e,t)=>getStream(e,{...t,encoding:"buffer"});e.exports.array=(e,t)=>getStream(e,{...t,array:true});e.exports.MaxBufferError=MaxBufferError},570:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.SIGNALS=void 0;const n=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:true},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:true},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:true},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];t.SIGNALS=n},410:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.signalsByNumber=t.signalsByName=void 0;var r=n(87);var o=n(67);var i=n(934);const getSignalsByName=function(){const e=(0,o.getSignals)();return e.reduce(getSignalByName,{})};const getSignalByName=function(e,{name:t,number:n,description:r,supported:o,action:i,forced:s,standard:a}){return{...e,[t]:{name:t,number:n,description:r,supported:o,action:i,forced:s,standard:a}}};const s=getSignalsByName();t.signalsByName=s;const getSignalsByNumber=function(){const e=(0,o.getSignals)();const t=i.SIGRTMAX+1;const n=Array.from({length:t},((t,n)=>getSignalByNumber(n,e)));return Object.assign({},...n)};const getSignalByNumber=function(e,t){const n=findSignalByNumber(e,t);if(n===undefined){return{}}const{name:r,description:o,supported:i,action:s,forced:a,standard:c}=n;return{[e]:{name:r,number:e,description:o,supported:i,action:s,forced:a,standard:c}}};const findSignalByNumber=function(e,t){const n=t.find((({name:t})=>r.constants.signals[t]===e));if(n!==undefined){return n}return t.find((t=>t.number===e))};const a=getSignalsByNumber();t.signalsByNumber=a},934:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.SIGRTMAX=t.getRealtimeSignals=void 0;const getRealtimeSignals=function(){const e=r-n+1;return Array.from({length:e},getRealtimeSignal)};t.getRealtimeSignals=getRealtimeSignals;const getRealtimeSignal=function(e,t){return{name:`SIGRT${t+1}`,number:n+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}};const n=34;const r=64;t.SIGRTMAX=r},67:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getSignals=void 0;var r=n(87);var o=n(570);var i=n(934);const getSignals=function(){const e=(0,i.getRealtimeSignals)();const t=[...o.SIGNALS,...e].map(normalizeSignal);return t};t.getSignals=getSignals;const normalizeSignal=function({name:e,number:t,description:n,action:o,forced:i=false,standard:s}){const{signals:{[e]:a}}=r.constants;const c=a!==undefined;const d=c?a:t;return{name:e,number:d,description:n,supported:c,action:o,forced:i,standard:s}}},8:function(e){"use strict";const isStream=e=>e!==null&&typeof e==="object"&&typeof e.pipe==="function";isStream.writable=e=>isStream(e)&&e.writable!==false&&typeof e._write==="function"&&typeof e._writableState==="object";isStream.readable=e=>isStream(e)&&e.readable!==false&&typeof e._read==="function"&&typeof e._readableState==="object";isStream.duplex=e=>isStream.writable(e)&&isStream.readable(e);isStream.transform=e=>isStream.duplex(e)&&typeof e._transform==="function";e.exports=isStream},450:function(e,t,n){"use strict";const{PassThrough:r}=n(413);e.exports=function(){var e=[];var t=new r({objectMode:true});t.setMaxListeners(0);t.add=add;t.isEmpty=isEmpty;t.on("unpipe",remove);Array.prototype.slice.call(arguments).forEach(add);return t;function add(n){if(Array.isArray(n)){n.forEach(add);return this}e.push(n);n.once("end",remove.bind(null,n));n.once("error",t.emit.bind(t,"error"));n.pipe(t,{end:false});return this}function isEmpty(){return e.length==0}function remove(n){e=e.filter((function(e){return e!==n}));if(!e.length&&t.readable){t.end()}}}},317:function(e){"use strict";const mimicFn=(e,t)=>{for(const n of Reflect.ownKeys(t)){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}return e};e.exports=mimicFn;e.exports.default=mimicFn},799:function(e,t,n){"use strict";const r=n(622);const o=n(646);const npmRunPath=e=>{e={cwd:process.cwd(),path:process.env[o()],execPath:process.execPath,...e};let t;let n=r.resolve(e.cwd);const i=[];while(t!==n){i.push(r.join(n,"node_modules/.bin"));t=n;n=r.resolve(n,"..")}const s=r.resolve(e.cwd,e.execPath,"..");i.push(s);return i.concat(e.path).join(r.delimiter)};e.exports=npmRunPath;e.exports.default=npmRunPath;e.exports.env=t=>{t={env:process.env,...t};const n={...t.env};const r=o({env:n});t.path=n[r];n[r]=e.exports(t);return n}},390:function(e,t,n){"use strict";const r=n(317);const o=new WeakMap;const onetime=(e,t={})=>{if(typeof e!=="function"){throw new TypeError("Expected a function")}let n;let i=0;const s=e.displayName||e.name||"<anonymous>";const onetime=function(...r){o.set(onetime,++i);if(i===1){n=e.apply(this,r);e=null}else if(t.throw===true){throw new Error(`Function \`${s}\` can only be called once`)}return n};r(onetime,e);o.set(onetime,i);return onetime};e.exports=onetime;e.exports.default=onetime;e.exports.callCount=e=>{if(!o.has(e)){throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`)}return o.get(e)}},646:function(e){"use strict";const pathKey=(e={})=>{const t=e.env||process.env;const n=e.platform||process.platform;if(n!=="win32"){return"PATH"}return Object.keys(t).reverse().find((e=>e.toUpperCase()==="PATH"))||"Path"};e.exports=pathKey;e.exports.default=pathKey},370:function(e,t,n){var r=global.process;if(typeof r!=="object"||!r){e.exports=function(){}}else{var o=n(357);var i=n(569);var s=/^win/i.test(r.platform);var a=n(759);if(typeof a!=="function"){a=a.EventEmitter}var c;if(r.__signal_exit_emitter__){c=r.__signal_exit_emitter__}else{c=r.__signal_exit_emitter__=new a;c.count=0;c.emitted={}}if(!c.infinite){c.setMaxListeners(Infinity);c.infinite=true}e.exports=function(e,t){if(global.process!==r){return}o.equal(typeof e,"function","a callback must be provided for exit handler");if(f===false){p()}var n="exit";if(t&&t.alwaysLast){n="afterexit"}var remove=function(){c.removeListener(n,e);if(c.listeners("exit").length===0&&c.listeners("afterexit").length===0){d()}};c.on(n,e);return remove};var d=function unload(){if(!f||global.process!==r){return}f=false;i.forEach((function(e){try{r.removeListener(e,l[e])}catch(e){}}));r.emit=x;r.reallyExit=m;c.count-=1};e.exports.unload=d;var u=function emit(e,t,n){if(c.emitted[e]){return}c.emitted[e]=true;c.emit(e,t,n)};var l={};i.forEach((function(e){l[e]=function listener(){if(r!==global.process){return}var t=r.listeners(e);if(t.length===c.count){d();u("exit",null,e);u("afterexit",null,e);if(s&&e==="SIGHUP"){e="SIGINT"}r.kill(r.pid,e)}}}));e.exports.signals=function(){return i};var f=false;var p=function load(){if(f||r!==global.process){return}f=true;c.count+=1;i=i.filter((function(e){try{r.on(e,l[e]);return true}catch(e){return false}}));r.emit=b;r.reallyExit=g};e.exports.load=p;var m=r.reallyExit;var g=function processReallyExit(e){if(r!==global.process){return}r.exitCode=e||0;u("exit",r.exitCode,null);u("afterexit",r.exitCode,null);m.call(r,r.exitCode)};var x=r.emit;var b=function processEmit(e,t){if(e==="exit"&&r===global.process){if(t!==undefined){r.exitCode=t}var n=x.apply(this,arguments);u("exit",r.exitCode,null);u("afterexit",r.exitCode,null);return n}else{return x.apply(this,arguments)}}}},569:function(e){e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32"){e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}},614:function(e){"use strict";e.exports=e=>{const t=typeof e==="string"?"\n":"\n".charCodeAt();const n=typeof e==="string"?"\r":"\r".charCodeAt();if(e[e.length-1]===t){e=e.slice(0,e.length-1)}if(e[e.length-1]===n){e=e.slice(0,e.length-1)}return e}},178:function(e){"use strict";e.exports=require("@umijs/utils/compiled/cross-spawn")},357:function(e){"use strict";e.exports=require("assert")},293:function(e){"use strict";e.exports=require("buffer")},129:function(e){"use strict";e.exports=require("child_process")},759:function(e){"use strict";e.exports=require("events")},87:function(e){"use strict";e.exports=require("os")},622:function(e){"use strict";e.exports=require("path")},413:function(e){"use strict";e.exports=require("stream")},669:function(e){"use strict";e.exports=require("util")}};var t={};function __nccwpck_require__(n){var r=t[n];if(r!==undefined){return r.exports}var o=t[n]={exports:{}};var i=true;try{e[n](o,o.exports,__nccwpck_require__);i=false}finally{if(i)delete t[n]}return o.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var n=__nccwpck_require__(184);module.exports=n})();
|
|
1
|
+
(function(){var e={782:function(e,t,n){"use strict";const{PassThrough:r}=n(781);e.exports=e=>{e={...e};const{array:t}=e;let{encoding:n}=e;const o=n==="buffer";let i=false;if(t){i=!(n||o)}else{n=n||"utf8"}if(o){n=null}const s=new r({objectMode:i});if(n){s.setEncoding(n)}let a=0;const c=[];s.on("data",(e=>{c.push(e);if(i){a=c.length}else{a+=e.length}}));s.getBufferedValue=()=>{if(t){return c}return o?Buffer.concat(c,a):c.join("")};s.getBufferedLength=()=>a;return s}},981:function(e,t,n){"use strict";const{constants:r}=n(300);const o=n(781);const{promisify:i}=n(837);const s=n(782);const a=i(o.pipeline);class MaxBufferError extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}async function getStream(e,t){if(!e){throw new Error("Expected a stream")}t={maxBuffer:Infinity,...t};const{maxBuffer:n}=t;const o=s(t);await new Promise(((t,i)=>{const rejectPromise=e=>{if(e&&o.getBufferedLength()<=r.MAX_LENGTH){e.bufferedData=o.getBufferedValue()}i(e)};(async()=>{try{await a(e,o);t()}catch(e){rejectPromise(e)}})();o.on("data",(()=>{if(o.getBufferedLength()>n){rejectPromise(new MaxBufferError)}}))}));return o.getBufferedValue()}e.exports=getStream;e.exports.buffer=(e,t)=>getStream(e,{...t,encoding:"buffer"});e.exports.array=(e,t)=>getStream(e,{...t,array:true});e.exports.MaxBufferError=MaxBufferError},853:function(e,t,n){"use strict";const{PassThrough:r}=n(781);e.exports=function(){var e=[];var t=new r({objectMode:true});t.setMaxListeners(0);t.add=add;t.isEmpty=isEmpty;t.on("unpipe",remove);Array.prototype.slice.call(arguments).forEach(add);return t;function add(n){if(Array.isArray(n)){n.forEach(add);return this}e.push(n);n.once("end",remove.bind(null,n));n.once("error",t.emit.bind(t,"error"));n.pipe(t,{end:false});return this}function isEmpty(){return e.length==0}function remove(n){e=e.filter((function(e){return e!==n}));if(!e.length&&t.readable){t.end()}}}},580:function(e,t,n){var r=global.process;const processOk=function(e){return e&&typeof e==="object"&&typeof e.removeListener==="function"&&typeof e.emit==="function"&&typeof e.reallyExit==="function"&&typeof e.listeners==="function"&&typeof e.kill==="function"&&typeof e.pid==="number"&&typeof e.on==="function"};if(!processOk(r)){e.exports=function(){return function(){}}}else{var o=n(491);var i=n(357);var s=/^win/i.test(r.platform);var a=n(361);if(typeof a!=="function"){a=a.EventEmitter}var c;if(r.__signal_exit_emitter__){c=r.__signal_exit_emitter__}else{c=r.__signal_exit_emitter__=new a;c.count=0;c.emitted={}}if(!c.infinite){c.setMaxListeners(Infinity);c.infinite=true}e.exports=function(e,t){if(!processOk(global.process)){return function(){}}o.equal(typeof e,"function","a callback must be provided for exit handler");if(l===false){p()}var n="exit";if(t&&t.alwaysLast){n="afterexit"}var remove=function(){c.removeListener(n,e);if(c.listeners("exit").length===0&&c.listeners("afterexit").length===0){u()}};c.on(n,e);return remove};var u=function unload(){if(!l||!processOk(global.process)){return}l=false;i.forEach((function(e){try{r.removeListener(e,f[e])}catch(e){}}));r.emit=g;r.reallyExit=m;c.count-=1};e.exports.unload=u;var d=function emit(e,t,n){if(c.emitted[e]){return}c.emitted[e]=true;c.emit(e,t,n)};var f={};i.forEach((function(e){f[e]=function listener(){if(!processOk(global.process)){return}var t=r.listeners(e);if(t.length===c.count){u();d("exit",null,e);d("afterexit",null,e);if(s&&e==="SIGHUP"){e="SIGINT"}r.kill(r.pid,e)}}}));e.exports.signals=function(){return i};var l=false;var p=function load(){if(l||!processOk(global.process)){return}l=true;c.count+=1;i=i.filter((function(e){try{r.on(e,f[e]);return true}catch(e){return false}}));r.emit=y;r.reallyExit=b};e.exports.load=p;var m=r.reallyExit;var b=function processReallyExit(e){if(!processOk(global.process)){return}r.exitCode=e||0;d("exit",r.exitCode,null);d("afterexit",r.exitCode,null);m.call(r,r.exitCode)};var g=r.emit;var y=function processEmit(e,t){if(e==="exit"&&processOk(global.process)){if(t!==undefined){r.exitCode=t}var n=g.apply(this,arguments);d("exit",r.exitCode,null);d("afterexit",r.exitCode,null);return n}else{return g.apply(this,arguments)}}}},357:function(e){e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32"){e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}},491:function(e){"use strict";e.exports=require("assert")},300:function(e){"use strict";e.exports=require("buffer")},361:function(e){"use strict";e.exports=require("events")},781:function(e){"use strict";e.exports=require("stream")},837:function(e){"use strict";e.exports=require("util")}};var t={};function __nccwpck_require__(n){var r=t[n];if(r!==undefined){return r.exports}var o=t[n]={exports:{}};var i=true;try{e[n](o,o.exports,__nccwpck_require__);i=false}finally{if(i)delete t[n]}return o.exports}!function(){__nccwpck_require__.d=function(e,t){for(var n in t){if(__nccwpck_require__.o(t,n)&&!__nccwpck_require__.o(e,n)){Object.defineProperty(e,n,{enumerable:true,get:t[n]})}}}}();!function(){__nccwpck_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}();!function(){__nccwpck_require__.r=function(e){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}}();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var n={};!function(){"use strict";__nccwpck_require__.r(n);__nccwpck_require__.d(n,{execa:function(){return execa},execaCommand:function(){return execaCommand},execaCommandSync:function(){return execaCommandSync},execaNode:function(){return execaNode},execaSync:function(){return execaSync}});var e=require("buffer");var t=require("path");var r=require("child_process");var o=require("process");var i=require("@umijs/utils/compiled/cross-spawn");function stripFinalNewline(e){const t=typeof e==="string"?"\n":"\n".charCodeAt();const n=typeof e==="string"?"\r":"\r".charCodeAt();if(e[e.length-1]===t){e=e.slice(0,-1)}if(e[e.length-1]===n){e=e.slice(0,-1)}return e}var s=require("url");function pathKey(e={}){const{env:t=process.env,platform:n=process.platform}=e;if(n!=="win32"){return"PATH"}return Object.keys(t).reverse().find((e=>e.toUpperCase()==="PATH"))||"Path"}function npmRunPath(e={}){const{cwd:n=o.cwd(),path:r=o.env[pathKey()],execPath:i=o.execPath}=e;let a;const c=n instanceof URL?s.fileURLToPath(n):n;let u=t.resolve(c);const d=[];while(a!==u){d.push(t.join(u,"node_modules/.bin"));a=u;u=t.resolve(u,"..")}d.push(t.resolve(c,i,".."));return[...d,r].join(t.delimiter)}function npmRunPathEnv({env:e=o.env,...t}={}){e={...e};const n=pathKey({env:e});t.path=e[n];e[n]=npmRunPath(t);return e}const copyProperty=(e,t,n,r)=>{if(n==="length"||n==="prototype"){return}if(n==="arguments"||n==="caller"){return}const o=Object.getOwnPropertyDescriptor(e,n);const i=Object.getOwnPropertyDescriptor(t,n);if(!canCopyProperty(o,i)&&r){return}Object.defineProperty(e,n,i)};const canCopyProperty=function(e,t){return e===undefined||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)};const changePrototype=(e,t)=>{const n=Object.getPrototypeOf(t);if(n===Object.getPrototypeOf(e)){return}Object.setPrototypeOf(e,n)};const wrappedToString=(e,t)=>`/* Wrapped ${e}*/\n${t}`;const a=Object.getOwnPropertyDescriptor(Function.prototype,"toString");const c=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");const changeToString=(e,t,n)=>{const r=n===""?"":`with ${n.trim()}() `;const o=wrappedToString.bind(null,r,t.toString());Object.defineProperty(o,"name",c);Object.defineProperty(e,"toString",{...a,value:o})};function mimicFunction(e,t,{ignoreNonConfigurable:n=false}={}){const{name:r}=e;for(const r of Reflect.ownKeys(t)){copyProperty(e,t,r,n)}changePrototype(e,t);changeToString(e,t,r);return e}const u=new WeakMap;const onetime=(e,t={})=>{if(typeof e!=="function"){throw new TypeError("Expected a function")}let n;let r=0;const o=e.displayName||e.name||"<anonymous>";const onetime=function(...i){u.set(onetime,++r);if(r===1){n=e.apply(this,i);e=null}else if(t.throw===true){throw new Error(`Function \`${o}\` can only be called once`)}return n};mimicFunction(onetime,e);u.set(onetime,r);return onetime};onetime.callCount=e=>{if(!u.has(e)){throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`)}return u.get(e)};var d=onetime;var f=require("os");const getRealtimeSignals=function(){const e=p-l+1;return Array.from({length:e},getRealtimeSignal)};const getRealtimeSignal=function(e,t){return{name:`SIGRT${t+1}`,number:l+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}};const l=34;const p=64;const m=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:true},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:true},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:true},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];const getSignals=function(){const e=getRealtimeSignals();const t=[...m,...e].map(normalizeSignal);return t};const normalizeSignal=function({name:e,number:t,description:n,action:r,forced:o=false,standard:i}){const{signals:{[e]:s}}=f.constants;const a=s!==undefined;const c=a?s:t;return{name:e,number:c,description:n,supported:a,action:r,forced:o,standard:i}};const getSignalsByName=function(){const e=getSignals();return e.reduce(getSignalByName,{})};const getSignalByName=function(e,{name:t,number:n,description:r,supported:o,action:i,forced:s,standard:a}){return{...e,[t]:{name:t,number:n,description:r,supported:o,action:i,forced:s,standard:a}}};const b=getSignalsByName();const getSignalsByNumber=function(){const e=getSignals();const t=p+1;const n=Array.from({length:t},((t,n)=>getSignalByNumber(n,e)));return Object.assign({},...n)};const getSignalByNumber=function(e,t){const n=findSignalByNumber(e,t);if(n===undefined){return{}}const{name:r,description:o,supported:i,action:s,forced:a,standard:c}=n;return{[e]:{name:r,number:e,description:o,supported:i,action:s,forced:a,standard:c}}};const findSignalByNumber=function(e,t){const n=t.find((({name:t})=>f.constants.signals[t]===e));if(n!==undefined){return n}return t.find((t=>t.number===e))};const g=getSignalsByNumber();const getErrorPrefix=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:o,exitCode:i,isCanceled:s})=>{if(e){return`timed out after ${t} milliseconds`}if(s){return"was canceled"}if(n!==undefined){return`failed with ${n}`}if(r!==undefined){return`was killed with ${r} (${o})`}if(i!==undefined){return`failed with exit code ${i}`}return"failed"};const makeError=({stdout:e,stderr:t,all:n,error:r,signal:o,exitCode:i,command:s,escapedCommand:a,timedOut:c,isCanceled:u,killed:d,parsed:{options:{timeout:f}}})=>{i=i===null?undefined:i;o=o===null?undefined:o;const l=o===undefined?undefined:b[o].description;const p=r&&r.code;const m=getErrorPrefix({timedOut:c,timeout:f,errorCode:p,signal:o,signalDescription:l,exitCode:i,isCanceled:u});const g=`Command ${m}: ${s}`;const y=Object.prototype.toString.call(r)==="[object Error]";const x=y?`${g}\n${r.message}`:g;const h=[x,t,e].filter(Boolean).join("\n");if(y){r.originalMessage=r.message;r.message=h}else{r=new Error(h)}r.shortMessage=x;r.command=s;r.escapedCommand=a;r.exitCode=i;r.signal=o;r.signalDescription=l;r.stdout=e;r.stderr=t;if(n!==undefined){r.all=n}if("bufferedData"in r){delete r.bufferedData}r.failed=true;r.timedOut=Boolean(c);r.isCanceled=u;r.killed=d&&!c;return r};const y=["stdin","stdout","stderr"];const hasAlias=e=>y.some((t=>e[t]!==undefined));const normalizeStdio=e=>{if(!e){return}const{stdio:t}=e;if(t===undefined){return y.map((t=>e[t]))}if(hasAlias(e)){throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${y.map((e=>`\`${e}\``)).join(", ")}`)}if(typeof t==="string"){return t}if(!Array.isArray(t)){throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``)}const n=Math.max(t.length,y.length);return Array.from({length:n},((e,n)=>t[n]))};const normalizeStdioNode=e=>{const t=normalizeStdio(e);if(t==="ipc"){return"ipc"}if(t===undefined||typeof t==="string"){return[t,t,t,"ipc"]}if(t.includes("ipc")){return t}return[...t,"ipc"]};var x=require("os");var h=__nccwpck_require__(580);const S=1e3*5;const spawnedKill=(e,t="SIGTERM",n={})=>{const r=e(t);setKillTimeout(e,t,n,r);return r};const setKillTimeout=(e,t,n,r)=>{if(!shouldForceKill(t,n,r)){return}const o=getForceKillAfterTimeout(n);const i=setTimeout((()=>{e("SIGKILL")}),o);if(i.unref){i.unref()}};const shouldForceKill=(e,{forceKillAfterTimeout:t},n)=>isSigterm(e)&&t!==false&&n;const isSigterm=e=>e===x.constants.signals.SIGTERM||typeof e==="string"&&e.toUpperCase()==="SIGTERM";const getForceKillAfterTimeout=({forceKillAfterTimeout:e=true})=>{if(e===true){return S}if(!Number.isFinite(e)||e<0){throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)}return e};const spawnedCancel=(e,t)=>{const n=e.kill();if(n){t.isCanceled=true}};const timeoutKill=(e,t,n)=>{e.kill(t);n(Object.assign(new Error("Timed out"),{timedOut:true,signal:t}))};const setupTimeout=(e,{timeout:t,killSignal:n="SIGTERM"},r)=>{if(t===0||t===undefined){return r}let o;const i=new Promise(((r,i)=>{o=setTimeout((()=>{timeoutKill(e,n,i)}),t)}));const s=r.finally((()=>{clearTimeout(o)}));return Promise.race([i,s])};const validateTimeout=({timeout:e})=>{if(e!==undefined&&(!Number.isFinite(e)||e<0)){throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)}};const setExitHandler=async(e,{cleanup:t,detached:n},r)=>{if(!t||n){return r}const o=h((()=>{e.kill()}));return r.finally((()=>{o()}))};function isStream(e){return e!==null&&typeof e==="object"&&typeof e.pipe==="function"}function isWritableStream(e){return isStream(e)&&e.writable!==false&&typeof e._write==="function"&&typeof e._writableState==="object"}function isReadableStream(e){return isStream(e)&&e.readable!==false&&typeof e._read==="function"&&typeof e._readableState==="object"}function isDuplexStream(e){return isWritableStream(e)&&isReadableStream(e)}function isTransformStream(e){return isDuplexStream(e)&&typeof e._transform==="function"}var w=__nccwpck_require__(981);var _=__nccwpck_require__(853);const handleInput=(e,t)=>{if(t===undefined||e.stdin===undefined){return}if(isStream(t)){t.pipe(e.stdin)}else{e.stdin.end(t)}};const makeAllStream=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr){return}const n=_();if(e.stdout){n.add(e.stdout)}if(e.stderr){n.add(e.stderr)}return n};const getBufferedData=async(e,t)=>{if(!e){return}e.destroy();try{return await t}catch(e){return e.bufferedData}};const getStreamPromise=(e,{encoding:t,buffer:n,maxBuffer:r})=>{if(!e||!n){return}if(t){return w(e,{encoding:t,maxBuffer:r})}return w.buffer(e,{maxBuffer:r})};const getSpawnedResult=async({stdout:e,stderr:t,all:n},{encoding:r,buffer:o,maxBuffer:i},s)=>{const a=getStreamPromise(e,{encoding:r,buffer:o,maxBuffer:i});const c=getStreamPromise(t,{encoding:r,buffer:o,maxBuffer:i});const u=getStreamPromise(n,{encoding:r,buffer:o,maxBuffer:i*2});try{return await Promise.all([s,a,c,u])}catch(r){return Promise.all([{error:r,signal:r.signal,timedOut:r.timedOut},getBufferedData(e,a),getBufferedData(t,c),getBufferedData(n,u)])}};const validateInputSync=({input:e})=>{if(isStream(e)){throw new TypeError("The `input` option cannot be a stream in sync mode")}};const v=(async()=>{})().constructor.prototype;const I=["then","catch","finally"].map((e=>[e,Reflect.getOwnPropertyDescriptor(v,e)]));const mergePromise=(e,t)=>{for(const[n,r]of I){const o=typeof t==="function"?(...e)=>Reflect.apply(r.value,t(),e):r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:o})}return e};const getSpawnedPromise=e=>new Promise(((t,n)=>{e.on("exit",((e,n)=>{t({exitCode:e,signal:n})}));e.on("error",(e=>{n(e)}));if(e.stdin){e.stdin.on("error",(e=>{n(e)}))}}));const normalizeArgs=(e,t=[])=>{if(!Array.isArray(t)){return[e]}return[e,...t]};const C=/^[\w.-]+$/;const T=/"/g;const escapeArg=e=>{if(typeof e!=="string"||C.test(e)){return e}return`"${e.replace(T,'\\"')}"`};const joinCommand=(e,t)=>normalizeArgs(e,t).join(" ");const getEscapedCommand=(e,t)=>normalizeArgs(e,t).map((e=>escapeArg(e))).join(" ");const G=/ +/g;const parseCommand=e=>{const t=[];for(const n of e.trim().split(G)){const e=t[t.length-1];if(e&&e.endsWith("\\")){t[t.length-1]=`${e.slice(0,-1)} ${n}`}else{t.push(n)}}return t};const P=1e3*1e3*100;const getEnv=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:i})=>{const s=t?{...o.env,...e}:e;if(n){return npmRunPathEnv({env:s,cwd:r,execPath:i})}return s};const handleArguments=(e,n,r={})=>{const s=i._parse(e,n,r);e=s.command;n=s.args;r=s.options;r={maxBuffer:P,buffer:true,stripFinalNewline:true,extendEnv:true,preferLocal:false,localDir:r.cwd||o.cwd(),execPath:o.execPath,encoding:"utf8",reject:true,cleanup:true,all:false,windowsHide:true,...r};r.env=getEnv(r);r.stdio=normalizeStdio(r);if(o.platform==="win32"&&t.basename(e,".exe")==="cmd"){n.unshift("/q")}return{file:e,args:n,options:r,parsed:s}};const handleOutput=(t,n,r)=>{if(typeof n!=="string"&&!e.Buffer.isBuffer(n)){return r===undefined?undefined:""}if(t.stripFinalNewline){return stripFinalNewline(n)}return n};function execa(e,t,n){const o=handleArguments(e,t,n);const i=joinCommand(e,t);const s=getEscapedCommand(e,t);validateTimeout(o.options);let a;try{a=r.spawn(o.file,o.args,o.options)}catch(e){const t=new r.ChildProcess;const n=Promise.reject(makeError({error:e,stdout:"",stderr:"",all:"",command:i,escapedCommand:s,parsed:o,timedOut:false,isCanceled:false,killed:false}));return mergePromise(t,n)}const c=getSpawnedPromise(a);const u=setupTimeout(a,o.options,c);const f=setExitHandler(a,o.options,u);const l={isCanceled:false};a.kill=spawnedKill.bind(null,a.kill.bind(a));a.cancel=spawnedCancel.bind(null,a,l);const handlePromise=async()=>{const[{error:e,exitCode:t,signal:n,timedOut:r},c,u,d]=await getSpawnedResult(a,o.options,f);const p=handleOutput(o.options,c);const m=handleOutput(o.options,u);const b=handleOutput(o.options,d);if(e||t!==0||n!==null){const c=makeError({error:e,exitCode:t,signal:n,stdout:p,stderr:m,all:b,command:i,escapedCommand:s,parsed:o,timedOut:r,isCanceled:l.isCanceled||(o.options.signal?o.options.signal.aborted:false),killed:a.killed});if(!o.options.reject){return c}throw c}return{command:i,escapedCommand:s,exitCode:0,stdout:p,stderr:m,all:b,failed:false,timedOut:false,isCanceled:false,killed:false}};const p=d(handlePromise);handleInput(a,o.options.input);a.all=makeAllStream(a,o.options);return mergePromise(a,p)}function execaSync(e,t,n){const o=handleArguments(e,t,n);const i=joinCommand(e,t);const s=getEscapedCommand(e,t);validateInputSync(o.options);let a;try{a=r.spawnSync(o.file,o.args,o.options)}catch(e){throw makeError({error:e,stdout:"",stderr:"",all:"",command:i,escapedCommand:s,parsed:o,timedOut:false,isCanceled:false,killed:false})}const c=handleOutput(o.options,a.stdout,a.error);const u=handleOutput(o.options,a.stderr,a.error);if(a.error||a.status!==0||a.signal!==null){const e=makeError({stdout:c,stderr:u,error:a.error,signal:a.signal,exitCode:a.status,command:i,escapedCommand:s,parsed:o,timedOut:a.error&&a.error.code==="ETIMEDOUT",isCanceled:false,killed:a.signal!==null});if(!o.options.reject){return e}throw e}return{command:i,escapedCommand:s,exitCode:0,stdout:c,stderr:u,failed:false,timedOut:false,isCanceled:false,killed:false}}function execaCommand(e,t){const[n,...r]=parseCommand(e);return execa(n,r,t)}function execaCommandSync(e,t){const[n,...r]=parseCommand(e);return execaSync(n,r,t)}function execaNode(e,t,n={}){if(t&&!Array.isArray(t)&&typeof t==="object"){n=t;t=[]}const r=normalizeStdioNode(n);const i=o.execArgv.filter((e=>!e.startsWith("--inspect")));const{nodePath:s=o.execPath,nodeOptions:a=i}=n;return execa(s,[...a,e,...Array.isArray(t)?t:[]],{...n,stdin:undefined,stdout:undefined,stderr:undefined,stdio:r,shell:false})}}();module.exports=n})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){"use strict";if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r={};!function(){var a=r;a.__esModule=true;a.distance=a.closest=void 0;var v=new Uint32Array(65536);var myers_32=function(r,a){var e=r.length;var t=a.length;var n=1<<e-1;var i=-1;var o=0;var f=e;var h=e;while(h--){v[r.charCodeAt(h)]|=1<<h}for(h=0;h<t;h++){var c=v[a.charCodeAt(h)];var u=c|o;c|=(c&i)+i^i;o|=~(c|i);i&=c;if(o&n){f++}if(i&n){f--}o=o<<1|1;i=i<<1|~(u|o);o&=u}h=e;while(h--){v[r.charCodeAt(h)]=0}return f};var myers_x=function(r,a){var e=a.length;var t=r.length;var n=[];var i=[];var o=Math.ceil(e/32);var f=Math.ceil(t/32);for(var h=0;h<o;h++){i[h]=-1;n[h]=0}var c=0;for(;c<f-1;c++){var u=0;var l=-1;var d=c*32;var _=Math.min(32,t)+d;for(var g=d;g<_;g++){v[r.charCodeAt(g)]|=1<<g}for(var h=0;h<e;h++){var s=v[a.charCodeAt(h)];var A=i[h/32|0]>>>h&1;var C=n[h/32|0]>>>h&1;var w=s|u;var M=((s|C)&l)+l^l|s|C;var m=u|~(M|l);var p=l&M;if(m>>>31^A){i[h/32|0]^=1<<h}if(p>>>31^C){n[h/32|0]^=1<<h}m=m<<1|A;p=p<<1|C;l=p|~(w|m);u=m&w}for(var g=d;g<_;g++){v[r.charCodeAt(g)]=0}}var b=0;var y=-1;var k=c*32;var q=Math.min(32,t-k)+k;for(var g=k;g<q;g++){v[r.charCodeAt(g)]|=1<<g}var x=t;for(var h=0;h<e;h++){var s=v[a.charCodeAt(h)];var A=i[h/32|0]>>>h&1;var C=n[h/32|0]>>>h&1;var w=s|b;var M=((s|C)&y)+y^y|s|C;var m=b|~(M|y);var p=y&M;x+=m>>>t-1&1;x-=p>>>t-1&1;if(m>>>31^A){i[h/32|0]^=1<<h}if(p>>>31^C){n[h/32|0]^=1<<h}m=m<<1|A;p=p<<1|C;y=p|~(w|m);b=m&w}for(var g=k;g<q;g++){v[r.charCodeAt(g)]=0}return x};var distance=function(r,a){if(r.length<a.length){var v=a;a=r;r=v}if(a.length===0){return r.length}if(r.length<=32){return myers_32(r,a)}return myers_x(r,a)};a.distance=distance;var closest=function(r,a){var v=Infinity;var e=0;for(var t=0;t<a.length;t++){var n=distance(r,a[t]);if(n<v){v=n;e=t}}return a[e]};a.closest=closest}();module.exports=r})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"fastest-levenshtein","version":"1.0.16","author":"Kasper U. Weihe","license":"MIT","types":"mod.d.ts"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Copyright (c) 2022, Jason Mulligan
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
|
5
|
+
modification, are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
8
|
+
list of conditions and the following disclaimer.
|
|
9
|
+
|
|
10
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
11
|
+
this list of conditions and the following disclaimer in the documentation
|
|
12
|
+
and/or other materials provided with the distribution.
|
|
13
|
+
|
|
14
|
+
* Neither the name of filesize nor the names of its
|
|
15
|
+
contributors may be used to endorse or promote products derived from
|
|
16
|
+
this software without specific prior written permission.
|
|
17
|
+
|
|
18
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
19
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
20
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
21
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
22
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
23
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
24
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
25
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
26
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
27
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
+
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// Type definitions for filesize 8.0.3
|
|
2
|
+
// Project: https://github.com/avoidwork/filesize.js, https://filesizejs.com
|
|
3
|
+
// Definitions by: Giedrius Grabauskas <https://github.com/GiedriusGrabauskas>
|
|
4
|
+
// Renaud Chaput <https://github.com/renchap>
|
|
5
|
+
// Roman Nuritdinov <https://github.com/Ky6uk>
|
|
6
|
+
// Sam Hulick <https://github.com/ffxsam>
|
|
7
|
+
// Tomoto S. Washio <https://github.com/tomoto>
|
|
8
|
+
|
|
9
|
+
declare var fileSize: Filesize.Filesize;
|
|
10
|
+
export = fileSize;
|
|
11
|
+
export as namespace filesize;
|
|
12
|
+
|
|
13
|
+
declare namespace Filesize {
|
|
14
|
+
interface SiJedecBits {
|
|
15
|
+
b?: string;
|
|
16
|
+
Kb?: string;
|
|
17
|
+
Mb?: string;
|
|
18
|
+
Gb?: string;
|
|
19
|
+
Tb?: string;
|
|
20
|
+
Pb?: string;
|
|
21
|
+
Eb?: string;
|
|
22
|
+
Zb?: string;
|
|
23
|
+
Yb?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface SiJedecBytes {
|
|
27
|
+
B?: string;
|
|
28
|
+
KB?: string;
|
|
29
|
+
MB?: string;
|
|
30
|
+
GB?: string;
|
|
31
|
+
TB?: string;
|
|
32
|
+
PB?: string;
|
|
33
|
+
EB?: string;
|
|
34
|
+
ZB?: string;
|
|
35
|
+
YB?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
type SiJedec = SiJedecBits & SiJedecBytes & { [name: string]: string };
|
|
39
|
+
|
|
40
|
+
interface Options {
|
|
41
|
+
/**
|
|
42
|
+
* Number base, default is 10
|
|
43
|
+
*/
|
|
44
|
+
base?: number;
|
|
45
|
+
/**
|
|
46
|
+
* Enables bit sizes, default is false
|
|
47
|
+
*/
|
|
48
|
+
bits?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Specifies the SI suffix via exponent, e.g. 2 is MB for bytes, default is -1
|
|
51
|
+
*/
|
|
52
|
+
exponent?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Enables full form of unit of measure, default is false
|
|
55
|
+
*/
|
|
56
|
+
fullform?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Array of full form overrides, default is []
|
|
59
|
+
*/
|
|
60
|
+
fullforms?: string[];
|
|
61
|
+
/**
|
|
62
|
+
* BCP 47 language tag to specify a locale, or true to use default locale, default is ""
|
|
63
|
+
*/
|
|
64
|
+
locale?: string | boolean;
|
|
65
|
+
/**
|
|
66
|
+
* ECMA-402 number format option overrides, default is "{}"
|
|
67
|
+
*/
|
|
68
|
+
localeOptions?: Intl.NumberFormatOptions;
|
|
69
|
+
/**
|
|
70
|
+
* Output of function (array, exponent, object, or string), default is string
|
|
71
|
+
*/
|
|
72
|
+
output?: "array" | "exponent" | "object" | "string";
|
|
73
|
+
/**
|
|
74
|
+
* Decimal place end padding, default is false
|
|
75
|
+
*/
|
|
76
|
+
pad?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Sets precision of numerical output, default is 0
|
|
79
|
+
*/
|
|
80
|
+
precision?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Decimal place, default is 2
|
|
83
|
+
*/
|
|
84
|
+
round?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Rounding method, can be round, floor, or ceil, default is round
|
|
87
|
+
*/
|
|
88
|
+
roundingMethod?: "round" | "floor" | "ceil";
|
|
89
|
+
/**
|
|
90
|
+
* Decimal separator character, default is `.`
|
|
91
|
+
*/
|
|
92
|
+
separator?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Character between the result and suffix, default is ` `
|
|
95
|
+
*/
|
|
96
|
+
spacer?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Standard unit of measure, can be iec or jedec, default is iec; can be overruled by base
|
|
99
|
+
*/
|
|
100
|
+
standard?: "iec" | "jedec";
|
|
101
|
+
/**
|
|
102
|
+
* Dictionary of SI/JEDEC symbols to replace for localization, defaults to english if no match is found
|
|
103
|
+
*/
|
|
104
|
+
symbols?: SiJedec;
|
|
105
|
+
/**
|
|
106
|
+
* Enables unix style human readable output, e.g ls -lh, default is false
|
|
107
|
+
*/
|
|
108
|
+
unix?: boolean;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Result type inference from the output option
|
|
112
|
+
interface ResultTypeMap<O> {
|
|
113
|
+
array: [O extends {precision: number} ? string : number, string];
|
|
114
|
+
exponent: number;
|
|
115
|
+
object: {
|
|
116
|
+
value: number,
|
|
117
|
+
symbol: string,
|
|
118
|
+
exponent: number,
|
|
119
|
+
unit: string,
|
|
120
|
+
};
|
|
121
|
+
string: string;
|
|
122
|
+
}
|
|
123
|
+
type DefaultOutput<O extends Options> = Exclude<O["output"], keyof ResultTypeMap<O>> extends never ? never : "string"
|
|
124
|
+
type CanonicalOutput<O extends Options> = Extract<O["output"], keyof ResultTypeMap<O>> | DefaultOutput<O>
|
|
125
|
+
|
|
126
|
+
interface Filesize {
|
|
127
|
+
(bytes: number): string;
|
|
128
|
+
<O extends Options>(bytes: number, options: O): ResultTypeMap<O>[CanonicalOutput<O>];
|
|
129
|
+
partial: <O extends Options>(options: O) => ((bytes: number) => ResultTypeMap<O>[CanonicalOutput<O>]);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
(function(){"use strict";if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var t={};!function(){var e=t;
|
|
2
|
+
/**
|
|
3
|
+
* filesize
|
|
4
|
+
*
|
|
5
|
+
* @copyright 2022 Jason Mulligan <jason.mulligan@avoidwork.com>
|
|
6
|
+
* @license BSD-3-Clause
|
|
7
|
+
* @version 10.0.6
|
|
8
|
+
*/Object.defineProperty(e,"__esModule",{value:true});const i="array";const o="bit";const n="bits";const s="byte";const r="bytes";const l="";const a="exponent";const f="function";const b="iec";const c="Invalid number";const u="Invalid rounding method";const p="jedec";const d="object";const m=".";const g="round";const y="s";const B="kbit";const h="kB";const M=" ";const _="string";const w="0";const x={symbol:{iec:{bits:["bit","Kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["bit","Kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},fullform:{iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]}};function filesize(t,{bits:e=false,pad:E=false,base:j=-1,round:k=2,locale:v=l,localeOptions:z={},separator:N=l,spacer:P=M,symbols:T={},standard:G=l,output:K=_,fullform:O=false,fullforms:S=[],exponent:Y=-1,roundingMethod:Z=g,precision:I=0}={}){let $=Y,q=Number(t),L=[],A=0,C=l;if(j===-1&&G.length===0){j=10;G=p}else if(j===-1&&G.length>0){G=G===b?b:p;j=G===b?2:10}else{j=j===2?2:10;G=j===10?p:G===p?p:b}const D=j===10?1e3:1024,F=O===true,H=q<0,J=Math[Z];if(typeof t!=="bigint"&&isNaN(t)){throw new TypeError(c)}if(typeof J!==f){throw new TypeError(u)}if(H){q=-q}if($===-1||isNaN($)){$=Math.floor(Math.log(q)/Math.log(D));if($<0){$=0}}if($>8){if(I>0){I+=8-$}$=8}if(K===a){return $}if(q===0){L[0]=0;C=L[1]=x.symbol[G][e?n:r][$]}else{A=q/(j===2?Math.pow(2,$*10):Math.pow(1e3,$));if(e){A=A*8;if(A>=D&&$<8){A=A/D;$++}}const t=Math.pow(10,$>0?k:0);L[0]=J(A*t)/t;if(L[0]===D&&$<8&&Y===-1){L[0]=1;$++}C=L[1]=j===10&&$===1?e?B:h:x.symbol[G][e?n:r][$]}if(H){L[0]=-L[0]}if(I>0){L[0]=L[0].toPrecision(I)}L[1]=T[L[1]]||L[1];if(v===true){L[0]=L[0].toLocaleString()}else if(v.length>0){L[0]=L[0].toLocaleString(v,z)}else if(N.length>0){L[0]=L[0].toString().replace(m,N)}if(E&&Number.isInteger(L[0])===false&&k>0){const t=N||m,e=L[0].toString().split(t),i=e[1]||l,o=i.length,n=k-o;L[0]=`${e[0]}${t}${i.padEnd(o+n,w)}`}if(F){L[1]=S[$]?S[$]:x.fullform[G][$]+(e?o:s)+(L[0]===1?l:y)}return K===i?L:K===d?{value:L[0],symbol:L[1],exponent:$,unit:C}:L.join(P)}function partial({bits:t=false,pad:e=false,base:i=-1,round:o=2,locale:n=l,localeOptions:s={},separator:r=l,spacer:a=M,symbols:f={},standard:b=l,output:c=_,fullform:u=false,fullforms:p=[],exponent:d=-1,roundingMethod:m=g,precision:y=0}={}){return l=>filesize(l,{bits:t,pad:e,base:i,round:o,locale:n,localeOptions:s,separator:r,spacer:a,symbols:f,standard:b,output:c,fullform:u,fullforms:p,exponent:d,roundingMethod:m,precision:y})}e.filesize=filesize;e.partial=partial}();module.exports=t})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"filesize","version":"10.0.6","author":"Jason Mulligan <jason.mulligan@avoidwork.com>","license":"BSD-3-Clause","types":"types/filesize.d.ts"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export function filesize(arg: any, { bits, pad, base, round, locale, localeOptions, separator, spacer, symbols, standard, output, fullform, fullforms, exponent, roundingMethod, precision }?: {
|
|
2
|
+
bits?: boolean;
|
|
3
|
+
pad?: boolean;
|
|
4
|
+
base?: number;
|
|
5
|
+
round?: number;
|
|
6
|
+
locale?: string;
|
|
7
|
+
localeOptions?: {};
|
|
8
|
+
separator?: string;
|
|
9
|
+
spacer?: string;
|
|
10
|
+
symbols?: {};
|
|
11
|
+
standard?: string;
|
|
12
|
+
output?: string;
|
|
13
|
+
fullform?: boolean;
|
|
14
|
+
fullforms?: any[];
|
|
15
|
+
exponent?: number;
|
|
16
|
+
roundingMethod?: string;
|
|
17
|
+
precision?: number;
|
|
18
|
+
}): string | number | any[] | {
|
|
19
|
+
value: any;
|
|
20
|
+
symbol: any;
|
|
21
|
+
exponent: number;
|
|
22
|
+
unit: string;
|
|
23
|
+
};
|
|
24
|
+
export function partial({ bits, pad, base, round, locale, localeOptions, separator, spacer, symbols, standard, output, fullform, fullforms, exponent, roundingMethod, precision }?: {
|
|
25
|
+
bits?: boolean;
|
|
26
|
+
pad?: boolean;
|
|
27
|
+
base?: number;
|
|
28
|
+
round?: number;
|
|
29
|
+
locale?: string;
|
|
30
|
+
localeOptions?: {};
|
|
31
|
+
separator?: string;
|
|
32
|
+
spacer?: string;
|
|
33
|
+
symbols?: {};
|
|
34
|
+
standard?: string;
|
|
35
|
+
output?: string;
|
|
36
|
+
fullform?: boolean;
|
|
37
|
+
fullforms?: any[];
|
|
38
|
+
exponent?: number;
|
|
39
|
+
roundingMethod?: string;
|
|
40
|
+
precision?: number;
|
|
41
|
+
}): (arg: any) => string | number | any[] | {
|
|
42
|
+
value: any;
|
|
43
|
+
symbol: any;
|
|
44
|
+
exponent: number;
|
|
45
|
+
unit: string;
|
|
46
|
+
};
|