@umijs/utils 4.0.42 → 4.0.44

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.
Files changed (46) hide show
  1. package/compiled/filesize/LICENSE +28 -28
  2. package/compiled/filesize/index.js +3 -4
  3. package/compiled/filesize/package.json +1 -1
  4. package/compiled/filesize/types/filesize.d.ts +46 -0
  5. package/compiled/fs-extra/index.d.ts +922 -476
  6. package/compiled/fs-extra/index.js +1 -1
  7. package/compiled/fs-extra/jsonfile/index.d.ts +78 -0
  8. package/compiled/fs-extra/package.json +1 -1
  9. package/compiled/glob/index.d.ts +1 -1
  10. package/compiled/glob/index.js +1 -1
  11. package/compiled/glob/package.json +1 -1
  12. package/compiled/gzip-size/index.d.ts +88 -81
  13. package/compiled/gzip-size/index.js +1 -1
  14. package/compiled/gzip-size/package.json +1 -1
  15. package/compiled/portfinder/index.js +1 -1
  16. package/compiled/portfinder/lib/portfinder.d.ts +16 -1
  17. package/compiled/portfinder/package.json +1 -1
  18. package/compiled/semver/classes/range.d.ts +1 -1
  19. package/compiled/semver/classes/semver.d.ts +1 -1
  20. package/compiled/semver/functions/compare-build.d.ts +6 -1
  21. package/compiled/semver/functions/diff.d.ts +1 -5
  22. package/compiled/semver/functions/satisfies.d.ts +1 -1
  23. package/compiled/semver/index.d.ts +3 -0
  24. package/compiled/semver/index.js +1 -1
  25. package/compiled/semver/package.json +1 -1
  26. package/compiled/semver/ranges/gtr.d.ts +1 -1
  27. package/compiled/semver/ranges/intersects.d.ts +1 -1
  28. package/compiled/semver/ranges/ltr.d.ts +1 -1
  29. package/compiled/semver/ranges/max-satisfying.d.ts +1 -1
  30. package/compiled/semver/ranges/min-satisfying.d.ts +1 -1
  31. package/compiled/semver/ranges/outside.d.ts +1 -1
  32. package/compiled/semver/ranges/subset.d.ts +1 -5
  33. package/compiled/semver/ranges/valid.d.ts +1 -1
  34. package/compiled/yargs-parser/index.js +1 -1
  35. package/compiled/yargs-parser/package.json +1 -1
  36. package/dist/aliasUtils/getAliasValue.d.ts +4 -0
  37. package/dist/aliasUtils/getAliasValue.js +62 -0
  38. package/dist/aliasUtils/index.d.ts +2 -0
  39. package/dist/aliasUtils/index.js +32 -0
  40. package/dist/aliasUtils/parseCircleAlias.d.ts +4 -0
  41. package/dist/aliasUtils/parseCircleAlias.js +66 -0
  42. package/dist/index.d.ts +6 -4
  43. package/dist/index.js +14 -7
  44. package/dist/isMonorepo.d.ts +5 -0
  45. package/dist/isMonorepo.js +43 -0
  46. package/package.json +16 -14
@@ -1,28 +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
-
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
+
@@ -1,9 +1,8 @@
1
- (function(){var i={647:function(i){
1
+ (function(){"use strict";if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var t={};!function(){var e=t;
2
2
  /**
3
3
  * filesize
4
4
  *
5
5
  * @copyright 2022 Jason Mulligan <jason.mulligan@avoidwork.com>
6
6
  * @license BSD-3-Clause
7
- * @version 9.0.11
8
- */
9
- (function(e,t){true?i.exports=t():0})(this,(function(){"use strict";function _typeof(i){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(i){return typeof i}:function(i){return i&&"function"==typeof Symbol&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},_typeof(i)}var i="array";var e="bit";var t="bits";var r="byte";var o="bytes";var a="";var n="exponent";var f="function";var l="iec";var b="Invalid number";var s="Invalid rounding method";var u="jedec";var v="object";var p=".";var c="round";var d="s";var y="kbit";var _="kB";var m=" ";var g="string";var h="0";var B={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(w){var x=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},M=x.bits,k=M===void 0?false:M,S=x.pad,E=S===void 0?false:S,z=x.base,N=z===void 0?-1:z,T=x.round,j=T===void 0?2:T,q=x.locale,P=q===void 0?a:q,G=x.localeOptions,K=G===void 0?{}:G,Y=x.separator,Z=Y===void 0?a:Y,I=x.spacer,L=I===void 0?m:I,O=x.symbols,A=O===void 0?{}:O,C=x.standard,D=C===void 0?a:C,F=x.output,H=F===void 0?g:F,J=x.fullform,Q=J===void 0?false:J,R=x.fullforms,U=R===void 0?[]:R,V=x.exponent,W=V===void 0?-1:V,X=x.roundingMethod,$=X===void 0?c:X,ii=x.precision,ei=ii===void 0?0:ii;var ti=W,ri=Number(w),oi=[],ai=0,ni=a;if(N===-1&&D.length===0){N=10;D=u}else if(N===-1&&D.length>0){D=D===l?l:u;N=D===l?2:10}else{N=N===2?2:10;D=N===10?u:D===u?u:l}var fi=N===10?1e3:1024,li=Q===true,bi=ri<0,si=Math[$];if(isNaN(w)){throw new TypeError(b)}if(_typeof(si)!==f){throw new TypeError(s)}if(bi){ri=-ri}if(ti===-1||isNaN(ti)){ti=Math.floor(Math.log(ri)/Math.log(fi));if(ti<0){ti=0}}if(ti>8){if(ei>0){ei+=8-ti}ti=8}if(H===n){return ti}if(ri===0){oi[0]=0;ni=oi[1]=B.symbol[D][k?t:o][ti]}else{ai=ri/(N===2?Math.pow(2,ti*10):Math.pow(1e3,ti));if(k){ai=ai*8;if(ai>=fi&&ti<8){ai=ai/fi;ti++}}var ui=Math.pow(10,ti>0?j:0);oi[0]=si(ai*ui)/ui;if(oi[0]===fi&&ti<8&&W===-1){oi[0]=1;ti++}ni=oi[1]=N===10&&ti===1?k?y:_:B.symbol[D][k?t:o][ti]}if(bi){oi[0]=-oi[0]}if(ei>0){oi[0]=oi[0].toPrecision(ei)}oi[1]=A[oi[1]]||oi[1];if(P===true){oi[0]=oi[0].toLocaleString()}else if(P.length>0){oi[0]=oi[0].toLocaleString(P,K)}else if(Z.length>0){oi[0]=oi[0].toString().replace(p,Z)}if(E&&Number.isInteger(oi[0])===false&&j>0){var vi=Z||p,pi=oi[0].toString().split(vi),ci=pi[1]||a,di=ci.length,yi=j-di;oi[0]="".concat(pi[0]).concat(vi).concat(ci.padEnd(di+yi,h))}if(li){oi[1]=U[ti]?U[ti]:B.fullform[D][ti]+(k?e:r)+(oi[0]===1?a:d)}return H===i?oi:H===v?{value:oi[0],symbol:oi[1],exponent:ti,unit:ni}:oi.join(L)}filesize.partial=function(i){return function(e){return filesize(e,i)}};return filesize}))}};var e={};function __nccwpck_require__(t){var r=e[t];if(r!==undefined){return r.exports}var o=e[t]={exports:{}};var a=true;try{i[t].call(o.exports,o,o.exports,__nccwpck_require__);a=false}finally{if(a)delete e[t]}return o.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var t=__nccwpck_require__(647);module.exports=t})();
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})();
@@ -1 +1 @@
1
- {"name":"filesize","version":"9.0.11","author":"Jason Mulligan <jason.mulligan@avoidwork.com>","license":"BSD-3-Clause","types":"filesize.d.ts"}
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
+ };