@modern-js/utils 2.69.7 → 3.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/cli/alias.js +76 -70
- package/dist/cjs/cli/applyOptionsChain.js +44 -45
- package/dist/cjs/cli/babel.js +100 -119
- package/dist/cjs/cli/commands.js +61 -59
- package/dist/cjs/cli/common.js +45 -37
- package/dist/cjs/cli/config.js +36 -30
- package/dist/cjs/cli/constants.js +124 -161
- package/dist/cjs/cli/ensure.js +52 -45
- package/dist/cjs/cli/fs.js +41 -38
- package/dist/cjs/cli/get/config.js +43 -38
- package/dist/cjs/cli/get/data.js +108 -125
- package/dist/cjs/cli/get/index.js +109 -58
- package/dist/cjs/cli/index.js +202 -63
- package/dist/cjs/cli/is/config.js +75 -71
- package/dist/cjs/cli/is/env.js +49 -37
- package/dist/cjs/cli/is/index.js +76 -25
- package/dist/cjs/cli/is/project.js +139 -135
- package/dist/cjs/cli/is/type.js +65 -49
- package/dist/cjs/cli/logger.js +36 -27
- package/dist/cjs/cli/monorepo.js +100 -96
- package/dist/cjs/cli/package.js +85 -82
- package/dist/cjs/cli/path.js +101 -82
- package/dist/cjs/cli/port.js +71 -74
- package/dist/cjs/cli/prettyInstructions.js +106 -116
- package/dist/cjs/cli/require.js +116 -136
- package/dist/cjs/cli/route.js +67 -77
- package/dist/cjs/cli/runtimeExports.js +16 -70
- package/dist/cjs/cli/version.js +53 -42
- package/dist/cjs/cli/watch.js +79 -72
- package/dist/cjs/compiled.js +199 -128
- package/dist/cjs/import.js +58 -33
- package/dist/cjs/index.js +69 -23
- package/dist/cjs/universal/constants.js +77 -67
- package/dist/cjs/universal/index.js +33 -25
- package/dist/cjs/universal/path.js +33 -27
- package/dist/cjs/universal/pluginDagSort.js +69 -68
- package/dist/compiled/address/index.js +171 -1
- package/dist/compiled/browserslist/index.js +1329 -1
- package/dist/compiled/chalk/index.js +2368 -1
- package/dist/compiled/chokidar/index.js +4138 -16
- package/dist/compiled/chokidar/index.js.LICENSE.txt +41 -0
- package/dist/compiled/commander/index.js +1540 -1
- package/dist/compiled/debug/index.js +621 -1
- package/dist/compiled/dotenv/index.js +101 -1
- package/dist/compiled/dotenv-expand/index.js +54 -1
- package/dist/compiled/execa/index.js +1738 -1
- package/dist/compiled/fast-glob/index.js +4645 -17
- package/dist/compiled/fast-glob/index.js.LICENSE.txt +38 -0
- package/dist/compiled/filesize/index.js +193 -4
- package/dist/compiled/filesize/index.js.LICENSE.txt +7 -0
- package/dist/compiled/fs-extra/index.js +2222 -1
- package/dist/compiled/glob/index.js +2011 -1
- package/dist/compiled/globby/index.js +690 -1
- package/dist/compiled/gzip-size/index.js +157 -1
- package/dist/compiled/import-lazy/index.js +45 -1
- package/dist/compiled/inquirer/index.js +20162 -4
- package/dist/compiled/inquirer/index.js.LICENSE.txt +7 -0
- package/dist/compiled/js-yaml/index.js +2188 -1
- package/dist/compiled/json5/index.js +983 -1
- package/dist/compiled/lodash/index.js +0 -4
- package/dist/compiled/mime-types/index.js +108 -6
- package/dist/compiled/mime-types/index.js.LICENSE.txt +13 -0
- package/dist/compiled/minimist/index.js +202 -1
- package/dist/compiled/nanoid/index.js +83 -1
- package/dist/compiled/ora/index.js +3936 -3
- package/dist/compiled/ora/index.js.LICENSE.txt +1 -0
- package/dist/compiled/pkg-up/index.js +177 -1
- package/dist/compiled/semver/index.js +1779 -1
- package/dist/compiled/signale/index.js +1704 -1
- package/dist/compiled/slash/index.js +32 -1
- package/dist/compiled/strip-ansi/index.js +34 -1
- package/dist/compiled/tsconfig-paths/index.js +629 -1
- package/dist/compiled/upath/index.js +135 -1
- package/dist/compiled/url-join/index.js +61 -1
- package/dist/compiled/webpack-chain/index.js +1475 -1
- package/dist/esm/cli/alias.mjs +31 -0
- package/dist/esm/cli/applyOptionsChain.mjs +16 -0
- package/dist/esm/cli/babel.mjs +76 -0
- package/dist/esm/cli/commands.mjs +23 -0
- package/dist/esm/cli/common.mjs +11 -0
- package/dist/esm/cli/config.mjs +5 -0
- package/dist/esm/cli/constants.mjs +29 -0
- package/dist/esm/cli/ensure.mjs +9 -0
- package/dist/esm/cli/fs.mjs +9 -0
- package/dist/esm/cli/get/config.mjs +14 -0
- package/dist/esm/cli/get/data.mjs +57 -0
- package/dist/esm/cli/get/index.mjs +18 -0
- package/dist/{esm-node/cli/index.js → esm/cli/index.mjs} +0 -1
- package/dist/esm/cli/is/config.mjs +34 -0
- package/dist/esm/cli/is/env.mjs +6 -0
- package/dist/esm/cli/is/project.mjs +104 -0
- package/dist/esm/cli/is/type.mjs +26 -0
- package/dist/esm/cli/logger.mjs +2 -0
- package/dist/esm/cli/monorepo.mjs +50 -0
- package/dist/esm/cli/package.mjs +51 -0
- package/dist/esm/cli/path.mjs +35 -0
- package/dist/esm/cli/port.mjs +35 -0
- package/dist/esm/cli/prettyInstructions.mjs +68 -0
- package/dist/esm/cli/require.mjs +79 -0
- package/dist/esm/cli/route.mjs +36 -0
- package/dist/esm/cli/runtimeExports.mjs +0 -0
- package/dist/esm/cli/version.mjs +21 -0
- package/dist/esm/cli/watch.mjs +40 -0
- package/dist/esm/compiled.mjs +115 -0
- package/dist/esm/import.mjs +25 -0
- package/dist/esm/universal/constants.mjs +13 -0
- package/dist/{esm-node/universal/index.js → esm/universal/index.mjs} +1 -3
- package/dist/esm/universal/path.mjs +2 -0
- package/dist/esm/universal/pluginDagSort.mjs +41 -0
- package/dist/esm-node/cli/alias.mjs +31 -0
- package/dist/esm-node/cli/applyOptionsChain.mjs +16 -0
- package/dist/esm-node/cli/babel.mjs +76 -0
- package/dist/esm-node/cli/commands.mjs +23 -0
- package/dist/esm-node/cli/common.mjs +11 -0
- package/dist/esm-node/cli/config.mjs +5 -0
- package/dist/esm-node/cli/constants.mjs +29 -0
- package/dist/esm-node/cli/ensure.mjs +9 -0
- package/dist/esm-node/cli/fs.mjs +9 -0
- package/dist/esm-node/cli/get/config.mjs +14 -0
- package/dist/esm-node/cli/get/data.mjs +57 -0
- package/dist/esm-node/cli/get/index.mjs +18 -0
- package/dist/esm-node/cli/index.mjs +22 -0
- package/dist/esm-node/cli/is/config.mjs +34 -0
- package/dist/esm-node/cli/is/env.mjs +6 -0
- package/dist/esm-node/cli/is/index.mjs +4 -0
- package/dist/esm-node/cli/is/project.mjs +104 -0
- package/dist/esm-node/cli/is/type.mjs +26 -0
- package/dist/esm-node/cli/logger.mjs +2 -0
- package/dist/esm-node/cli/monorepo.mjs +50 -0
- package/dist/esm-node/cli/package.mjs +51 -0
- package/dist/esm-node/cli/path.mjs +35 -0
- package/dist/esm-node/cli/port.mjs +35 -0
- package/dist/esm-node/cli/prettyInstructions.mjs +68 -0
- package/dist/esm-node/cli/require.mjs +79 -0
- package/dist/esm-node/cli/route.mjs +36 -0
- package/dist/esm-node/cli/runtimeExports.mjs +0 -0
- package/dist/esm-node/cli/version.mjs +21 -0
- package/dist/esm-node/cli/watch.mjs +40 -0
- package/dist/esm-node/compiled.mjs +115 -0
- package/dist/esm-node/import.mjs +25 -0
- package/dist/esm-node/index.mjs +3 -0
- package/dist/esm-node/universal/constants.mjs +13 -0
- package/dist/esm-node/universal/index.mjs +2 -0
- package/dist/esm-node/universal/path.mjs +2 -0
- package/dist/esm-node/universal/pluginDagSort.mjs +41 -0
- package/dist/types/cli/constants.d.ts +2 -26
- package/dist/types/cli/get/data.d.ts +0 -1
- package/dist/types/cli/index.d.ts +0 -1
- package/dist/types/cli/is/config.d.ts +1 -1
- package/dist/types/cli/runtimeExports.d.ts +1 -4
- package/dist/types/cli/watch.d.ts +1 -1
- package/dist/types/compiled.d.ts +0 -5
- package/dist/types/universal/constants.d.ts +4 -7
- package/package.json +27 -27
- package/rslib.config.mts +140 -0
- package/dist/cjs/cli/action.js +0 -55
- package/dist/cjs/universal/formatWebpack.js +0 -127
- package/dist/esm/cli/action.js +0 -68
- package/dist/esm/cli/alias.js +0 -43
- package/dist/esm/cli/applyOptionsChain.js +0 -29
- package/dist/esm/cli/babel.js +0 -122
- package/dist/esm/cli/commands.js +0 -39
- package/dist/esm/cli/common.js +0 -20
- package/dist/esm/cli/config.js +0 -11
- package/dist/esm/cli/constants.js +0 -114
- package/dist/esm/cli/ensure.js +0 -16
- package/dist/esm/cli/fs.js +0 -65
- package/dist/esm/cli/get/config.js +0 -19
- package/dist/esm/cli/get/data.js +0 -143
- package/dist/esm/cli/get/index.js +0 -38
- package/dist/esm/cli/index.js +0 -23
- package/dist/esm/cli/is/config.js +0 -70
- package/dist/esm/cli/is/env.js +0 -22
- package/dist/esm/cli/is/index.js +0 -4
- package/dist/esm/cli/is/project.js +0 -146
- package/dist/esm/cli/is/type.js +0 -39
- package/dist/esm/cli/logger.js +0 -5
- package/dist/esm/cli/monorepo.js +0 -82
- package/dist/esm/cli/package.js +0 -203
- package/dist/esm/cli/path.js +0 -66
- package/dist/esm/cli/port.js +0 -97
- package/dist/esm/cli/prettyInstructions.js +0 -102
- package/dist/esm/cli/require.js +0 -235
- package/dist/esm/cli/route.js +0 -64
- package/dist/esm/cli/runtimeExports.js +0 -44
- package/dist/esm/cli/version.js +0 -26
- package/dist/esm/cli/watch.js +0 -112
- package/dist/esm/compiled.js +0 -66
- package/dist/esm/import.js +0 -11
- package/dist/esm/index.js +0 -3
- package/dist/esm/universal/constants.js +0 -32
- package/dist/esm/universal/formatWebpack.js +0 -95
- package/dist/esm/universal/index.js +0 -4
- package/dist/esm/universal/path.js +0 -6
- package/dist/esm/universal/pluginDagSort.js +0 -73
- package/dist/esm-node/cli/action.js +0 -30
- package/dist/esm-node/cli/alias.js +0 -40
- package/dist/esm-node/cli/applyOptionsChain.js +0 -27
- package/dist/esm-node/cli/babel.js +0 -107
- package/dist/esm-node/cli/commands.js +0 -39
- package/dist/esm-node/cli/common.js +0 -15
- package/dist/esm-node/cli/config.js +0 -9
- package/dist/esm-node/cli/constants.js +0 -114
- package/dist/esm-node/cli/ensure.js +0 -14
- package/dist/esm-node/cli/fs.js +0 -18
- package/dist/esm-node/cli/get/config.js +0 -19
- package/dist/esm-node/cli/get/data.js +0 -96
- package/dist/esm-node/cli/get/index.js +0 -22
- package/dist/esm-node/cli/is/config.js +0 -50
- package/dist/esm-node/cli/is/env.js +0 -12
- package/dist/esm-node/cli/is/project.js +0 -105
- package/dist/esm-node/cli/is/type.js +0 -36
- package/dist/esm-node/cli/logger.js +0 -5
- package/dist/esm-node/cli/monorepo.js +0 -67
- package/dist/esm-node/cli/package.js +0 -66
- package/dist/esm-node/cli/path.js +0 -48
- package/dist/esm-node/cli/port.js +0 -48
- package/dist/esm-node/cli/prettyInstructions.js +0 -90
- package/dist/esm-node/cli/require.js +0 -111
- package/dist/esm-node/cli/route.js +0 -60
- package/dist/esm-node/cli/runtimeExports.js +0 -38
- package/dist/esm-node/cli/version.js +0 -26
- package/dist/esm-node/cli/watch.js +0 -45
- package/dist/esm-node/compiled.js +0 -66
- package/dist/esm-node/import.js +0 -11
- package/dist/esm-node/universal/constants.js +0 -32
- package/dist/esm-node/universal/formatWebpack.js +0 -102
- package/dist/esm-node/universal/path.js +0 -6
- package/dist/esm-node/universal/pluginDagSort.js +0 -50
- package/dist/types/cli/action.d.ts +0 -2
- package/dist/types/universal/formatWebpack.d.ts +0 -26
- /package/dist/{esm-node/cli/is/index.js → esm/cli/is/index.mjs} +0 -0
- /package/dist/{esm-node/index.js → esm/index.mjs} +0 -0
|
@@ -1,40 +1,4162 @@
|
|
|
1
|
-
(()=>{var t={372:(t,e,s)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});const r=s(700);const i=s(498);const n="!";const o={returnIndex:false};const arrify=t=>Array.isArray(t)?t:[t];const createPattern=(t,e)=>{if(typeof t==="function"){return t}if(typeof t==="string"){const s=r(t,e);return e=>t===e||s(e)}if(t instanceof RegExp){return e=>t.test(e)}return t=>false};const matchPatterns=(t,e,s,r)=>{const n=Array.isArray(s);const o=n?s[0]:s;if(!n&&typeof o!=="string"){throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(o))}const a=i(o);for(let t=0;t<e.length;t++){const s=e[t];if(s(a)){return r?-1:false}}const u=n&&[a].concat(s.slice(1));for(let e=0;e<t.length;e++){const s=t[e];if(n?s(...u):s(a)){return r?e:true}}return r?-1:false};const anymatch=(t,e,s=o)=>{if(t==null){throw new TypeError("anymatch: specify first argument")}const i=typeof s==="boolean"?{returnIndex:s}:s;const a=i.returnIndex||false;const u=arrify(t);const l=u.filter((t=>typeof t==="string"&&t.charAt(0)===n)).map((t=>t.slice(1))).map((t=>r(t,i)));const c=u.filter((t=>typeof t!=="string"||typeof t==="string"&&t.charAt(0)!==n)).map((t=>createPattern(t,i)));if(e==null){return(t,e=false)=>{const s=typeof e==="boolean"?e:false;return matchPatterns(c,l,t,s)}}return matchPatterns(c,l,e,a)};anymatch.default=anymatch;t.exports=anymatch},828:(t,e,s)=>{t.exports=s(600)},570:(t,e,s)=>{"use strict";const r=s(625);const i=s(666);const n=s(183);const o=s(467);const braces=(t,e={})=>{let s=[];if(Array.isArray(t)){for(let r of t){let t=braces.create(r,e);if(Array.isArray(t)){s.push(...t)}else{s.push(t)}}}else{s=[].concat(braces.create(t,e))}if(e&&e.expand===true&&e.nodupes===true){s=[...new Set(s)]}return s};braces.parse=(t,e={})=>o(t,e);braces.stringify=(t,e={})=>{if(typeof t==="string"){return r(braces.parse(t,e),e)}return r(t,e)};braces.compile=(t,e={})=>{if(typeof t==="string"){t=braces.parse(t,e)}return i(t,e)};braces.expand=(t,e={})=>{if(typeof t==="string"){t=braces.parse(t,e)}let s=n(t,e);if(e.noempty===true){s=s.filter(Boolean)}if(e.nodupes===true){s=[...new Set(s)]}return s};braces.create=(t,e={})=>{if(t===""||t.length<3){return[t]}return e.expand!==true?braces.compile(t,e):braces.expand(t,e)};t.exports=braces},666:(t,e,s)=>{"use strict";const r=s(442);const i=s(456);const compile=(t,e={})=>{let walk=(t,s={})=>{let n=i.isInvalidBrace(s);let o=t.invalid===true&&e.escapeInvalid===true;let a=n===true||o===true;let u=e.escapeInvalid===true?"\\":"";let l="";if(t.isOpen===true){return u+t.value}if(t.isClose===true){return u+t.value}if(t.type==="open"){return a?u+t.value:"("}if(t.type==="close"){return a?u+t.value:")"}if(t.type==="comma"){return t.prev.type==="comma"?"":a?t.value:"|"}if(t.value){return t.value}if(t.nodes&&t.ranges>0){let s=i.reduce(t.nodes);let n=r(...s,{...e,wrap:false,toRegex:true});if(n.length!==0){return s.length>1&&n.length>1?`(${n})`:n}}if(t.nodes){for(let e of t.nodes){l+=walk(e,t)}}return l};return walk(t)};t.exports=compile},487:t=>{"use strict";t.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"}},183:(t,e,s)=>{"use strict";const r=s(442);const i=s(625);const n=s(456);const append=(t="",e="",s=false)=>{let r=[];t=[].concat(t);e=[].concat(e);if(!e.length)return t;if(!t.length){return s?n.flatten(e).map((t=>`{${t}}`)):e}for(let i of t){if(Array.isArray(i)){for(let t of i){r.push(append(t,e,s))}}else{for(let t of e){if(s===true&&typeof t==="string")t=`{${t}}`;r.push(Array.isArray(t)?append(i,t,s):i+t)}}}return n.flatten(r)};const expand=(t,e={})=>{let s=e.rangeLimit===void 0?1e3:e.rangeLimit;let walk=(t,o={})=>{t.queue=[];let a=o;let u=o.queue;while(a.type!=="brace"&&a.type!=="root"&&a.parent){a=a.parent;u=a.queue}if(t.invalid||t.dollar){u.push(append(u.pop(),i(t,e)));return}if(t.type==="brace"&&t.invalid!==true&&t.nodes.length===2){u.push(append(u.pop(),["{}"]));return}if(t.nodes&&t.ranges>0){let o=n.reduce(t.nodes);if(n.exceedsLimit(...o,e.step,s)){throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.")}let a=r(...o,e);if(a.length===0){a=i(t,e)}u.push(append(u.pop(),a));t.nodes=[];return}let l=n.encloseBrace(t);let c=t.queue;let f=t;while(f.type!=="brace"&&f.type!=="root"&&f.parent){f=f.parent;c=f.queue}for(let e=0;e<t.nodes.length;e++){let s=t.nodes[e];if(s.type==="comma"&&t.type==="brace"){if(e===1)c.push("");c.push("");continue}if(s.type==="close"){u.push(append(u.pop(),c,l));continue}if(s.value&&s.type!=="open"){c.push(append(c.pop(),s.value));continue}if(s.nodes){walk(s,t)}}return c};return n.flatten(walk(t))};t.exports=expand},467:(t,e,s)=>{"use strict";const r=s(625);const{MAX_LENGTH:i,CHAR_BACKSLASH:n,CHAR_BACKTICK:o,CHAR_COMMA:a,CHAR_DOT:u,CHAR_LEFT_PARENTHESES:l,CHAR_RIGHT_PARENTHESES:c,CHAR_LEFT_CURLY_BRACE:f,CHAR_RIGHT_CURLY_BRACE:h,CHAR_LEFT_SQUARE_BRACKET:p,CHAR_RIGHT_SQUARE_BRACKET:d,CHAR_DOUBLE_QUOTE:_,CHAR_SINGLE_QUOTE:E,CHAR_NO_BREAK_SPACE:g,CHAR_ZERO_WIDTH_NOBREAK_SPACE:m}=s(487);const parse=(t,e={})=>{if(typeof t!=="string"){throw new TypeError("Expected a string")}let s=e||{};let y=typeof s.maxLength==="number"?Math.min(i,s.maxLength):i;if(t.length>y){throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${y})`)}let R={type:"root",input:t,nodes:[]};let w=[R];let A=R;let b=R;let v=0;let S=t.length;let C=0;let x=0;let T;let H={};const advance=()=>t[C++];const push=t=>{if(t.type==="text"&&b.type==="dot"){b.type="text"}if(b&&b.type==="text"&&t.type==="text"){b.value+=t.value;return}A.nodes.push(t);t.parent=A;t.prev=b;b=t;return t};push({type:"bos"});while(C<S){A=w[w.length-1];T=advance();if(T===m||T===g){continue}if(T===n){push({type:"text",value:(e.keepEscaping?T:"")+advance()});continue}if(T===d){push({type:"text",value:"\\"+T});continue}if(T===p){v++;let t=true;let e;while(C<S&&(e=advance())){T+=e;if(e===p){v++;continue}if(e===n){T+=advance();continue}if(e===d){v--;if(v===0){break}}}push({type:"text",value:T});continue}if(T===l){A=push({type:"paren",nodes:[]});w.push(A);push({type:"text",value:T});continue}if(T===c){if(A.type!=="paren"){push({type:"text",value:T});continue}A=w.pop();push({type:"text",value:T});A=w[w.length-1];continue}if(T===_||T===E||T===o){let t=T;let s;if(e.keepQuotes!==true){T=""}while(C<S&&(s=advance())){if(s===n){T+=s+advance();continue}if(s===t){if(e.keepQuotes===true)T+=s;break}T+=s}push({type:"text",value:T});continue}if(T===f){x++;let t=b.value&&b.value.slice(-1)==="$"||A.dollar===true;let e={type:"brace",open:true,close:false,dollar:t,depth:x,commas:0,ranges:0,nodes:[]};A=push(e);w.push(A);push({type:"open",value:T});continue}if(T===h){if(A.type!=="brace"){push({type:"text",value:T});continue}let t="close";A=w.pop();A.close=true;push({type:t,value:T});x--;A=w[w.length-1];continue}if(T===a&&x>0){if(A.ranges>0){A.ranges=0;let t=A.nodes.shift();A.nodes=[t,{type:"text",value:r(A)}]}push({type:"comma",value:T});A.commas++;continue}if(T===u&&x>0&&A.commas===0){let t=A.nodes;if(x===0||t.length===0){push({type:"text",value:T});continue}if(b.type==="dot"){A.range=[];b.value+=T;b.type="range";if(A.nodes.length!==3&&A.nodes.length!==5){A.invalid=true;A.ranges=0;b.type="text";continue}A.ranges++;A.args=[];continue}if(b.type==="range"){t.pop();let e=t[t.length-1];e.value+=b.value+T;b=e;A.ranges--;continue}push({type:"dot",value:T});continue}push({type:"text",value:T})}do{A=w.pop();if(A.type!=="root"){A.nodes.forEach((t=>{if(!t.nodes){if(t.type==="open")t.isOpen=true;if(t.type==="close")t.isClose=true;if(!t.nodes)t.type="text";t.invalid=true}}));let t=w[w.length-1];let e=t.nodes.indexOf(A);t.nodes.splice(e,1,...A.nodes)}}while(w.length>0);push({type:"eos"});return R};t.exports=parse},625:(t,e,s)=>{"use strict";const r=s(456);t.exports=(t,e={})=>{let stringify=(t,s={})=>{let i=e.escapeInvalid&&r.isInvalidBrace(s);let n=t.invalid===true&&e.escapeInvalid===true;let o="";if(t.value){if((i||n)&&r.isOpenOrClose(t)){return"\\"+t.value}return t.value}if(t.value){return t.value}if(t.nodes){for(let e of t.nodes){o+=stringify(e)}}return o};return stringify(t)}},456:(t,e)=>{"use strict";e.isInteger=t=>{if(typeof t==="number"){return Number.isInteger(t)}if(typeof t==="string"&&t.trim()!==""){return Number.isInteger(Number(t))}return false};e.find=(t,e)=>t.nodes.find((t=>t.type===e));e.exceedsLimit=(t,s,r=1,i)=>{if(i===false)return false;if(!e.isInteger(t)||!e.isInteger(s))return false;return(Number(s)-Number(t))/Number(r)>=i};e.escapeNode=(t,e=0,s)=>{let r=t.nodes[e];if(!r)return;if(s&&r.type===s||r.type==="open"||r.type==="close"){if(r.escaped!==true){r.value="\\"+r.value;r.escaped=true}}};e.encloseBrace=t=>{if(t.type!=="brace")return false;if(t.commas>>0+t.ranges>>0===0){t.invalid=true;return true}return false};e.isInvalidBrace=t=>{if(t.type!=="brace")return false;if(t.invalid===true||t.dollar)return true;if(t.commas>>0+t.ranges>>0===0){t.invalid=true;return true}if(t.open!==true||t.close!==true){t.invalid=true;return true}return false};e.isOpenOrClose=t=>{if(t.type==="open"||t.type==="close"){return true}return t.open===true||t.close===true};e.reduce=t=>t.reduce(((t,e)=>{if(e.type==="text")t.push(e.value);if(e.type==="range")e.type="text";return t}),[]);e.flatten=(...t)=>{const e=[];const flat=t=>{for(let s=0;s<t.length;s++){let r=t[s];Array.isArray(r)?flat(r,e):r!==void 0&&e.push(r)}return e};flat(t);return e}},240:(t,e,s)=>{"use strict";const{sep:r}=s(17);const{platform:i}=process;const n=s(37);e.EV_ALL="all";e.EV_READY="ready";e.EV_ADD="add";e.EV_CHANGE="change";e.EV_ADD_DIR="addDir";e.EV_UNLINK="unlink";e.EV_UNLINK_DIR="unlinkDir";e.EV_RAW="raw";e.EV_ERROR="error";e.STR_DATA="data";e.STR_END="end";e.STR_CLOSE="close";e.FSEVENT_CREATED="created";e.FSEVENT_MODIFIED="modified";e.FSEVENT_DELETED="deleted";e.FSEVENT_MOVED="moved";e.FSEVENT_CLONED="cloned";e.FSEVENT_UNKNOWN="unknown";e.FSEVENT_TYPE_FILE="file";e.FSEVENT_TYPE_DIRECTORY="directory";e.FSEVENT_TYPE_SYMLINK="symlink";e.KEY_LISTENERS="listeners";e.KEY_ERR="errHandlers";e.KEY_RAW="rawEmitters";e.HANDLER_KEYS=[e.KEY_LISTENERS,e.KEY_ERR,e.KEY_RAW];e.DOT_SLASH=`.${r}`;e.BACK_SLASH_RE=/\\/g;e.DOUBLE_SLASH_RE=/\/\//;e.SLASH_OR_BACK_SLASH_RE=/[/\\]/;e.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;e.REPLACER_RE=/^\.[/\\]/;e.SLASH="/";e.SLASH_SLASH="//";e.BRACE_START="{";e.BANG="!";e.ONE_DOT=".";e.TWO_DOTS="..";e.STAR="*";e.GLOBSTAR="**";e.ROOT_GLOBSTAR="/**/*";e.SLASH_GLOBSTAR="/**";e.DIR_SUFFIX="Dir";e.ANYMATCH_OPTS={dot:true};e.STRING_TYPE="string";e.FUNCTION_TYPE="function";e.EMPTY_STR="";e.EMPTY_FN=()=>{};e.IDENTITY_FN=t=>t;e.isWindows=i==="win32";e.isMacos=i==="darwin";e.isLinux=i==="linux";e.isIBMi=n.type()==="OS400"},578:(t,e,s)=>{"use strict";const r=s(147);const i=s(17);const{promisify:n}=s(837);let o;try{o=s(249)}catch(t){if(process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR)console.error(t)}if(o){const t=process.version.match(/v(\d+)\.(\d+)/);if(t&&t[1]&&t[2]){const e=Number.parseInt(t[1],10);const s=Number.parseInt(t[2],10);if(e===8&&s<16){o=undefined}}}const{EV_ADD:a,EV_CHANGE:u,EV_ADD_DIR:l,EV_UNLINK:c,EV_ERROR:f,STR_DATA:h,STR_END:p,FSEVENT_CREATED:d,FSEVENT_MODIFIED:_,FSEVENT_DELETED:E,FSEVENT_MOVED:g,FSEVENT_UNKNOWN:m,FSEVENT_TYPE_FILE:y,FSEVENT_TYPE_DIRECTORY:R,FSEVENT_TYPE_SYMLINK:w,ROOT_GLOBSTAR:A,DIR_SUFFIX:b,DOT_SLASH:v,FUNCTION_TYPE:S,EMPTY_FN:C,IDENTITY_FN:x}=s(240);const Depth=t=>isNaN(t)?{}:{depth:t};const T=n(r.stat);const H=n(r.lstat);const O=n(r.realpath);const P={stat:T,lstat:H};const I=new Map;const L=10;const N=new Set([69888,70400,71424,72704,73472,131328,131840,262912]);const createFSEventsInstance=(t,e)=>{const s=o.watch(t,e);return{stop:s}};function setFSEventsListener(t,e,s,r){let n=i.extname(e)?i.dirname(e):e;const a=i.dirname(n);let u=I.get(n);if(couldConsolidate(a)){n=a}const l=i.resolve(t);const c=l!==e;const filteredListener=(t,r,n)=>{if(c)t=t.replace(e,l);if(t===l||!t.indexOf(l+i.sep))s(t,r,n)};let f=false;for(const t of I.keys()){if(e.indexOf(i.resolve(t)+i.sep)===0){n=t;u=I.get(n);f=true;break}}if(u||f){u.listeners.add(filteredListener)}else{u={listeners:new Set([filteredListener]),rawEmitter:r,watcher:createFSEventsInstance(n,((t,e)=>{if(!u.listeners.size)return;const s=o.getInfo(t,e);u.listeners.forEach((r=>{r(t,e,s)}));u.rawEmitter(s.event,t,s)}))};I.set(n,u)}return()=>{const t=u.listeners;t.delete(filteredListener);if(!t.size){I.delete(n);if(u.watcher)return u.watcher.stop().then((()=>{u.rawEmitter=u.watcher=undefined;Object.freeze(u)}))}}}const couldConsolidate=t=>{let e=0;for(const s of I.keys()){if(s.indexOf(t)===0){e++;if(e>=L){return true}}}return false};const canUse=()=>o&&I.size<128;const calcDepth=(t,e)=>{let s=0;while(!t.indexOf(e)&&(t=i.dirname(t))!==e)s++;return s};const sameTypes=(t,e)=>t.type===R&&e.isDirectory()||t.type===w&&e.isSymbolicLink()||t.type===y&&e.isFile();class FsEventsHandler{constructor(t){this.fsw=t}checkIgnored(t,e){const s=this.fsw._ignoredPaths;if(this.fsw._isIgnored(t,e)){s.add(t);if(e&&e.isDirectory()){s.add(t+A)}return true}s.delete(t);s.delete(t+A)}addOrChange(t,e,s,r,i,n,o,l){const c=i.has(n)?u:a;this.handleEvent(c,t,e,s,r,i,n,o,l)}async checkExists(t,e,s,r,i,n,o,a){try{const u=await T(t);if(this.fsw.closed)return;if(sameTypes(o,u)){this.addOrChange(t,e,s,r,i,n,o,a)}else{this.handleEvent(c,t,e,s,r,i,n,o,a)}}catch(u){if(u.code==="EACCES"){this.addOrChange(t,e,s,r,i,n,o,a)}else{this.handleEvent(c,t,e,s,r,i,n,o,a)}}}handleEvent(t,e,s,r,i,n,o,u,f){if(this.fsw.closed||this.checkIgnored(e))return;if(t===c){const t=u.type===R;if(t||n.has(o)){this.fsw._remove(i,o,t)}}else{if(t===a){if(u.type===R)this.fsw._getWatchedDir(e);if(u.type===w&&f.followSymlinks){const t=f.depth===undefined?undefined:calcDepth(s,r)+1;return this._addToFsEvents(e,false,true,t)}this.fsw._getWatchedDir(i).add(o)}const n=u.type===R?t+b:t;this.fsw._emit(n,e);if(n===l)this._addToFsEvents(e,false,true)}}_watchWithFsEvents(t,e,s,r){if(this.fsw.closed||this.fsw._isIgnored(t))return;const n=this.fsw.options;const watchCallback=async(o,a,u)=>{if(this.fsw.closed)return;if(n.depth!==undefined&&calcDepth(o,e)>n.depth)return;const l=s(i.join(t,i.relative(t,o)));if(r&&!r(l))return;const f=i.dirname(l);const h=i.basename(l);const p=this.fsw._getWatchedDir(u.type===R?l:f);if(N.has(a)||u.event===m){if(typeof n.ignored===S){let t;try{t=await T(l)}catch(t){}if(this.fsw.closed)return;if(this.checkIgnored(l,t))return;if(sameTypes(u,t)){this.addOrChange(l,o,e,f,p,h,u,n)}else{this.handleEvent(c,l,o,e,f,p,h,u,n)}}else{this.checkExists(l,o,e,f,p,h,u,n)}}else{switch(u.event){case d:case _:return this.addOrChange(l,o,e,f,p,h,u,n);case E:case g:return this.checkExists(l,o,e,f,p,h,u,n)}}};const o=setFSEventsListener(t,e,watchCallback,this.fsw._emitRaw);this.fsw._emitReady();return o}async _handleFsEventsSymlink(t,e,s,r){if(this.fsw.closed||this.fsw._symlinkPaths.has(e))return;this.fsw._symlinkPaths.set(e,true);this.fsw._incrReadyCount();try{const e=await O(t);if(this.fsw.closed)return;if(this.fsw._isIgnored(e)){return this.fsw._emitReady()}this.fsw._incrReadyCount();this._addToFsEvents(e||t,(r=>{let n=t;if(e&&e!==v){n=r.replace(e,t)}else if(r!==v){n=i.join(t,r)}return s(n)}),false,r)}catch(t){if(this.fsw._handleError(t)){return this.fsw._emitReady()}}}emitAdd(t,e,s,r,n){const o=s(t);const u=e.isDirectory();const c=this.fsw._getWatchedDir(i.dirname(o));const f=i.basename(o);if(u)this.fsw._getWatchedDir(o);if(c.has(f))return;c.add(f);if(!r.ignoreInitial||n===true){this.fsw._emit(u?l:a,o,e)}}initWatch(t,e,s,r){if(this.fsw.closed)return;const n=this._watchWithFsEvents(s.watchPath,i.resolve(t||s.watchPath),r,s.globFilter);this.fsw._addPathCloser(e,n)}async _addToFsEvents(t,e,s,r){if(this.fsw.closed){return}const n=this.fsw.options;const o=typeof e===S?e:x;const a=this.fsw._getWatchHelpers(t);try{const e=await P[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,e)){throw null}if(e.isDirectory()){if(!a.globFilter)this.emitAdd(o(t),e,o,n,s);if(r&&r>n.depth)return;this.fsw._readdirp(a.watchPath,{fileFilter:t=>a.filterPath(t),directoryFilter:t=>a.filterDir(t),...Depth(n.depth-(r||0))}).on(h,(t=>{if(this.fsw.closed){return}if(t.stats.isDirectory()&&!a.filterPath(t))return;const e=i.join(a.watchPath,t.path);const{fullPath:r}=t;if(a.followSymlinks&&t.stats.isSymbolicLink()){const t=n.depth===undefined?undefined:calcDepth(e,i.resolve(a.watchPath))+1;this._handleFsEventsSymlink(e,r,o,t)}else{this.emitAdd(e,t.stats,o,n,s)}})).on(f,C).on(p,(()=>{this.fsw._emitReady()}))}else{this.emitAdd(a.watchPath,e,o,n,s);this.fsw._emitReady()}}catch(t){if(!t||this.fsw._handleError(t)){this.fsw._emitReady();this.fsw._emitReady()}}if(n.persistent&&s!==true){if(typeof e===S){this.initWatch(undefined,t,a,o)}else{let e;try{e=await O(a.watchPath)}catch(t){}this.initWatch(e,t,a,o)}}}}t.exports=FsEventsHandler;t.exports.canUse=canUse},254:(t,e,s)=>{"use strict";const r=s(147);const i=s(17);const{promisify:n}=s(837);const o=s(41);const{isWindows:a,isLinux:u,EMPTY_FN:l,EMPTY_STR:c,KEY_LISTENERS:f,KEY_ERR:h,KEY_RAW:p,HANDLER_KEYS:d,EV_CHANGE:_,EV_ADD:E,EV_ADD_DIR:g,EV_ERROR:m,STR_DATA:y,STR_END:R,BRACE_START:w,STAR:A}=s(240);const b="watch";const v=n(r.open);const S=n(r.stat);const C=n(r.lstat);const x=n(r.close);const T=n(r.realpath);const H={lstat:C,stat:S};const foreach=(t,e)=>{if(t instanceof Set){t.forEach(e)}else{e(t)}};const addAndConvert=(t,e,s)=>{let r=t[e];if(!(r instanceof Set)){t[e]=r=new Set([r])}r.add(s)};const clearItem=t=>e=>{const s=t[e];if(s instanceof Set){s.clear()}else{delete t[e]}};const delFromSet=(t,e,s)=>{const r=t[e];if(r instanceof Set){r.delete(s)}else if(r===s){delete t[e]}};const isEmptySet=t=>t instanceof Set?t.size===0:!t;const O=new Map;function createFsWatchInstance(t,e,s,n,o){const handleEvent=(e,r)=>{s(t);o(e,r,{watchedPath:t});if(r&&t!==r){fsWatchBroadcast(i.resolve(t,r),f,i.join(t,r))}};try{return r.watch(t,e,handleEvent)}catch(t){n(t)}}const fsWatchBroadcast=(t,e,s,r,i)=>{const n=O.get(t);if(!n)return;foreach(n[e],(t=>{t(s,r,i)}))};const setFsWatchListener=(t,e,s,r)=>{const{listener:i,errHandler:n,rawEmitter:o}=r;let u=O.get(e);let l;if(!s.persistent){l=createFsWatchInstance(t,s,i,n,o);return l.close.bind(l)}if(u){addAndConvert(u,f,i);addAndConvert(u,h,n);addAndConvert(u,p,o)}else{l=createFsWatchInstance(t,s,fsWatchBroadcast.bind(null,e,f),n,fsWatchBroadcast.bind(null,e,p));if(!l)return;l.on(m,(async s=>{const r=fsWatchBroadcast.bind(null,e,h);u.watcherUnusable=true;if(a&&s.code==="EPERM"){try{const e=await v(t,"r");await x(e);r(s)}catch(t){}}else{r(s)}}));u={listeners:i,errHandlers:n,rawEmitters:o,watcher:l};O.set(e,u)}return()=>{delFromSet(u,f,i);delFromSet(u,h,n);delFromSet(u,p,o);if(isEmptySet(u.listeners)){u.watcher.close();O.delete(e);d.forEach(clearItem(u));u.watcher=undefined;Object.freeze(u)}}};const P=new Map;const setFsWatchFileListener=(t,e,s,i)=>{const{listener:n,rawEmitter:o}=i;let a=P.get(e);let u=new Set;let l=new Set;const c=a&&a.options;if(c&&(c.persistent<s.persistent||c.interval>s.interval)){u=a.listeners;l=a.rawEmitters;r.unwatchFile(e);a=undefined}if(a){addAndConvert(a,f,n);addAndConvert(a,p,o)}else{a={listeners:n,rawEmitters:o,options:s,watcher:r.watchFile(e,s,((s,r)=>{foreach(a.rawEmitters,(t=>{t(_,e,{curr:s,prev:r})}));const i=s.mtimeMs;if(s.size!==r.size||i>r.mtimeMs||i===0){foreach(a.listeners,(e=>e(t,s)))}}))};P.set(e,a)}return()=>{delFromSet(a,f,n);delFromSet(a,p,o);if(isEmptySet(a.listeners)){P.delete(e);r.unwatchFile(e);a.options=a.watcher=undefined;Object.freeze(a)}}};class NodeFsHandler{constructor(t){this.fsw=t;this._boundHandleError=e=>t._handleError(e)}_watchWithNodeFs(t,e){const s=this.fsw.options;const r=i.dirname(t);const n=i.basename(t);const a=this.fsw._getWatchedDir(r);a.add(n);const u=i.resolve(t);const c={persistent:s.persistent};if(!e)e=l;let f;if(s.usePolling){c.interval=s.enableBinaryInterval&&o(n)?s.binaryInterval:s.interval;f=setFsWatchFileListener(t,u,c,{listener:e,rawEmitter:this.fsw._emitRaw})}else{f=setFsWatchListener(t,u,c,{listener:e,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw})}return f}_handleFile(t,e,s){if(this.fsw.closed){return}const r=i.dirname(t);const n=i.basename(t);const o=this.fsw._getWatchedDir(r);let a=e;if(o.has(n))return;const listener=async(e,s)=>{if(!this.fsw._throttle(b,t,5))return;if(!s||s.mtimeMs===0){try{const s=await S(t);if(this.fsw.closed)return;const r=s.atimeMs;const i=s.mtimeMs;if(!r||r<=i||i!==a.mtimeMs){this.fsw._emit(_,t,s)}if(u&&a.ino!==s.ino){this.fsw._closeFile(e);a=s;this.fsw._addPathCloser(e,this._watchWithNodeFs(t,listener))}else{a=s}}catch(t){this.fsw._remove(r,n)}}else if(o.has(n)){const e=s.atimeMs;const r=s.mtimeMs;if(!e||e<=r||r!==a.mtimeMs){this.fsw._emit(_,t,s)}a=s}};const l=this._watchWithNodeFs(t,listener);if(!(s&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(t)){if(!this.fsw._throttle(E,t,0))return;this.fsw._emit(E,t,e)}return l}async _handleSymlink(t,e,s,r){if(this.fsw.closed){return}const i=t.fullPath;const n=this.fsw._getWatchedDir(e);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let e;try{e=await T(s)}catch(t){this.fsw._emitReady();return true}if(this.fsw.closed)return;if(n.has(r)){if(this.fsw._symlinkPaths.get(i)!==e){this.fsw._symlinkPaths.set(i,e);this.fsw._emit(_,s,t.stats)}}else{n.add(r);this.fsw._symlinkPaths.set(i,e);this.fsw._emit(E,s,t.stats)}this.fsw._emitReady();return true}if(this.fsw._symlinkPaths.has(i)){return true}this.fsw._symlinkPaths.set(i,true)}_handleRead(t,e,s,r,n,o,a){t=i.join(t,c);if(!s.hasGlob){a=this.fsw._throttle("readdir",t,1e3);if(!a)return}const u=this.fsw._getWatchedDir(s.path);const l=new Set;let f=this.fsw._readdirp(t,{fileFilter:t=>s.filterPath(t),directoryFilter:t=>s.filterDir(t),depth:0}).on(y,(async a=>{if(this.fsw.closed){f=undefined;return}const c=a.path;let h=i.join(t,c);l.add(c);if(a.stats.isSymbolicLink()&&await this._handleSymlink(a,t,h,c)){return}if(this.fsw.closed){f=undefined;return}if(c===r||!r&&!u.has(c)){this.fsw._incrReadyCount();h=i.join(n,i.relative(n,h));this._addToNodeFs(h,e,s,o+1)}})).on(m,this._boundHandleError);return new Promise((e=>f.once(R,(()=>{if(this.fsw.closed){f=undefined;return}const c=a?a.clear():false;e();u.getChildren().filter((e=>e!==t&&!l.has(e)&&(!s.hasGlob||s.filterPath({fullPath:i.resolve(t,e)})))).forEach((e=>{this.fsw._remove(t,e)}));f=undefined;if(c)this._handleRead(t,false,s,r,n,o,a)}))))}async _handleDir(t,e,s,r,n,o,a){const u=this.fsw._getWatchedDir(i.dirname(t));const l=u.has(i.basename(t));if(!(s&&this.fsw.options.ignoreInitial)&&!n&&!l){if(!o.hasGlob||o.globFilter(t))this.fsw._emit(g,t,e)}u.add(i.basename(t));this.fsw._getWatchedDir(t);let c;let f;const h=this.fsw.options.depth;if((h==null||r<=h)&&!this.fsw._symlinkPaths.has(a)){if(!n){await this._handleRead(t,s,o,n,t,r,c);if(this.fsw.closed)return}f=this._watchWithNodeFs(t,((e,s)=>{if(s&&s.mtimeMs===0)return;this._handleRead(e,false,o,n,t,r,c)}))}return f}async _addToNodeFs(t,e,s,r,n){const o=this.fsw._emitReady;if(this.fsw._isIgnored(t)||this.fsw.closed){o();return false}const a=this.fsw._getWatchHelpers(t,r);if(!a.hasGlob&&s){a.hasGlob=s.hasGlob;a.globFilter=s.globFilter;a.filterPath=t=>s.filterPath(t);a.filterDir=t=>s.filterDir(t)}try{const s=await H[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,s)){o();return false}const u=this.fsw.options.followSymlinks&&!t.includes(A)&&!t.includes(w);let l;if(s.isDirectory()){const o=i.resolve(t);const c=u?await T(t):t;if(this.fsw.closed)return;l=await this._handleDir(a.watchPath,s,e,r,n,a,c);if(this.fsw.closed)return;if(o!==c&&c!==undefined){this.fsw._symlinkPaths.set(o,c)}}else if(s.isSymbolicLink()){const n=u?await T(t):t;if(this.fsw.closed)return;const o=i.dirname(a.watchPath);this.fsw._getWatchedDir(o).add(a.watchPath);this.fsw._emit(E,a.watchPath,s);l=await this._handleDir(o,s,e,r,t,a,n);if(this.fsw.closed)return;if(n!==undefined){this.fsw._symlinkPaths.set(i.resolve(t),n)}}else{l=this._handleFile(a.watchPath,s,e)}o();this.fsw._addPathCloser(t,l);return false}catch(e){if(this.fsw._handleError(e)){o();return t}}}}t.exports=NodeFsHandler},442:(t,e,s)=>{"use strict";
|
|
2
|
-
|
|
1
|
+
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
+
(()=>{
|
|
3
|
+
var t = {
|
|
4
|
+
372: (t, e, s)=>{
|
|
5
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(e, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
const r = s(700);
|
|
10
|
+
const i = s(498);
|
|
11
|
+
const n = "!";
|
|
12
|
+
const o = {
|
|
13
|
+
returnIndex: false
|
|
14
|
+
};
|
|
15
|
+
const arrify = (t)=>Array.isArray(t) ? t : [
|
|
16
|
+
t
|
|
17
|
+
];
|
|
18
|
+
const createPattern = (t, e)=>{
|
|
19
|
+
if ("function" == typeof t) return t;
|
|
20
|
+
if ("string" == typeof t) {
|
|
21
|
+
const s = r(t, e);
|
|
22
|
+
return (e)=>t === e || s(e);
|
|
23
|
+
}
|
|
24
|
+
if (t instanceof RegExp) return (e)=>t.test(e);
|
|
25
|
+
return (t)=>false;
|
|
26
|
+
};
|
|
27
|
+
const matchPatterns = (t, e, s, r)=>{
|
|
28
|
+
const n = Array.isArray(s);
|
|
29
|
+
const o = n ? s[0] : s;
|
|
30
|
+
if (!n && "string" != typeof o) throw new TypeError("anymatch: second argument must be a string: got " + Object.prototype.toString.call(o));
|
|
31
|
+
const a = i(o);
|
|
32
|
+
for(let t = 0; t < e.length; t++){
|
|
33
|
+
const s = e[t];
|
|
34
|
+
if (s(a)) return r ? -1 : false;
|
|
35
|
+
}
|
|
36
|
+
const u = n && [
|
|
37
|
+
a
|
|
38
|
+
].concat(s.slice(1));
|
|
39
|
+
for(let e = 0; e < t.length; e++){
|
|
40
|
+
const s = t[e];
|
|
41
|
+
if (n ? s(...u) : s(a)) return r ? e : true;
|
|
42
|
+
}
|
|
43
|
+
return r ? -1 : false;
|
|
44
|
+
};
|
|
45
|
+
const anymatch = (t, e, s = o)=>{
|
|
46
|
+
if (null == t) throw new TypeError("anymatch: specify first argument");
|
|
47
|
+
const i = "boolean" == typeof s ? {
|
|
48
|
+
returnIndex: s
|
|
49
|
+
} : s;
|
|
50
|
+
const a = i.returnIndex || false;
|
|
51
|
+
const u = arrify(t);
|
|
52
|
+
const l = u.filter((t)=>"string" == typeof t && t.charAt(0) === n).map((t)=>t.slice(1)).map((t)=>r(t, i));
|
|
53
|
+
const c = u.filter((t)=>"string" != typeof t || "string" == typeof t && t.charAt(0) !== n).map((t)=>createPattern(t, i));
|
|
54
|
+
if (null == e) return (t, e = false)=>{
|
|
55
|
+
const s = "boolean" == typeof e ? e : false;
|
|
56
|
+
return matchPatterns(c, l, t, s);
|
|
57
|
+
};
|
|
58
|
+
return matchPatterns(c, l, e, a);
|
|
59
|
+
};
|
|
60
|
+
anymatch.default = anymatch;
|
|
61
|
+
t.exports = anymatch;
|
|
62
|
+
},
|
|
63
|
+
828: (t, e, s)=>{
|
|
64
|
+
t.exports = s(600);
|
|
65
|
+
},
|
|
66
|
+
570: (t, e, s)=>{
|
|
67
|
+
"use strict";
|
|
68
|
+
const r = s(625);
|
|
69
|
+
const i = s(666);
|
|
70
|
+
const n = s(183);
|
|
71
|
+
const o = s(467);
|
|
72
|
+
const braces = (t, e = {})=>{
|
|
73
|
+
let s = [];
|
|
74
|
+
if (Array.isArray(t)) for (let r of t){
|
|
75
|
+
let t = braces.create(r, e);
|
|
76
|
+
if (Array.isArray(t)) s.push(...t);
|
|
77
|
+
else s.push(t);
|
|
78
|
+
}
|
|
79
|
+
else s = [].concat(braces.create(t, e));
|
|
80
|
+
if (e && true === e.expand && true === e.nodupes) s = [
|
|
81
|
+
...new Set(s)
|
|
82
|
+
];
|
|
83
|
+
return s;
|
|
84
|
+
};
|
|
85
|
+
braces.parse = (t, e = {})=>o(t, e);
|
|
86
|
+
braces.stringify = (t, e = {})=>{
|
|
87
|
+
if ("string" == typeof t) return r(braces.parse(t, e), e);
|
|
88
|
+
return r(t, e);
|
|
89
|
+
};
|
|
90
|
+
braces.compile = (t, e = {})=>{
|
|
91
|
+
if ("string" == typeof t) t = braces.parse(t, e);
|
|
92
|
+
return i(t, e);
|
|
93
|
+
};
|
|
94
|
+
braces.expand = (t, e = {})=>{
|
|
95
|
+
if ("string" == typeof t) t = braces.parse(t, e);
|
|
96
|
+
let s = n(t, e);
|
|
97
|
+
if (true === e.noempty) s = s.filter(Boolean);
|
|
98
|
+
if (true === e.nodupes) s = [
|
|
99
|
+
...new Set(s)
|
|
100
|
+
];
|
|
101
|
+
return s;
|
|
102
|
+
};
|
|
103
|
+
braces.create = (t, e = {})=>{
|
|
104
|
+
if ("" === t || t.length < 3) return [
|
|
105
|
+
t
|
|
106
|
+
];
|
|
107
|
+
return true !== e.expand ? braces.compile(t, e) : braces.expand(t, e);
|
|
108
|
+
};
|
|
109
|
+
t.exports = braces;
|
|
110
|
+
},
|
|
111
|
+
666: (t, e, s)=>{
|
|
112
|
+
"use strict";
|
|
113
|
+
const r = s(442);
|
|
114
|
+
const i = s(456);
|
|
115
|
+
const compile = (t, e = {})=>{
|
|
116
|
+
let walk = (t, s = {})=>{
|
|
117
|
+
let n = i.isInvalidBrace(s);
|
|
118
|
+
let o = true === t.invalid && true === e.escapeInvalid;
|
|
119
|
+
let a = true === n || true === o;
|
|
120
|
+
let u = true === e.escapeInvalid ? "\\" : "";
|
|
121
|
+
let l = "";
|
|
122
|
+
if (true === t.isOpen) return u + t.value;
|
|
123
|
+
if (true === t.isClose) return u + t.value;
|
|
124
|
+
if ("open" === t.type) return a ? u + t.value : "(";
|
|
125
|
+
if ("close" === t.type) return a ? u + t.value : ")";
|
|
126
|
+
if ("comma" === t.type) return "comma" === t.prev.type ? "" : a ? t.value : "|";
|
|
127
|
+
if (t.value) return t.value;
|
|
128
|
+
if (t.nodes && t.ranges > 0) {
|
|
129
|
+
let s = i.reduce(t.nodes);
|
|
130
|
+
let n = r(...s, {
|
|
131
|
+
...e,
|
|
132
|
+
wrap: false,
|
|
133
|
+
toRegex: true
|
|
134
|
+
});
|
|
135
|
+
if (0 !== n.length) return s.length > 1 && n.length > 1 ? `(${n})` : n;
|
|
136
|
+
}
|
|
137
|
+
if (t.nodes) for (let e of t.nodes)l += walk(e, t);
|
|
138
|
+
return l;
|
|
139
|
+
};
|
|
140
|
+
return walk(t);
|
|
141
|
+
};
|
|
142
|
+
t.exports = compile;
|
|
143
|
+
},
|
|
144
|
+
487: (t)=>{
|
|
145
|
+
"use strict";
|
|
146
|
+
t.exports = {
|
|
147
|
+
MAX_LENGTH: 65536,
|
|
148
|
+
CHAR_0: "0",
|
|
149
|
+
CHAR_9: "9",
|
|
150
|
+
CHAR_UPPERCASE_A: "A",
|
|
151
|
+
CHAR_LOWERCASE_A: "a",
|
|
152
|
+
CHAR_UPPERCASE_Z: "Z",
|
|
153
|
+
CHAR_LOWERCASE_Z: "z",
|
|
154
|
+
CHAR_LEFT_PARENTHESES: "(",
|
|
155
|
+
CHAR_RIGHT_PARENTHESES: ")",
|
|
156
|
+
CHAR_ASTERISK: "*",
|
|
157
|
+
CHAR_AMPERSAND: "&",
|
|
158
|
+
CHAR_AT: "@",
|
|
159
|
+
CHAR_BACKSLASH: "\\",
|
|
160
|
+
CHAR_BACKTICK: "`",
|
|
161
|
+
CHAR_CARRIAGE_RETURN: "\r",
|
|
162
|
+
CHAR_CIRCUMFLEX_ACCENT: "^",
|
|
163
|
+
CHAR_COLON: ":",
|
|
164
|
+
CHAR_COMMA: ",",
|
|
165
|
+
CHAR_DOLLAR: "$",
|
|
166
|
+
CHAR_DOT: ".",
|
|
167
|
+
CHAR_DOUBLE_QUOTE: '"',
|
|
168
|
+
CHAR_EQUAL: "=",
|
|
169
|
+
CHAR_EXCLAMATION_MARK: "!",
|
|
170
|
+
CHAR_FORM_FEED: "\f",
|
|
171
|
+
CHAR_FORWARD_SLASH: "/",
|
|
172
|
+
CHAR_HASH: "#",
|
|
173
|
+
CHAR_HYPHEN_MINUS: "-",
|
|
174
|
+
CHAR_LEFT_ANGLE_BRACKET: "<",
|
|
175
|
+
CHAR_LEFT_CURLY_BRACE: "{",
|
|
176
|
+
CHAR_LEFT_SQUARE_BRACKET: "[",
|
|
177
|
+
CHAR_LINE_FEED: "\n",
|
|
178
|
+
CHAR_NO_BREAK_SPACE: " ",
|
|
179
|
+
CHAR_PERCENT: "%",
|
|
180
|
+
CHAR_PLUS: "+",
|
|
181
|
+
CHAR_QUESTION_MARK: "?",
|
|
182
|
+
CHAR_RIGHT_ANGLE_BRACKET: ">",
|
|
183
|
+
CHAR_RIGHT_CURLY_BRACE: "}",
|
|
184
|
+
CHAR_RIGHT_SQUARE_BRACKET: "]",
|
|
185
|
+
CHAR_SEMICOLON: ";",
|
|
186
|
+
CHAR_SINGLE_QUOTE: "'",
|
|
187
|
+
CHAR_SPACE: " ",
|
|
188
|
+
CHAR_TAB: "\t",
|
|
189
|
+
CHAR_UNDERSCORE: "_",
|
|
190
|
+
CHAR_VERTICAL_LINE: "|",
|
|
191
|
+
CHAR_ZERO_WIDTH_NOBREAK_SPACE: "\ufeff"
|
|
192
|
+
};
|
|
193
|
+
},
|
|
194
|
+
183: (t, e, s)=>{
|
|
195
|
+
"use strict";
|
|
196
|
+
const r = s(442);
|
|
197
|
+
const i = s(625);
|
|
198
|
+
const n = s(456);
|
|
199
|
+
const append = (t = "", e = "", s = false)=>{
|
|
200
|
+
let r = [];
|
|
201
|
+
t = [].concat(t);
|
|
202
|
+
e = [].concat(e);
|
|
203
|
+
if (!e.length) return t;
|
|
204
|
+
if (!t.length) return s ? n.flatten(e).map((t)=>`{${t}}`) : e;
|
|
205
|
+
for (let i of t)if (Array.isArray(i)) for (let t of i)r.push(append(t, e, s));
|
|
206
|
+
else for (let t of e){
|
|
207
|
+
if (true === s && "string" == typeof t) t = `{${t}}`;
|
|
208
|
+
r.push(Array.isArray(t) ? append(i, t, s) : i + t);
|
|
209
|
+
}
|
|
210
|
+
return n.flatten(r);
|
|
211
|
+
};
|
|
212
|
+
const expand = (t, e = {})=>{
|
|
213
|
+
let s = void 0 === e.rangeLimit ? 1e3 : e.rangeLimit;
|
|
214
|
+
let walk = (t, o = {})=>{
|
|
215
|
+
t.queue = [];
|
|
216
|
+
let a = o;
|
|
217
|
+
let u = o.queue;
|
|
218
|
+
while("brace" !== a.type && "root" !== a.type && a.parent){
|
|
219
|
+
a = a.parent;
|
|
220
|
+
u = a.queue;
|
|
221
|
+
}
|
|
222
|
+
if (t.invalid || t.dollar) return void u.push(append(u.pop(), i(t, e)));
|
|
223
|
+
if ("brace" === t.type && true !== t.invalid && 2 === t.nodes.length) return void u.push(append(u.pop(), [
|
|
224
|
+
"{}"
|
|
225
|
+
]));
|
|
226
|
+
if (t.nodes && t.ranges > 0) {
|
|
227
|
+
let o = n.reduce(t.nodes);
|
|
228
|
+
if (n.exceedsLimit(...o, e.step, s)) throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
|
|
229
|
+
let a = r(...o, e);
|
|
230
|
+
if (0 === a.length) a = i(t, e);
|
|
231
|
+
u.push(append(u.pop(), a));
|
|
232
|
+
t.nodes = [];
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
let l = n.encloseBrace(t);
|
|
236
|
+
let c = t.queue;
|
|
237
|
+
let f = t;
|
|
238
|
+
while("brace" !== f.type && "root" !== f.type && f.parent){
|
|
239
|
+
f = f.parent;
|
|
240
|
+
c = f.queue;
|
|
241
|
+
}
|
|
242
|
+
for(let e = 0; e < t.nodes.length; e++){
|
|
243
|
+
let s = t.nodes[e];
|
|
244
|
+
if ("comma" === s.type && "brace" === t.type) {
|
|
245
|
+
if (1 === e) c.push("");
|
|
246
|
+
c.push("");
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
if ("close" === s.type) {
|
|
250
|
+
u.push(append(u.pop(), c, l));
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
253
|
+
if (s.value && "open" !== s.type) {
|
|
254
|
+
c.push(append(c.pop(), s.value));
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
if (s.nodes) walk(s, t);
|
|
258
|
+
}
|
|
259
|
+
return c;
|
|
260
|
+
};
|
|
261
|
+
return n.flatten(walk(t));
|
|
262
|
+
};
|
|
263
|
+
t.exports = expand;
|
|
264
|
+
},
|
|
265
|
+
467: (t, e, s)=>{
|
|
266
|
+
"use strict";
|
|
267
|
+
const r = s(625);
|
|
268
|
+
const { MAX_LENGTH: i, CHAR_BACKSLASH: n, CHAR_BACKTICK: o, CHAR_COMMA: a, CHAR_DOT: u, CHAR_LEFT_PARENTHESES: l, CHAR_RIGHT_PARENTHESES: c, CHAR_LEFT_CURLY_BRACE: f, CHAR_RIGHT_CURLY_BRACE: h, CHAR_LEFT_SQUARE_BRACKET: p, CHAR_RIGHT_SQUARE_BRACKET: d, CHAR_DOUBLE_QUOTE: _, CHAR_SINGLE_QUOTE: E, CHAR_NO_BREAK_SPACE: g, CHAR_ZERO_WIDTH_NOBREAK_SPACE: m } = s(487);
|
|
269
|
+
const parse = (t, e = {})=>{
|
|
270
|
+
if ("string" != typeof t) throw new TypeError("Expected a string");
|
|
271
|
+
let s = e || {};
|
|
272
|
+
let y = "number" == typeof s.maxLength ? Math.min(i, s.maxLength) : i;
|
|
273
|
+
if (t.length > y) throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${y})`);
|
|
274
|
+
let R = {
|
|
275
|
+
type: "root",
|
|
276
|
+
input: t,
|
|
277
|
+
nodes: []
|
|
278
|
+
};
|
|
279
|
+
let w = [
|
|
280
|
+
R
|
|
281
|
+
];
|
|
282
|
+
let A = R;
|
|
283
|
+
let b = R;
|
|
284
|
+
let v = 0;
|
|
285
|
+
let S = t.length;
|
|
286
|
+
let C = 0;
|
|
287
|
+
let x = 0;
|
|
288
|
+
let T;
|
|
289
|
+
const advance = ()=>t[C++];
|
|
290
|
+
const push = (t)=>{
|
|
291
|
+
if ("text" === t.type && "dot" === b.type) b.type = "text";
|
|
292
|
+
if (b && "text" === b.type && "text" === t.type) {
|
|
293
|
+
b.value += t.value;
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
A.nodes.push(t);
|
|
297
|
+
t.parent = A;
|
|
298
|
+
t.prev = b;
|
|
299
|
+
b = t;
|
|
300
|
+
return t;
|
|
301
|
+
};
|
|
302
|
+
push({
|
|
303
|
+
type: "bos"
|
|
304
|
+
});
|
|
305
|
+
while(C < S){
|
|
306
|
+
A = w[w.length - 1];
|
|
307
|
+
T = advance();
|
|
308
|
+
if (T === m || T === g) continue;
|
|
309
|
+
if (T === n) {
|
|
310
|
+
push({
|
|
311
|
+
type: "text",
|
|
312
|
+
value: (e.keepEscaping ? T : "") + advance()
|
|
313
|
+
});
|
|
314
|
+
continue;
|
|
315
|
+
}
|
|
316
|
+
if (T === d) {
|
|
317
|
+
push({
|
|
318
|
+
type: "text",
|
|
319
|
+
value: "\\" + T
|
|
320
|
+
});
|
|
321
|
+
continue;
|
|
322
|
+
}
|
|
323
|
+
if (T === p) {
|
|
324
|
+
v++;
|
|
325
|
+
let e;
|
|
326
|
+
while(C < S && (e = advance())){
|
|
327
|
+
T += e;
|
|
328
|
+
if (e === p) {
|
|
329
|
+
v++;
|
|
330
|
+
continue;
|
|
331
|
+
}
|
|
332
|
+
if (e === n) {
|
|
333
|
+
T += advance();
|
|
334
|
+
continue;
|
|
335
|
+
}
|
|
336
|
+
if (e === d) {
|
|
337
|
+
v--;
|
|
338
|
+
if (0 === v) break;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
push({
|
|
342
|
+
type: "text",
|
|
343
|
+
value: T
|
|
344
|
+
});
|
|
345
|
+
continue;
|
|
346
|
+
}
|
|
347
|
+
if (T === l) {
|
|
348
|
+
A = push({
|
|
349
|
+
type: "paren",
|
|
350
|
+
nodes: []
|
|
351
|
+
});
|
|
352
|
+
w.push(A);
|
|
353
|
+
push({
|
|
354
|
+
type: "text",
|
|
355
|
+
value: T
|
|
356
|
+
});
|
|
357
|
+
continue;
|
|
358
|
+
}
|
|
359
|
+
if (T === c) {
|
|
360
|
+
if ("paren" !== A.type) {
|
|
361
|
+
push({
|
|
362
|
+
type: "text",
|
|
363
|
+
value: T
|
|
364
|
+
});
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
A = w.pop();
|
|
368
|
+
push({
|
|
369
|
+
type: "text",
|
|
370
|
+
value: T
|
|
371
|
+
});
|
|
372
|
+
A = w[w.length - 1];
|
|
373
|
+
continue;
|
|
374
|
+
}
|
|
375
|
+
if (T === _ || T === E || T === o) {
|
|
376
|
+
let t = T;
|
|
377
|
+
let s;
|
|
378
|
+
if (true !== e.keepQuotes) T = "";
|
|
379
|
+
while(C < S && (s = advance())){
|
|
380
|
+
if (s === n) {
|
|
381
|
+
T += s + advance();
|
|
382
|
+
continue;
|
|
383
|
+
}
|
|
384
|
+
if (s === t) {
|
|
385
|
+
if (true === e.keepQuotes) T += s;
|
|
386
|
+
break;
|
|
387
|
+
}
|
|
388
|
+
T += s;
|
|
389
|
+
}
|
|
390
|
+
push({
|
|
391
|
+
type: "text",
|
|
392
|
+
value: T
|
|
393
|
+
});
|
|
394
|
+
continue;
|
|
395
|
+
}
|
|
396
|
+
if (T === f) {
|
|
397
|
+
x++;
|
|
398
|
+
let t = b.value && "$" === b.value.slice(-1) || true === A.dollar;
|
|
399
|
+
let e = {
|
|
400
|
+
type: "brace",
|
|
401
|
+
open: true,
|
|
402
|
+
close: false,
|
|
403
|
+
dollar: t,
|
|
404
|
+
depth: x,
|
|
405
|
+
commas: 0,
|
|
406
|
+
ranges: 0,
|
|
407
|
+
nodes: []
|
|
408
|
+
};
|
|
409
|
+
A = push(e);
|
|
410
|
+
w.push(A);
|
|
411
|
+
push({
|
|
412
|
+
type: "open",
|
|
413
|
+
value: T
|
|
414
|
+
});
|
|
415
|
+
continue;
|
|
416
|
+
}
|
|
417
|
+
if (T === h) {
|
|
418
|
+
if ("brace" !== A.type) {
|
|
419
|
+
push({
|
|
420
|
+
type: "text",
|
|
421
|
+
value: T
|
|
422
|
+
});
|
|
423
|
+
continue;
|
|
424
|
+
}
|
|
425
|
+
let t = "close";
|
|
426
|
+
A = w.pop();
|
|
427
|
+
A.close = true;
|
|
428
|
+
push({
|
|
429
|
+
type: t,
|
|
430
|
+
value: T
|
|
431
|
+
});
|
|
432
|
+
x--;
|
|
433
|
+
A = w[w.length - 1];
|
|
434
|
+
continue;
|
|
435
|
+
}
|
|
436
|
+
if (T === a && x > 0) {
|
|
437
|
+
if (A.ranges > 0) {
|
|
438
|
+
A.ranges = 0;
|
|
439
|
+
let t = A.nodes.shift();
|
|
440
|
+
A.nodes = [
|
|
441
|
+
t,
|
|
442
|
+
{
|
|
443
|
+
type: "text",
|
|
444
|
+
value: r(A)
|
|
445
|
+
}
|
|
446
|
+
];
|
|
447
|
+
}
|
|
448
|
+
push({
|
|
449
|
+
type: "comma",
|
|
450
|
+
value: T
|
|
451
|
+
});
|
|
452
|
+
A.commas++;
|
|
453
|
+
continue;
|
|
454
|
+
}
|
|
455
|
+
if (T === u && x > 0 && 0 === A.commas) {
|
|
456
|
+
let t = A.nodes;
|
|
457
|
+
if (0 === x || 0 === t.length) {
|
|
458
|
+
push({
|
|
459
|
+
type: "text",
|
|
460
|
+
value: T
|
|
461
|
+
});
|
|
462
|
+
continue;
|
|
463
|
+
}
|
|
464
|
+
if ("dot" === b.type) {
|
|
465
|
+
A.range = [];
|
|
466
|
+
b.value += T;
|
|
467
|
+
b.type = "range";
|
|
468
|
+
if (3 !== A.nodes.length && 5 !== A.nodes.length) {
|
|
469
|
+
A.invalid = true;
|
|
470
|
+
A.ranges = 0;
|
|
471
|
+
b.type = "text";
|
|
472
|
+
continue;
|
|
473
|
+
}
|
|
474
|
+
A.ranges++;
|
|
475
|
+
A.args = [];
|
|
476
|
+
continue;
|
|
477
|
+
}
|
|
478
|
+
if ("range" === b.type) {
|
|
479
|
+
t.pop();
|
|
480
|
+
let e = t[t.length - 1];
|
|
481
|
+
e.value += b.value + T;
|
|
482
|
+
b = e;
|
|
483
|
+
A.ranges--;
|
|
484
|
+
continue;
|
|
485
|
+
}
|
|
486
|
+
push({
|
|
487
|
+
type: "dot",
|
|
488
|
+
value: T
|
|
489
|
+
});
|
|
490
|
+
continue;
|
|
491
|
+
}
|
|
492
|
+
push({
|
|
493
|
+
type: "text",
|
|
494
|
+
value: T
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
do {
|
|
498
|
+
A = w.pop();
|
|
499
|
+
if ("root" !== A.type) {
|
|
500
|
+
A.nodes.forEach((t)=>{
|
|
501
|
+
if (!t.nodes) {
|
|
502
|
+
if ("open" === t.type) t.isOpen = true;
|
|
503
|
+
if ("close" === t.type) t.isClose = true;
|
|
504
|
+
if (!t.nodes) t.type = "text";
|
|
505
|
+
t.invalid = true;
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
let t = w[w.length - 1];
|
|
509
|
+
let e = t.nodes.indexOf(A);
|
|
510
|
+
t.nodes.splice(e, 1, ...A.nodes);
|
|
511
|
+
}
|
|
512
|
+
}while (w.length > 0);
|
|
513
|
+
push({
|
|
514
|
+
type: "eos"
|
|
515
|
+
});
|
|
516
|
+
return R;
|
|
517
|
+
};
|
|
518
|
+
t.exports = parse;
|
|
519
|
+
},
|
|
520
|
+
625: (t, e, s)=>{
|
|
521
|
+
"use strict";
|
|
522
|
+
const r = s(456);
|
|
523
|
+
t.exports = (t, e = {})=>{
|
|
524
|
+
let stringify = (t, s = {})=>{
|
|
525
|
+
let i = e.escapeInvalid && r.isInvalidBrace(s);
|
|
526
|
+
let n = true === t.invalid && true === e.escapeInvalid;
|
|
527
|
+
let o = "";
|
|
528
|
+
if (t.value) {
|
|
529
|
+
if ((i || n) && r.isOpenOrClose(t)) return "\\" + t.value;
|
|
530
|
+
return t.value;
|
|
531
|
+
}
|
|
532
|
+
if (t.value) return t.value;
|
|
533
|
+
if (t.nodes) for (let e of t.nodes)o += stringify(e);
|
|
534
|
+
return o;
|
|
535
|
+
};
|
|
536
|
+
return stringify(t);
|
|
537
|
+
};
|
|
538
|
+
},
|
|
539
|
+
456: (t, e)=>{
|
|
540
|
+
"use strict";
|
|
541
|
+
e.isInteger = (t)=>{
|
|
542
|
+
if ("number" == typeof t) return Number.isInteger(t);
|
|
543
|
+
if ("string" == typeof t && "" !== t.trim()) return Number.isInteger(Number(t));
|
|
544
|
+
return false;
|
|
545
|
+
};
|
|
546
|
+
e.find = (t, e)=>t.nodes.find((t)=>t.type === e);
|
|
547
|
+
e.exceedsLimit = (t, s, r = 1, i)=>{
|
|
548
|
+
if (false === i) return false;
|
|
549
|
+
if (!e.isInteger(t) || !e.isInteger(s)) return false;
|
|
550
|
+
return (Number(s) - Number(t)) / Number(r) >= i;
|
|
551
|
+
};
|
|
552
|
+
e.escapeNode = (t, e = 0, s)=>{
|
|
553
|
+
let r = t.nodes[e];
|
|
554
|
+
if (!r) return;
|
|
555
|
+
if (s && r.type === s || "open" === r.type || "close" === r.type) {
|
|
556
|
+
if (true !== r.escaped) {
|
|
557
|
+
r.value = "\\" + r.value;
|
|
558
|
+
r.escaped = true;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
e.encloseBrace = (t)=>{
|
|
563
|
+
if ("brace" !== t.type) return false;
|
|
564
|
+
if (t.commas >> 0 + t.ranges === 0) {
|
|
565
|
+
t.invalid = true;
|
|
566
|
+
return true;
|
|
567
|
+
}
|
|
568
|
+
return false;
|
|
569
|
+
};
|
|
570
|
+
e.isInvalidBrace = (t)=>{
|
|
571
|
+
if ("brace" !== t.type) return false;
|
|
572
|
+
if (true === t.invalid || t.dollar) return true;
|
|
573
|
+
if (t.commas >> 0 + t.ranges === 0) {
|
|
574
|
+
t.invalid = true;
|
|
575
|
+
return true;
|
|
576
|
+
}
|
|
577
|
+
if (true !== t.open || true !== t.close) {
|
|
578
|
+
t.invalid = true;
|
|
579
|
+
return true;
|
|
580
|
+
}
|
|
581
|
+
return false;
|
|
582
|
+
};
|
|
583
|
+
e.isOpenOrClose = (t)=>{
|
|
584
|
+
if ("open" === t.type || "close" === t.type) return true;
|
|
585
|
+
return true === t.open || true === t.close;
|
|
586
|
+
};
|
|
587
|
+
e.reduce = (t)=>t.reduce((t, e)=>{
|
|
588
|
+
if ("text" === e.type) t.push(e.value);
|
|
589
|
+
if ("range" === e.type) e.type = "text";
|
|
590
|
+
return t;
|
|
591
|
+
}, []);
|
|
592
|
+
e.flatten = (...t)=>{
|
|
593
|
+
const e = [];
|
|
594
|
+
const flat = (t)=>{
|
|
595
|
+
for(let s = 0; s < t.length; s++){
|
|
596
|
+
let r = t[s];
|
|
597
|
+
Array.isArray(r) ? flat(r, e) : void 0 !== r && e.push(r);
|
|
598
|
+
}
|
|
599
|
+
return e;
|
|
600
|
+
};
|
|
601
|
+
flat(t);
|
|
602
|
+
return e;
|
|
603
|
+
};
|
|
604
|
+
},
|
|
605
|
+
240: (t, e, s)=>{
|
|
606
|
+
"use strict";
|
|
607
|
+
const { sep: r } = s(17);
|
|
608
|
+
const { platform: i } = process;
|
|
609
|
+
const n = s(37);
|
|
610
|
+
e.EV_ALL = "all";
|
|
611
|
+
e.EV_READY = "ready";
|
|
612
|
+
e.EV_ADD = "add";
|
|
613
|
+
e.EV_CHANGE = "change";
|
|
614
|
+
e.EV_ADD_DIR = "addDir";
|
|
615
|
+
e.EV_UNLINK = "unlink";
|
|
616
|
+
e.EV_UNLINK_DIR = "unlinkDir";
|
|
617
|
+
e.EV_RAW = "raw";
|
|
618
|
+
e.EV_ERROR = "error";
|
|
619
|
+
e.STR_DATA = "data";
|
|
620
|
+
e.STR_END = "end";
|
|
621
|
+
e.STR_CLOSE = "close";
|
|
622
|
+
e.FSEVENT_CREATED = "created";
|
|
623
|
+
e.FSEVENT_MODIFIED = "modified";
|
|
624
|
+
e.FSEVENT_DELETED = "deleted";
|
|
625
|
+
e.FSEVENT_MOVED = "moved";
|
|
626
|
+
e.FSEVENT_CLONED = "cloned";
|
|
627
|
+
e.FSEVENT_UNKNOWN = "unknown";
|
|
628
|
+
e.FSEVENT_TYPE_FILE = "file";
|
|
629
|
+
e.FSEVENT_TYPE_DIRECTORY = "directory";
|
|
630
|
+
e.FSEVENT_TYPE_SYMLINK = "symlink";
|
|
631
|
+
e.KEY_LISTENERS = "listeners";
|
|
632
|
+
e.KEY_ERR = "errHandlers";
|
|
633
|
+
e.KEY_RAW = "rawEmitters";
|
|
634
|
+
e.HANDLER_KEYS = [
|
|
635
|
+
e.KEY_LISTENERS,
|
|
636
|
+
e.KEY_ERR,
|
|
637
|
+
e.KEY_RAW
|
|
638
|
+
];
|
|
639
|
+
e.DOT_SLASH = `.${r}`;
|
|
640
|
+
e.BACK_SLASH_RE = /\\/g;
|
|
641
|
+
e.DOUBLE_SLASH_RE = /\/\//;
|
|
642
|
+
e.SLASH_OR_BACK_SLASH_RE = /[/\\]/;
|
|
643
|
+
e.DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
|
|
644
|
+
e.REPLACER_RE = /^\.[/\\]/;
|
|
645
|
+
e.SLASH = "/";
|
|
646
|
+
e.SLASH_SLASH = "//";
|
|
647
|
+
e.BRACE_START = "{";
|
|
648
|
+
e.BANG = "!";
|
|
649
|
+
e.ONE_DOT = ".";
|
|
650
|
+
e.TWO_DOTS = "..";
|
|
651
|
+
e.STAR = "*";
|
|
652
|
+
e.GLOBSTAR = "**";
|
|
653
|
+
e.ROOT_GLOBSTAR = "/**/*";
|
|
654
|
+
e.SLASH_GLOBSTAR = "/**";
|
|
655
|
+
e.DIR_SUFFIX = "Dir";
|
|
656
|
+
e.ANYMATCH_OPTS = {
|
|
657
|
+
dot: true
|
|
658
|
+
};
|
|
659
|
+
e.STRING_TYPE = "string";
|
|
660
|
+
e.FUNCTION_TYPE = "function";
|
|
661
|
+
e.EMPTY_STR = "";
|
|
662
|
+
e.EMPTY_FN = ()=>{};
|
|
663
|
+
e.IDENTITY_FN = (t)=>t;
|
|
664
|
+
e.isWindows = "win32" === i;
|
|
665
|
+
e.isMacos = "darwin" === i;
|
|
666
|
+
e.isLinux = "linux" === i;
|
|
667
|
+
e.isIBMi = "OS400" === n.type();
|
|
668
|
+
},
|
|
669
|
+
578: (t, e, s)=>{
|
|
670
|
+
"use strict";
|
|
671
|
+
const r = s(147);
|
|
672
|
+
const i = s(17);
|
|
673
|
+
const { promisify: n } = s(837);
|
|
674
|
+
let o;
|
|
675
|
+
try {
|
|
676
|
+
o = s(249);
|
|
677
|
+
} catch (t) {
|
|
678
|
+
if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR) console.error(t);
|
|
679
|
+
}
|
|
680
|
+
if (o) {
|
|
681
|
+
const t = process.version.match(/v(\d+)\.(\d+)/);
|
|
682
|
+
if (t && t[1] && t[2]) {
|
|
683
|
+
const e = Number.parseInt(t[1], 10);
|
|
684
|
+
const s = Number.parseInt(t[2], 10);
|
|
685
|
+
if (8 === e && s < 16) o = void 0;
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
const { EV_ADD: a, EV_CHANGE: u, EV_ADD_DIR: l, EV_UNLINK: c, EV_ERROR: f, STR_DATA: h, STR_END: p, FSEVENT_CREATED: d, FSEVENT_MODIFIED: _, FSEVENT_DELETED: E, FSEVENT_MOVED: g, FSEVENT_UNKNOWN: m, FSEVENT_TYPE_FILE: y, FSEVENT_TYPE_DIRECTORY: R, FSEVENT_TYPE_SYMLINK: w, ROOT_GLOBSTAR: A, DIR_SUFFIX: b, DOT_SLASH: v, FUNCTION_TYPE: S, EMPTY_FN: C, IDENTITY_FN: x } = s(240);
|
|
689
|
+
const Depth = (t)=>isNaN(t) ? {} : {
|
|
690
|
+
depth: t
|
|
691
|
+
};
|
|
692
|
+
const T = n(r.stat);
|
|
693
|
+
const H = n(r.lstat);
|
|
694
|
+
const O = n(r.realpath);
|
|
695
|
+
const P = {
|
|
696
|
+
stat: T,
|
|
697
|
+
lstat: H
|
|
698
|
+
};
|
|
699
|
+
const I = new Map;
|
|
700
|
+
const L = 10;
|
|
701
|
+
const N = new Set([
|
|
702
|
+
69888,
|
|
703
|
+
70400,
|
|
704
|
+
71424,
|
|
705
|
+
72704,
|
|
706
|
+
73472,
|
|
707
|
+
131328,
|
|
708
|
+
131840,
|
|
709
|
+
262912
|
|
710
|
+
]);
|
|
711
|
+
const createFSEventsInstance = (t, e)=>{
|
|
712
|
+
const s = o.watch(t, e);
|
|
713
|
+
return {
|
|
714
|
+
stop: s
|
|
715
|
+
};
|
|
716
|
+
};
|
|
717
|
+
function setFSEventsListener(t, e, s, r) {
|
|
718
|
+
let n = i.extname(e) ? i.dirname(e) : e;
|
|
719
|
+
const a = i.dirname(n);
|
|
720
|
+
let u = I.get(n);
|
|
721
|
+
if (couldConsolidate(a)) n = a;
|
|
722
|
+
const l = i.resolve(t);
|
|
723
|
+
const c = l !== e;
|
|
724
|
+
const filteredListener = (t, r, n)=>{
|
|
725
|
+
if (c) t = t.replace(e, l);
|
|
726
|
+
if (t === l || !t.indexOf(l + i.sep)) s(t, r, n);
|
|
727
|
+
};
|
|
728
|
+
let f = false;
|
|
729
|
+
for (const t of I.keys())if (0 === e.indexOf(i.resolve(t) + i.sep)) {
|
|
730
|
+
n = t;
|
|
731
|
+
u = I.get(n);
|
|
732
|
+
f = true;
|
|
733
|
+
break;
|
|
734
|
+
}
|
|
735
|
+
if (u || f) u.listeners.add(filteredListener);
|
|
736
|
+
else {
|
|
737
|
+
u = {
|
|
738
|
+
listeners: new Set([
|
|
739
|
+
filteredListener
|
|
740
|
+
]),
|
|
741
|
+
rawEmitter: r,
|
|
742
|
+
watcher: createFSEventsInstance(n, (t, e)=>{
|
|
743
|
+
if (!u.listeners.size) return;
|
|
744
|
+
const s = o.getInfo(t, e);
|
|
745
|
+
u.listeners.forEach((r)=>{
|
|
746
|
+
r(t, e, s);
|
|
747
|
+
});
|
|
748
|
+
u.rawEmitter(s.event, t, s);
|
|
749
|
+
})
|
|
750
|
+
};
|
|
751
|
+
I.set(n, u);
|
|
752
|
+
}
|
|
753
|
+
return ()=>{
|
|
754
|
+
const t = u.listeners;
|
|
755
|
+
t.delete(filteredListener);
|
|
756
|
+
if (!t.size) {
|
|
757
|
+
I.delete(n);
|
|
758
|
+
if (u.watcher) return u.watcher.stop().then(()=>{
|
|
759
|
+
u.rawEmitter = u.watcher = void 0;
|
|
760
|
+
Object.freeze(u);
|
|
761
|
+
});
|
|
762
|
+
}
|
|
763
|
+
};
|
|
764
|
+
}
|
|
765
|
+
const couldConsolidate = (t)=>{
|
|
766
|
+
let e = 0;
|
|
767
|
+
for (const s of I.keys())if (0 === s.indexOf(t)) {
|
|
768
|
+
e++;
|
|
769
|
+
if (e >= L) return true;
|
|
770
|
+
}
|
|
771
|
+
return false;
|
|
772
|
+
};
|
|
773
|
+
const canUse = ()=>o && I.size < 128;
|
|
774
|
+
const calcDepth = (t, e)=>{
|
|
775
|
+
let s = 0;
|
|
776
|
+
while(!t.indexOf(e) && (t = i.dirname(t)) !== e)s++;
|
|
777
|
+
return s;
|
|
778
|
+
};
|
|
779
|
+
const sameTypes = (t, e)=>t.type === R && e.isDirectory() || t.type === w && e.isSymbolicLink() || t.type === y && e.isFile();
|
|
780
|
+
class FsEventsHandler {
|
|
781
|
+
constructor(t){
|
|
782
|
+
this.fsw = t;
|
|
783
|
+
}
|
|
784
|
+
checkIgnored(t, e) {
|
|
785
|
+
const s = this.fsw._ignoredPaths;
|
|
786
|
+
if (this.fsw._isIgnored(t, e)) {
|
|
787
|
+
s.add(t);
|
|
788
|
+
if (e && e.isDirectory()) s.add(t + A);
|
|
789
|
+
return true;
|
|
790
|
+
}
|
|
791
|
+
s.delete(t);
|
|
792
|
+
s.delete(t + A);
|
|
793
|
+
}
|
|
794
|
+
addOrChange(t, e, s, r, i, n, o, l) {
|
|
795
|
+
const c = i.has(n) ? u : a;
|
|
796
|
+
this.handleEvent(c, t, e, s, r, i, n, o, l);
|
|
797
|
+
}
|
|
798
|
+
async checkExists(t, e, s, r, i, n, o, a) {
|
|
799
|
+
try {
|
|
800
|
+
const u = await T(t);
|
|
801
|
+
if (this.fsw.closed) return;
|
|
802
|
+
if (sameTypes(o, u)) this.addOrChange(t, e, s, r, i, n, o, a);
|
|
803
|
+
else this.handleEvent(c, t, e, s, r, i, n, o, a);
|
|
804
|
+
} catch (u) {
|
|
805
|
+
if ("EACCES" === u.code) this.addOrChange(t, e, s, r, i, n, o, a);
|
|
806
|
+
else this.handleEvent(c, t, e, s, r, i, n, o, a);
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
handleEvent(t, e, s, r, i, n, o, u, f) {
|
|
810
|
+
if (this.fsw.closed || this.checkIgnored(e)) return;
|
|
811
|
+
if (t === c) {
|
|
812
|
+
const t = u.type === R;
|
|
813
|
+
if (t || n.has(o)) this.fsw._remove(i, o, t);
|
|
814
|
+
} else {
|
|
815
|
+
if (t === a) {
|
|
816
|
+
if (u.type === R) this.fsw._getWatchedDir(e);
|
|
817
|
+
if (u.type === w && f.followSymlinks) {
|
|
818
|
+
const t = void 0 === f.depth ? void 0 : calcDepth(s, r) + 1;
|
|
819
|
+
return this._addToFsEvents(e, false, true, t);
|
|
820
|
+
}
|
|
821
|
+
this.fsw._getWatchedDir(i).add(o);
|
|
822
|
+
}
|
|
823
|
+
const n = u.type === R ? t + b : t;
|
|
824
|
+
this.fsw._emit(n, e);
|
|
825
|
+
if (n === l) this._addToFsEvents(e, false, true);
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
_watchWithFsEvents(t, e, s, r) {
|
|
829
|
+
if (this.fsw.closed || this.fsw._isIgnored(t)) return;
|
|
830
|
+
const n = this.fsw.options;
|
|
831
|
+
const watchCallback = async (o, a, u)=>{
|
|
832
|
+
if (this.fsw.closed) return;
|
|
833
|
+
if (void 0 !== n.depth && calcDepth(o, e) > n.depth) return;
|
|
834
|
+
const l = s(i.join(t, i.relative(t, o)));
|
|
835
|
+
if (r && !r(l)) return;
|
|
836
|
+
const f = i.dirname(l);
|
|
837
|
+
const h = i.basename(l);
|
|
838
|
+
const p = this.fsw._getWatchedDir(u.type === R ? l : f);
|
|
839
|
+
if (N.has(a) || u.event === m) if (typeof n.ignored === S) {
|
|
840
|
+
let t;
|
|
841
|
+
try {
|
|
842
|
+
t = await T(l);
|
|
843
|
+
} catch (t) {}
|
|
844
|
+
if (this.fsw.closed) return;
|
|
845
|
+
if (this.checkIgnored(l, t)) return;
|
|
846
|
+
if (sameTypes(u, t)) this.addOrChange(l, o, e, f, p, h, u, n);
|
|
847
|
+
else this.handleEvent(c, l, o, e, f, p, h, u, n);
|
|
848
|
+
} else this.checkExists(l, o, e, f, p, h, u, n);
|
|
849
|
+
else switch(u.event){
|
|
850
|
+
case d:
|
|
851
|
+
case _:
|
|
852
|
+
return this.addOrChange(l, o, e, f, p, h, u, n);
|
|
853
|
+
case E:
|
|
854
|
+
case g:
|
|
855
|
+
return this.checkExists(l, o, e, f, p, h, u, n);
|
|
856
|
+
}
|
|
857
|
+
};
|
|
858
|
+
const o = setFSEventsListener(t, e, watchCallback, this.fsw._emitRaw);
|
|
859
|
+
this.fsw._emitReady();
|
|
860
|
+
return o;
|
|
861
|
+
}
|
|
862
|
+
async _handleFsEventsSymlink(t, e, s, r) {
|
|
863
|
+
if (this.fsw.closed || this.fsw._symlinkPaths.has(e)) return;
|
|
864
|
+
this.fsw._symlinkPaths.set(e, true);
|
|
865
|
+
this.fsw._incrReadyCount();
|
|
866
|
+
try {
|
|
867
|
+
const e = await O(t);
|
|
868
|
+
if (this.fsw.closed) return;
|
|
869
|
+
if (this.fsw._isIgnored(e)) return this.fsw._emitReady();
|
|
870
|
+
this.fsw._incrReadyCount();
|
|
871
|
+
this._addToFsEvents(e || t, (r)=>{
|
|
872
|
+
let n = t;
|
|
873
|
+
if (e && e !== v) n = r.replace(e, t);
|
|
874
|
+
else if (r !== v) n = i.join(t, r);
|
|
875
|
+
return s(n);
|
|
876
|
+
}, false, r);
|
|
877
|
+
} catch (t) {
|
|
878
|
+
if (this.fsw._handleError(t)) return this.fsw._emitReady();
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
emitAdd(t, e, s, r, n) {
|
|
882
|
+
const o = s(t);
|
|
883
|
+
const u = e.isDirectory();
|
|
884
|
+
const c = this.fsw._getWatchedDir(i.dirname(o));
|
|
885
|
+
const f = i.basename(o);
|
|
886
|
+
if (u) this.fsw._getWatchedDir(o);
|
|
887
|
+
if (c.has(f)) return;
|
|
888
|
+
c.add(f);
|
|
889
|
+
if (!r.ignoreInitial || true === n) this.fsw._emit(u ? l : a, o, e);
|
|
890
|
+
}
|
|
891
|
+
initWatch(t, e, s, r) {
|
|
892
|
+
if (this.fsw.closed) return;
|
|
893
|
+
const n = this._watchWithFsEvents(s.watchPath, i.resolve(t || s.watchPath), r, s.globFilter);
|
|
894
|
+
this.fsw._addPathCloser(e, n);
|
|
895
|
+
}
|
|
896
|
+
async _addToFsEvents(t, e, s, r) {
|
|
897
|
+
if (this.fsw.closed) return;
|
|
898
|
+
const n = this.fsw.options;
|
|
899
|
+
const o = typeof e === S ? e : x;
|
|
900
|
+
const a = this.fsw._getWatchHelpers(t);
|
|
901
|
+
try {
|
|
902
|
+
const e = await P[a.statMethod](a.watchPath);
|
|
903
|
+
if (this.fsw.closed) return;
|
|
904
|
+
if (this.fsw._isIgnored(a.watchPath, e)) throw null;
|
|
905
|
+
if (e.isDirectory()) {
|
|
906
|
+
if (!a.globFilter) this.emitAdd(o(t), e, o, n, s);
|
|
907
|
+
if (r && r > n.depth) return;
|
|
908
|
+
this.fsw._readdirp(a.watchPath, {
|
|
909
|
+
fileFilter: (t)=>a.filterPath(t),
|
|
910
|
+
directoryFilter: (t)=>a.filterDir(t),
|
|
911
|
+
...Depth(n.depth - (r || 0))
|
|
912
|
+
}).on(h, (t)=>{
|
|
913
|
+
if (this.fsw.closed) return;
|
|
914
|
+
if (t.stats.isDirectory() && !a.filterPath(t)) return;
|
|
915
|
+
const e = i.join(a.watchPath, t.path);
|
|
916
|
+
const { fullPath: r } = t;
|
|
917
|
+
if (a.followSymlinks && t.stats.isSymbolicLink()) {
|
|
918
|
+
const t = void 0 === n.depth ? void 0 : calcDepth(e, i.resolve(a.watchPath)) + 1;
|
|
919
|
+
this._handleFsEventsSymlink(e, r, o, t);
|
|
920
|
+
} else this.emitAdd(e, t.stats, o, n, s);
|
|
921
|
+
}).on(f, C).on(p, ()=>{
|
|
922
|
+
this.fsw._emitReady();
|
|
923
|
+
});
|
|
924
|
+
} else {
|
|
925
|
+
this.emitAdd(a.watchPath, e, o, n, s);
|
|
926
|
+
this.fsw._emitReady();
|
|
927
|
+
}
|
|
928
|
+
} catch (t) {
|
|
929
|
+
if (!t || this.fsw._handleError(t)) {
|
|
930
|
+
this.fsw._emitReady();
|
|
931
|
+
this.fsw._emitReady();
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
if (n.persistent && true !== s) if (typeof e === S) this.initWatch(void 0, t, a, o);
|
|
935
|
+
else {
|
|
936
|
+
let e;
|
|
937
|
+
try {
|
|
938
|
+
e = await O(a.watchPath);
|
|
939
|
+
} catch (t) {}
|
|
940
|
+
this.initWatch(e, t, a, o);
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
t.exports = FsEventsHandler;
|
|
945
|
+
t.exports.canUse = canUse;
|
|
946
|
+
},
|
|
947
|
+
254: (t, e, s)=>{
|
|
948
|
+
"use strict";
|
|
949
|
+
const r = s(147);
|
|
950
|
+
const i = s(17);
|
|
951
|
+
const { promisify: n } = s(837);
|
|
952
|
+
const o = s(41);
|
|
953
|
+
const { isWindows: a, isLinux: u, EMPTY_FN: l, EMPTY_STR: c, KEY_LISTENERS: f, KEY_ERR: h, KEY_RAW: p, HANDLER_KEYS: d, EV_CHANGE: _, EV_ADD: E, EV_ADD_DIR: g, EV_ERROR: m, STR_DATA: y, STR_END: R, BRACE_START: w, STAR: A } = s(240);
|
|
954
|
+
const b = "watch";
|
|
955
|
+
const v = n(r.open);
|
|
956
|
+
const S = n(r.stat);
|
|
957
|
+
const C = n(r.lstat);
|
|
958
|
+
const x = n(r.close);
|
|
959
|
+
const T = n(r.realpath);
|
|
960
|
+
const H = {
|
|
961
|
+
lstat: C,
|
|
962
|
+
stat: S
|
|
963
|
+
};
|
|
964
|
+
const foreach = (t, e)=>{
|
|
965
|
+
if (t instanceof Set) t.forEach(e);
|
|
966
|
+
else e(t);
|
|
967
|
+
};
|
|
968
|
+
const addAndConvert = (t, e, s)=>{
|
|
969
|
+
let r = t[e];
|
|
970
|
+
if (!(r instanceof Set)) t[e] = r = new Set([
|
|
971
|
+
r
|
|
972
|
+
]);
|
|
973
|
+
r.add(s);
|
|
974
|
+
};
|
|
975
|
+
const clearItem = (t)=>(e)=>{
|
|
976
|
+
const s = t[e];
|
|
977
|
+
if (s instanceof Set) s.clear();
|
|
978
|
+
else delete t[e];
|
|
979
|
+
};
|
|
980
|
+
const delFromSet = (t, e, s)=>{
|
|
981
|
+
const r = t[e];
|
|
982
|
+
if (r instanceof Set) r.delete(s);
|
|
983
|
+
else if (r === s) delete t[e];
|
|
984
|
+
};
|
|
985
|
+
const isEmptySet = (t)=>t instanceof Set ? 0 === t.size : !t;
|
|
986
|
+
const O = new Map;
|
|
987
|
+
function createFsWatchInstance(t, e, s, n, o) {
|
|
988
|
+
const handleEvent = (e, r)=>{
|
|
989
|
+
s(t);
|
|
990
|
+
o(e, r, {
|
|
991
|
+
watchedPath: t
|
|
992
|
+
});
|
|
993
|
+
if (r && t !== r) fsWatchBroadcast(i.resolve(t, r), f, i.join(t, r));
|
|
994
|
+
};
|
|
995
|
+
try {
|
|
996
|
+
return r.watch(t, e, handleEvent);
|
|
997
|
+
} catch (t) {
|
|
998
|
+
n(t);
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
const fsWatchBroadcast = (t, e, s, r, i)=>{
|
|
1002
|
+
const n = O.get(t);
|
|
1003
|
+
if (!n) return;
|
|
1004
|
+
foreach(n[e], (t)=>{
|
|
1005
|
+
t(s, r, i);
|
|
1006
|
+
});
|
|
1007
|
+
};
|
|
1008
|
+
const setFsWatchListener = (t, e, s, r)=>{
|
|
1009
|
+
const { listener: i, errHandler: n, rawEmitter: o } = r;
|
|
1010
|
+
let u = O.get(e);
|
|
1011
|
+
let l;
|
|
1012
|
+
if (!s.persistent) {
|
|
1013
|
+
l = createFsWatchInstance(t, s, i, n, o);
|
|
1014
|
+
return l.close.bind(l);
|
|
1015
|
+
}
|
|
1016
|
+
if (u) {
|
|
1017
|
+
addAndConvert(u, f, i);
|
|
1018
|
+
addAndConvert(u, h, n);
|
|
1019
|
+
addAndConvert(u, p, o);
|
|
1020
|
+
} else {
|
|
1021
|
+
l = createFsWatchInstance(t, s, fsWatchBroadcast.bind(null, e, f), n, fsWatchBroadcast.bind(null, e, p));
|
|
1022
|
+
if (!l) return;
|
|
1023
|
+
l.on(m, async (s)=>{
|
|
1024
|
+
const r = fsWatchBroadcast.bind(null, e, h);
|
|
1025
|
+
u.watcherUnusable = true;
|
|
1026
|
+
if (a && "EPERM" === s.code) try {
|
|
1027
|
+
const e = await v(t, "r");
|
|
1028
|
+
await x(e);
|
|
1029
|
+
r(s);
|
|
1030
|
+
} catch (t) {}
|
|
1031
|
+
else r(s);
|
|
1032
|
+
});
|
|
1033
|
+
u = {
|
|
1034
|
+
listeners: i,
|
|
1035
|
+
errHandlers: n,
|
|
1036
|
+
rawEmitters: o,
|
|
1037
|
+
watcher: l
|
|
1038
|
+
};
|
|
1039
|
+
O.set(e, u);
|
|
1040
|
+
}
|
|
1041
|
+
return ()=>{
|
|
1042
|
+
delFromSet(u, f, i);
|
|
1043
|
+
delFromSet(u, h, n);
|
|
1044
|
+
delFromSet(u, p, o);
|
|
1045
|
+
if (isEmptySet(u.listeners)) {
|
|
1046
|
+
u.watcher.close();
|
|
1047
|
+
O.delete(e);
|
|
1048
|
+
d.forEach(clearItem(u));
|
|
1049
|
+
u.watcher = void 0;
|
|
1050
|
+
Object.freeze(u);
|
|
1051
|
+
}
|
|
1052
|
+
};
|
|
1053
|
+
};
|
|
1054
|
+
const P = new Map;
|
|
1055
|
+
const setFsWatchFileListener = (t, e, s, i)=>{
|
|
1056
|
+
const { listener: n, rawEmitter: o } = i;
|
|
1057
|
+
let a = P.get(e);
|
|
1058
|
+
new Set;
|
|
1059
|
+
new Set;
|
|
1060
|
+
const c = a && a.options;
|
|
1061
|
+
if (c && (c.persistent < s.persistent || c.interval > s.interval)) {
|
|
1062
|
+
a.listeners;
|
|
1063
|
+
a.rawEmitters;
|
|
1064
|
+
r.unwatchFile(e);
|
|
1065
|
+
a = void 0;
|
|
1066
|
+
}
|
|
1067
|
+
if (a) {
|
|
1068
|
+
addAndConvert(a, f, n);
|
|
1069
|
+
addAndConvert(a, p, o);
|
|
1070
|
+
} else {
|
|
1071
|
+
a = {
|
|
1072
|
+
listeners: n,
|
|
1073
|
+
rawEmitters: o,
|
|
1074
|
+
options: s,
|
|
1075
|
+
watcher: r.watchFile(e, s, (s, r)=>{
|
|
1076
|
+
foreach(a.rawEmitters, (t)=>{
|
|
1077
|
+
t(_, e, {
|
|
1078
|
+
curr: s,
|
|
1079
|
+
prev: r
|
|
1080
|
+
});
|
|
1081
|
+
});
|
|
1082
|
+
const i = s.mtimeMs;
|
|
1083
|
+
if (s.size !== r.size || i > r.mtimeMs || 0 === i) foreach(a.listeners, (e)=>e(t, s));
|
|
1084
|
+
})
|
|
1085
|
+
};
|
|
1086
|
+
P.set(e, a);
|
|
1087
|
+
}
|
|
1088
|
+
return ()=>{
|
|
1089
|
+
delFromSet(a, f, n);
|
|
1090
|
+
delFromSet(a, p, o);
|
|
1091
|
+
if (isEmptySet(a.listeners)) {
|
|
1092
|
+
P.delete(e);
|
|
1093
|
+
r.unwatchFile(e);
|
|
1094
|
+
a.options = a.watcher = void 0;
|
|
1095
|
+
Object.freeze(a);
|
|
1096
|
+
}
|
|
1097
|
+
};
|
|
1098
|
+
};
|
|
1099
|
+
class NodeFsHandler {
|
|
1100
|
+
constructor(t){
|
|
1101
|
+
this.fsw = t;
|
|
1102
|
+
this._boundHandleError = (e)=>t._handleError(e);
|
|
1103
|
+
}
|
|
1104
|
+
_watchWithNodeFs(t, e) {
|
|
1105
|
+
const s = this.fsw.options;
|
|
1106
|
+
const r = i.dirname(t);
|
|
1107
|
+
const n = i.basename(t);
|
|
1108
|
+
const a = this.fsw._getWatchedDir(r);
|
|
1109
|
+
a.add(n);
|
|
1110
|
+
const u = i.resolve(t);
|
|
1111
|
+
const c = {
|
|
1112
|
+
persistent: s.persistent
|
|
1113
|
+
};
|
|
1114
|
+
if (!e) e = l;
|
|
1115
|
+
let f;
|
|
1116
|
+
if (s.usePolling) {
|
|
1117
|
+
c.interval = s.enableBinaryInterval && o(n) ? s.binaryInterval : s.interval;
|
|
1118
|
+
f = setFsWatchFileListener(t, u, c, {
|
|
1119
|
+
listener: e,
|
|
1120
|
+
rawEmitter: this.fsw._emitRaw
|
|
1121
|
+
});
|
|
1122
|
+
} else f = setFsWatchListener(t, u, c, {
|
|
1123
|
+
listener: e,
|
|
1124
|
+
errHandler: this._boundHandleError,
|
|
1125
|
+
rawEmitter: this.fsw._emitRaw
|
|
1126
|
+
});
|
|
1127
|
+
return f;
|
|
1128
|
+
}
|
|
1129
|
+
_handleFile(t, e, s) {
|
|
1130
|
+
if (this.fsw.closed) return;
|
|
1131
|
+
const r = i.dirname(t);
|
|
1132
|
+
const n = i.basename(t);
|
|
1133
|
+
const o = this.fsw._getWatchedDir(r);
|
|
1134
|
+
let a = e;
|
|
1135
|
+
if (o.has(n)) return;
|
|
1136
|
+
const listener = async (e, s)=>{
|
|
1137
|
+
if (!this.fsw._throttle(b, t, 5)) return;
|
|
1138
|
+
if (s && 0 !== s.mtimeMs) {
|
|
1139
|
+
if (o.has(n)) {
|
|
1140
|
+
const e = s.atimeMs;
|
|
1141
|
+
const r = s.mtimeMs;
|
|
1142
|
+
if (!e || e <= r || r !== a.mtimeMs) this.fsw._emit(_, t, s);
|
|
1143
|
+
a = s;
|
|
1144
|
+
}
|
|
1145
|
+
} else try {
|
|
1146
|
+
const s = await S(t);
|
|
1147
|
+
if (this.fsw.closed) return;
|
|
1148
|
+
const r = s.atimeMs;
|
|
1149
|
+
const i = s.mtimeMs;
|
|
1150
|
+
if (!r || r <= i || i !== a.mtimeMs) this.fsw._emit(_, t, s);
|
|
1151
|
+
if (u && a.ino !== s.ino) {
|
|
1152
|
+
this.fsw._closeFile(e);
|
|
1153
|
+
a = s;
|
|
1154
|
+
this.fsw._addPathCloser(e, this._watchWithNodeFs(t, listener));
|
|
1155
|
+
} else a = s;
|
|
1156
|
+
} catch (t) {
|
|
1157
|
+
this.fsw._remove(r, n);
|
|
1158
|
+
}
|
|
1159
|
+
};
|
|
1160
|
+
const l = this._watchWithNodeFs(t, listener);
|
|
1161
|
+
if (!(s && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(t)) {
|
|
1162
|
+
if (!this.fsw._throttle(E, t, 0)) return;
|
|
1163
|
+
this.fsw._emit(E, t, e);
|
|
1164
|
+
}
|
|
1165
|
+
return l;
|
|
1166
|
+
}
|
|
1167
|
+
async _handleSymlink(t, e, s, r) {
|
|
1168
|
+
if (this.fsw.closed) return;
|
|
1169
|
+
const i = t.fullPath;
|
|
1170
|
+
const n = this.fsw._getWatchedDir(e);
|
|
1171
|
+
if (!this.fsw.options.followSymlinks) {
|
|
1172
|
+
this.fsw._incrReadyCount();
|
|
1173
|
+
let e;
|
|
1174
|
+
try {
|
|
1175
|
+
e = await T(s);
|
|
1176
|
+
} catch (t) {
|
|
1177
|
+
this.fsw._emitReady();
|
|
1178
|
+
return true;
|
|
1179
|
+
}
|
|
1180
|
+
if (this.fsw.closed) return;
|
|
1181
|
+
if (n.has(r)) {
|
|
1182
|
+
if (this.fsw._symlinkPaths.get(i) !== e) {
|
|
1183
|
+
this.fsw._symlinkPaths.set(i, e);
|
|
1184
|
+
this.fsw._emit(_, s, t.stats);
|
|
1185
|
+
}
|
|
1186
|
+
} else {
|
|
1187
|
+
n.add(r);
|
|
1188
|
+
this.fsw._symlinkPaths.set(i, e);
|
|
1189
|
+
this.fsw._emit(E, s, t.stats);
|
|
1190
|
+
}
|
|
1191
|
+
this.fsw._emitReady();
|
|
1192
|
+
return true;
|
|
1193
|
+
}
|
|
1194
|
+
if (this.fsw._symlinkPaths.has(i)) return true;
|
|
1195
|
+
this.fsw._symlinkPaths.set(i, true);
|
|
1196
|
+
}
|
|
1197
|
+
_handleRead(t, e, s, r, n, o, a) {
|
|
1198
|
+
t = i.join(t, c);
|
|
1199
|
+
if (!s.hasGlob) {
|
|
1200
|
+
a = this.fsw._throttle("readdir", t, 1e3);
|
|
1201
|
+
if (!a) return;
|
|
1202
|
+
}
|
|
1203
|
+
const u = this.fsw._getWatchedDir(s.path);
|
|
1204
|
+
const l = new Set;
|
|
1205
|
+
let f = this.fsw._readdirp(t, {
|
|
1206
|
+
fileFilter: (t)=>s.filterPath(t),
|
|
1207
|
+
directoryFilter: (t)=>s.filterDir(t),
|
|
1208
|
+
depth: 0
|
|
1209
|
+
}).on(y, async (a)=>{
|
|
1210
|
+
if (this.fsw.closed) {
|
|
1211
|
+
f = void 0;
|
|
1212
|
+
return;
|
|
1213
|
+
}
|
|
1214
|
+
const c = a.path;
|
|
1215
|
+
let h = i.join(t, c);
|
|
1216
|
+
l.add(c);
|
|
1217
|
+
if (a.stats.isSymbolicLink() && await this._handleSymlink(a, t, h, c)) return;
|
|
1218
|
+
if (this.fsw.closed) {
|
|
1219
|
+
f = void 0;
|
|
1220
|
+
return;
|
|
1221
|
+
}
|
|
1222
|
+
if (c === r || !r && !u.has(c)) {
|
|
1223
|
+
this.fsw._incrReadyCount();
|
|
1224
|
+
h = i.join(n, i.relative(n, h));
|
|
1225
|
+
this._addToNodeFs(h, e, s, o + 1);
|
|
1226
|
+
}
|
|
1227
|
+
}).on(m, this._boundHandleError);
|
|
1228
|
+
return new Promise((e)=>f.once(R, ()=>{
|
|
1229
|
+
if (this.fsw.closed) {
|
|
1230
|
+
f = void 0;
|
|
1231
|
+
return;
|
|
1232
|
+
}
|
|
1233
|
+
const c = a ? a.clear() : false;
|
|
1234
|
+
e();
|
|
1235
|
+
u.getChildren().filter((e)=>e !== t && !l.has(e) && (!s.hasGlob || s.filterPath({
|
|
1236
|
+
fullPath: i.resolve(t, e)
|
|
1237
|
+
}))).forEach((e)=>{
|
|
1238
|
+
this.fsw._remove(t, e);
|
|
1239
|
+
});
|
|
1240
|
+
f = void 0;
|
|
1241
|
+
if (c) this._handleRead(t, false, s, r, n, o, a);
|
|
1242
|
+
}));
|
|
1243
|
+
}
|
|
1244
|
+
async _handleDir(t, e, s, r, n, o, a) {
|
|
1245
|
+
const u = this.fsw._getWatchedDir(i.dirname(t));
|
|
1246
|
+
const l = u.has(i.basename(t));
|
|
1247
|
+
if (!(s && this.fsw.options.ignoreInitial) && !n && !l) {
|
|
1248
|
+
if (!o.hasGlob || o.globFilter(t)) this.fsw._emit(g, t, e);
|
|
1249
|
+
}
|
|
1250
|
+
u.add(i.basename(t));
|
|
1251
|
+
this.fsw._getWatchedDir(t);
|
|
1252
|
+
let c;
|
|
1253
|
+
let f;
|
|
1254
|
+
const h = this.fsw.options.depth;
|
|
1255
|
+
if ((null == h || r <= h) && !this.fsw._symlinkPaths.has(a)) {
|
|
1256
|
+
if (!n) {
|
|
1257
|
+
await this._handleRead(t, s, o, n, t, r, c);
|
|
1258
|
+
if (this.fsw.closed) return;
|
|
1259
|
+
}
|
|
1260
|
+
f = this._watchWithNodeFs(t, (e, s)=>{
|
|
1261
|
+
if (s && 0 === s.mtimeMs) return;
|
|
1262
|
+
this._handleRead(e, false, o, n, t, r, c);
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1265
|
+
return f;
|
|
1266
|
+
}
|
|
1267
|
+
async _addToNodeFs(t, e, s, r, n) {
|
|
1268
|
+
const o = this.fsw._emitReady;
|
|
1269
|
+
if (this.fsw._isIgnored(t) || this.fsw.closed) {
|
|
1270
|
+
o();
|
|
1271
|
+
return false;
|
|
1272
|
+
}
|
|
1273
|
+
const a = this.fsw._getWatchHelpers(t, r);
|
|
1274
|
+
if (!a.hasGlob && s) {
|
|
1275
|
+
a.hasGlob = s.hasGlob;
|
|
1276
|
+
a.globFilter = s.globFilter;
|
|
1277
|
+
a.filterPath = (t)=>s.filterPath(t);
|
|
1278
|
+
a.filterDir = (t)=>s.filterDir(t);
|
|
1279
|
+
}
|
|
1280
|
+
try {
|
|
1281
|
+
const s = await H[a.statMethod](a.watchPath);
|
|
1282
|
+
if (this.fsw.closed) return;
|
|
1283
|
+
if (this.fsw._isIgnored(a.watchPath, s)) {
|
|
1284
|
+
o();
|
|
1285
|
+
return false;
|
|
1286
|
+
}
|
|
1287
|
+
const u = this.fsw.options.followSymlinks && !t.includes(A) && !t.includes(w);
|
|
1288
|
+
let l;
|
|
1289
|
+
if (s.isDirectory()) {
|
|
1290
|
+
const o = i.resolve(t);
|
|
1291
|
+
const c = u ? await T(t) : t;
|
|
1292
|
+
if (this.fsw.closed) return;
|
|
1293
|
+
l = await this._handleDir(a.watchPath, s, e, r, n, a, c);
|
|
1294
|
+
if (this.fsw.closed) return;
|
|
1295
|
+
if (o !== c && void 0 !== c) this.fsw._symlinkPaths.set(o, c);
|
|
1296
|
+
} else if (s.isSymbolicLink()) {
|
|
1297
|
+
const n = u ? await T(t) : t;
|
|
1298
|
+
if (this.fsw.closed) return;
|
|
1299
|
+
const o = i.dirname(a.watchPath);
|
|
1300
|
+
this.fsw._getWatchedDir(o).add(a.watchPath);
|
|
1301
|
+
this.fsw._emit(E, a.watchPath, s);
|
|
1302
|
+
l = await this._handleDir(o, s, e, r, t, a, n);
|
|
1303
|
+
if (this.fsw.closed) return;
|
|
1304
|
+
if (void 0 !== n) this.fsw._symlinkPaths.set(i.resolve(t), n);
|
|
1305
|
+
} else l = this._handleFile(a.watchPath, s, e);
|
|
1306
|
+
o();
|
|
1307
|
+
this.fsw._addPathCloser(t, l);
|
|
1308
|
+
return false;
|
|
1309
|
+
} catch (e) {
|
|
1310
|
+
if (this.fsw._handleError(e)) {
|
|
1311
|
+
o();
|
|
1312
|
+
return t;
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
t.exports = NodeFsHandler;
|
|
1318
|
+
},
|
|
1319
|
+
442: (t, e, s)=>{
|
|
1320
|
+
"use strict";
|
|
1321
|
+
/*!
|
|
3
1322
|
* fill-range <https://github.com/jonschlinkert/fill-range>
|
|
4
1323
|
*
|
|
5
1324
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
6
1325
|
* Licensed under the MIT License.
|
|
7
|
-
*/
|
|
8
|
-
|
|
1326
|
+
*/ const r = s(837);
|
|
1327
|
+
const i = s(211);
|
|
1328
|
+
const isObject = (t)=>null !== t && "object" == typeof t && !Array.isArray(t);
|
|
1329
|
+
const transform = (t)=>(e)=>true === t ? Number(e) : String(e);
|
|
1330
|
+
const isValidValue = (t)=>"number" == typeof t || "string" == typeof t && "" !== t;
|
|
1331
|
+
const isNumber = (t)=>Number.isInteger(+t);
|
|
1332
|
+
const zeros = (t)=>{
|
|
1333
|
+
let e = `${t}`;
|
|
1334
|
+
let s = -1;
|
|
1335
|
+
if ("-" === e[0]) e = e.slice(1);
|
|
1336
|
+
if ("0" === e) return false;
|
|
1337
|
+
while("0" === e[++s]);
|
|
1338
|
+
return s > 0;
|
|
1339
|
+
};
|
|
1340
|
+
const stringify = (t, e, s)=>{
|
|
1341
|
+
if ("string" == typeof t || "string" == typeof e) return true;
|
|
1342
|
+
return true === s.stringify;
|
|
1343
|
+
};
|
|
1344
|
+
const pad = (t, e, s)=>{
|
|
1345
|
+
if (e > 0) {
|
|
1346
|
+
let s = "-" === t[0] ? "-" : "";
|
|
1347
|
+
if (s) t = t.slice(1);
|
|
1348
|
+
t = s + t.padStart(s ? e - 1 : e, "0");
|
|
1349
|
+
}
|
|
1350
|
+
if (false === s) return String(t);
|
|
1351
|
+
return t;
|
|
1352
|
+
};
|
|
1353
|
+
const toMaxLen = (t, e)=>{
|
|
1354
|
+
let s = "-" === t[0] ? "-" : "";
|
|
1355
|
+
if (s) {
|
|
1356
|
+
t = t.slice(1);
|
|
1357
|
+
e--;
|
|
1358
|
+
}
|
|
1359
|
+
while(t.length < e)t = "0" + t;
|
|
1360
|
+
return s ? "-" + t : t;
|
|
1361
|
+
};
|
|
1362
|
+
const toSequence = (t, e)=>{
|
|
1363
|
+
t.negatives.sort((t, e)=>t < e ? -1 : t > e ? 1 : 0);
|
|
1364
|
+
t.positives.sort((t, e)=>t < e ? -1 : t > e ? 1 : 0);
|
|
1365
|
+
let s = e.capture ? "" : "?:";
|
|
1366
|
+
let r = "";
|
|
1367
|
+
let i = "";
|
|
1368
|
+
let n;
|
|
1369
|
+
if (t.positives.length) r = t.positives.join("|");
|
|
1370
|
+
if (t.negatives.length) i = `-(${s}${t.negatives.join("|")})`;
|
|
1371
|
+
n = r && i ? `${r}|${i}` : r || i;
|
|
1372
|
+
if (e.wrap) return `(${s}${n})`;
|
|
1373
|
+
return n;
|
|
1374
|
+
};
|
|
1375
|
+
const toRange = (t, e, s, r)=>{
|
|
1376
|
+
if (s) return i(t, e, {
|
|
1377
|
+
wrap: false,
|
|
1378
|
+
...r
|
|
1379
|
+
});
|
|
1380
|
+
let n = String.fromCharCode(t);
|
|
1381
|
+
if (t === e) return n;
|
|
1382
|
+
let o = String.fromCharCode(e);
|
|
1383
|
+
return `[${n}-${o}]`;
|
|
1384
|
+
};
|
|
1385
|
+
const toRegex = (t, e, s)=>{
|
|
1386
|
+
if (Array.isArray(t)) {
|
|
1387
|
+
let e = true === s.wrap;
|
|
1388
|
+
let r = s.capture ? "" : "?:";
|
|
1389
|
+
return e ? `(${r}${t.join("|")})` : t.join("|");
|
|
1390
|
+
}
|
|
1391
|
+
return i(t, e, s);
|
|
1392
|
+
};
|
|
1393
|
+
const rangeError = (...t)=>new RangeError("Invalid range arguments: " + r.inspect(...t));
|
|
1394
|
+
const invalidRange = (t, e, s)=>{
|
|
1395
|
+
if (true === s.strictRanges) throw rangeError([
|
|
1396
|
+
t,
|
|
1397
|
+
e
|
|
1398
|
+
]);
|
|
1399
|
+
return [];
|
|
1400
|
+
};
|
|
1401
|
+
const invalidStep = (t, e)=>{
|
|
1402
|
+
if (true === e.strictRanges) throw new TypeError(`Expected step "${t}" to be a number`);
|
|
1403
|
+
return [];
|
|
1404
|
+
};
|
|
1405
|
+
const fillNumbers = (t, e, s = 1, r = {})=>{
|
|
1406
|
+
let i = Number(t);
|
|
1407
|
+
let n = Number(e);
|
|
1408
|
+
if (!Number.isInteger(i) || !Number.isInteger(n)) {
|
|
1409
|
+
if (true === r.strictRanges) throw rangeError([
|
|
1410
|
+
t,
|
|
1411
|
+
e
|
|
1412
|
+
]);
|
|
1413
|
+
return [];
|
|
1414
|
+
}
|
|
1415
|
+
if (0 === i) i = 0;
|
|
1416
|
+
if (0 === n) n = 0;
|
|
1417
|
+
let o = i > n;
|
|
1418
|
+
let a = String(t);
|
|
1419
|
+
let u = String(e);
|
|
1420
|
+
let l = String(s);
|
|
1421
|
+
s = Math.max(Math.abs(s), 1);
|
|
1422
|
+
let c = zeros(a) || zeros(u) || zeros(l);
|
|
1423
|
+
let f = c ? Math.max(a.length, u.length, l.length) : 0;
|
|
1424
|
+
let h = false === c && false === stringify(t, e, r);
|
|
1425
|
+
let p = r.transform || transform(h);
|
|
1426
|
+
if (r.toRegex && 1 === s) return toRange(toMaxLen(t, f), toMaxLen(e, f), true, r);
|
|
1427
|
+
let d = {
|
|
1428
|
+
negatives: [],
|
|
1429
|
+
positives: []
|
|
1430
|
+
};
|
|
1431
|
+
let push = (t)=>d[t < 0 ? "negatives" : "positives"].push(Math.abs(t));
|
|
1432
|
+
let _ = [];
|
|
1433
|
+
let E = 0;
|
|
1434
|
+
while(o ? i >= n : i <= n){
|
|
1435
|
+
if (true === r.toRegex && s > 1) push(i);
|
|
1436
|
+
else _.push(pad(p(i, E), f, h));
|
|
1437
|
+
i = o ? i - s : i + s;
|
|
1438
|
+
E++;
|
|
1439
|
+
}
|
|
1440
|
+
if (true === r.toRegex) return s > 1 ? toSequence(d, r) : toRegex(_, null, {
|
|
1441
|
+
wrap: false,
|
|
1442
|
+
...r
|
|
1443
|
+
});
|
|
1444
|
+
return _;
|
|
1445
|
+
};
|
|
1446
|
+
const fillLetters = (t, e, s = 1, r = {})=>{
|
|
1447
|
+
if (!isNumber(t) && t.length > 1 || !isNumber(e) && e.length > 1) return invalidRange(t, e, r);
|
|
1448
|
+
let i = r.transform || ((t)=>String.fromCharCode(t));
|
|
1449
|
+
let n = `${t}`.charCodeAt(0);
|
|
1450
|
+
let o = `${e}`.charCodeAt(0);
|
|
1451
|
+
let a = n > o;
|
|
1452
|
+
let u = Math.min(n, o);
|
|
1453
|
+
let l = Math.max(n, o);
|
|
1454
|
+
if (r.toRegex && 1 === s) return toRange(u, l, false, r);
|
|
1455
|
+
let c = [];
|
|
1456
|
+
let f = 0;
|
|
1457
|
+
while(a ? n >= o : n <= o){
|
|
1458
|
+
c.push(i(n, f));
|
|
1459
|
+
n = a ? n - s : n + s;
|
|
1460
|
+
f++;
|
|
1461
|
+
}
|
|
1462
|
+
if (true === r.toRegex) return toRegex(c, null, {
|
|
1463
|
+
wrap: false,
|
|
1464
|
+
options: r
|
|
1465
|
+
});
|
|
1466
|
+
return c;
|
|
1467
|
+
};
|
|
1468
|
+
const fill = (t, e, s, r = {})=>{
|
|
1469
|
+
if (null == e && isValidValue(t)) return [
|
|
1470
|
+
t
|
|
1471
|
+
];
|
|
1472
|
+
if (!isValidValue(t) || !isValidValue(e)) return invalidRange(t, e, r);
|
|
1473
|
+
if ("function" == typeof s) return fill(t, e, 1, {
|
|
1474
|
+
transform: s
|
|
1475
|
+
});
|
|
1476
|
+
if (isObject(s)) return fill(t, e, 0, s);
|
|
1477
|
+
let i = {
|
|
1478
|
+
...r
|
|
1479
|
+
};
|
|
1480
|
+
if (true === i.capture) i.wrap = true;
|
|
1481
|
+
s = s || i.step || 1;
|
|
1482
|
+
if (!isNumber(s)) {
|
|
1483
|
+
if (null != s && !isObject(s)) return invalidStep(s, i);
|
|
1484
|
+
return fill(t, e, 1, s);
|
|
1485
|
+
}
|
|
1486
|
+
if (isNumber(t) && isNumber(e)) return fillNumbers(t, e, s, i);
|
|
1487
|
+
return fillLetters(t, e, Math.max(Math.abs(s), 1), i);
|
|
1488
|
+
};
|
|
1489
|
+
t.exports = fill;
|
|
1490
|
+
},
|
|
1491
|
+
249: (t, e, s)=>{
|
|
1492
|
+
"use strict";
|
|
1493
|
+
if ("darwin" !== process.platform) throw new Error(`Module 'fsevents' is not compatible with platform '${process.platform}'`);
|
|
1494
|
+
const r = s(653);
|
|
1495
|
+
const i = r.constants;
|
|
1496
|
+
function watch(t, e, s) {
|
|
1497
|
+
if ("string" != typeof t) throw new TypeError(`fsevents argument 1 must be a string and not a ${typeof t}`);
|
|
1498
|
+
if ("function" == typeof e && void 0 === s) {
|
|
1499
|
+
s = e;
|
|
1500
|
+
e = r.flags.SinceNow;
|
|
1501
|
+
}
|
|
1502
|
+
if ("number" != typeof e) throw new TypeError(`fsevents argument 2 must be a number and not a ${typeof e}`);
|
|
1503
|
+
if ("function" != typeof s) throw new TypeError(`fsevents argument 3 must be a function and not a ${typeof s}`);
|
|
1504
|
+
let i = r.start(r.global, t, e, s);
|
|
1505
|
+
if (!i) throw new Error(`could not watch: ${t}`);
|
|
1506
|
+
return ()=>{
|
|
1507
|
+
const t = i ? Promise.resolve(i).then(r.stop) : Promise.resolve(void 0);
|
|
1508
|
+
i = void 0;
|
|
1509
|
+
return t;
|
|
1510
|
+
};
|
|
1511
|
+
}
|
|
1512
|
+
function getInfo(t, e) {
|
|
1513
|
+
return {
|
|
1514
|
+
path: t,
|
|
1515
|
+
flags: e,
|
|
1516
|
+
event: getEventType(e),
|
|
1517
|
+
type: getFileType(e),
|
|
1518
|
+
changes: getFileChanges(e)
|
|
1519
|
+
};
|
|
1520
|
+
}
|
|
1521
|
+
function getFileType(t) {
|
|
1522
|
+
if (i.ItemIsFile & t) return "file";
|
|
1523
|
+
if (i.ItemIsDir & t) return "directory";
|
|
1524
|
+
if (i.ItemIsSymlink & t) return "symlink";
|
|
1525
|
+
}
|
|
1526
|
+
function anyIsTrue(t) {
|
|
1527
|
+
for(let e in t)if (t[e]) return true;
|
|
1528
|
+
return false;
|
|
1529
|
+
}
|
|
1530
|
+
function getEventType(t) {
|
|
1531
|
+
if (i.ItemRemoved & t) return "deleted";
|
|
1532
|
+
if (i.ItemRenamed & t) return "moved";
|
|
1533
|
+
if (i.ItemCreated & t) return "created";
|
|
1534
|
+
if (i.ItemModified & t) return "modified";
|
|
1535
|
+
if (i.RootChanged & t) return "root-changed";
|
|
1536
|
+
if (i.ItemCloned & t) return "cloned";
|
|
1537
|
+
if (anyIsTrue(t)) return "modified";
|
|
1538
|
+
return "unknown";
|
|
1539
|
+
}
|
|
1540
|
+
function getFileChanges(t) {
|
|
1541
|
+
return {
|
|
1542
|
+
inode: !!(i.ItemInodeMetaMod & t),
|
|
1543
|
+
finder: !!(i.ItemFinderInfoMod & t),
|
|
1544
|
+
access: !!(i.ItemChangeOwner & t),
|
|
1545
|
+
xattrs: !!(i.ItemXattrMod & t)
|
|
1546
|
+
};
|
|
1547
|
+
}
|
|
1548
|
+
e.watch = watch;
|
|
1549
|
+
e.getInfo = getInfo;
|
|
1550
|
+
e.constants = i;
|
|
1551
|
+
},
|
|
1552
|
+
976: (t, e, s)=>{
|
|
1553
|
+
"use strict";
|
|
1554
|
+
var r = s(654);
|
|
1555
|
+
var i = s(17).posix.dirname;
|
|
1556
|
+
var n = "win32" === s(37).platform();
|
|
1557
|
+
var o = "/";
|
|
1558
|
+
var a = /\\/g;
|
|
1559
|
+
var u = /[\{\[].*[\}\]]$/;
|
|
1560
|
+
var l = /(^|[^\\])([\{\[]|\([^\)]+$)/;
|
|
1561
|
+
var c = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
|
|
1562
|
+
t.exports = function(t, e) {
|
|
1563
|
+
var s = Object.assign({
|
|
1564
|
+
flipBackslashes: true
|
|
1565
|
+
}, e);
|
|
1566
|
+
if (s.flipBackslashes && n && t.indexOf(o) < 0) t = t.replace(a, o);
|
|
1567
|
+
if (u.test(t)) t += o;
|
|
1568
|
+
t += "a";
|
|
1569
|
+
do t = i(t);
|
|
1570
|
+
while (r(t) || l.test(t));
|
|
1571
|
+
return t.replace(c, "$1");
|
|
1572
|
+
};
|
|
1573
|
+
},
|
|
1574
|
+
41: (t, e, s)=>{
|
|
1575
|
+
"use strict";
|
|
1576
|
+
const r = s(17);
|
|
1577
|
+
const i = s(828);
|
|
1578
|
+
const n = new Set(i);
|
|
1579
|
+
t.exports = (t)=>n.has(r.extname(t).slice(1).toLowerCase());
|
|
1580
|
+
},
|
|
1581
|
+
71: (t)=>{
|
|
1582
|
+
/*!
|
|
9
1583
|
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
10
1584
|
*
|
|
11
1585
|
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
12
1586
|
* Licensed under the MIT License.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
|
|
1587
|
+
*/ t.exports = function(t) {
|
|
1588
|
+
if ("string" != typeof t || "" === t) return false;
|
|
1589
|
+
var e;
|
|
1590
|
+
while(e = /(\\).|([@?!+*]\(.*\))/g.exec(t)){
|
|
1591
|
+
if (e[2]) return true;
|
|
1592
|
+
t = t.slice(e.index + e[0].length);
|
|
1593
|
+
}
|
|
1594
|
+
return false;
|
|
1595
|
+
};
|
|
1596
|
+
},
|
|
1597
|
+
654: (t, e, s)=>{
|
|
1598
|
+
/*!
|
|
16
1599
|
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|
17
1600
|
*
|
|
18
1601
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
19
1602
|
* Released under the MIT License.
|
|
20
|
-
*/
|
|
21
|
-
var
|
|
22
|
-
|
|
1603
|
+
*/ var r = s(71);
|
|
1604
|
+
var i = {
|
|
1605
|
+
"{": "}",
|
|
1606
|
+
"(": ")",
|
|
1607
|
+
"[": "]"
|
|
1608
|
+
};
|
|
1609
|
+
var strictCheck = function(t) {
|
|
1610
|
+
if ("!" === t[0]) return true;
|
|
1611
|
+
var e = 0;
|
|
1612
|
+
var s = -2;
|
|
1613
|
+
var r = -2;
|
|
1614
|
+
var n = -2;
|
|
1615
|
+
var o = -2;
|
|
1616
|
+
var a = -2;
|
|
1617
|
+
while(e < t.length){
|
|
1618
|
+
if ("*" === t[e]) return true;
|
|
1619
|
+
if ("?" === t[e + 1] && /[\].+)]/.test(t[e])) return true;
|
|
1620
|
+
if (-1 !== r && "[" === t[e] && "]" !== t[e + 1]) {
|
|
1621
|
+
if (r < e) r = t.indexOf("]", e);
|
|
1622
|
+
if (r > e) {
|
|
1623
|
+
if (-1 === a || a > r) return true;
|
|
1624
|
+
a = t.indexOf("\\", e);
|
|
1625
|
+
if (-1 === a || a > r) return true;
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
if (-1 !== n && "{" === t[e] && "}" !== t[e + 1]) {
|
|
1629
|
+
n = t.indexOf("}", e);
|
|
1630
|
+
if (n > e) {
|
|
1631
|
+
a = t.indexOf("\\", e);
|
|
1632
|
+
if (-1 === a || a > n) return true;
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1635
|
+
if (-1 !== o && "(" === t[e] && "?" === t[e + 1] && /[:!=]/.test(t[e + 2]) && ")" !== t[e + 3]) {
|
|
1636
|
+
o = t.indexOf(")", e);
|
|
1637
|
+
if (o > e) {
|
|
1638
|
+
a = t.indexOf("\\", e);
|
|
1639
|
+
if (-1 === a || a > o) return true;
|
|
1640
|
+
}
|
|
1641
|
+
}
|
|
1642
|
+
if (-1 !== s && "(" === t[e] && "|" !== t[e + 1]) {
|
|
1643
|
+
if (s < e) s = t.indexOf("|", e);
|
|
1644
|
+
if (-1 !== s && ")" !== t[s + 1]) {
|
|
1645
|
+
o = t.indexOf(")", s);
|
|
1646
|
+
if (o > s) {
|
|
1647
|
+
a = t.indexOf("\\", s);
|
|
1648
|
+
if (-1 === a || a > o) return true;
|
|
1649
|
+
}
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
if ("\\" === t[e]) {
|
|
1653
|
+
var u = t[e + 1];
|
|
1654
|
+
e += 2;
|
|
1655
|
+
var l = i[u];
|
|
1656
|
+
if (l) {
|
|
1657
|
+
var c = t.indexOf(l, e);
|
|
1658
|
+
if (-1 !== c) e = c + 1;
|
|
1659
|
+
}
|
|
1660
|
+
if ("!" === t[e]) return true;
|
|
1661
|
+
} else e++;
|
|
1662
|
+
}
|
|
1663
|
+
return false;
|
|
1664
|
+
};
|
|
1665
|
+
var relaxedCheck = function(t) {
|
|
1666
|
+
if ("!" === t[0]) return true;
|
|
1667
|
+
var e = 0;
|
|
1668
|
+
while(e < t.length){
|
|
1669
|
+
if (/[*?{}()[\]]/.test(t[e])) return true;
|
|
1670
|
+
if ("\\" === t[e]) {
|
|
1671
|
+
var s = t[e + 1];
|
|
1672
|
+
e += 2;
|
|
1673
|
+
var r = i[s];
|
|
1674
|
+
if (r) {
|
|
1675
|
+
var n = t.indexOf(r, e);
|
|
1676
|
+
if (-1 !== n) e = n + 1;
|
|
1677
|
+
}
|
|
1678
|
+
if ("!" === t[e]) return true;
|
|
1679
|
+
} else e++;
|
|
1680
|
+
}
|
|
1681
|
+
return false;
|
|
1682
|
+
};
|
|
1683
|
+
t.exports = function(t, e) {
|
|
1684
|
+
if ("string" != typeof t || "" === t) return false;
|
|
1685
|
+
if (r(t)) return true;
|
|
1686
|
+
var s = strictCheck;
|
|
1687
|
+
if (e && false === e.strict) s = relaxedCheck;
|
|
1688
|
+
return s(t);
|
|
1689
|
+
};
|
|
1690
|
+
},
|
|
1691
|
+
387: (t)=>{
|
|
1692
|
+
"use strict";
|
|
1693
|
+
/*!
|
|
23
1694
|
* is-number <https://github.com/jonschlinkert/is-number>
|
|
24
1695
|
*
|
|
25
1696
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
26
1697
|
* Released under the MIT License.
|
|
27
|
-
*/t.exports=function(t)
|
|
28
|
-
|
|
1698
|
+
*/ t.exports = function(t) {
|
|
1699
|
+
if ("number" == typeof t) return t - t === 0;
|
|
1700
|
+
if ("string" == typeof t && "" !== t.trim()) return Number.isFinite ? Number.isFinite(+t) : isFinite(+t);
|
|
1701
|
+
return false;
|
|
1702
|
+
};
|
|
1703
|
+
},
|
|
1704
|
+
498: (t)=>{
|
|
1705
|
+
/*!
|
|
29
1706
|
* normalize-path <https://github.com/jonschlinkert/normalize-path>
|
|
30
1707
|
*
|
|
31
1708
|
* Copyright (c) 2014-2018, Jon Schlinkert.
|
|
32
1709
|
* Released under the MIT License.
|
|
33
|
-
*/
|
|
34
|
-
t.exports=function(t,e){if(typeof t!=="string"){throw new TypeError("expected path to be a string")}if(t==="\\"||t==="/")return"/";var s=t.length;if(s<=1)return t;var r="";if(s>4&&t[3]==="\\"){var i=t[2];if((i==="?"||i===".")&&t.slice(0,2)==="\\\\"){t=t.slice(2);r="//"}}var n=t.split(/[/\\]+/);if(e!==false&&n[n.length-1]===""){n.pop()}return r+n.join("/")}},700:(t,e,s)=>{"use strict";t.exports=s(144)},112:(t,e,s)=>{"use strict";const r=s(17);const i="\\\\/";const n=`[^${i}]`;const o="\\.";const a="\\+";const u="\\?";const l="\\/";const c="(?=.)";const f="[^/]";const h=`(?:${l}|$)`;const p=`(?:^|${l})`;const d=`${o}{1,2}${h}`;const _=`(?!${o})`;const E=`(?!${p}${d})`;const g=`(?!${o}{0,1}${h})`;const m=`(?!${d})`;const y=`[^.${l}]`;const R=`${f}*?`;const w={DOT_LITERAL:o,PLUS_LITERAL:a,QMARK_LITERAL:u,SLASH_LITERAL:l,ONE_CHAR:c,QMARK:f,END_ANCHOR:h,DOTS_SLASH:d,NO_DOT:_,NO_DOTS:E,NO_DOT_SLASH:g,NO_DOTS_SLASH:m,QMARK_NO_DOT:y,STAR:R,START_ANCHOR:p};const A={...w,SLASH_LITERAL:`[${i}]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`${o}{1,2}(?:[${i}]|$)`,NO_DOT:`(?!${o})`,NO_DOTS:`(?!(?:^|[${i}])${o}{1,2}(?:[${i}]|$))`,NO_DOT_SLASH:`(?!${o}{0,1}(?:[${i}]|$))`,NO_DOTS_SLASH:`(?!${o}{1,2}(?:[${i}]|$))`,QMARK_NO_DOT:`[^.${i}]`,START_ANCHOR:`(?:^|[${i}])`,END_ANCHOR:`(?:[${i}]|$)`};const b={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};t.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:b,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:r.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===true?A:w}}},352:(t,e,s)=>{"use strict";const r=s(112);const i=s(869);const{MAX_LENGTH:n,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:u,REPLACEMENTS:l}=r;const expandRange=(t,e)=>{if(typeof e.expandRange==="function"){return e.expandRange(...t,e)}t.sort();const s=`[${t.join("-")}]`;try{new RegExp(s)}catch(e){return t.map((t=>i.escapeRegex(t))).join("..")}return s};const syntaxError=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`;const parse=(t,e)=>{if(typeof t!=="string"){throw new TypeError("Expected a string")}t=l[t]||t;const s={...e};const c=typeof s.maxLength==="number"?Math.min(n,s.maxLength):n;let f=t.length;if(f>c){throw new SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${c}`)}const h={type:"bos",value:"",output:s.prepend||""};const p=[h];const d=s.capture?"":"?:";const _=i.isWindows(e);const E=r.globChars(_);const g=r.extglobChars(E);const{DOT_LITERAL:m,PLUS_LITERAL:y,SLASH_LITERAL:R,ONE_CHAR:w,DOTS_SLASH:A,NO_DOT:b,NO_DOT_SLASH:v,NO_DOTS_SLASH:S,QMARK:C,QMARK_NO_DOT:x,STAR:T,START_ANCHOR:H}=E;const globstar=t=>`(${d}(?:(?!${H}${t.dot?A:m}).)*?)`;const O=s.dot?"":b;const P=s.dot?C:x;let I=s.bash===true?globstar(s):T;if(s.capture){I=`(${I})`}if(typeof s.noext==="boolean"){s.noextglob=s.noext}const L={input:t,index:-1,start:0,dot:s.dot===true,consumed:"",output:"",prefix:"",backtrack:false,negated:false,brackets:0,braces:0,parens:0,quotes:0,globstar:false,tokens:p};t=i.removePrefix(t,L);f=t.length;const N=[];const k=[];const $=[];let D=h;let F;const eos=()=>L.index===f-1;const M=L.peek=(e=1)=>t[L.index+e];const W=L.advance=()=>t[++L.index]||"";const remaining=()=>t.slice(L.index+1);const consume=(t="",e=0)=>{L.consumed+=t;L.index+=e};const append=t=>{L.output+=t.output!=null?t.output:t.value;consume(t.value)};const negate=()=>{let t=1;while(M()==="!"&&(M(2)!=="("||M(3)==="?")){W();L.start++;t++}if(t%2===0){return false}L.negated=true;L.start++;return true};const increment=t=>{L[t]++;$.push(t)};const decrement=t=>{L[t]--;$.pop()};const push=t=>{if(D.type==="globstar"){const e=L.braces>0&&(t.type==="comma"||t.type==="brace");const s=t.extglob===true||N.length&&(t.type==="pipe"||t.type==="paren");if(t.type!=="slash"&&t.type!=="paren"&&!e&&!s){L.output=L.output.slice(0,-D.output.length);D.type="star";D.value="*";D.output=I;L.output+=D.output}}if(N.length&&t.type!=="paren"){N[N.length-1].inner+=t.value}if(t.value||t.output)append(t);if(D&&D.type==="text"&&t.type==="text"){D.value+=t.value;D.output=(D.output||"")+t.value;return}t.prev=D;p.push(t);D=t};const extglobOpen=(t,e)=>{const r={...g[e],conditions:1,inner:""};r.prev=D;r.parens=L.parens;r.output=L.output;const i=(s.capture?"(":"")+r.open;increment("parens");push({type:t,value:e,output:L.output?"":w});push({type:"paren",extglob:true,value:W(),output:i});N.push(r)};const extglobClose=t=>{let e=t.close+(s.capture?")":"");let r;if(t.type==="negate"){let i=I;if(t.inner&&t.inner.length>1&&t.inner.includes("/")){i=globstar(s)}if(i!==I||eos()||/^\)+$/.test(remaining())){e=t.close=`)$))${i}`}if(t.inner.includes("*")&&(r=remaining())&&/^\.[^\\/.]+$/.test(r)){e=t.close=`)${r})${i})`}if(t.prev.type==="bos"){L.negatedExtglob=true}}push({type:"paren",extglob:true,value:F,output:e});decrement("parens")};if(s.fastpaths!==false&&!/(^[*!]|[/()[\]{}"])/.test(t)){let r=false;let n=t.replace(u,((t,e,s,i,n,o)=>{if(i==="\\"){r=true;return t}if(i==="?"){if(e){return e+i+(n?C.repeat(n.length):"")}if(o===0){return P+(n?C.repeat(n.length):"")}return C.repeat(s.length)}if(i==="."){return m.repeat(s.length)}if(i==="*"){if(e){return e+i+(n?I:"")}return I}return e?t:`\\${t}`}));if(r===true){if(s.unescape===true){n=n.replace(/\\/g,"")}else{n=n.replace(/\\+/g,(t=>t.length%2===0?"\\\\":t?"\\":""))}}if(n===t&&s.contains===true){L.output=t;return L}L.output=i.wrapOutput(n,L,e);return L}while(!eos()){F=W();if(F==="\0"){continue}if(F==="\\"){const t=M();if(t==="/"&&s.bash!==true){continue}if(t==="."||t===";"){continue}if(!t){F+="\\";push({type:"text",value:F});continue}const e=/^\\+/.exec(remaining());let r=0;if(e&&e[0].length>2){r=e[0].length;L.index+=r;if(r%2!==0){F+="\\"}}if(s.unescape===true){F=W()}else{F+=W()}if(L.brackets===0){push({type:"text",value:F});continue}}if(L.brackets>0&&(F!=="]"||D.value==="["||D.value==="[^")){if(s.posix!==false&&F===":"){const t=D.value.slice(1);if(t.includes("[")){D.posix=true;if(t.includes(":")){const t=D.value.lastIndexOf("[");const e=D.value.slice(0,t);const s=D.value.slice(t+2);const r=o[s];if(r){D.value=e+r;L.backtrack=true;W();if(!h.output&&p.indexOf(D)===1){h.output=w}continue}}}}if(F==="["&&M()!==":"||F==="-"&&M()==="]"){F=`\\${F}`}if(F==="]"&&(D.value==="["||D.value==="[^")){F=`\\${F}`}if(s.posix===true&&F==="!"&&D.value==="["){F="^"}D.value+=F;append({value:F});continue}if(L.quotes===1&&F!=='"'){F=i.escapeRegex(F);D.value+=F;append({value:F});continue}if(F==='"'){L.quotes=L.quotes===1?0:1;if(s.keepQuotes===true){push({type:"text",value:F})}continue}if(F==="("){increment("parens");push({type:"paren",value:F});continue}if(F===")"){if(L.parens===0&&s.strictBrackets===true){throw new SyntaxError(syntaxError("opening","("))}const t=N[N.length-1];if(t&&L.parens===t.parens+1){extglobClose(N.pop());continue}push({type:"paren",value:F,output:L.parens?")":"\\)"});decrement("parens");continue}if(F==="["){if(s.nobracket===true||!remaining().includes("]")){if(s.nobracket!==true&&s.strictBrackets===true){throw new SyntaxError(syntaxError("closing","]"))}F=`\\${F}`}else{increment("brackets")}push({type:"bracket",value:F});continue}if(F==="]"){if(s.nobracket===true||D&&D.type==="bracket"&&D.value.length===1){push({type:"text",value:F,output:`\\${F}`});continue}if(L.brackets===0){if(s.strictBrackets===true){throw new SyntaxError(syntaxError("opening","["))}push({type:"text",value:F,output:`\\${F}`});continue}decrement("brackets");const t=D.value.slice(1);if(D.posix!==true&&t[0]==="^"&&!t.includes("/")){F=`/${F}`}D.value+=F;append({value:F});if(s.literalBrackets===false||i.hasRegexChars(t)){continue}const e=i.escapeRegex(D.value);L.output=L.output.slice(0,-D.value.length);if(s.literalBrackets===true){L.output+=e;D.value=e;continue}D.value=`(${d}${e}|${D.value})`;L.output+=D.value;continue}if(F==="{"&&s.nobrace!==true){increment("braces");const t={type:"brace",value:F,output:"(",outputIndex:L.output.length,tokensIndex:L.tokens.length};k.push(t);push(t);continue}if(F==="}"){const t=k[k.length-1];if(s.nobrace===true||!t){push({type:"text",value:F,output:F});continue}let e=")";if(t.dots===true){const t=p.slice();const r=[];for(let e=t.length-1;e>=0;e--){p.pop();if(t[e].type==="brace"){break}if(t[e].type!=="dots"){r.unshift(t[e].value)}}e=expandRange(r,s);L.backtrack=true}if(t.comma!==true&&t.dots!==true){const s=L.output.slice(0,t.outputIndex);const r=L.tokens.slice(t.tokensIndex);t.value=t.output="\\{";F=e="\\}";L.output=s;for(const t of r){L.output+=t.output||t.value}}push({type:"brace",value:F,output:e});decrement("braces");k.pop();continue}if(F==="|"){if(N.length>0){N[N.length-1].conditions++}push({type:"text",value:F});continue}if(F===","){let t=F;const e=k[k.length-1];if(e&&$[$.length-1]==="braces"){e.comma=true;t="|"}push({type:"comma",value:F,output:t});continue}if(F==="/"){if(D.type==="dot"&&L.index===L.start+1){L.start=L.index+1;L.consumed="";L.output="";p.pop();D=h;continue}push({type:"slash",value:F,output:R});continue}if(F==="."){if(L.braces>0&&D.type==="dot"){if(D.value===".")D.output=m;const t=k[k.length-1];D.type="dots";D.output+=F;D.value+=F;t.dots=true;continue}if(L.braces+L.parens===0&&D.type!=="bos"&&D.type!=="slash"){push({type:"text",value:F,output:m});continue}push({type:"dot",value:F,output:m});continue}if(F==="?"){const t=D&&D.value==="(";if(!t&&s.noextglob!==true&&M()==="("&&M(2)!=="?"){extglobOpen("qmark",F);continue}if(D&&D.type==="paren"){const t=M();let e=F;if(t==="<"&&!i.supportsLookbehinds()){throw new Error("Node.js v10 or higher is required for regex lookbehinds")}if(D.value==="("&&!/[!=<:]/.test(t)||t==="<"&&!/<([!=]|\w+>)/.test(remaining())){e=`\\${F}`}push({type:"text",value:F,output:e});continue}if(s.dot!==true&&(D.type==="slash"||D.type==="bos")){push({type:"qmark",value:F,output:x});continue}push({type:"qmark",value:F,output:C});continue}if(F==="!"){if(s.noextglob!==true&&M()==="("){if(M(2)!=="?"||!/[!=<:]/.test(M(3))){extglobOpen("negate",F);continue}}if(s.nonegate!==true&&L.index===0){negate();continue}}if(F==="+"){if(s.noextglob!==true&&M()==="("&&M(2)!=="?"){extglobOpen("plus",F);continue}if(D&&D.value==="("||s.regex===false){push({type:"plus",value:F,output:y});continue}if(D&&(D.type==="bracket"||D.type==="paren"||D.type==="brace")||L.parens>0){push({type:"plus",value:F});continue}push({type:"plus",value:y});continue}if(F==="@"){if(s.noextglob!==true&&M()==="("&&M(2)!=="?"){push({type:"at",extglob:true,value:F,output:""});continue}push({type:"text",value:F});continue}if(F!=="*"){if(F==="$"||F==="^"){F=`\\${F}`}const t=a.exec(remaining());if(t){F+=t[0];L.index+=t[0].length}push({type:"text",value:F});continue}if(D&&(D.type==="globstar"||D.star===true)){D.type="star";D.star=true;D.value+=F;D.output=I;L.backtrack=true;L.globstar=true;consume(F);continue}let e=remaining();if(s.noextglob!==true&&/^\([^?]/.test(e)){extglobOpen("star",F);continue}if(D.type==="star"){if(s.noglobstar===true){consume(F);continue}const r=D.prev;const i=r.prev;const n=r.type==="slash"||r.type==="bos";const o=i&&(i.type==="star"||i.type==="globstar");if(s.bash===true&&(!n||e[0]&&e[0]!=="/")){push({type:"star",value:F,output:""});continue}const a=L.braces>0&&(r.type==="comma"||r.type==="brace");const u=N.length&&(r.type==="pipe"||r.type==="paren");if(!n&&r.type!=="paren"&&!a&&!u){push({type:"star",value:F,output:""});continue}while(e.slice(0,3)==="/**"){const s=t[L.index+4];if(s&&s!=="/"){break}e=e.slice(3);consume("/**",3)}if(r.type==="bos"&&eos()){D.type="globstar";D.value+=F;D.output=globstar(s);L.output=D.output;L.globstar=true;consume(F);continue}if(r.type==="slash"&&r.prev.type!=="bos"&&!o&&eos()){L.output=L.output.slice(0,-(r.output+D.output).length);r.output=`(?:${r.output}`;D.type="globstar";D.output=globstar(s)+(s.strictSlashes?")":"|$)");D.value+=F;L.globstar=true;L.output+=r.output+D.output;consume(F);continue}if(r.type==="slash"&&r.prev.type!=="bos"&&e[0]==="/"){const t=e[1]!==void 0?"|$":"";L.output=L.output.slice(0,-(r.output+D.output).length);r.output=`(?:${r.output}`;D.type="globstar";D.output=`${globstar(s)}${R}|${R}${t})`;D.value+=F;L.output+=r.output+D.output;L.globstar=true;consume(F+W());push({type:"slash",value:"/",output:""});continue}if(r.type==="bos"&&e[0]==="/"){D.type="globstar";D.value+=F;D.output=`(?:^|${R}|${globstar(s)}${R})`;L.output=D.output;L.globstar=true;consume(F+W());push({type:"slash",value:"/",output:""});continue}L.output=L.output.slice(0,-D.output.length);D.type="globstar";D.output=globstar(s);D.value+=F;L.output+=D.output;L.globstar=true;consume(F);continue}const r={type:"star",value:F,output:I};if(s.bash===true){r.output=".*?";if(D.type==="bos"||D.type==="slash"){r.output=O+r.output}push(r);continue}if(D&&(D.type==="bracket"||D.type==="paren")&&s.regex===true){r.output=F;push(r);continue}if(L.index===L.start||D.type==="slash"||D.type==="dot"){if(D.type==="dot"){L.output+=v;D.output+=v}else if(s.dot===true){L.output+=S;D.output+=S}else{L.output+=O;D.output+=O}if(M()!=="*"){L.output+=w;D.output+=w}}push(r)}while(L.brackets>0){if(s.strictBrackets===true)throw new SyntaxError(syntaxError("closing","]"));L.output=i.escapeLast(L.output,"[");decrement("brackets")}while(L.parens>0){if(s.strictBrackets===true)throw new SyntaxError(syntaxError("closing",")"));L.output=i.escapeLast(L.output,"(");decrement("parens")}while(L.braces>0){if(s.strictBrackets===true)throw new SyntaxError(syntaxError("closing","}"));L.output=i.escapeLast(L.output,"{");decrement("braces")}if(s.strictSlashes!==true&&(D.type==="star"||D.type==="bracket")){push({type:"maybe_slash",value:"",output:`${R}?`})}if(L.backtrack===true){L.output="";for(const t of L.tokens){L.output+=t.output!=null?t.output:t.value;if(t.suffix){L.output+=t.suffix}}}return L};parse.fastpaths=(t,e)=>{const s={...e};const o=typeof s.maxLength==="number"?Math.min(n,s.maxLength):n;const a=t.length;if(a>o){throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${o}`)}t=l[t]||t;const u=i.isWindows(e);const{DOT_LITERAL:c,SLASH_LITERAL:f,ONE_CHAR:h,DOTS_SLASH:p,NO_DOT:d,NO_DOTS:_,NO_DOTS_SLASH:E,STAR:g,START_ANCHOR:m}=r.globChars(u);const y=s.dot?_:d;const R=s.dot?E:d;const w=s.capture?"":"?:";const A={negated:false,prefix:""};let b=s.bash===true?".*?":g;if(s.capture){b=`(${b})`}const globstar=t=>{if(t.noglobstar===true)return b;return`(${w}(?:(?!${m}${t.dot?p:c}).)*?)`};const create=t=>{switch(t){case"*":return`${y}${h}${b}`;case".*":return`${c}${h}${b}`;case"*.*":return`${y}${b}${c}${h}${b}`;case"*/*":return`${y}${b}${f}${h}${R}${b}`;case"**":return y+globstar(s);case"**/*":return`(?:${y}${globstar(s)}${f})?${R}${h}${b}`;case"**/*.*":return`(?:${y}${globstar(s)}${f})?${R}${b}${c}${h}${b}`;case"**/.*":return`(?:${y}${globstar(s)}${f})?${c}${h}${b}`;default:{const e=/^(.*?)\.(\w+)$/.exec(t);if(!e)return;const s=create(e[1]);if(!s)return;return s+c+e[2]}}};const v=i.removePrefix(t,A);let S=create(v);if(S&&s.strictSlashes!==true){S+=`${f}?`}return S};t.exports=parse},144:(t,e,s)=>{"use strict";const r=s(17);const i=s(909);const n=s(352);const o=s(869);const a=s(112);const isObject=t=>t&&typeof t==="object"&&!Array.isArray(t);const picomatch=(t,e,s=false)=>{if(Array.isArray(t)){const r=t.map((t=>picomatch(t,e,s)));const arrayMatcher=t=>{for(const e of r){const s=e(t);if(s)return s}return false};return arrayMatcher}const r=isObject(t)&&t.tokens&&t.input;if(t===""||typeof t!=="string"&&!r){throw new TypeError("Expected pattern to be a non-empty string")}const i=e||{};const n=o.isWindows(e);const a=r?picomatch.compileRe(t,e):picomatch.makeRe(t,e,false,true);const u=a.state;delete a.state;let isIgnored=()=>false;if(i.ignore){const t={...e,ignore:null,onMatch:null,onResult:null};isIgnored=picomatch(i.ignore,t,s)}const matcher=(s,r=false)=>{const{isMatch:o,match:l,output:c}=picomatch.test(s,a,e,{glob:t,posix:n});const f={glob:t,state:u,regex:a,posix:n,input:s,output:c,match:l,isMatch:o};if(typeof i.onResult==="function"){i.onResult(f)}if(o===false){f.isMatch=false;return r?f:false}if(isIgnored(s)){if(typeof i.onIgnore==="function"){i.onIgnore(f)}f.isMatch=false;return r?f:false}if(typeof i.onMatch==="function"){i.onMatch(f)}return r?f:true};if(s){matcher.state=u}return matcher};picomatch.test=(t,e,s,{glob:r,posix:i}={})=>{if(typeof t!=="string"){throw new TypeError("Expected input to be a string")}if(t===""){return{isMatch:false,output:""}}const n=s||{};const a=n.format||(i?o.toPosixSlashes:null);let u=t===r;let l=u&&a?a(t):t;if(u===false){l=a?a(t):t;u=l===r}if(u===false||n.capture===true){if(n.matchBase===true||n.basename===true){u=picomatch.matchBase(t,e,s,i)}else{u=e.exec(l)}}return{isMatch:Boolean(u),match:u,output:l}};picomatch.matchBase=(t,e,s,i=o.isWindows(s))=>{const n=e instanceof RegExp?e:picomatch.makeRe(e,s);return n.test(r.basename(t))};picomatch.isMatch=(t,e,s)=>picomatch(e,s)(t);picomatch.parse=(t,e)=>{if(Array.isArray(t))return t.map((t=>picomatch.parse(t,e)));return n(t,{...e,fastpaths:false})};picomatch.scan=(t,e)=>i(t,e);picomatch.compileRe=(t,e,s=false,r=false)=>{if(s===true){return t.output}const i=e||{};const n=i.contains?"":"^";const o=i.contains?"":"$";let a=`${n}(?:${t.output})${o}`;if(t&&t.negated===true){a=`^(?!${a}).*$`}const u=picomatch.toRegex(a,e);if(r===true){u.state=t}return u};picomatch.makeRe=(t,e={},s=false,r=false)=>{if(!t||typeof t!=="string"){throw new TypeError("Expected a non-empty string")}let i={negated:false,fastpaths:true};if(e.fastpaths!==false&&(t[0]==="."||t[0]==="*")){i.output=n.fastpaths(t,e)}if(!i.output){i=n(t,e)}return picomatch.compileRe(i,e,s,r)};picomatch.toRegex=(t,e)=>{try{const s=e||{};return new RegExp(t,s.flags||(s.nocase?"i":""))}catch(t){if(e&&e.debug===true)throw t;return/$^/}};picomatch.constants=a;t.exports=picomatch},909:(t,e,s)=>{"use strict";const r=s(869);const{CHAR_ASTERISK:i,CHAR_AT:n,CHAR_BACKWARD_SLASH:o,CHAR_COMMA:a,CHAR_DOT:u,CHAR_EXCLAMATION_MARK:l,CHAR_FORWARD_SLASH:c,CHAR_LEFT_CURLY_BRACE:f,CHAR_LEFT_PARENTHESES:h,CHAR_LEFT_SQUARE_BRACKET:p,CHAR_PLUS:d,CHAR_QUESTION_MARK:_,CHAR_RIGHT_CURLY_BRACE:E,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:m}=s(112);const isPathSeparator=t=>t===c||t===o;const depth=t=>{if(t.isPrefix!==true){t.depth=t.isGlobstar?Infinity:1}};const scan=(t,e)=>{const s=e||{};const y=t.length-1;const R=s.parts===true||s.scanToEnd===true;const w=[];const A=[];const b=[];let v=t;let S=-1;let C=0;let x=0;let T=false;let H=false;let O=false;let P=false;let I=false;let L=false;let N=false;let k=false;let $=false;let D=false;let F=0;let M;let W;let G={value:"",depth:0,isGlob:false};const eos=()=>S>=y;const peek=()=>v.charCodeAt(S+1);const advance=()=>{M=W;return v.charCodeAt(++S)};while(S<y){W=advance();let t;if(W===o){N=G.backslashes=true;W=advance();if(W===f){L=true}continue}if(L===true||W===f){F++;while(eos()!==true&&(W=advance())){if(W===o){N=G.backslashes=true;advance();continue}if(W===f){F++;continue}if(L!==true&&W===u&&(W=advance())===u){T=G.isBrace=true;O=G.isGlob=true;D=true;if(R===true){continue}break}if(L!==true&&W===a){T=G.isBrace=true;O=G.isGlob=true;D=true;if(R===true){continue}break}if(W===E){F--;if(F===0){L=false;T=G.isBrace=true;D=true;break}}}if(R===true){continue}break}if(W===c){w.push(S);A.push(G);G={value:"",depth:0,isGlob:false};if(D===true)continue;if(M===u&&S===C+1){C+=2;continue}x=S+1;continue}if(s.noext!==true){const t=W===d||W===n||W===i||W===_||W===l;if(t===true&&peek()===h){O=G.isGlob=true;P=G.isExtglob=true;D=true;if(W===l&&S===C){$=true}if(R===true){while(eos()!==true&&(W=advance())){if(W===o){N=G.backslashes=true;W=advance();continue}if(W===g){O=G.isGlob=true;D=true;break}}continue}break}}if(W===i){if(M===i)I=G.isGlobstar=true;O=G.isGlob=true;D=true;if(R===true){continue}break}if(W===_){O=G.isGlob=true;D=true;if(R===true){continue}break}if(W===p){while(eos()!==true&&(t=advance())){if(t===o){N=G.backslashes=true;advance();continue}if(t===m){H=G.isBracket=true;O=G.isGlob=true;D=true;break}}if(R===true){continue}break}if(s.nonegate!==true&&W===l&&S===C){k=G.negated=true;C++;continue}if(s.noparen!==true&&W===h){O=G.isGlob=true;if(R===true){while(eos()!==true&&(W=advance())){if(W===h){N=G.backslashes=true;W=advance();continue}if(W===g){D=true;break}}continue}break}if(O===true){D=true;if(R===true){continue}break}}if(s.noext===true){P=false;O=false}let B=v;let U="";let K="";if(C>0){U=v.slice(0,C);v=v.slice(C);x-=C}if(B&&O===true&&x>0){B=v.slice(0,x);K=v.slice(x)}else if(O===true){B="";K=v}else{B=v}if(B&&B!==""&&B!=="/"&&B!==v){if(isPathSeparator(B.charCodeAt(B.length-1))){B=B.slice(0,-1)}}if(s.unescape===true){if(K)K=r.removeBackslashes(K);if(B&&N===true){B=r.removeBackslashes(B)}}const V={prefix:U,input:t,start:C,base:B,glob:K,isBrace:T,isBracket:H,isGlob:O,isExtglob:P,isGlobstar:I,negated:k,negatedExtglob:$};if(s.tokens===true){V.maxDepth=0;if(!isPathSeparator(W)){A.push(G)}V.tokens=A}if(s.parts===true||s.tokens===true){let e;for(let r=0;r<w.length;r++){const i=e?e+1:C;const n=w[r];const o=t.slice(i,n);if(s.tokens){if(r===0&&C!==0){A[r].isPrefix=true;A[r].value=U}else{A[r].value=o}depth(A[r]);V.maxDepth+=A[r].depth}if(r!==0||o!==""){b.push(o)}e=n}if(e&&e+1<t.length){const r=t.slice(e+1);b.push(r);if(s.tokens){A[A.length-1].value=r;depth(A[A.length-1]);V.maxDepth+=A[A.length-1].depth}}V.slashes=w;V.parts=b}return V};t.exports=scan},869:(t,e,s)=>{"use strict";const r=s(17);const i=process.platform==="win32";const{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_GLOBAL:u}=s(112);e.isObject=t=>t!==null&&typeof t==="object"&&!Array.isArray(t);e.hasRegexChars=t=>a.test(t);e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t);e.escapeRegex=t=>t.replace(u,"\\$1");e.toPosixSlashes=t=>t.replace(n,"/");e.removeBackslashes=t=>t.replace(o,(t=>t==="\\"?"":t));e.supportsLookbehinds=()=>{const t=process.version.slice(1).split(".").map(Number);if(t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10){return true}return false};e.isWindows=t=>{if(t&&typeof t.windows==="boolean"){return t.windows}return i===true||r.sep==="\\"};e.escapeLast=(t,s,r)=>{const i=t.lastIndexOf(s,r);if(i===-1)return t;if(t[i-1]==="\\")return e.escapeLast(t,s,i-1);return`${t.slice(0,i)}\\${t.slice(i)}`};e.removePrefix=(t,e={})=>{let s=t;if(s.startsWith("./")){s=s.slice(2);e.prefix="./"}return s};e.wrapOutput=(t,e={},s={})=>{const r=s.contains?"":"^";const i=s.contains?"":"$";let n=`${r}(?:${t})${i}`;if(e.negated===true){n=`(?:^(?!${n}).*$)`}return n}},559:(t,e,s)=>{"use strict";const r=s(147);const{Readable:i}=s(781);const n=s(17);const{promisify:o}=s(837);const a=s(700);const u=o(r.readdir);const l=o(r.stat);const c=o(r.lstat);const f=o(r.realpath);const h="!";const p="READDIRP_RECURSIVE_ERROR";const d=new Set(["ENOENT","EPERM","EACCES","ELOOP",p]);const _="files";const E="directories";const g="files_directories";const m="all";const y=[_,E,g,m];const isNormalFlowError=t=>d.has(t.code);const[R,w]=process.versions.node.split(".").slice(0,2).map((t=>Number.parseInt(t,10)));const A=process.platform==="win32"&&(R>10||R===10&&w>=5);const normalizeFilter=t=>{if(t===undefined)return;if(typeof t==="function")return t;if(typeof t==="string"){const e=a(t.trim());return t=>e(t.basename)}if(Array.isArray(t)){const e=[];const s=[];for(const r of t){const t=r.trim();if(t.charAt(0)===h){s.push(a(t.slice(1)))}else{e.push(a(t))}}if(s.length>0){if(e.length>0){return t=>e.some((e=>e(t.basename)))&&!s.some((e=>e(t.basename)))}return t=>!s.some((e=>e(t.basename)))}return t=>e.some((e=>e(t.basename)))}};class ReaddirpStream extends i{static get defaultOptions(){return{root:".",fileFilter:t=>true,directoryFilter:t=>true,type:_,lstat:false,depth:2147483648,alwaysStat:false}}constructor(t={}){super({objectMode:true,autoDestroy:true,highWaterMark:t.highWaterMark||4096});const e={...ReaddirpStream.defaultOptions,...t};const{root:s,type:i}=e;this._fileFilter=normalizeFilter(e.fileFilter);this._directoryFilter=normalizeFilter(e.directoryFilter);const o=e.lstat?c:l;if(A){this._stat=t=>o(t,{bigint:true})}else{this._stat=o}this._maxDepth=e.depth;this._wantsDir=[E,g,m].includes(i);this._wantsFile=[_,g,m].includes(i);this._wantsEverything=i===m;this._root=n.resolve(s);this._isDirent="Dirent"in r&&!e.alwaysStat;this._statsProp=this._isDirent?"dirent":"stats";this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent};this.parents=[this._exploreDir(s,1)];this.reading=false;this.parent=undefined}async _read(t){if(this.reading)return;this.reading=true;try{while(!this.destroyed&&t>0){const{path:e,depth:s,files:r=[]}=this.parent||{};if(r.length>0){const i=r.splice(0,t).map((t=>this._formatEntry(t,e)));for(const e of await Promise.all(i)){if(this.destroyed)return;const r=await this._getEntryType(e);if(r==="directory"&&this._directoryFilter(e)){if(s<=this._maxDepth){this.parents.push(this._exploreDir(e.fullPath,s+1))}if(this._wantsDir){this.push(e);t--}}else if((r==="file"||this._includeAsFile(e))&&this._fileFilter(e)){if(this._wantsFile){this.push(e);t--}}}}else{const t=this.parents.pop();if(!t){this.push(null);break}this.parent=await t;if(this.destroyed)return}}}catch(t){this.destroy(t)}finally{this.reading=false}}async _exploreDir(t,e){let s;try{s=await u(t,this._rdOptions)}catch(t){this._onError(t)}return{files:s,depth:e,path:t}}async _formatEntry(t,e){let s;try{const r=this._isDirent?t.name:t;const i=n.resolve(n.join(e,r));s={path:n.relative(this._root,i),fullPath:i,basename:r};s[this._statsProp]=this._isDirent?t:await this._stat(i)}catch(t){this._onError(t)}return s}_onError(t){if(isNormalFlowError(t)&&!this.destroyed){this.emit("warn",t)}else{this.destroy(t)}}async _getEntryType(t){const e=t&&t[this._statsProp];if(!e){return}if(e.isFile()){return"file"}if(e.isDirectory()){return"directory"}if(e&&e.isSymbolicLink()){const e=t.fullPath;try{const t=await f(e);const s=await c(t);if(s.isFile()){return"file"}if(s.isDirectory()){const s=t.length;if(e.startsWith(t)&&e.substr(s,1)===n.sep){const s=new Error(`Circular symlink detected: "${e}" points to "${t}"`);s.code=p;return this._onError(s)}return"directory"}}catch(t){this._onError(t)}}}_includeAsFile(t){const e=t&&t[this._statsProp];return e&&this._wantsEverything&&!e.isDirectory()}}const readdirp=(t,e={})=>{let s=e.entryType||e.type;if(s==="both")s=g;if(s)e.type=s;if(!t){throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)")}else if(typeof t!=="string"){throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)")}else if(s&&!y.includes(s)){throw new Error(`readdirp: Invalid type passed. Use one of ${y.join(", ")}`)}e.root=t;return new ReaddirpStream(e)};const readdirpPromise=(t,e={})=>new Promise(((s,r)=>{const i=[];readdirp(t,e).on("data",(t=>i.push(t))).on("end",(()=>s(i))).on("error",(t=>r(t)))}));readdirp.promise=readdirpPromise;readdirp.ReaddirpStream=ReaddirpStream;readdirp.default=readdirp;t.exports=readdirp},211:(t,e,s)=>{"use strict";
|
|
35
|
-
|
|
1710
|
+
*/ t.exports = function(t, e) {
|
|
1711
|
+
if ("string" != typeof t) throw new TypeError("expected path to be a string");
|
|
1712
|
+
if ("\\" === t || "/" === t) return "/";
|
|
1713
|
+
var s = t.length;
|
|
1714
|
+
if (s <= 1) return t;
|
|
1715
|
+
var r = "";
|
|
1716
|
+
if (s > 4 && "\\" === t[3]) {
|
|
1717
|
+
var i = t[2];
|
|
1718
|
+
if (("?" === i || "." === i) && "\\\\" === t.slice(0, 2)) {
|
|
1719
|
+
t = t.slice(2);
|
|
1720
|
+
r = "//";
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
var n = t.split(/[/\\]+/);
|
|
1724
|
+
if (false !== e && "" === n[n.length - 1]) n.pop();
|
|
1725
|
+
return r + n.join("/");
|
|
1726
|
+
};
|
|
1727
|
+
},
|
|
1728
|
+
700: (t, e, s)=>{
|
|
1729
|
+
"use strict";
|
|
1730
|
+
t.exports = s(144);
|
|
1731
|
+
},
|
|
1732
|
+
112: (t, e, s)=>{
|
|
1733
|
+
"use strict";
|
|
1734
|
+
const r = s(17);
|
|
1735
|
+
const i = "\\\\/";
|
|
1736
|
+
const n = `[^${i}]`;
|
|
1737
|
+
const o = "\\.";
|
|
1738
|
+
const a = "\\+";
|
|
1739
|
+
const u = "\\?";
|
|
1740
|
+
const l = "\\/";
|
|
1741
|
+
const c = "(?=.)";
|
|
1742
|
+
const f = "[^/]";
|
|
1743
|
+
const h = `(?:${l}|$)`;
|
|
1744
|
+
const p = `(?:^|${l})`;
|
|
1745
|
+
const d = `${o}{1,2}${h}`;
|
|
1746
|
+
const _ = `(?!${o})`;
|
|
1747
|
+
const E = `(?!${p}${d})`;
|
|
1748
|
+
const g = `(?!${o}{0,1}${h})`;
|
|
1749
|
+
const m = `(?!${d})`;
|
|
1750
|
+
const y = `[^.${l}]`;
|
|
1751
|
+
const R = `${f}*?`;
|
|
1752
|
+
const w = {
|
|
1753
|
+
DOT_LITERAL: o,
|
|
1754
|
+
PLUS_LITERAL: a,
|
|
1755
|
+
QMARK_LITERAL: u,
|
|
1756
|
+
SLASH_LITERAL: l,
|
|
1757
|
+
ONE_CHAR: c,
|
|
1758
|
+
QMARK: f,
|
|
1759
|
+
END_ANCHOR: h,
|
|
1760
|
+
DOTS_SLASH: d,
|
|
1761
|
+
NO_DOT: _,
|
|
1762
|
+
NO_DOTS: E,
|
|
1763
|
+
NO_DOT_SLASH: g,
|
|
1764
|
+
NO_DOTS_SLASH: m,
|
|
1765
|
+
QMARK_NO_DOT: y,
|
|
1766
|
+
STAR: R,
|
|
1767
|
+
START_ANCHOR: p
|
|
1768
|
+
};
|
|
1769
|
+
const A = {
|
|
1770
|
+
...w,
|
|
1771
|
+
SLASH_LITERAL: `[${i}]`,
|
|
1772
|
+
QMARK: n,
|
|
1773
|
+
STAR: `${n}*?`,
|
|
1774
|
+
DOTS_SLASH: `${o}{1,2}(?:[${i}]|$)`,
|
|
1775
|
+
NO_DOT: `(?!${o})`,
|
|
1776
|
+
NO_DOTS: `(?!(?:^|[${i}])${o}{1,2}(?:[${i}]|$))`,
|
|
1777
|
+
NO_DOT_SLASH: `(?!${o}{0,1}(?:[${i}]|$))`,
|
|
1778
|
+
NO_DOTS_SLASH: `(?!${o}{1,2}(?:[${i}]|$))`,
|
|
1779
|
+
QMARK_NO_DOT: `[^.${i}]`,
|
|
1780
|
+
START_ANCHOR: `(?:^|[${i}])`,
|
|
1781
|
+
END_ANCHOR: `(?:[${i}]|$)`
|
|
1782
|
+
};
|
|
1783
|
+
const b = {
|
|
1784
|
+
alnum: "a-zA-Z0-9",
|
|
1785
|
+
alpha: "a-zA-Z",
|
|
1786
|
+
ascii: "\\x00-\\x7F",
|
|
1787
|
+
blank: " \\t",
|
|
1788
|
+
cntrl: "\\x00-\\x1F\\x7F",
|
|
1789
|
+
digit: "0-9",
|
|
1790
|
+
graph: "\\x21-\\x7E",
|
|
1791
|
+
lower: "a-z",
|
|
1792
|
+
print: "\\x20-\\x7E ",
|
|
1793
|
+
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
|
|
1794
|
+
space: " \\t\\r\\n\\v\\f",
|
|
1795
|
+
upper: "A-Z",
|
|
1796
|
+
word: "A-Za-z0-9_",
|
|
1797
|
+
xdigit: "A-Fa-f0-9"
|
|
1798
|
+
};
|
|
1799
|
+
t.exports = {
|
|
1800
|
+
MAX_LENGTH: 65536,
|
|
1801
|
+
POSIX_REGEX_SOURCE: b,
|
|
1802
|
+
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
1803
|
+
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
1804
|
+
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
|
1805
|
+
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
|
1806
|
+
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
|
1807
|
+
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
1808
|
+
REPLACEMENTS: {
|
|
1809
|
+
"***": "*",
|
|
1810
|
+
"**/**": "**",
|
|
1811
|
+
"**/**/**": "**"
|
|
1812
|
+
},
|
|
1813
|
+
CHAR_0: 48,
|
|
1814
|
+
CHAR_9: 57,
|
|
1815
|
+
CHAR_UPPERCASE_A: 65,
|
|
1816
|
+
CHAR_LOWERCASE_A: 97,
|
|
1817
|
+
CHAR_UPPERCASE_Z: 90,
|
|
1818
|
+
CHAR_LOWERCASE_Z: 122,
|
|
1819
|
+
CHAR_LEFT_PARENTHESES: 40,
|
|
1820
|
+
CHAR_RIGHT_PARENTHESES: 41,
|
|
1821
|
+
CHAR_ASTERISK: 42,
|
|
1822
|
+
CHAR_AMPERSAND: 38,
|
|
1823
|
+
CHAR_AT: 64,
|
|
1824
|
+
CHAR_BACKWARD_SLASH: 92,
|
|
1825
|
+
CHAR_CARRIAGE_RETURN: 13,
|
|
1826
|
+
CHAR_CIRCUMFLEX_ACCENT: 94,
|
|
1827
|
+
CHAR_COLON: 58,
|
|
1828
|
+
CHAR_COMMA: 44,
|
|
1829
|
+
CHAR_DOT: 46,
|
|
1830
|
+
CHAR_DOUBLE_QUOTE: 34,
|
|
1831
|
+
CHAR_EQUAL: 61,
|
|
1832
|
+
CHAR_EXCLAMATION_MARK: 33,
|
|
1833
|
+
CHAR_FORM_FEED: 12,
|
|
1834
|
+
CHAR_FORWARD_SLASH: 47,
|
|
1835
|
+
CHAR_GRAVE_ACCENT: 96,
|
|
1836
|
+
CHAR_HASH: 35,
|
|
1837
|
+
CHAR_HYPHEN_MINUS: 45,
|
|
1838
|
+
CHAR_LEFT_ANGLE_BRACKET: 60,
|
|
1839
|
+
CHAR_LEFT_CURLY_BRACE: 123,
|
|
1840
|
+
CHAR_LEFT_SQUARE_BRACKET: 91,
|
|
1841
|
+
CHAR_LINE_FEED: 10,
|
|
1842
|
+
CHAR_NO_BREAK_SPACE: 160,
|
|
1843
|
+
CHAR_PERCENT: 37,
|
|
1844
|
+
CHAR_PLUS: 43,
|
|
1845
|
+
CHAR_QUESTION_MARK: 63,
|
|
1846
|
+
CHAR_RIGHT_ANGLE_BRACKET: 62,
|
|
1847
|
+
CHAR_RIGHT_CURLY_BRACE: 125,
|
|
1848
|
+
CHAR_RIGHT_SQUARE_BRACKET: 93,
|
|
1849
|
+
CHAR_SEMICOLON: 59,
|
|
1850
|
+
CHAR_SINGLE_QUOTE: 39,
|
|
1851
|
+
CHAR_SPACE: 32,
|
|
1852
|
+
CHAR_TAB: 9,
|
|
1853
|
+
CHAR_UNDERSCORE: 95,
|
|
1854
|
+
CHAR_VERTICAL_LINE: 124,
|
|
1855
|
+
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
1856
|
+
SEP: r.sep,
|
|
1857
|
+
extglobChars (t) {
|
|
1858
|
+
return {
|
|
1859
|
+
"!": {
|
|
1860
|
+
type: "negate",
|
|
1861
|
+
open: "(?:(?!(?:",
|
|
1862
|
+
close: `))${t.STAR})`
|
|
1863
|
+
},
|
|
1864
|
+
"?": {
|
|
1865
|
+
type: "qmark",
|
|
1866
|
+
open: "(?:",
|
|
1867
|
+
close: ")?"
|
|
1868
|
+
},
|
|
1869
|
+
"+": {
|
|
1870
|
+
type: "plus",
|
|
1871
|
+
open: "(?:",
|
|
1872
|
+
close: ")+"
|
|
1873
|
+
},
|
|
1874
|
+
"*": {
|
|
1875
|
+
type: "star",
|
|
1876
|
+
open: "(?:",
|
|
1877
|
+
close: ")*"
|
|
1878
|
+
},
|
|
1879
|
+
"@": {
|
|
1880
|
+
type: "at",
|
|
1881
|
+
open: "(?:",
|
|
1882
|
+
close: ")"
|
|
1883
|
+
}
|
|
1884
|
+
};
|
|
1885
|
+
},
|
|
1886
|
+
globChars (t) {
|
|
1887
|
+
return true === t ? A : w;
|
|
1888
|
+
}
|
|
1889
|
+
};
|
|
1890
|
+
},
|
|
1891
|
+
352: (t, e, s)=>{
|
|
1892
|
+
"use strict";
|
|
1893
|
+
const r = s(112);
|
|
1894
|
+
const i = s(869);
|
|
1895
|
+
const { MAX_LENGTH: n, POSIX_REGEX_SOURCE: o, REGEX_NON_SPECIAL_CHARS: a, REGEX_SPECIAL_CHARS_BACKREF: u, REPLACEMENTS: l } = r;
|
|
1896
|
+
const expandRange = (t, e)=>{
|
|
1897
|
+
if ("function" == typeof e.expandRange) return e.expandRange(...t, e);
|
|
1898
|
+
t.sort();
|
|
1899
|
+
const s = `[${t.join("-")}]`;
|
|
1900
|
+
try {
|
|
1901
|
+
new RegExp(s);
|
|
1902
|
+
} catch (e) {
|
|
1903
|
+
return t.map((t)=>i.escapeRegex(t)).join("..");
|
|
1904
|
+
}
|
|
1905
|
+
return s;
|
|
1906
|
+
};
|
|
1907
|
+
const syntaxError = (t, e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`;
|
|
1908
|
+
const parse = (t, e)=>{
|
|
1909
|
+
if ("string" != typeof t) throw new TypeError("Expected a string");
|
|
1910
|
+
t = l[t] || t;
|
|
1911
|
+
const s = {
|
|
1912
|
+
...e
|
|
1913
|
+
};
|
|
1914
|
+
const c = "number" == typeof s.maxLength ? Math.min(n, s.maxLength) : n;
|
|
1915
|
+
let f = t.length;
|
|
1916
|
+
if (f > c) throw new SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${c}`);
|
|
1917
|
+
const h = {
|
|
1918
|
+
type: "bos",
|
|
1919
|
+
value: "",
|
|
1920
|
+
output: s.prepend || ""
|
|
1921
|
+
};
|
|
1922
|
+
const p = [
|
|
1923
|
+
h
|
|
1924
|
+
];
|
|
1925
|
+
const d = s.capture ? "" : "?:";
|
|
1926
|
+
const _ = i.isWindows(e);
|
|
1927
|
+
const E = r.globChars(_);
|
|
1928
|
+
const g = r.extglobChars(E);
|
|
1929
|
+
const { DOT_LITERAL: m, PLUS_LITERAL: y, SLASH_LITERAL: R, ONE_CHAR: w, DOTS_SLASH: A, NO_DOT: b, NO_DOT_SLASH: v, NO_DOTS_SLASH: S, QMARK: C, QMARK_NO_DOT: x, STAR: T, START_ANCHOR: H } = E;
|
|
1930
|
+
const globstar = (t)=>`(${d}(?:(?!${H}${t.dot ? A : m}).)*?)`;
|
|
1931
|
+
const O = s.dot ? "" : b;
|
|
1932
|
+
const P = s.dot ? C : x;
|
|
1933
|
+
let I = true === s.bash ? globstar(s) : T;
|
|
1934
|
+
if (s.capture) I = `(${I})`;
|
|
1935
|
+
if ("boolean" == typeof s.noext) s.noextglob = s.noext;
|
|
1936
|
+
const L = {
|
|
1937
|
+
input: t,
|
|
1938
|
+
index: -1,
|
|
1939
|
+
start: 0,
|
|
1940
|
+
dot: true === s.dot,
|
|
1941
|
+
consumed: "",
|
|
1942
|
+
output: "",
|
|
1943
|
+
prefix: "",
|
|
1944
|
+
backtrack: false,
|
|
1945
|
+
negated: false,
|
|
1946
|
+
brackets: 0,
|
|
1947
|
+
braces: 0,
|
|
1948
|
+
parens: 0,
|
|
1949
|
+
quotes: 0,
|
|
1950
|
+
globstar: false,
|
|
1951
|
+
tokens: p
|
|
1952
|
+
};
|
|
1953
|
+
t = i.removePrefix(t, L);
|
|
1954
|
+
f = t.length;
|
|
1955
|
+
const N = [];
|
|
1956
|
+
const k = [];
|
|
1957
|
+
const $ = [];
|
|
1958
|
+
let D = h;
|
|
1959
|
+
let F;
|
|
1960
|
+
const eos = ()=>L.index === f - 1;
|
|
1961
|
+
const M = L.peek = (e = 1)=>t[L.index + e];
|
|
1962
|
+
const W = L.advance = ()=>t[++L.index] || "";
|
|
1963
|
+
const remaining = ()=>t.slice(L.index + 1);
|
|
1964
|
+
const consume = (t = "", e = 0)=>{
|
|
1965
|
+
L.consumed += t;
|
|
1966
|
+
L.index += e;
|
|
1967
|
+
};
|
|
1968
|
+
const append = (t)=>{
|
|
1969
|
+
L.output += null != t.output ? t.output : t.value;
|
|
1970
|
+
consume(t.value);
|
|
1971
|
+
};
|
|
1972
|
+
const negate = ()=>{
|
|
1973
|
+
let t = 1;
|
|
1974
|
+
while("!" === M() && ("(" !== M(2) || "?" === M(3))){
|
|
1975
|
+
W();
|
|
1976
|
+
L.start++;
|
|
1977
|
+
t++;
|
|
1978
|
+
}
|
|
1979
|
+
if (t % 2 === 0) return false;
|
|
1980
|
+
L.negated = true;
|
|
1981
|
+
L.start++;
|
|
1982
|
+
return true;
|
|
1983
|
+
};
|
|
1984
|
+
const increment = (t)=>{
|
|
1985
|
+
L[t]++;
|
|
1986
|
+
$.push(t);
|
|
1987
|
+
};
|
|
1988
|
+
const decrement = (t)=>{
|
|
1989
|
+
L[t]--;
|
|
1990
|
+
$.pop();
|
|
1991
|
+
};
|
|
1992
|
+
const push = (t)=>{
|
|
1993
|
+
if ("globstar" === D.type) {
|
|
1994
|
+
const e = L.braces > 0 && ("comma" === t.type || "brace" === t.type);
|
|
1995
|
+
const s = true === t.extglob || N.length && ("pipe" === t.type || "paren" === t.type);
|
|
1996
|
+
if ("slash" !== t.type && "paren" !== t.type && !e && !s) {
|
|
1997
|
+
L.output = L.output.slice(0, -D.output.length);
|
|
1998
|
+
D.type = "star";
|
|
1999
|
+
D.value = "*";
|
|
2000
|
+
D.output = I;
|
|
2001
|
+
L.output += D.output;
|
|
2002
|
+
}
|
|
2003
|
+
}
|
|
2004
|
+
if (N.length && "paren" !== t.type) N[N.length - 1].inner += t.value;
|
|
2005
|
+
if (t.value || t.output) append(t);
|
|
2006
|
+
if (D && "text" === D.type && "text" === t.type) {
|
|
2007
|
+
D.value += t.value;
|
|
2008
|
+
D.output = (D.output || "") + t.value;
|
|
2009
|
+
return;
|
|
2010
|
+
}
|
|
2011
|
+
t.prev = D;
|
|
2012
|
+
p.push(t);
|
|
2013
|
+
D = t;
|
|
2014
|
+
};
|
|
2015
|
+
const extglobOpen = (t, e)=>{
|
|
2016
|
+
const r = {
|
|
2017
|
+
...g[e],
|
|
2018
|
+
conditions: 1,
|
|
2019
|
+
inner: ""
|
|
2020
|
+
};
|
|
2021
|
+
r.prev = D;
|
|
2022
|
+
r.parens = L.parens;
|
|
2023
|
+
r.output = L.output;
|
|
2024
|
+
const i = (s.capture ? "(" : "") + r.open;
|
|
2025
|
+
increment("parens");
|
|
2026
|
+
push({
|
|
2027
|
+
type: t,
|
|
2028
|
+
value: e,
|
|
2029
|
+
output: L.output ? "" : w
|
|
2030
|
+
});
|
|
2031
|
+
push({
|
|
2032
|
+
type: "paren",
|
|
2033
|
+
extglob: true,
|
|
2034
|
+
value: W(),
|
|
2035
|
+
output: i
|
|
2036
|
+
});
|
|
2037
|
+
N.push(r);
|
|
2038
|
+
};
|
|
2039
|
+
const extglobClose = (t)=>{
|
|
2040
|
+
let e = t.close + (s.capture ? ")" : "");
|
|
2041
|
+
let r;
|
|
2042
|
+
if ("negate" === t.type) {
|
|
2043
|
+
let i = I;
|
|
2044
|
+
if (t.inner && t.inner.length > 1 && t.inner.includes("/")) i = globstar(s);
|
|
2045
|
+
if (i !== I || eos() || /^\)+$/.test(remaining())) e = t.close = `)$))${i}`;
|
|
2046
|
+
if (t.inner.includes("*") && (r = remaining()) && /^\.[^\\/.]+$/.test(r)) e = t.close = `)${r})${i})`;
|
|
2047
|
+
if ("bos" === t.prev.type) L.negatedExtglob = true;
|
|
2048
|
+
}
|
|
2049
|
+
push({
|
|
2050
|
+
type: "paren",
|
|
2051
|
+
extglob: true,
|
|
2052
|
+
value: F,
|
|
2053
|
+
output: e
|
|
2054
|
+
});
|
|
2055
|
+
decrement("parens");
|
|
2056
|
+
};
|
|
2057
|
+
if (false !== s.fastpaths && !/(^[*!]|[/()[\]{}"])/.test(t)) {
|
|
2058
|
+
let r = false;
|
|
2059
|
+
let n = t.replace(u, (t, e, s, i, n, o)=>{
|
|
2060
|
+
if ("\\" === i) {
|
|
2061
|
+
r = true;
|
|
2062
|
+
return t;
|
|
2063
|
+
}
|
|
2064
|
+
if ("?" === i) {
|
|
2065
|
+
if (e) return e + i + (n ? C.repeat(n.length) : "");
|
|
2066
|
+
if (0 === o) return P + (n ? C.repeat(n.length) : "");
|
|
2067
|
+
return C.repeat(s.length);
|
|
2068
|
+
}
|
|
2069
|
+
if ("." === i) return m.repeat(s.length);
|
|
2070
|
+
if ("*" === i) {
|
|
2071
|
+
if (e) return e + i + (n ? I : "");
|
|
2072
|
+
return I;
|
|
2073
|
+
}
|
|
2074
|
+
return e ? t : `\\${t}`;
|
|
2075
|
+
});
|
|
2076
|
+
if (true === r) n = true === s.unescape ? n.replace(/\\/g, "") : n.replace(/\\+/g, (t)=>t.length % 2 === 0 ? "\\\\" : t ? "\\" : "");
|
|
2077
|
+
if (n === t && true === s.contains) {
|
|
2078
|
+
L.output = t;
|
|
2079
|
+
return L;
|
|
2080
|
+
}
|
|
2081
|
+
L.output = i.wrapOutput(n, L, e);
|
|
2082
|
+
return L;
|
|
2083
|
+
}
|
|
2084
|
+
while(!eos()){
|
|
2085
|
+
F = W();
|
|
2086
|
+
if ("\0" === F) continue;
|
|
2087
|
+
if ("\\" === F) {
|
|
2088
|
+
const t = M();
|
|
2089
|
+
if ("/" === t && true !== s.bash) continue;
|
|
2090
|
+
if ("." === t || ";" === t) continue;
|
|
2091
|
+
if (!t) {
|
|
2092
|
+
F += "\\";
|
|
2093
|
+
push({
|
|
2094
|
+
type: "text",
|
|
2095
|
+
value: F
|
|
2096
|
+
});
|
|
2097
|
+
continue;
|
|
2098
|
+
}
|
|
2099
|
+
const e = /^\\+/.exec(remaining());
|
|
2100
|
+
let r = 0;
|
|
2101
|
+
if (e && e[0].length > 2) {
|
|
2102
|
+
r = e[0].length;
|
|
2103
|
+
L.index += r;
|
|
2104
|
+
if (r % 2 !== 0) F += "\\";
|
|
2105
|
+
}
|
|
2106
|
+
if (true === s.unescape) F = W();
|
|
2107
|
+
else F += W();
|
|
2108
|
+
if (0 === L.brackets) {
|
|
2109
|
+
push({
|
|
2110
|
+
type: "text",
|
|
2111
|
+
value: F
|
|
2112
|
+
});
|
|
2113
|
+
continue;
|
|
2114
|
+
}
|
|
2115
|
+
}
|
|
2116
|
+
if (L.brackets > 0 && ("]" !== F || "[" === D.value || "[^" === D.value)) {
|
|
2117
|
+
if (false !== s.posix && ":" === F) {
|
|
2118
|
+
const t = D.value.slice(1);
|
|
2119
|
+
if (t.includes("[")) {
|
|
2120
|
+
D.posix = true;
|
|
2121
|
+
if (t.includes(":")) {
|
|
2122
|
+
const t = D.value.lastIndexOf("[");
|
|
2123
|
+
const e = D.value.slice(0, t);
|
|
2124
|
+
const s = D.value.slice(t + 2);
|
|
2125
|
+
const r = o[s];
|
|
2126
|
+
if (r) {
|
|
2127
|
+
D.value = e + r;
|
|
2128
|
+
L.backtrack = true;
|
|
2129
|
+
W();
|
|
2130
|
+
if (!h.output && 1 === p.indexOf(D)) h.output = w;
|
|
2131
|
+
continue;
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2136
|
+
if ("[" === F && ":" !== M() || "-" === F && "]" === M()) F = `\\${F}`;
|
|
2137
|
+
if ("]" === F && ("[" === D.value || "[^" === D.value)) F = `\\${F}`;
|
|
2138
|
+
if (true === s.posix && "!" === F && "[" === D.value) F = "^";
|
|
2139
|
+
D.value += F;
|
|
2140
|
+
append({
|
|
2141
|
+
value: F
|
|
2142
|
+
});
|
|
2143
|
+
continue;
|
|
2144
|
+
}
|
|
2145
|
+
if (1 === L.quotes && '"' !== F) {
|
|
2146
|
+
F = i.escapeRegex(F);
|
|
2147
|
+
D.value += F;
|
|
2148
|
+
append({
|
|
2149
|
+
value: F
|
|
2150
|
+
});
|
|
2151
|
+
continue;
|
|
2152
|
+
}
|
|
2153
|
+
if ('"' === F) {
|
|
2154
|
+
L.quotes = 1 === L.quotes ? 0 : 1;
|
|
2155
|
+
if (true === s.keepQuotes) push({
|
|
2156
|
+
type: "text",
|
|
2157
|
+
value: F
|
|
2158
|
+
});
|
|
2159
|
+
continue;
|
|
2160
|
+
}
|
|
2161
|
+
if ("(" === F) {
|
|
2162
|
+
increment("parens");
|
|
2163
|
+
push({
|
|
2164
|
+
type: "paren",
|
|
2165
|
+
value: F
|
|
2166
|
+
});
|
|
2167
|
+
continue;
|
|
2168
|
+
}
|
|
2169
|
+
if (")" === F) {
|
|
2170
|
+
if (0 === L.parens && true === s.strictBrackets) throw new SyntaxError(syntaxError("opening", "("));
|
|
2171
|
+
const t = N[N.length - 1];
|
|
2172
|
+
if (t && L.parens === t.parens + 1) {
|
|
2173
|
+
extglobClose(N.pop());
|
|
2174
|
+
continue;
|
|
2175
|
+
}
|
|
2176
|
+
push({
|
|
2177
|
+
type: "paren",
|
|
2178
|
+
value: F,
|
|
2179
|
+
output: L.parens ? ")" : "\\)"
|
|
2180
|
+
});
|
|
2181
|
+
decrement("parens");
|
|
2182
|
+
continue;
|
|
2183
|
+
}
|
|
2184
|
+
if ("[" === F) {
|
|
2185
|
+
if (true !== s.nobracket && remaining().includes("]")) increment("brackets");
|
|
2186
|
+
else {
|
|
2187
|
+
if (true !== s.nobracket && true === s.strictBrackets) throw new SyntaxError(syntaxError("closing", "]"));
|
|
2188
|
+
F = `\\${F}`;
|
|
2189
|
+
}
|
|
2190
|
+
push({
|
|
2191
|
+
type: "bracket",
|
|
2192
|
+
value: F
|
|
2193
|
+
});
|
|
2194
|
+
continue;
|
|
2195
|
+
}
|
|
2196
|
+
if ("]" === F) {
|
|
2197
|
+
if (true === s.nobracket || D && "bracket" === D.type && 1 === D.value.length) {
|
|
2198
|
+
push({
|
|
2199
|
+
type: "text",
|
|
2200
|
+
value: F,
|
|
2201
|
+
output: `\\${F}`
|
|
2202
|
+
});
|
|
2203
|
+
continue;
|
|
2204
|
+
}
|
|
2205
|
+
if (0 === L.brackets) {
|
|
2206
|
+
if (true === s.strictBrackets) throw new SyntaxError(syntaxError("opening", "["));
|
|
2207
|
+
push({
|
|
2208
|
+
type: "text",
|
|
2209
|
+
value: F,
|
|
2210
|
+
output: `\\${F}`
|
|
2211
|
+
});
|
|
2212
|
+
continue;
|
|
2213
|
+
}
|
|
2214
|
+
decrement("brackets");
|
|
2215
|
+
const t = D.value.slice(1);
|
|
2216
|
+
if (true !== D.posix && "^" === t[0] && !t.includes("/")) F = `/${F}`;
|
|
2217
|
+
D.value += F;
|
|
2218
|
+
append({
|
|
2219
|
+
value: F
|
|
2220
|
+
});
|
|
2221
|
+
if (false === s.literalBrackets || i.hasRegexChars(t)) continue;
|
|
2222
|
+
const e = i.escapeRegex(D.value);
|
|
2223
|
+
L.output = L.output.slice(0, -D.value.length);
|
|
2224
|
+
if (true === s.literalBrackets) {
|
|
2225
|
+
L.output += e;
|
|
2226
|
+
D.value = e;
|
|
2227
|
+
continue;
|
|
2228
|
+
}
|
|
2229
|
+
D.value = `(${d}${e}|${D.value})`;
|
|
2230
|
+
L.output += D.value;
|
|
2231
|
+
continue;
|
|
2232
|
+
}
|
|
2233
|
+
if ("{" === F && true !== s.nobrace) {
|
|
2234
|
+
increment("braces");
|
|
2235
|
+
const t = {
|
|
2236
|
+
type: "brace",
|
|
2237
|
+
value: F,
|
|
2238
|
+
output: "(",
|
|
2239
|
+
outputIndex: L.output.length,
|
|
2240
|
+
tokensIndex: L.tokens.length
|
|
2241
|
+
};
|
|
2242
|
+
k.push(t);
|
|
2243
|
+
push(t);
|
|
2244
|
+
continue;
|
|
2245
|
+
}
|
|
2246
|
+
if ("}" === F) {
|
|
2247
|
+
const t = k[k.length - 1];
|
|
2248
|
+
if (true === s.nobrace || !t) {
|
|
2249
|
+
push({
|
|
2250
|
+
type: "text",
|
|
2251
|
+
value: F,
|
|
2252
|
+
output: F
|
|
2253
|
+
});
|
|
2254
|
+
continue;
|
|
2255
|
+
}
|
|
2256
|
+
let e = ")";
|
|
2257
|
+
if (true === t.dots) {
|
|
2258
|
+
const t = p.slice();
|
|
2259
|
+
const r = [];
|
|
2260
|
+
for(let e = t.length - 1; e >= 0; e--){
|
|
2261
|
+
p.pop();
|
|
2262
|
+
if ("brace" === t[e].type) break;
|
|
2263
|
+
if ("dots" !== t[e].type) r.unshift(t[e].value);
|
|
2264
|
+
}
|
|
2265
|
+
e = expandRange(r, s);
|
|
2266
|
+
L.backtrack = true;
|
|
2267
|
+
}
|
|
2268
|
+
if (true !== t.comma && true !== t.dots) {
|
|
2269
|
+
const s = L.output.slice(0, t.outputIndex);
|
|
2270
|
+
const r = L.tokens.slice(t.tokensIndex);
|
|
2271
|
+
t.value = t.output = "\\{";
|
|
2272
|
+
F = e = "\\}";
|
|
2273
|
+
L.output = s;
|
|
2274
|
+
for (const t of r)L.output += t.output || t.value;
|
|
2275
|
+
}
|
|
2276
|
+
push({
|
|
2277
|
+
type: "brace",
|
|
2278
|
+
value: F,
|
|
2279
|
+
output: e
|
|
2280
|
+
});
|
|
2281
|
+
decrement("braces");
|
|
2282
|
+
k.pop();
|
|
2283
|
+
continue;
|
|
2284
|
+
}
|
|
2285
|
+
if ("|" === F) {
|
|
2286
|
+
if (N.length > 0) N[N.length - 1].conditions++;
|
|
2287
|
+
push({
|
|
2288
|
+
type: "text",
|
|
2289
|
+
value: F
|
|
2290
|
+
});
|
|
2291
|
+
continue;
|
|
2292
|
+
}
|
|
2293
|
+
if ("," === F) {
|
|
2294
|
+
let t = F;
|
|
2295
|
+
const e = k[k.length - 1];
|
|
2296
|
+
if (e && "braces" === $[$.length - 1]) {
|
|
2297
|
+
e.comma = true;
|
|
2298
|
+
t = "|";
|
|
2299
|
+
}
|
|
2300
|
+
push({
|
|
2301
|
+
type: "comma",
|
|
2302
|
+
value: F,
|
|
2303
|
+
output: t
|
|
2304
|
+
});
|
|
2305
|
+
continue;
|
|
2306
|
+
}
|
|
2307
|
+
if ("/" === F) {
|
|
2308
|
+
if ("dot" === D.type && L.index === L.start + 1) {
|
|
2309
|
+
L.start = L.index + 1;
|
|
2310
|
+
L.consumed = "";
|
|
2311
|
+
L.output = "";
|
|
2312
|
+
p.pop();
|
|
2313
|
+
D = h;
|
|
2314
|
+
continue;
|
|
2315
|
+
}
|
|
2316
|
+
push({
|
|
2317
|
+
type: "slash",
|
|
2318
|
+
value: F,
|
|
2319
|
+
output: R
|
|
2320
|
+
});
|
|
2321
|
+
continue;
|
|
2322
|
+
}
|
|
2323
|
+
if ("." === F) {
|
|
2324
|
+
if (L.braces > 0 && "dot" === D.type) {
|
|
2325
|
+
if ("." === D.value) D.output = m;
|
|
2326
|
+
const t = k[k.length - 1];
|
|
2327
|
+
D.type = "dots";
|
|
2328
|
+
D.output += F;
|
|
2329
|
+
D.value += F;
|
|
2330
|
+
t.dots = true;
|
|
2331
|
+
continue;
|
|
2332
|
+
}
|
|
2333
|
+
if (L.braces + L.parens === 0 && "bos" !== D.type && "slash" !== D.type) {
|
|
2334
|
+
push({
|
|
2335
|
+
type: "text",
|
|
2336
|
+
value: F,
|
|
2337
|
+
output: m
|
|
2338
|
+
});
|
|
2339
|
+
continue;
|
|
2340
|
+
}
|
|
2341
|
+
push({
|
|
2342
|
+
type: "dot",
|
|
2343
|
+
value: F,
|
|
2344
|
+
output: m
|
|
2345
|
+
});
|
|
2346
|
+
continue;
|
|
2347
|
+
}
|
|
2348
|
+
if ("?" === F) {
|
|
2349
|
+
const t = D && "(" === D.value;
|
|
2350
|
+
if (!t && true !== s.noextglob && "(" === M() && "?" !== M(2)) {
|
|
2351
|
+
extglobOpen("qmark", F);
|
|
2352
|
+
continue;
|
|
2353
|
+
}
|
|
2354
|
+
if (D && "paren" === D.type) {
|
|
2355
|
+
const t = M();
|
|
2356
|
+
let e = F;
|
|
2357
|
+
if ("<" === t && !i.supportsLookbehinds()) throw new Error("Node.js v10 or higher is required for regex lookbehinds");
|
|
2358
|
+
if ("(" === D.value && !/[!=<:]/.test(t) || "<" === t && !/<([!=]|\w+>)/.test(remaining())) e = `\\${F}`;
|
|
2359
|
+
push({
|
|
2360
|
+
type: "text",
|
|
2361
|
+
value: F,
|
|
2362
|
+
output: e
|
|
2363
|
+
});
|
|
2364
|
+
continue;
|
|
2365
|
+
}
|
|
2366
|
+
if (true !== s.dot && ("slash" === D.type || "bos" === D.type)) {
|
|
2367
|
+
push({
|
|
2368
|
+
type: "qmark",
|
|
2369
|
+
value: F,
|
|
2370
|
+
output: x
|
|
2371
|
+
});
|
|
2372
|
+
continue;
|
|
2373
|
+
}
|
|
2374
|
+
push({
|
|
2375
|
+
type: "qmark",
|
|
2376
|
+
value: F,
|
|
2377
|
+
output: C
|
|
2378
|
+
});
|
|
2379
|
+
continue;
|
|
2380
|
+
}
|
|
2381
|
+
if ("!" === F) {
|
|
2382
|
+
if (true !== s.noextglob && "(" === M()) {
|
|
2383
|
+
if ("?" !== M(2) || !/[!=<:]/.test(M(3))) {
|
|
2384
|
+
extglobOpen("negate", F);
|
|
2385
|
+
continue;
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2388
|
+
if (true !== s.nonegate && 0 === L.index) {
|
|
2389
|
+
negate();
|
|
2390
|
+
continue;
|
|
2391
|
+
}
|
|
2392
|
+
}
|
|
2393
|
+
if ("+" === F) {
|
|
2394
|
+
if (true !== s.noextglob && "(" === M() && "?" !== M(2)) {
|
|
2395
|
+
extglobOpen("plus", F);
|
|
2396
|
+
continue;
|
|
2397
|
+
}
|
|
2398
|
+
if (D && "(" === D.value || false === s.regex) {
|
|
2399
|
+
push({
|
|
2400
|
+
type: "plus",
|
|
2401
|
+
value: F,
|
|
2402
|
+
output: y
|
|
2403
|
+
});
|
|
2404
|
+
continue;
|
|
2405
|
+
}
|
|
2406
|
+
if (D && ("bracket" === D.type || "paren" === D.type || "brace" === D.type) || L.parens > 0) {
|
|
2407
|
+
push({
|
|
2408
|
+
type: "plus",
|
|
2409
|
+
value: F
|
|
2410
|
+
});
|
|
2411
|
+
continue;
|
|
2412
|
+
}
|
|
2413
|
+
push({
|
|
2414
|
+
type: "plus",
|
|
2415
|
+
value: y
|
|
2416
|
+
});
|
|
2417
|
+
continue;
|
|
2418
|
+
}
|
|
2419
|
+
if ("@" === F) {
|
|
2420
|
+
if (true !== s.noextglob && "(" === M() && "?" !== M(2)) {
|
|
2421
|
+
push({
|
|
2422
|
+
type: "at",
|
|
2423
|
+
extglob: true,
|
|
2424
|
+
value: F,
|
|
2425
|
+
output: ""
|
|
2426
|
+
});
|
|
2427
|
+
continue;
|
|
2428
|
+
}
|
|
2429
|
+
push({
|
|
2430
|
+
type: "text",
|
|
2431
|
+
value: F
|
|
2432
|
+
});
|
|
2433
|
+
continue;
|
|
2434
|
+
}
|
|
2435
|
+
if ("*" !== F) {
|
|
2436
|
+
if ("$" === F || "^" === F) F = `\\${F}`;
|
|
2437
|
+
const t = a.exec(remaining());
|
|
2438
|
+
if (t) {
|
|
2439
|
+
F += t[0];
|
|
2440
|
+
L.index += t[0].length;
|
|
2441
|
+
}
|
|
2442
|
+
push({
|
|
2443
|
+
type: "text",
|
|
2444
|
+
value: F
|
|
2445
|
+
});
|
|
2446
|
+
continue;
|
|
2447
|
+
}
|
|
2448
|
+
if (D && ("globstar" === D.type || true === D.star)) {
|
|
2449
|
+
D.type = "star";
|
|
2450
|
+
D.star = true;
|
|
2451
|
+
D.value += F;
|
|
2452
|
+
D.output = I;
|
|
2453
|
+
L.backtrack = true;
|
|
2454
|
+
L.globstar = true;
|
|
2455
|
+
consume(F);
|
|
2456
|
+
continue;
|
|
2457
|
+
}
|
|
2458
|
+
let e = remaining();
|
|
2459
|
+
if (true !== s.noextglob && /^\([^?]/.test(e)) {
|
|
2460
|
+
extglobOpen("star", F);
|
|
2461
|
+
continue;
|
|
2462
|
+
}
|
|
2463
|
+
if ("star" === D.type) {
|
|
2464
|
+
if (true === s.noglobstar) {
|
|
2465
|
+
consume(F);
|
|
2466
|
+
continue;
|
|
2467
|
+
}
|
|
2468
|
+
const r = D.prev;
|
|
2469
|
+
const i = r.prev;
|
|
2470
|
+
const n = "slash" === r.type || "bos" === r.type;
|
|
2471
|
+
const o = i && ("star" === i.type || "globstar" === i.type);
|
|
2472
|
+
if (true === s.bash && (!n || e[0] && "/" !== e[0])) {
|
|
2473
|
+
push({
|
|
2474
|
+
type: "star",
|
|
2475
|
+
value: F,
|
|
2476
|
+
output: ""
|
|
2477
|
+
});
|
|
2478
|
+
continue;
|
|
2479
|
+
}
|
|
2480
|
+
const a = L.braces > 0 && ("comma" === r.type || "brace" === r.type);
|
|
2481
|
+
const u = N.length && ("pipe" === r.type || "paren" === r.type);
|
|
2482
|
+
if (!n && "paren" !== r.type && !a && !u) {
|
|
2483
|
+
push({
|
|
2484
|
+
type: "star",
|
|
2485
|
+
value: F,
|
|
2486
|
+
output: ""
|
|
2487
|
+
});
|
|
2488
|
+
continue;
|
|
2489
|
+
}
|
|
2490
|
+
while("/**" === e.slice(0, 3)){
|
|
2491
|
+
const s = t[L.index + 4];
|
|
2492
|
+
if (s && "/" !== s) break;
|
|
2493
|
+
e = e.slice(3);
|
|
2494
|
+
consume("/**", 3);
|
|
2495
|
+
}
|
|
2496
|
+
if ("bos" === r.type && eos()) {
|
|
2497
|
+
D.type = "globstar";
|
|
2498
|
+
D.value += F;
|
|
2499
|
+
D.output = globstar(s);
|
|
2500
|
+
L.output = D.output;
|
|
2501
|
+
L.globstar = true;
|
|
2502
|
+
consume(F);
|
|
2503
|
+
continue;
|
|
2504
|
+
}
|
|
2505
|
+
if ("slash" === r.type && "bos" !== r.prev.type && !o && eos()) {
|
|
2506
|
+
L.output = L.output.slice(0, -(r.output + D.output).length);
|
|
2507
|
+
r.output = `(?:${r.output}`;
|
|
2508
|
+
D.type = "globstar";
|
|
2509
|
+
D.output = globstar(s) + (s.strictSlashes ? ")" : "|$)");
|
|
2510
|
+
D.value += F;
|
|
2511
|
+
L.globstar = true;
|
|
2512
|
+
L.output += r.output + D.output;
|
|
2513
|
+
consume(F);
|
|
2514
|
+
continue;
|
|
2515
|
+
}
|
|
2516
|
+
if ("slash" === r.type && "bos" !== r.prev.type && "/" === e[0]) {
|
|
2517
|
+
const t = void 0 !== e[1] ? "|$" : "";
|
|
2518
|
+
L.output = L.output.slice(0, -(r.output + D.output).length);
|
|
2519
|
+
r.output = `(?:${r.output}`;
|
|
2520
|
+
D.type = "globstar";
|
|
2521
|
+
D.output = `${globstar(s)}${R}|${R}${t})`;
|
|
2522
|
+
D.value += F;
|
|
2523
|
+
L.output += r.output + D.output;
|
|
2524
|
+
L.globstar = true;
|
|
2525
|
+
consume(F + W());
|
|
2526
|
+
push({
|
|
2527
|
+
type: "slash",
|
|
2528
|
+
value: "/",
|
|
2529
|
+
output: ""
|
|
2530
|
+
});
|
|
2531
|
+
continue;
|
|
2532
|
+
}
|
|
2533
|
+
if ("bos" === r.type && "/" === e[0]) {
|
|
2534
|
+
D.type = "globstar";
|
|
2535
|
+
D.value += F;
|
|
2536
|
+
D.output = `(?:^|${R}|${globstar(s)}${R})`;
|
|
2537
|
+
L.output = D.output;
|
|
2538
|
+
L.globstar = true;
|
|
2539
|
+
consume(F + W());
|
|
2540
|
+
push({
|
|
2541
|
+
type: "slash",
|
|
2542
|
+
value: "/",
|
|
2543
|
+
output: ""
|
|
2544
|
+
});
|
|
2545
|
+
continue;
|
|
2546
|
+
}
|
|
2547
|
+
L.output = L.output.slice(0, -D.output.length);
|
|
2548
|
+
D.type = "globstar";
|
|
2549
|
+
D.output = globstar(s);
|
|
2550
|
+
D.value += F;
|
|
2551
|
+
L.output += D.output;
|
|
2552
|
+
L.globstar = true;
|
|
2553
|
+
consume(F);
|
|
2554
|
+
continue;
|
|
2555
|
+
}
|
|
2556
|
+
const r = {
|
|
2557
|
+
type: "star",
|
|
2558
|
+
value: F,
|
|
2559
|
+
output: I
|
|
2560
|
+
};
|
|
2561
|
+
if (true === s.bash) {
|
|
2562
|
+
r.output = ".*?";
|
|
2563
|
+
if ("bos" === D.type || "slash" === D.type) r.output = O + r.output;
|
|
2564
|
+
push(r);
|
|
2565
|
+
continue;
|
|
2566
|
+
}
|
|
2567
|
+
if (D && ("bracket" === D.type || "paren" === D.type) && true === s.regex) {
|
|
2568
|
+
r.output = F;
|
|
2569
|
+
push(r);
|
|
2570
|
+
continue;
|
|
2571
|
+
}
|
|
2572
|
+
if (L.index === L.start || "slash" === D.type || "dot" === D.type) {
|
|
2573
|
+
if ("dot" === D.type) {
|
|
2574
|
+
L.output += v;
|
|
2575
|
+
D.output += v;
|
|
2576
|
+
} else if (true === s.dot) {
|
|
2577
|
+
L.output += S;
|
|
2578
|
+
D.output += S;
|
|
2579
|
+
} else {
|
|
2580
|
+
L.output += O;
|
|
2581
|
+
D.output += O;
|
|
2582
|
+
}
|
|
2583
|
+
if ("*" !== M()) {
|
|
2584
|
+
L.output += w;
|
|
2585
|
+
D.output += w;
|
|
2586
|
+
}
|
|
2587
|
+
}
|
|
2588
|
+
push(r);
|
|
2589
|
+
}
|
|
2590
|
+
while(L.brackets > 0){
|
|
2591
|
+
if (true === s.strictBrackets) throw new SyntaxError(syntaxError("closing", "]"));
|
|
2592
|
+
L.output = i.escapeLast(L.output, "[");
|
|
2593
|
+
decrement("brackets");
|
|
2594
|
+
}
|
|
2595
|
+
while(L.parens > 0){
|
|
2596
|
+
if (true === s.strictBrackets) throw new SyntaxError(syntaxError("closing", ")"));
|
|
2597
|
+
L.output = i.escapeLast(L.output, "(");
|
|
2598
|
+
decrement("parens");
|
|
2599
|
+
}
|
|
2600
|
+
while(L.braces > 0){
|
|
2601
|
+
if (true === s.strictBrackets) throw new SyntaxError(syntaxError("closing", "}"));
|
|
2602
|
+
L.output = i.escapeLast(L.output, "{");
|
|
2603
|
+
decrement("braces");
|
|
2604
|
+
}
|
|
2605
|
+
if (true !== s.strictSlashes && ("star" === D.type || "bracket" === D.type)) push({
|
|
2606
|
+
type: "maybe_slash",
|
|
2607
|
+
value: "",
|
|
2608
|
+
output: `${R}?`
|
|
2609
|
+
});
|
|
2610
|
+
if (true === L.backtrack) {
|
|
2611
|
+
L.output = "";
|
|
2612
|
+
for (const t of L.tokens){
|
|
2613
|
+
L.output += null != t.output ? t.output : t.value;
|
|
2614
|
+
if (t.suffix) L.output += t.suffix;
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
return L;
|
|
2618
|
+
};
|
|
2619
|
+
parse.fastpaths = (t, e)=>{
|
|
2620
|
+
const s = {
|
|
2621
|
+
...e
|
|
2622
|
+
};
|
|
2623
|
+
const o = "number" == typeof s.maxLength ? Math.min(n, s.maxLength) : n;
|
|
2624
|
+
const a = t.length;
|
|
2625
|
+
if (a > o) throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${o}`);
|
|
2626
|
+
t = l[t] || t;
|
|
2627
|
+
const u = i.isWindows(e);
|
|
2628
|
+
const { DOT_LITERAL: c, SLASH_LITERAL: f, ONE_CHAR: h, DOTS_SLASH: p, NO_DOT: d, NO_DOTS: _, NO_DOTS_SLASH: E, STAR: g, START_ANCHOR: m } = r.globChars(u);
|
|
2629
|
+
const y = s.dot ? _ : d;
|
|
2630
|
+
const R = s.dot ? E : d;
|
|
2631
|
+
const w = s.capture ? "" : "?:";
|
|
2632
|
+
const A = {
|
|
2633
|
+
negated: false,
|
|
2634
|
+
prefix: ""
|
|
2635
|
+
};
|
|
2636
|
+
let b = true === s.bash ? ".*?" : g;
|
|
2637
|
+
if (s.capture) b = `(${b})`;
|
|
2638
|
+
const globstar = (t)=>{
|
|
2639
|
+
if (true === t.noglobstar) return b;
|
|
2640
|
+
return `(${w}(?:(?!${m}${t.dot ? p : c}).)*?)`;
|
|
2641
|
+
};
|
|
2642
|
+
const create = (t)=>{
|
|
2643
|
+
switch(t){
|
|
2644
|
+
case "*":
|
|
2645
|
+
return `${y}${h}${b}`;
|
|
2646
|
+
case ".*":
|
|
2647
|
+
return `${c}${h}${b}`;
|
|
2648
|
+
case "*.*":
|
|
2649
|
+
return `${y}${b}${c}${h}${b}`;
|
|
2650
|
+
case "*/*":
|
|
2651
|
+
return `${y}${b}${f}${h}${R}${b}`;
|
|
2652
|
+
case "**":
|
|
2653
|
+
return y + globstar(s);
|
|
2654
|
+
case "**/*":
|
|
2655
|
+
return `(?:${y}${globstar(s)}${f})?${R}${h}${b}`;
|
|
2656
|
+
case "**/*.*":
|
|
2657
|
+
return `(?:${y}${globstar(s)}${f})?${R}${b}${c}${h}${b}`;
|
|
2658
|
+
case "**/.*":
|
|
2659
|
+
return `(?:${y}${globstar(s)}${f})?${c}${h}${b}`;
|
|
2660
|
+
default:
|
|
2661
|
+
{
|
|
2662
|
+
const e = /^(.*?)\.(\w+)$/.exec(t);
|
|
2663
|
+
if (!e) return;
|
|
2664
|
+
const s = create(e[1]);
|
|
2665
|
+
if (!s) return;
|
|
2666
|
+
return s + c + e[2];
|
|
2667
|
+
}
|
|
2668
|
+
}
|
|
2669
|
+
};
|
|
2670
|
+
const v = i.removePrefix(t, A);
|
|
2671
|
+
let S = create(v);
|
|
2672
|
+
if (S && true !== s.strictSlashes) S += `${f}?`;
|
|
2673
|
+
return S;
|
|
2674
|
+
};
|
|
2675
|
+
t.exports = parse;
|
|
2676
|
+
},
|
|
2677
|
+
144: (t, e, s)=>{
|
|
2678
|
+
"use strict";
|
|
2679
|
+
const r = s(17);
|
|
2680
|
+
const i = s(909);
|
|
2681
|
+
const n = s(352);
|
|
2682
|
+
const o = s(869);
|
|
2683
|
+
const a = s(112);
|
|
2684
|
+
const isObject = (t)=>t && "object" == typeof t && !Array.isArray(t);
|
|
2685
|
+
const picomatch = (t, e, s = false)=>{
|
|
2686
|
+
if (Array.isArray(t)) {
|
|
2687
|
+
const r = t.map((t)=>picomatch(t, e, s));
|
|
2688
|
+
const arrayMatcher = (t)=>{
|
|
2689
|
+
for (const e of r){
|
|
2690
|
+
const s = e(t);
|
|
2691
|
+
if (s) return s;
|
|
2692
|
+
}
|
|
2693
|
+
return false;
|
|
2694
|
+
};
|
|
2695
|
+
return arrayMatcher;
|
|
2696
|
+
}
|
|
2697
|
+
const r = isObject(t) && t.tokens && t.input;
|
|
2698
|
+
if ("" === t || "string" != typeof t && !r) throw new TypeError("Expected pattern to be a non-empty string");
|
|
2699
|
+
const i = e || {};
|
|
2700
|
+
const n = o.isWindows(e);
|
|
2701
|
+
const a = r ? picomatch.compileRe(t, e) : picomatch.makeRe(t, e, false, true);
|
|
2702
|
+
const u = a.state;
|
|
2703
|
+
delete a.state;
|
|
2704
|
+
let isIgnored = ()=>false;
|
|
2705
|
+
if (i.ignore) {
|
|
2706
|
+
const t = {
|
|
2707
|
+
...e,
|
|
2708
|
+
ignore: null,
|
|
2709
|
+
onMatch: null,
|
|
2710
|
+
onResult: null
|
|
2711
|
+
};
|
|
2712
|
+
isIgnored = picomatch(i.ignore, t, s);
|
|
2713
|
+
}
|
|
2714
|
+
const matcher = (s, r = false)=>{
|
|
2715
|
+
const { isMatch: o, match: l, output: c } = picomatch.test(s, a, e, {
|
|
2716
|
+
glob: t,
|
|
2717
|
+
posix: n
|
|
2718
|
+
});
|
|
2719
|
+
const f = {
|
|
2720
|
+
glob: t,
|
|
2721
|
+
state: u,
|
|
2722
|
+
regex: a,
|
|
2723
|
+
posix: n,
|
|
2724
|
+
input: s,
|
|
2725
|
+
output: c,
|
|
2726
|
+
match: l,
|
|
2727
|
+
isMatch: o
|
|
2728
|
+
};
|
|
2729
|
+
if ("function" == typeof i.onResult) i.onResult(f);
|
|
2730
|
+
if (false === o) {
|
|
2731
|
+
f.isMatch = false;
|
|
2732
|
+
return r ? f : false;
|
|
2733
|
+
}
|
|
2734
|
+
if (isIgnored(s)) {
|
|
2735
|
+
if ("function" == typeof i.onIgnore) i.onIgnore(f);
|
|
2736
|
+
f.isMatch = false;
|
|
2737
|
+
return r ? f : false;
|
|
2738
|
+
}
|
|
2739
|
+
if ("function" == typeof i.onMatch) i.onMatch(f);
|
|
2740
|
+
return r ? f : true;
|
|
2741
|
+
};
|
|
2742
|
+
if (s) matcher.state = u;
|
|
2743
|
+
return matcher;
|
|
2744
|
+
};
|
|
2745
|
+
picomatch.test = (t, e, s, { glob: r, posix: i } = {})=>{
|
|
2746
|
+
if ("string" != typeof t) throw new TypeError("Expected input to be a string");
|
|
2747
|
+
if ("" === t) return {
|
|
2748
|
+
isMatch: false,
|
|
2749
|
+
output: ""
|
|
2750
|
+
};
|
|
2751
|
+
const n = s || {};
|
|
2752
|
+
const a = n.format || (i ? o.toPosixSlashes : null);
|
|
2753
|
+
let u = t === r;
|
|
2754
|
+
let l = u && a ? a(t) : t;
|
|
2755
|
+
if (false === u) {
|
|
2756
|
+
l = a ? a(t) : t;
|
|
2757
|
+
u = l === r;
|
|
2758
|
+
}
|
|
2759
|
+
if (false === u || true === n.capture) u = true === n.matchBase || true === n.basename ? picomatch.matchBase(t, e, s, i) : e.exec(l);
|
|
2760
|
+
return {
|
|
2761
|
+
isMatch: Boolean(u),
|
|
2762
|
+
match: u,
|
|
2763
|
+
output: l
|
|
2764
|
+
};
|
|
2765
|
+
};
|
|
2766
|
+
picomatch.matchBase = (t, e, s, i = o.isWindows(s))=>{
|
|
2767
|
+
const n = e instanceof RegExp ? e : picomatch.makeRe(e, s);
|
|
2768
|
+
return n.test(r.basename(t));
|
|
2769
|
+
};
|
|
2770
|
+
picomatch.isMatch = (t, e, s)=>picomatch(e, s)(t);
|
|
2771
|
+
picomatch.parse = (t, e)=>{
|
|
2772
|
+
if (Array.isArray(t)) return t.map((t)=>picomatch.parse(t, e));
|
|
2773
|
+
return n(t, {
|
|
2774
|
+
...e,
|
|
2775
|
+
fastpaths: false
|
|
2776
|
+
});
|
|
2777
|
+
};
|
|
2778
|
+
picomatch.scan = (t, e)=>i(t, e);
|
|
2779
|
+
picomatch.compileRe = (t, e, s = false, r = false)=>{
|
|
2780
|
+
if (true === s) return t.output;
|
|
2781
|
+
const i = e || {};
|
|
2782
|
+
const n = i.contains ? "" : "^";
|
|
2783
|
+
const o = i.contains ? "" : "$";
|
|
2784
|
+
let a = `${n}(?:${t.output})${o}`;
|
|
2785
|
+
if (t && true === t.negated) a = `^(?!${a}).*$`;
|
|
2786
|
+
const u = picomatch.toRegex(a, e);
|
|
2787
|
+
if (true === r) u.state = t;
|
|
2788
|
+
return u;
|
|
2789
|
+
};
|
|
2790
|
+
picomatch.makeRe = (t, e = {}, s = false, r = false)=>{
|
|
2791
|
+
if (!t || "string" != typeof t) throw new TypeError("Expected a non-empty string");
|
|
2792
|
+
let i = {
|
|
2793
|
+
negated: false,
|
|
2794
|
+
fastpaths: true
|
|
2795
|
+
};
|
|
2796
|
+
if (false !== e.fastpaths && ("." === t[0] || "*" === t[0])) i.output = n.fastpaths(t, e);
|
|
2797
|
+
if (!i.output) i = n(t, e);
|
|
2798
|
+
return picomatch.compileRe(i, e, s, r);
|
|
2799
|
+
};
|
|
2800
|
+
picomatch.toRegex = (t, e)=>{
|
|
2801
|
+
try {
|
|
2802
|
+
const s = e || {};
|
|
2803
|
+
return new RegExp(t, s.flags || (s.nocase ? "i" : ""));
|
|
2804
|
+
} catch (t) {
|
|
2805
|
+
if (e && true === e.debug) throw t;
|
|
2806
|
+
return /$^/;
|
|
2807
|
+
}
|
|
2808
|
+
};
|
|
2809
|
+
picomatch.constants = a;
|
|
2810
|
+
t.exports = picomatch;
|
|
2811
|
+
},
|
|
2812
|
+
909: (t, e, s)=>{
|
|
2813
|
+
"use strict";
|
|
2814
|
+
const r = s(869);
|
|
2815
|
+
const { CHAR_ASTERISK: i, CHAR_AT: n, CHAR_BACKWARD_SLASH: o, CHAR_COMMA: a, CHAR_DOT: u, CHAR_EXCLAMATION_MARK: l, CHAR_FORWARD_SLASH: c, CHAR_LEFT_CURLY_BRACE: f, CHAR_LEFT_PARENTHESES: h, CHAR_LEFT_SQUARE_BRACKET: p, CHAR_PLUS: d, CHAR_QUESTION_MARK: _, CHAR_RIGHT_CURLY_BRACE: E, CHAR_RIGHT_PARENTHESES: g, CHAR_RIGHT_SQUARE_BRACKET: m } = s(112);
|
|
2816
|
+
const isPathSeparator = (t)=>t === c || t === o;
|
|
2817
|
+
const depth = (t)=>{
|
|
2818
|
+
if (true !== t.isPrefix) t.depth = t.isGlobstar ? 1 / 0 : 1;
|
|
2819
|
+
};
|
|
2820
|
+
const scan = (t, e)=>{
|
|
2821
|
+
const s = e || {};
|
|
2822
|
+
const y = t.length - 1;
|
|
2823
|
+
const R = true === s.parts || true === s.scanToEnd;
|
|
2824
|
+
const w = [];
|
|
2825
|
+
const A = [];
|
|
2826
|
+
const b = [];
|
|
2827
|
+
let v = t;
|
|
2828
|
+
let S = -1;
|
|
2829
|
+
let C = 0;
|
|
2830
|
+
let x = 0;
|
|
2831
|
+
let T = false;
|
|
2832
|
+
let H = false;
|
|
2833
|
+
let O = false;
|
|
2834
|
+
let P = false;
|
|
2835
|
+
let I = false;
|
|
2836
|
+
let L = false;
|
|
2837
|
+
let N = false;
|
|
2838
|
+
let k = false;
|
|
2839
|
+
let $ = false;
|
|
2840
|
+
let D = false;
|
|
2841
|
+
let F = 0;
|
|
2842
|
+
let M;
|
|
2843
|
+
let W;
|
|
2844
|
+
let G = {
|
|
2845
|
+
value: "",
|
|
2846
|
+
depth: 0,
|
|
2847
|
+
isGlob: false
|
|
2848
|
+
};
|
|
2849
|
+
const eos = ()=>S >= y;
|
|
2850
|
+
const peek = ()=>v.charCodeAt(S + 1);
|
|
2851
|
+
const advance = ()=>{
|
|
2852
|
+
M = W;
|
|
2853
|
+
return v.charCodeAt(++S);
|
|
2854
|
+
};
|
|
2855
|
+
while(S < y){
|
|
2856
|
+
W = advance();
|
|
2857
|
+
let t;
|
|
2858
|
+
if (W === o) {
|
|
2859
|
+
N = G.backslashes = true;
|
|
2860
|
+
W = advance();
|
|
2861
|
+
if (W === f) L = true;
|
|
2862
|
+
continue;
|
|
2863
|
+
}
|
|
2864
|
+
if (true === L || W === f) {
|
|
2865
|
+
F++;
|
|
2866
|
+
while(true !== eos() && (W = advance())){
|
|
2867
|
+
if (W === o) {
|
|
2868
|
+
N = G.backslashes = true;
|
|
2869
|
+
advance();
|
|
2870
|
+
continue;
|
|
2871
|
+
}
|
|
2872
|
+
if (W === f) {
|
|
2873
|
+
F++;
|
|
2874
|
+
continue;
|
|
2875
|
+
}
|
|
2876
|
+
if (true !== L && W === u && (W = advance()) === u) {
|
|
2877
|
+
T = G.isBrace = true;
|
|
2878
|
+
O = G.isGlob = true;
|
|
2879
|
+
D = true;
|
|
2880
|
+
if (true === R) continue;
|
|
2881
|
+
break;
|
|
2882
|
+
}
|
|
2883
|
+
if (true !== L && W === a) {
|
|
2884
|
+
T = G.isBrace = true;
|
|
2885
|
+
O = G.isGlob = true;
|
|
2886
|
+
D = true;
|
|
2887
|
+
if (true === R) continue;
|
|
2888
|
+
break;
|
|
2889
|
+
}
|
|
2890
|
+
if (W === E) {
|
|
2891
|
+
F--;
|
|
2892
|
+
if (0 === F) {
|
|
2893
|
+
L = false;
|
|
2894
|
+
T = G.isBrace = true;
|
|
2895
|
+
D = true;
|
|
2896
|
+
break;
|
|
2897
|
+
}
|
|
2898
|
+
}
|
|
2899
|
+
}
|
|
2900
|
+
if (true === R) continue;
|
|
2901
|
+
break;
|
|
2902
|
+
}
|
|
2903
|
+
if (W === c) {
|
|
2904
|
+
w.push(S);
|
|
2905
|
+
A.push(G);
|
|
2906
|
+
G = {
|
|
2907
|
+
value: "",
|
|
2908
|
+
depth: 0,
|
|
2909
|
+
isGlob: false
|
|
2910
|
+
};
|
|
2911
|
+
if (true === D) continue;
|
|
2912
|
+
if (M === u && S === C + 1) {
|
|
2913
|
+
C += 2;
|
|
2914
|
+
continue;
|
|
2915
|
+
}
|
|
2916
|
+
x = S + 1;
|
|
2917
|
+
continue;
|
|
2918
|
+
}
|
|
2919
|
+
if (true !== s.noext) {
|
|
2920
|
+
const t = W === d || W === n || W === i || W === _ || W === l;
|
|
2921
|
+
if (true === t && peek() === h) {
|
|
2922
|
+
O = G.isGlob = true;
|
|
2923
|
+
P = G.isExtglob = true;
|
|
2924
|
+
D = true;
|
|
2925
|
+
if (W === l && S === C) $ = true;
|
|
2926
|
+
if (true === R) {
|
|
2927
|
+
while(true !== eos() && (W = advance())){
|
|
2928
|
+
if (W === o) {
|
|
2929
|
+
N = G.backslashes = true;
|
|
2930
|
+
W = advance();
|
|
2931
|
+
continue;
|
|
2932
|
+
}
|
|
2933
|
+
if (W === g) {
|
|
2934
|
+
O = G.isGlob = true;
|
|
2935
|
+
D = true;
|
|
2936
|
+
break;
|
|
2937
|
+
}
|
|
2938
|
+
}
|
|
2939
|
+
continue;
|
|
2940
|
+
}
|
|
2941
|
+
break;
|
|
2942
|
+
}
|
|
2943
|
+
}
|
|
2944
|
+
if (W === i) {
|
|
2945
|
+
if (M === i) I = G.isGlobstar = true;
|
|
2946
|
+
O = G.isGlob = true;
|
|
2947
|
+
D = true;
|
|
2948
|
+
if (true === R) continue;
|
|
2949
|
+
break;
|
|
2950
|
+
}
|
|
2951
|
+
if (W === _) {
|
|
2952
|
+
O = G.isGlob = true;
|
|
2953
|
+
D = true;
|
|
2954
|
+
if (true === R) continue;
|
|
2955
|
+
break;
|
|
2956
|
+
}
|
|
2957
|
+
if (W === p) {
|
|
2958
|
+
while(true !== eos() && (t = advance())){
|
|
2959
|
+
if (t === o) {
|
|
2960
|
+
N = G.backslashes = true;
|
|
2961
|
+
advance();
|
|
2962
|
+
continue;
|
|
2963
|
+
}
|
|
2964
|
+
if (t === m) {
|
|
2965
|
+
H = G.isBracket = true;
|
|
2966
|
+
O = G.isGlob = true;
|
|
2967
|
+
D = true;
|
|
2968
|
+
break;
|
|
2969
|
+
}
|
|
2970
|
+
}
|
|
2971
|
+
if (true === R) continue;
|
|
2972
|
+
break;
|
|
2973
|
+
}
|
|
2974
|
+
if (true !== s.nonegate && W === l && S === C) {
|
|
2975
|
+
k = G.negated = true;
|
|
2976
|
+
C++;
|
|
2977
|
+
continue;
|
|
2978
|
+
}
|
|
2979
|
+
if (true !== s.noparen && W === h) {
|
|
2980
|
+
O = G.isGlob = true;
|
|
2981
|
+
if (true === R) {
|
|
2982
|
+
while(true !== eos() && (W = advance())){
|
|
2983
|
+
if (W === h) {
|
|
2984
|
+
N = G.backslashes = true;
|
|
2985
|
+
W = advance();
|
|
2986
|
+
continue;
|
|
2987
|
+
}
|
|
2988
|
+
if (W === g) {
|
|
2989
|
+
D = true;
|
|
2990
|
+
break;
|
|
2991
|
+
}
|
|
2992
|
+
}
|
|
2993
|
+
continue;
|
|
2994
|
+
}
|
|
2995
|
+
break;
|
|
2996
|
+
}
|
|
2997
|
+
if (true === O) {
|
|
2998
|
+
D = true;
|
|
2999
|
+
if (true === R) continue;
|
|
3000
|
+
break;
|
|
3001
|
+
}
|
|
3002
|
+
}
|
|
3003
|
+
if (true === s.noext) {
|
|
3004
|
+
P = false;
|
|
3005
|
+
O = false;
|
|
3006
|
+
}
|
|
3007
|
+
let B = v;
|
|
3008
|
+
let U = "";
|
|
3009
|
+
let K = "";
|
|
3010
|
+
if (C > 0) {
|
|
3011
|
+
U = v.slice(0, C);
|
|
3012
|
+
v = v.slice(C);
|
|
3013
|
+
x -= C;
|
|
3014
|
+
}
|
|
3015
|
+
if (B && true === O && x > 0) {
|
|
3016
|
+
B = v.slice(0, x);
|
|
3017
|
+
K = v.slice(x);
|
|
3018
|
+
} else if (true === O) {
|
|
3019
|
+
B = "";
|
|
3020
|
+
K = v;
|
|
3021
|
+
} else B = v;
|
|
3022
|
+
if (B && "" !== B && "/" !== B && B !== v) {
|
|
3023
|
+
if (isPathSeparator(B.charCodeAt(B.length - 1))) B = B.slice(0, -1);
|
|
3024
|
+
}
|
|
3025
|
+
if (true === s.unescape) {
|
|
3026
|
+
if (K) K = r.removeBackslashes(K);
|
|
3027
|
+
if (B && true === N) B = r.removeBackslashes(B);
|
|
3028
|
+
}
|
|
3029
|
+
const V = {
|
|
3030
|
+
prefix: U,
|
|
3031
|
+
input: t,
|
|
3032
|
+
start: C,
|
|
3033
|
+
base: B,
|
|
3034
|
+
glob: K,
|
|
3035
|
+
isBrace: T,
|
|
3036
|
+
isBracket: H,
|
|
3037
|
+
isGlob: O,
|
|
3038
|
+
isExtglob: P,
|
|
3039
|
+
isGlobstar: I,
|
|
3040
|
+
negated: k,
|
|
3041
|
+
negatedExtglob: $
|
|
3042
|
+
};
|
|
3043
|
+
if (true === s.tokens) {
|
|
3044
|
+
V.maxDepth = 0;
|
|
3045
|
+
if (!isPathSeparator(W)) A.push(G);
|
|
3046
|
+
V.tokens = A;
|
|
3047
|
+
}
|
|
3048
|
+
if (true === s.parts || true === s.tokens) {
|
|
3049
|
+
let e;
|
|
3050
|
+
for(let r = 0; r < w.length; r++){
|
|
3051
|
+
const i = e ? e + 1 : C;
|
|
3052
|
+
const n = w[r];
|
|
3053
|
+
const o = t.slice(i, n);
|
|
3054
|
+
if (s.tokens) {
|
|
3055
|
+
if (0 === r && 0 !== C) {
|
|
3056
|
+
A[r].isPrefix = true;
|
|
3057
|
+
A[r].value = U;
|
|
3058
|
+
} else A[r].value = o;
|
|
3059
|
+
depth(A[r]);
|
|
3060
|
+
V.maxDepth += A[r].depth;
|
|
3061
|
+
}
|
|
3062
|
+
if (0 !== r || "" !== o) b.push(o);
|
|
3063
|
+
e = n;
|
|
3064
|
+
}
|
|
3065
|
+
if (e && e + 1 < t.length) {
|
|
3066
|
+
const r = t.slice(e + 1);
|
|
3067
|
+
b.push(r);
|
|
3068
|
+
if (s.tokens) {
|
|
3069
|
+
A[A.length - 1].value = r;
|
|
3070
|
+
depth(A[A.length - 1]);
|
|
3071
|
+
V.maxDepth += A[A.length - 1].depth;
|
|
3072
|
+
}
|
|
3073
|
+
}
|
|
3074
|
+
V.slashes = w;
|
|
3075
|
+
V.parts = b;
|
|
3076
|
+
}
|
|
3077
|
+
return V;
|
|
3078
|
+
};
|
|
3079
|
+
t.exports = scan;
|
|
3080
|
+
},
|
|
3081
|
+
869: (t, e, s)=>{
|
|
3082
|
+
"use strict";
|
|
3083
|
+
const r = s(17);
|
|
3084
|
+
const i = "win32" === process.platform;
|
|
3085
|
+
const { REGEX_BACKSLASH: n, REGEX_REMOVE_BACKSLASH: o, REGEX_SPECIAL_CHARS: a, REGEX_SPECIAL_CHARS_GLOBAL: u } = s(112);
|
|
3086
|
+
e.isObject = (t)=>null !== t && "object" == typeof t && !Array.isArray(t);
|
|
3087
|
+
e.hasRegexChars = (t)=>a.test(t);
|
|
3088
|
+
e.isRegexChar = (t)=>1 === t.length && e.hasRegexChars(t);
|
|
3089
|
+
e.escapeRegex = (t)=>t.replace(u, "\\$1");
|
|
3090
|
+
e.toPosixSlashes = (t)=>t.replace(n, "/");
|
|
3091
|
+
e.removeBackslashes = (t)=>t.replace(o, (t)=>"\\" === t ? "" : t);
|
|
3092
|
+
e.supportsLookbehinds = ()=>{
|
|
3093
|
+
const t = process.version.slice(1).split(".").map(Number);
|
|
3094
|
+
if (3 === t.length && t[0] >= 9 || 8 === t[0] && t[1] >= 10) return true;
|
|
3095
|
+
return false;
|
|
3096
|
+
};
|
|
3097
|
+
e.isWindows = (t)=>{
|
|
3098
|
+
if (t && "boolean" == typeof t.windows) return t.windows;
|
|
3099
|
+
return true === i || "\\" === r.sep;
|
|
3100
|
+
};
|
|
3101
|
+
e.escapeLast = (t, s, r)=>{
|
|
3102
|
+
const i = t.lastIndexOf(s, r);
|
|
3103
|
+
if (-1 === i) return t;
|
|
3104
|
+
if ("\\" === t[i - 1]) return e.escapeLast(t, s, i - 1);
|
|
3105
|
+
return `${t.slice(0, i)}\\${t.slice(i)}`;
|
|
3106
|
+
};
|
|
3107
|
+
e.removePrefix = (t, e = {})=>{
|
|
3108
|
+
let s = t;
|
|
3109
|
+
if (s.startsWith("./")) {
|
|
3110
|
+
s = s.slice(2);
|
|
3111
|
+
e.prefix = "./";
|
|
3112
|
+
}
|
|
3113
|
+
return s;
|
|
3114
|
+
};
|
|
3115
|
+
e.wrapOutput = (t, e = {}, s = {})=>{
|
|
3116
|
+
const r = s.contains ? "" : "^";
|
|
3117
|
+
const i = s.contains ? "" : "$";
|
|
3118
|
+
let n = `${r}(?:${t})${i}`;
|
|
3119
|
+
if (true === e.negated) n = `(?:^(?!${n}).*$)`;
|
|
3120
|
+
return n;
|
|
3121
|
+
};
|
|
3122
|
+
},
|
|
3123
|
+
559: (t, e, s)=>{
|
|
3124
|
+
"use strict";
|
|
3125
|
+
const r = s(147);
|
|
3126
|
+
const { Readable: i } = s(781);
|
|
3127
|
+
const n = s(17);
|
|
3128
|
+
const { promisify: o } = s(837);
|
|
3129
|
+
const a = s(700);
|
|
3130
|
+
const u = o(r.readdir);
|
|
3131
|
+
const l = o(r.stat);
|
|
3132
|
+
const c = o(r.lstat);
|
|
3133
|
+
const f = o(r.realpath);
|
|
3134
|
+
const h = "!";
|
|
3135
|
+
const p = "READDIRP_RECURSIVE_ERROR";
|
|
3136
|
+
const d = new Set([
|
|
3137
|
+
"ENOENT",
|
|
3138
|
+
"EPERM",
|
|
3139
|
+
"EACCES",
|
|
3140
|
+
"ELOOP",
|
|
3141
|
+
p
|
|
3142
|
+
]);
|
|
3143
|
+
const _ = "files";
|
|
3144
|
+
const E = "directories";
|
|
3145
|
+
const g = "files_directories";
|
|
3146
|
+
const m = "all";
|
|
3147
|
+
const y = [
|
|
3148
|
+
_,
|
|
3149
|
+
E,
|
|
3150
|
+
g,
|
|
3151
|
+
m
|
|
3152
|
+
];
|
|
3153
|
+
const isNormalFlowError = (t)=>d.has(t.code);
|
|
3154
|
+
const [R, w] = process.versions.node.split(".").slice(0, 2).map((t)=>Number.parseInt(t, 10));
|
|
3155
|
+
const A = "win32" === process.platform && (R > 10 || 10 === R && w >= 5);
|
|
3156
|
+
const normalizeFilter = (t)=>{
|
|
3157
|
+
if (void 0 === t) return;
|
|
3158
|
+
if ("function" == typeof t) return t;
|
|
3159
|
+
if ("string" == typeof t) {
|
|
3160
|
+
const e = a(t.trim());
|
|
3161
|
+
return (t)=>e(t.basename);
|
|
3162
|
+
}
|
|
3163
|
+
if (Array.isArray(t)) {
|
|
3164
|
+
const e = [];
|
|
3165
|
+
const s = [];
|
|
3166
|
+
for (const r of t){
|
|
3167
|
+
const t = r.trim();
|
|
3168
|
+
if (t.charAt(0) === h) s.push(a(t.slice(1)));
|
|
3169
|
+
else e.push(a(t));
|
|
3170
|
+
}
|
|
3171
|
+
if (s.length > 0) {
|
|
3172
|
+
if (e.length > 0) return (t)=>e.some((e)=>e(t.basename)) && !s.some((e)=>e(t.basename));
|
|
3173
|
+
return (t)=>!s.some((e)=>e(t.basename));
|
|
3174
|
+
}
|
|
3175
|
+
return (t)=>e.some((e)=>e(t.basename));
|
|
3176
|
+
}
|
|
3177
|
+
};
|
|
3178
|
+
class ReaddirpStream extends i {
|
|
3179
|
+
static get defaultOptions() {
|
|
3180
|
+
return {
|
|
3181
|
+
root: ".",
|
|
3182
|
+
fileFilter: (t)=>true,
|
|
3183
|
+
directoryFilter: (t)=>true,
|
|
3184
|
+
type: _,
|
|
3185
|
+
lstat: false,
|
|
3186
|
+
depth: 2147483648,
|
|
3187
|
+
alwaysStat: false
|
|
3188
|
+
};
|
|
3189
|
+
}
|
|
3190
|
+
constructor(t = {}){
|
|
3191
|
+
super({
|
|
3192
|
+
objectMode: true,
|
|
3193
|
+
autoDestroy: true,
|
|
3194
|
+
highWaterMark: t.highWaterMark || 4096
|
|
3195
|
+
});
|
|
3196
|
+
const e = {
|
|
3197
|
+
...ReaddirpStream.defaultOptions,
|
|
3198
|
+
...t
|
|
3199
|
+
};
|
|
3200
|
+
const { root: s, type: i } = e;
|
|
3201
|
+
this._fileFilter = normalizeFilter(e.fileFilter);
|
|
3202
|
+
this._directoryFilter = normalizeFilter(e.directoryFilter);
|
|
3203
|
+
const o = e.lstat ? c : l;
|
|
3204
|
+
if (A) this._stat = (t)=>o(t, {
|
|
3205
|
+
bigint: true
|
|
3206
|
+
});
|
|
3207
|
+
else this._stat = o;
|
|
3208
|
+
this._maxDepth = e.depth;
|
|
3209
|
+
this._wantsDir = [
|
|
3210
|
+
E,
|
|
3211
|
+
g,
|
|
3212
|
+
m
|
|
3213
|
+
].includes(i);
|
|
3214
|
+
this._wantsFile = [
|
|
3215
|
+
_,
|
|
3216
|
+
g,
|
|
3217
|
+
m
|
|
3218
|
+
].includes(i);
|
|
3219
|
+
this._wantsEverything = i === m;
|
|
3220
|
+
this._root = n.resolve(s);
|
|
3221
|
+
this._isDirent = "Dirent" in r && !e.alwaysStat;
|
|
3222
|
+
this._statsProp = this._isDirent ? "dirent" : "stats";
|
|
3223
|
+
this._rdOptions = {
|
|
3224
|
+
encoding: "utf8",
|
|
3225
|
+
withFileTypes: this._isDirent
|
|
3226
|
+
};
|
|
3227
|
+
this.parents = [
|
|
3228
|
+
this._exploreDir(s, 1)
|
|
3229
|
+
];
|
|
3230
|
+
this.reading = false;
|
|
3231
|
+
this.parent = void 0;
|
|
3232
|
+
}
|
|
3233
|
+
async _read(t) {
|
|
3234
|
+
if (this.reading) return;
|
|
3235
|
+
this.reading = true;
|
|
3236
|
+
try {
|
|
3237
|
+
while(!this.destroyed && t > 0){
|
|
3238
|
+
const { path: e, depth: s, files: r = [] } = this.parent || {};
|
|
3239
|
+
if (r.length > 0) {
|
|
3240
|
+
const i = r.splice(0, t).map((t)=>this._formatEntry(t, e));
|
|
3241
|
+
for (const e of (await Promise.all(i))){
|
|
3242
|
+
if (this.destroyed) return;
|
|
3243
|
+
const r = await this._getEntryType(e);
|
|
3244
|
+
if ("directory" === r && this._directoryFilter(e)) {
|
|
3245
|
+
if (s <= this._maxDepth) this.parents.push(this._exploreDir(e.fullPath, s + 1));
|
|
3246
|
+
if (this._wantsDir) {
|
|
3247
|
+
this.push(e);
|
|
3248
|
+
t--;
|
|
3249
|
+
}
|
|
3250
|
+
} else if (("file" === r || this._includeAsFile(e)) && this._fileFilter(e)) {
|
|
3251
|
+
if (this._wantsFile) {
|
|
3252
|
+
this.push(e);
|
|
3253
|
+
t--;
|
|
3254
|
+
}
|
|
3255
|
+
}
|
|
3256
|
+
}
|
|
3257
|
+
} else {
|
|
3258
|
+
const t = this.parents.pop();
|
|
3259
|
+
if (!t) {
|
|
3260
|
+
this.push(null);
|
|
3261
|
+
break;
|
|
3262
|
+
}
|
|
3263
|
+
this.parent = await t;
|
|
3264
|
+
if (this.destroyed) return;
|
|
3265
|
+
}
|
|
3266
|
+
}
|
|
3267
|
+
} catch (t) {
|
|
3268
|
+
this.destroy(t);
|
|
3269
|
+
} finally{
|
|
3270
|
+
this.reading = false;
|
|
3271
|
+
}
|
|
3272
|
+
}
|
|
3273
|
+
async _exploreDir(t, e) {
|
|
3274
|
+
let s;
|
|
3275
|
+
try {
|
|
3276
|
+
s = await u(t, this._rdOptions);
|
|
3277
|
+
} catch (t) {
|
|
3278
|
+
this._onError(t);
|
|
3279
|
+
}
|
|
3280
|
+
return {
|
|
3281
|
+
files: s,
|
|
3282
|
+
depth: e,
|
|
3283
|
+
path: t
|
|
3284
|
+
};
|
|
3285
|
+
}
|
|
3286
|
+
async _formatEntry(t, e) {
|
|
3287
|
+
let s;
|
|
3288
|
+
try {
|
|
3289
|
+
const r = this._isDirent ? t.name : t;
|
|
3290
|
+
const i = n.resolve(n.join(e, r));
|
|
3291
|
+
s = {
|
|
3292
|
+
path: n.relative(this._root, i),
|
|
3293
|
+
fullPath: i,
|
|
3294
|
+
basename: r
|
|
3295
|
+
};
|
|
3296
|
+
s[this._statsProp] = this._isDirent ? t : await this._stat(i);
|
|
3297
|
+
} catch (t) {
|
|
3298
|
+
this._onError(t);
|
|
3299
|
+
}
|
|
3300
|
+
return s;
|
|
3301
|
+
}
|
|
3302
|
+
_onError(t) {
|
|
3303
|
+
if (isNormalFlowError(t) && !this.destroyed) this.emit("warn", t);
|
|
3304
|
+
else this.destroy(t);
|
|
3305
|
+
}
|
|
3306
|
+
async _getEntryType(t) {
|
|
3307
|
+
const e = t && t[this._statsProp];
|
|
3308
|
+
if (!e) return;
|
|
3309
|
+
if (e.isFile()) return "file";
|
|
3310
|
+
if (e.isDirectory()) return "directory";
|
|
3311
|
+
if (e && e.isSymbolicLink()) {
|
|
3312
|
+
const e = t.fullPath;
|
|
3313
|
+
try {
|
|
3314
|
+
const t = await f(e);
|
|
3315
|
+
const s = await c(t);
|
|
3316
|
+
if (s.isFile()) return "file";
|
|
3317
|
+
if (s.isDirectory()) {
|
|
3318
|
+
const s = t.length;
|
|
3319
|
+
if (e.startsWith(t) && e.substr(s, 1) === n.sep) {
|
|
3320
|
+
const s = new Error(`Circular symlink detected: "${e}" points to "${t}"`);
|
|
3321
|
+
s.code = p;
|
|
3322
|
+
return this._onError(s);
|
|
3323
|
+
}
|
|
3324
|
+
return "directory";
|
|
3325
|
+
}
|
|
3326
|
+
} catch (t) {
|
|
3327
|
+
this._onError(t);
|
|
3328
|
+
}
|
|
3329
|
+
}
|
|
3330
|
+
}
|
|
3331
|
+
_includeAsFile(t) {
|
|
3332
|
+
const e = t && t[this._statsProp];
|
|
3333
|
+
return e && this._wantsEverything && !e.isDirectory();
|
|
3334
|
+
}
|
|
3335
|
+
}
|
|
3336
|
+
const readdirp = (t, e = {})=>{
|
|
3337
|
+
let s = e.entryType || e.type;
|
|
3338
|
+
if ("both" === s) s = g;
|
|
3339
|
+
if (s) e.type = s;
|
|
3340
|
+
if (t) {
|
|
3341
|
+
if ("string" != typeof t) throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
|
|
3342
|
+
else if (s && !y.includes(s)) throw new Error(`readdirp: Invalid type passed. Use one of ${y.join(", ")}`);
|
|
3343
|
+
} else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
|
|
3344
|
+
e.root = t;
|
|
3345
|
+
return new ReaddirpStream(e);
|
|
3346
|
+
};
|
|
3347
|
+
const readdirpPromise = (t, e = {})=>new Promise((s, r)=>{
|
|
3348
|
+
const i = [];
|
|
3349
|
+
readdirp(t, e).on("data", (t)=>i.push(t)).on("end", ()=>s(i)).on("error", (t)=>r(t));
|
|
3350
|
+
});
|
|
3351
|
+
readdirp.promise = readdirpPromise;
|
|
3352
|
+
readdirp.ReaddirpStream = ReaddirpStream;
|
|
3353
|
+
readdirp.default = readdirp;
|
|
3354
|
+
t.exports = readdirp;
|
|
3355
|
+
},
|
|
3356
|
+
211: (t, e, s)=>{
|
|
3357
|
+
"use strict";
|
|
3358
|
+
/*!
|
|
36
3359
|
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
|
37
3360
|
*
|
|
38
3361
|
* Copyright (c) 2015-present, Jon Schlinkert.
|
|
39
3362
|
* Released under the MIT License.
|
|
40
|
-
*/const r=s(387);const toRegexRange=(t,e,s)=>{if(r(t)===false){throw new TypeError("toRegexRange: expected the first argument to be a number")}if(e===void 0||t===e){return String(t)}if(r(e)===false){throw new TypeError("toRegexRange: expected the second argument to be a number.")}let i={relaxZeros:true,...s};if(typeof i.strictZeros==="boolean"){i.relaxZeros=i.strictZeros===false}let n=String(i.relaxZeros);let o=String(i.shorthand);let a=String(i.capture);let u=String(i.wrap);let l=t+":"+e+"="+n+o+a+u;if(toRegexRange.cache.hasOwnProperty(l)){return toRegexRange.cache[l].result}let c=Math.min(t,e);let f=Math.max(t,e);if(Math.abs(c-f)===1){let s=t+"|"+e;if(i.capture){return`(${s})`}if(i.wrap===false){return s}return`(?:${s})`}let h=hasPadding(t)||hasPadding(e);let p={min:t,max:e,a:c,b:f};let d=[];let _=[];if(h){p.isPadded=h;p.maxLen=String(p.max).length}if(c<0){let t=f<0?Math.abs(f):1;_=splitToPatterns(t,Math.abs(c),p,i);c=p.a=0}if(f>=0){d=splitToPatterns(c,f,p,i)}p.negatives=_;p.positives=d;p.result=collatePatterns(_,d,i);if(i.capture===true){p.result=`(${p.result})`}else if(i.wrap!==false&&d.length+_.length>1){p.result=`(?:${p.result})`}toRegexRange.cache[l]=p;return p.result};function collatePatterns(t,e,s){let r=filterPatterns(t,e,"-",false,s)||[];let i=filterPatterns(e,t,"",false,s)||[];let n=filterPatterns(t,e,"-?",true,s)||[];let o=r.concat(n).concat(i);return o.join("|")}function splitToRanges(t,e){let s=1;let r=1;let i=countNines(t,s);let n=new Set([e]);while(t<=i&&i<=e){n.add(i);s+=1;i=countNines(t,s)}i=countZeros(e+1,r)-1;while(t<i&&i<=e){n.add(i);r+=1;i=countZeros(e+1,r)-1}n=[...n];n.sort(compare);return n}function rangeToPattern(t,e,s){if(t===e){return{pattern:t,count:[],digits:0}}let r=zip(t,e);let i=r.length;let n="";let o=0;for(let t=0;t<i;t++){let[e,i]=r[t];if(e===i){n+=e}else if(e!=="0"||i!=="9"){n+=toCharacterClass(e,i,s)}else{o++}}if(o){n+=s.shorthand===true?"\\d":"[0-9]"}return{pattern:n,count:[o],digits:i}}function splitToPatterns(t,e,s,r){let i=splitToRanges(t,e);let n=[];let o=t;let a;for(let t=0;t<i.length;t++){let e=i[t];let u=rangeToPattern(String(o),String(e),r);let l="";if(!s.isPadded&&a&&a.pattern===u.pattern){if(a.count.length>1){a.count.pop()}a.count.push(u.count[0]);a.string=a.pattern+toQuantifier(a.count);o=e+1;continue}if(s.isPadded){l=padZeros(e,s,r)}u.string=l+u.pattern+toQuantifier(u.count);n.push(u);o=e+1;a=u}return n}function filterPatterns(t,e,s,r,i){let n=[];for(let i of t){let{string:t}=i;if(!r&&!contains(e,"string",t)){n.push(s+t)}if(r&&contains(e,"string",t)){n.push(s+t)}}return n}function zip(t,e){let s=[];for(let r=0;r<t.length;r++)s.push([t[r],e[r]]);return s}function compare(t,e){return t>e?1:e>t?-1:0}function contains(t,e,s){return t.some((t=>t[e]===s))}function countNines(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function countZeros(t,e){return t-t%Math.pow(10,e)}function toQuantifier(t){let[e=0,s=""]=t;if(s||e>1){return`{${e+(s?","+s:"")}}`}return""}function toCharacterClass(t,e,s){return`[${t}${e-t===1?"":"-"}${e}]`}function hasPadding(t){return/^-?(0+)\d/.test(t)}function padZeros(t,e,s){if(!e.isPadded){return t}let r=Math.abs(e.maxLen-String(t).length);let i=s.relaxZeros!==false;switch(r){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:{return i?`0{0,${r}}`:`0{${r}}`}}}toRegexRange.cache={};toRegexRange.clearCache=()=>toRegexRange.cache={};t.exports=toRegexRange},653:(t,e,s)=>{t.exports=require(s.ab+"fsevents.node")},361:t=>{"use strict";t.exports=require("events")},147:t=>{"use strict";t.exports=require("fs")},37:t=>{"use strict";t.exports=require("os")},17:t=>{"use strict";t.exports=require("path")},781:t=>{"use strict";t.exports=require("stream")},837:t=>{"use strict";t.exports=require("util")},600:t=>{"use strict";t.exports=JSON.parse('["3dm","3ds","3g2","3gp","7z","a","aac","adp","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]')}};var e={};function __nccwpck_require__(s){var r=e[s];if(r!==undefined){return r.exports}var i=e[s]={exports:{}};var n=true;try{t[s](i,i.exports,__nccwpck_require__);n=false}finally{if(n)delete e[s]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var s={};(()=>{"use strict";var t=s;const{EventEmitter:e}=__nccwpck_require__(361);const r=__nccwpck_require__(147);const i=__nccwpck_require__(17);const{promisify:n}=__nccwpck_require__(837);const o=__nccwpck_require__(559);const a=__nccwpck_require__(372)["default"];const u=__nccwpck_require__(976);const l=__nccwpck_require__(654);const c=__nccwpck_require__(570);const f=__nccwpck_require__(498);const h=__nccwpck_require__(254);const p=__nccwpck_require__(578);const{EV_ALL:d,EV_READY:_,EV_ADD:E,EV_CHANGE:g,EV_UNLINK:m,EV_ADD_DIR:y,EV_UNLINK_DIR:R,EV_RAW:w,EV_ERROR:A,STR_CLOSE:b,STR_END:v,BACK_SLASH_RE:S,DOUBLE_SLASH_RE:C,SLASH_OR_BACK_SLASH_RE:x,DOT_RE:T,REPLACER_RE:H,SLASH:O,SLASH_SLASH:P,BRACE_START:I,BANG:L,ONE_DOT:N,TWO_DOTS:k,GLOBSTAR:$,SLASH_GLOBSTAR:D,ANYMATCH_OPTS:F,STRING_TYPE:M,FUNCTION_TYPE:W,EMPTY_STR:G,EMPTY_FN:B,isWindows:U,isMacos:K,isIBMi:V}=__nccwpck_require__(240);const j=n(r.stat);const Y=n(r.readdir);const arrify=(t=[])=>Array.isArray(t)?t:[t];const flatten=(t,e=[])=>{t.forEach((t=>{if(Array.isArray(t)){flatten(t,e)}else{e.push(t)}}));return e};const unifyPaths=t=>{const e=flatten(arrify(t));if(!e.every((t=>typeof t===M))){throw new TypeError(`Non-string provided as watch path: ${e}`)}return e.map(normalizePathToUnix)};const toUnix=t=>{let e=t.replace(S,O);let s=false;if(e.startsWith(P)){s=true}while(e.match(C)){e=e.replace(C,O)}if(s){e=O+e}return e};const normalizePathToUnix=t=>toUnix(i.normalize(toUnix(t)));const normalizeIgnored=(t=G)=>e=>{if(typeof e!==M)return e;return normalizePathToUnix(i.isAbsolute(e)?e:i.join(t,e))};const getAbsolutePath=(t,e)=>{if(i.isAbsolute(t)){return t}if(t.startsWith(L)){return L+i.join(e,t.slice(1))}return i.join(e,t)};const undef=(t,e)=>t[e]===undefined;class DirEntry{constructor(t,e){this.path=t;this._removeWatcher=e;this.items=new Set}add(t){const{items:e}=this;if(!e)return;if(t!==N&&t!==k)e.add(t)}async remove(t){const{items:e}=this;if(!e)return;e.delete(t);if(e.size>0)return;const s=this.path;try{await Y(s)}catch(t){if(this._removeWatcher){this._removeWatcher(i.dirname(s),i.basename(s))}}}has(t){const{items:e}=this;if(!e)return;return e.has(t)}getChildren(){const{items:t}=this;if(!t)return;return[...t.values()]}dispose(){this.items.clear();delete this.path;delete this._removeWatcher;delete this.items;Object.freeze(this)}}const z="stat";const q="lstat";class WatchHelper{constructor(t,e,s,r){this.fsw=r;this.path=t=t.replace(H,G);this.watchPath=e;this.fullWatchPath=i.resolve(e);this.hasGlob=e!==t;if(t===G)this.hasGlob=false;this.globSymlink=this.hasGlob&&s?undefined:false;this.globFilter=this.hasGlob?a(t,undefined,F):false;this.dirParts=this.getDirParts(t);this.dirParts.forEach((t=>{if(t.length>1)t.pop()}));this.followSymlinks=s;this.statMethod=s?z:q}checkGlobSymlink(t){if(this.globSymlink===undefined){this.globSymlink=t.fullParentDir===this.fullWatchPath?false:{realPath:t.fullParentDir,linkPath:this.fullWatchPath}}if(this.globSymlink){return t.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath)}return t.fullPath}entryPath(t){return i.join(this.watchPath,i.relative(this.watchPath,this.checkGlobSymlink(t)))}filterPath(t){const{stats:e}=t;if(e&&e.isSymbolicLink())return this.filterDir(t);const s=this.entryPath(t);const r=this.hasGlob&&typeof this.globFilter===W?this.globFilter(s):true;return r&&this.fsw._isntIgnored(s,e)&&this.fsw._hasReadPermissions(e)}getDirParts(t){if(!this.hasGlob)return[];const e=[];const s=t.includes(I)?c.expand(t):[t];s.forEach((t=>{e.push(i.relative(this.watchPath,t).split(x))}));return e}filterDir(t){if(this.hasGlob){const e=this.getDirParts(this.checkGlobSymlink(t));let s=false;this.unmatchedGlob=!this.dirParts.some((t=>t.every(((t,r)=>{if(t===$)s=true;return s||!e[0][r]||a(t,e[0][r],F)}))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(t),t.stats)}}class FSWatcher extends e{constructor(t){super();const e={};if(t)Object.assign(e,t);this._watched=new Map;this._closers=new Map;this._ignoredPaths=new Set;this._throttled=new Map;this._symlinkPaths=new Map;this._streams=new Set;this.closed=false;if(undef(e,"persistent"))e.persistent=true;if(undef(e,"ignoreInitial"))e.ignoreInitial=false;if(undef(e,"ignorePermissionErrors"))e.ignorePermissionErrors=false;if(undef(e,"interval"))e.interval=100;if(undef(e,"binaryInterval"))e.binaryInterval=300;if(undef(e,"disableGlobbing"))e.disableGlobbing=false;e.enableBinaryInterval=e.binaryInterval!==e.interval;if(undef(e,"useFsEvents"))e.useFsEvents=!e.usePolling;const s=p.canUse();if(!s)e.useFsEvents=false;if(undef(e,"usePolling")&&!e.useFsEvents){e.usePolling=K}if(V){e.usePolling=true}const r=process.env.CHOKIDAR_USEPOLLING;if(r!==undefined){const t=r.toLowerCase();if(t==="false"||t==="0"){e.usePolling=false}else if(t==="true"||t==="1"){e.usePolling=true}else{e.usePolling=!!t}}const i=process.env.CHOKIDAR_INTERVAL;if(i){e.interval=Number.parseInt(i,10)}if(undef(e,"atomic"))e.atomic=!e.usePolling&&!e.useFsEvents;if(e.atomic)this._pendingUnlinks=new Map;if(undef(e,"followSymlinks"))e.followSymlinks=true;if(undef(e,"awaitWriteFinish"))e.awaitWriteFinish=false;if(e.awaitWriteFinish===true)e.awaitWriteFinish={};const n=e.awaitWriteFinish;if(n){if(!n.stabilityThreshold)n.stabilityThreshold=2e3;if(!n.pollInterval)n.pollInterval=100;this._pendingWrites=new Map}if(e.ignored)e.ignored=arrify(e.ignored);let o=0;this._emitReady=()=>{o++;if(o>=this._readyCount){this._emitReady=B;this._readyEmitted=true;process.nextTick((()=>this.emit(_)))}};this._emitRaw=(...t)=>this.emit(w,...t);this._readyEmitted=false;this.options=e;if(e.useFsEvents){this._fsEventsHandler=new p(this)}else{this._nodeFsHandler=new h(this)}Object.freeze(e)}add(t,e,s){const{cwd:r,disableGlobbing:n}=this.options;this.closed=false;let o=unifyPaths(t);if(r){o=o.map((t=>{const e=getAbsolutePath(t,r);if(n||!l(t)){return e}return f(e)}))}o=o.filter((t=>{if(t.startsWith(L)){this._ignoredPaths.add(t.slice(1));return false}this._ignoredPaths.delete(t);this._ignoredPaths.delete(t+D);this._userIgnored=undefined;return true}));if(this.options.useFsEvents&&this._fsEventsHandler){if(!this._readyCount)this._readyCount=o.length;if(this.options.persistent)this._readyCount*=2;o.forEach((t=>this._fsEventsHandler._addToFsEvents(t)))}else{if(!this._readyCount)this._readyCount=0;this._readyCount+=o.length;Promise.all(o.map((async t=>{const r=await this._nodeFsHandler._addToNodeFs(t,!s,0,0,e);if(r)this._emitReady();return r}))).then((t=>{if(this.closed)return;t.filter((t=>t)).forEach((t=>{this.add(i.dirname(t),i.basename(e||t))}))}))}return this}unwatch(t){if(this.closed)return this;const e=unifyPaths(t);const{cwd:s}=this.options;e.forEach((t=>{if(!i.isAbsolute(t)&&!this._closers.has(t)){if(s)t=i.join(s,t);t=i.resolve(t)}this._closePath(t);this._ignoredPaths.add(t);if(this._watched.has(t)){this._ignoredPaths.add(t+D)}this._userIgnored=undefined}));return this}close(){if(this.closed)return this._closePromise;this.closed=true;this.removeAllListeners();const t=[];this._closers.forEach((e=>e.forEach((e=>{const s=e();if(s instanceof Promise)t.push(s)}))));this._streams.forEach((t=>t.destroy()));this._userIgnored=undefined;this._readyCount=0;this._readyEmitted=false;this._watched.forEach((t=>t.dispose()));["closers","watched","streams","symlinkPaths","throttled"].forEach((t=>{this[`_${t}`].clear()}));this._closePromise=t.length?Promise.all(t).then((()=>undefined)):Promise.resolve();return this._closePromise}getWatched(){const t={};this._watched.forEach(((e,s)=>{const r=this.options.cwd?i.relative(this.options.cwd,s):s;t[r||N]=e.getChildren().sort()}));return t}emitWithAll(t,e){this.emit(...e);if(t!==A)this.emit(d,...e)}async _emit(t,e,s,r,n){if(this.closed)return;const o=this.options;if(U)e=i.normalize(e);if(o.cwd)e=i.relative(o.cwd,e);const a=[t,e];if(n!==undefined)a.push(s,r,n);else if(r!==undefined)a.push(s,r);else if(s!==undefined)a.push(s);const u=o.awaitWriteFinish;let l;if(u&&(l=this._pendingWrites.get(e))){l.lastChange=new Date;return this}if(o.atomic){if(t===m){this._pendingUnlinks.set(e,a);setTimeout((()=>{this._pendingUnlinks.forEach(((t,e)=>{this.emit(...t);this.emit(d,...t);this._pendingUnlinks.delete(e)}))}),typeof o.atomic==="number"?o.atomic:100);return this}if(t===E&&this._pendingUnlinks.has(e)){t=a[0]=g;this._pendingUnlinks.delete(e)}}if(u&&(t===E||t===g)&&this._readyEmitted){const awfEmit=(e,s)=>{if(e){t=a[0]=A;a[1]=e;this.emitWithAll(t,a)}else if(s){if(a.length>2){a[2]=s}else{a.push(s)}this.emitWithAll(t,a)}};this._awaitWriteFinish(e,u.stabilityThreshold,t,awfEmit);return this}if(t===g){const t=!this._throttle(g,e,50);if(t)return this}if(o.alwaysStat&&s===undefined&&(t===E||t===y||t===g)){const t=o.cwd?i.join(o.cwd,e):e;let s;try{s=await j(t)}catch(t){}if(!s||this.closed)return;a.push(s)}this.emitWithAll(t,a);return this}_handleError(t){const e=t&&t.code;if(t&&e!=="ENOENT"&&e!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||e!=="EPERM"&&e!=="EACCES")){this.emit(A,t)}return t||this.closed}_throttle(t,e,s){if(!this._throttled.has(t)){this._throttled.set(t,new Map)}const r=this._throttled.get(t);const i=r.get(e);if(i){i.count++;return false}let n;const clear=()=>{const t=r.get(e);const s=t?t.count:0;r.delete(e);clearTimeout(n);if(t)clearTimeout(t.timeoutObject);return s};n=setTimeout(clear,s);const o={timeoutObject:n,clear:clear,count:0};r.set(e,o);return o}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(t,e,s,n){let o;let a=t;if(this.options.cwd&&!i.isAbsolute(t)){a=i.join(this.options.cwd,t)}const u=new Date;const awaitWriteFinish=s=>{r.stat(a,((r,i)=>{if(r||!this._pendingWrites.has(t)){if(r&&r.code!=="ENOENT")n(r);return}const a=Number(new Date);if(s&&i.size!==s.size){this._pendingWrites.get(t).lastChange=a}const u=this._pendingWrites.get(t);const l=a-u.lastChange;if(l>=e){this._pendingWrites.delete(t);n(undefined,i)}else{o=setTimeout(awaitWriteFinish,this.options.awaitWriteFinish.pollInterval,i)}}))};if(!this._pendingWrites.has(t)){this._pendingWrites.set(t,{lastChange:u,cancelWait:()=>{this._pendingWrites.delete(t);clearTimeout(o);return s}});o=setTimeout(awaitWriteFinish,this.options.awaitWriteFinish.pollInterval)}}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(t,e){if(this.options.atomic&&T.test(t))return true;if(!this._userIgnored){const{cwd:t}=this.options;const e=this.options.ignored;const s=e&&e.map(normalizeIgnored(t));const r=arrify(s).filter((t=>typeof t===M&&!l(t))).map((t=>t+D));const i=this._getGlobIgnored().map(normalizeIgnored(t)).concat(s,r);this._userIgnored=a(i,undefined,F)}return this._userIgnored([t,e])}_isntIgnored(t,e){return!this._isIgnored(t,e)}_getWatchHelpers(t,e){const s=e||this.options.disableGlobbing||!l(t)?t:u(t);const r=this.options.followSymlinks;return new WatchHelper(t,s,r,this)}_getWatchedDir(t){if(!this._boundRemove)this._boundRemove=this._remove.bind(this);const e=i.resolve(t);if(!this._watched.has(e))this._watched.set(e,new DirEntry(e,this._boundRemove));return this._watched.get(e)}_hasReadPermissions(t){if(this.options.ignorePermissionErrors)return true;const e=t&&Number.parseInt(t.mode,10);const s=e&511;const r=Number.parseInt(s.toString(8)[0],10);return Boolean(4&r)}_remove(t,e,s){const r=i.join(t,e);const n=i.resolve(r);s=s!=null?s:this._watched.has(r)||this._watched.has(n);if(!this._throttle("remove",r,100))return;if(!s&&!this.options.useFsEvents&&this._watched.size===1){this.add(t,e,true)}const o=this._getWatchedDir(r);const a=o.getChildren();a.forEach((t=>this._remove(r,t)));const u=this._getWatchedDir(t);const l=u.has(e);u.remove(e);if(this._symlinkPaths.has(n)){this._symlinkPaths.delete(n)}let c=r;if(this.options.cwd)c=i.relative(this.options.cwd,r);if(this.options.awaitWriteFinish&&this._pendingWrites.has(c)){const t=this._pendingWrites.get(c).cancelWait();if(t===E)return}this._watched.delete(r);this._watched.delete(n);const f=s?R:m;if(l&&!this._isIgnored(r))this._emit(f,r);if(!this.options.useFsEvents){this._closePath(r)}}_closePath(t){this._closeFile(t);const e=i.dirname(t);this._getWatchedDir(e).remove(i.basename(t))}_closeFile(t){const e=this._closers.get(t);if(!e)return;e.forEach((t=>t()));this._closers.delete(t)}_addPathCloser(t,e){if(!e)return;let s=this._closers.get(t);if(!s){s=[];this._closers.set(t,s)}s.push(e)}_readdirp(t,e){if(this.closed)return;const s={type:d,alwaysStat:true,lstat:true,...e};let r=o(t,s);this._streams.add(r);r.once(b,(()=>{r=undefined}));r.once(v,(()=>{if(r){this._streams.delete(r);r=undefined}}));return r}}t.FSWatcher=FSWatcher;const watch=(t,e)=>{const s=new FSWatcher(e);s.add(t);return s};t.watch=watch})();module.exports=s})();
|
|
3363
|
+
*/ const r = s(387);
|
|
3364
|
+
const toRegexRange = (t, e, s)=>{
|
|
3365
|
+
if (false === r(t)) throw new TypeError("toRegexRange: expected the first argument to be a number");
|
|
3366
|
+
if (void 0 === e || t === e) return String(t);
|
|
3367
|
+
if (false === r(e)) throw new TypeError("toRegexRange: expected the second argument to be a number.");
|
|
3368
|
+
let i = {
|
|
3369
|
+
relaxZeros: true,
|
|
3370
|
+
...s
|
|
3371
|
+
};
|
|
3372
|
+
if ("boolean" == typeof i.strictZeros) i.relaxZeros = false === i.strictZeros;
|
|
3373
|
+
let n = String(i.relaxZeros);
|
|
3374
|
+
let o = String(i.shorthand);
|
|
3375
|
+
let a = String(i.capture);
|
|
3376
|
+
let u = String(i.wrap);
|
|
3377
|
+
let l = t + ":" + e + "=" + n + o + a + u;
|
|
3378
|
+
if (toRegexRange.cache.hasOwnProperty(l)) return toRegexRange.cache[l].result;
|
|
3379
|
+
let c = Math.min(t, e);
|
|
3380
|
+
let f = Math.max(t, e);
|
|
3381
|
+
if (1 === Math.abs(c - f)) {
|
|
3382
|
+
let s = t + "|" + e;
|
|
3383
|
+
if (i.capture) return `(${s})`;
|
|
3384
|
+
if (false === i.wrap) return s;
|
|
3385
|
+
return `(?:${s})`;
|
|
3386
|
+
}
|
|
3387
|
+
let h = hasPadding(t) || hasPadding(e);
|
|
3388
|
+
let p = {
|
|
3389
|
+
min: t,
|
|
3390
|
+
max: e,
|
|
3391
|
+
a: c,
|
|
3392
|
+
b: f
|
|
3393
|
+
};
|
|
3394
|
+
let d = [];
|
|
3395
|
+
let _ = [];
|
|
3396
|
+
if (h) {
|
|
3397
|
+
p.isPadded = h;
|
|
3398
|
+
p.maxLen = String(p.max).length;
|
|
3399
|
+
}
|
|
3400
|
+
if (c < 0) {
|
|
3401
|
+
let t = f < 0 ? Math.abs(f) : 1;
|
|
3402
|
+
_ = splitToPatterns(t, Math.abs(c), p, i);
|
|
3403
|
+
c = p.a = 0;
|
|
3404
|
+
}
|
|
3405
|
+
if (f >= 0) d = splitToPatterns(c, f, p, i);
|
|
3406
|
+
p.negatives = _;
|
|
3407
|
+
p.positives = d;
|
|
3408
|
+
p.result = collatePatterns(_, d, i);
|
|
3409
|
+
if (true === i.capture) p.result = `(${p.result})`;
|
|
3410
|
+
else if (false !== i.wrap && d.length + _.length > 1) p.result = `(?:${p.result})`;
|
|
3411
|
+
toRegexRange.cache[l] = p;
|
|
3412
|
+
return p.result;
|
|
3413
|
+
};
|
|
3414
|
+
function collatePatterns(t, e, s) {
|
|
3415
|
+
let r = filterPatterns(t, e, "-", false, s) || [];
|
|
3416
|
+
let i = filterPatterns(e, t, "", false, s) || [];
|
|
3417
|
+
let n = filterPatterns(t, e, "-?", true, s) || [];
|
|
3418
|
+
let o = r.concat(n).concat(i);
|
|
3419
|
+
return o.join("|");
|
|
3420
|
+
}
|
|
3421
|
+
function splitToRanges(t, e) {
|
|
3422
|
+
let s = 1;
|
|
3423
|
+
let r = 1;
|
|
3424
|
+
let i = countNines(t, s);
|
|
3425
|
+
let n = new Set([
|
|
3426
|
+
e
|
|
3427
|
+
]);
|
|
3428
|
+
while(t <= i && i <= e){
|
|
3429
|
+
n.add(i);
|
|
3430
|
+
s += 1;
|
|
3431
|
+
i = countNines(t, s);
|
|
3432
|
+
}
|
|
3433
|
+
i = countZeros(e + 1, r) - 1;
|
|
3434
|
+
while(t < i && i <= e){
|
|
3435
|
+
n.add(i);
|
|
3436
|
+
r += 1;
|
|
3437
|
+
i = countZeros(e + 1, r) - 1;
|
|
3438
|
+
}
|
|
3439
|
+
n = [
|
|
3440
|
+
...n
|
|
3441
|
+
];
|
|
3442
|
+
n.sort(compare);
|
|
3443
|
+
return n;
|
|
3444
|
+
}
|
|
3445
|
+
function rangeToPattern(t, e, s) {
|
|
3446
|
+
if (t === e) return {
|
|
3447
|
+
pattern: t,
|
|
3448
|
+
count: [],
|
|
3449
|
+
digits: 0
|
|
3450
|
+
};
|
|
3451
|
+
let r = zip(t, e);
|
|
3452
|
+
let i = r.length;
|
|
3453
|
+
let n = "";
|
|
3454
|
+
let o = 0;
|
|
3455
|
+
for(let t = 0; t < i; t++){
|
|
3456
|
+
let [e, i] = r[t];
|
|
3457
|
+
if (e === i) n += e;
|
|
3458
|
+
else if ("0" !== e || "9" !== i) n += toCharacterClass(e, i, s);
|
|
3459
|
+
else o++;
|
|
3460
|
+
}
|
|
3461
|
+
if (o) n += true === s.shorthand ? "\\d" : "[0-9]";
|
|
3462
|
+
return {
|
|
3463
|
+
pattern: n,
|
|
3464
|
+
count: [
|
|
3465
|
+
o
|
|
3466
|
+
],
|
|
3467
|
+
digits: i
|
|
3468
|
+
};
|
|
3469
|
+
}
|
|
3470
|
+
function splitToPatterns(t, e, s, r) {
|
|
3471
|
+
let i = splitToRanges(t, e);
|
|
3472
|
+
let n = [];
|
|
3473
|
+
let o = t;
|
|
3474
|
+
let a;
|
|
3475
|
+
for(let t = 0; t < i.length; t++){
|
|
3476
|
+
let e = i[t];
|
|
3477
|
+
let u = rangeToPattern(String(o), String(e), r);
|
|
3478
|
+
let l = "";
|
|
3479
|
+
if (!s.isPadded && a && a.pattern === u.pattern) {
|
|
3480
|
+
if (a.count.length > 1) a.count.pop();
|
|
3481
|
+
a.count.push(u.count[0]);
|
|
3482
|
+
a.string = a.pattern + toQuantifier(a.count);
|
|
3483
|
+
o = e + 1;
|
|
3484
|
+
continue;
|
|
3485
|
+
}
|
|
3486
|
+
if (s.isPadded) l = padZeros(e, s, r);
|
|
3487
|
+
u.string = l + u.pattern + toQuantifier(u.count);
|
|
3488
|
+
n.push(u);
|
|
3489
|
+
o = e + 1;
|
|
3490
|
+
a = u;
|
|
3491
|
+
}
|
|
3492
|
+
return n;
|
|
3493
|
+
}
|
|
3494
|
+
function filterPatterns(t, e, s, r, i) {
|
|
3495
|
+
let n = [];
|
|
3496
|
+
for (let i of t){
|
|
3497
|
+
let { string: t } = i;
|
|
3498
|
+
if (!r && !contains(e, "string", t)) n.push(s + t);
|
|
3499
|
+
if (r && contains(e, "string", t)) n.push(s + t);
|
|
3500
|
+
}
|
|
3501
|
+
return n;
|
|
3502
|
+
}
|
|
3503
|
+
function zip(t, e) {
|
|
3504
|
+
let s = [];
|
|
3505
|
+
for(let r = 0; r < t.length; r++)s.push([
|
|
3506
|
+
t[r],
|
|
3507
|
+
e[r]
|
|
3508
|
+
]);
|
|
3509
|
+
return s;
|
|
3510
|
+
}
|
|
3511
|
+
function compare(t, e) {
|
|
3512
|
+
return t > e ? 1 : e > t ? -1 : 0;
|
|
3513
|
+
}
|
|
3514
|
+
function contains(t, e, s) {
|
|
3515
|
+
return t.some((t)=>t[e] === s);
|
|
3516
|
+
}
|
|
3517
|
+
function countNines(t, e) {
|
|
3518
|
+
return Number(String(t).slice(0, -e) + "9".repeat(e));
|
|
3519
|
+
}
|
|
3520
|
+
function countZeros(t, e) {
|
|
3521
|
+
return t - t % Math.pow(10, e);
|
|
3522
|
+
}
|
|
3523
|
+
function toQuantifier(t) {
|
|
3524
|
+
let [e = 0, s = ""] = t;
|
|
3525
|
+
if (s || e > 1) return `{${e + (s ? "," + s : "")}}`;
|
|
3526
|
+
return "";
|
|
3527
|
+
}
|
|
3528
|
+
function toCharacterClass(t, e, s) {
|
|
3529
|
+
return `[${t}${e - t === 1 ? "" : "-"}${e}]`;
|
|
3530
|
+
}
|
|
3531
|
+
function hasPadding(t) {
|
|
3532
|
+
return /^-?(0+)\d/.test(t);
|
|
3533
|
+
}
|
|
3534
|
+
function padZeros(t, e, s) {
|
|
3535
|
+
if (!e.isPadded) return t;
|
|
3536
|
+
let r = Math.abs(e.maxLen - String(t).length);
|
|
3537
|
+
let i = false !== s.relaxZeros;
|
|
3538
|
+
switch(r){
|
|
3539
|
+
case 0:
|
|
3540
|
+
return "";
|
|
3541
|
+
case 1:
|
|
3542
|
+
return i ? "0?" : "0";
|
|
3543
|
+
case 2:
|
|
3544
|
+
return i ? "0{0,2}" : "00";
|
|
3545
|
+
default:
|
|
3546
|
+
return i ? `0{0,${r}}` : `0{${r}}`;
|
|
3547
|
+
}
|
|
3548
|
+
}
|
|
3549
|
+
toRegexRange.cache = {};
|
|
3550
|
+
toRegexRange.clearCache = ()=>toRegexRange.cache = {};
|
|
3551
|
+
t.exports = toRegexRange;
|
|
3552
|
+
},
|
|
3553
|
+
653: (t, e, s)=>{
|
|
3554
|
+
t.exports = require(s.ab + "fsevents.node");
|
|
3555
|
+
},
|
|
3556
|
+
361: (t)=>{
|
|
3557
|
+
"use strict";
|
|
3558
|
+
t.exports = require("events");
|
|
3559
|
+
},
|
|
3560
|
+
147: (t)=>{
|
|
3561
|
+
"use strict";
|
|
3562
|
+
t.exports = require("fs");
|
|
3563
|
+
},
|
|
3564
|
+
37: (t)=>{
|
|
3565
|
+
"use strict";
|
|
3566
|
+
t.exports = require("os");
|
|
3567
|
+
},
|
|
3568
|
+
17: (t)=>{
|
|
3569
|
+
"use strict";
|
|
3570
|
+
t.exports = require("path");
|
|
3571
|
+
},
|
|
3572
|
+
781: (t)=>{
|
|
3573
|
+
"use strict";
|
|
3574
|
+
t.exports = require("stream");
|
|
3575
|
+
},
|
|
3576
|
+
837: (t)=>{
|
|
3577
|
+
"use strict";
|
|
3578
|
+
t.exports = require("util");
|
|
3579
|
+
},
|
|
3580
|
+
600: (t)=>{
|
|
3581
|
+
"use strict";
|
|
3582
|
+
t.exports = JSON.parse('["3dm","3ds","3g2","3gp","7z","a","aac","adp","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]');
|
|
3583
|
+
}
|
|
3584
|
+
};
|
|
3585
|
+
var e = {};
|
|
3586
|
+
function __nccwpck_require__(s) {
|
|
3587
|
+
var r = e[s];
|
|
3588
|
+
if (void 0 !== r) return r.exports;
|
|
3589
|
+
var i = e[s] = {
|
|
3590
|
+
exports: {}
|
|
3591
|
+
};
|
|
3592
|
+
var n = true;
|
|
3593
|
+
try {
|
|
3594
|
+
t[s](i, i.exports, __nccwpck_require__);
|
|
3595
|
+
n = false;
|
|
3596
|
+
} finally{
|
|
3597
|
+
if (n) delete e[s];
|
|
3598
|
+
}
|
|
3599
|
+
return i.exports;
|
|
3600
|
+
}
|
|
3601
|
+
if (void 0 !== __nccwpck_require__) __nccwpck_require__.ab = __dirname + "/";
|
|
3602
|
+
var s = {};
|
|
3603
|
+
(()=>{
|
|
3604
|
+
"use strict";
|
|
3605
|
+
var t = s;
|
|
3606
|
+
const { EventEmitter: e } = __nccwpck_require__(361);
|
|
3607
|
+
const r = __nccwpck_require__(147);
|
|
3608
|
+
const i = __nccwpck_require__(17);
|
|
3609
|
+
const { promisify: n } = __nccwpck_require__(837);
|
|
3610
|
+
const o = __nccwpck_require__(559);
|
|
3611
|
+
const a = __nccwpck_require__(372)["default"];
|
|
3612
|
+
const u = __nccwpck_require__(976);
|
|
3613
|
+
const l = __nccwpck_require__(654);
|
|
3614
|
+
const c = __nccwpck_require__(570);
|
|
3615
|
+
const f = __nccwpck_require__(498);
|
|
3616
|
+
const h = __nccwpck_require__(254);
|
|
3617
|
+
const p = __nccwpck_require__(578);
|
|
3618
|
+
const { EV_ALL: d, EV_READY: _, EV_ADD: E, EV_CHANGE: g, EV_UNLINK: m, EV_ADD_DIR: y, EV_UNLINK_DIR: R, EV_RAW: w, EV_ERROR: A, STR_CLOSE: b, STR_END: v, BACK_SLASH_RE: S, DOUBLE_SLASH_RE: C, SLASH_OR_BACK_SLASH_RE: x, DOT_RE: T, REPLACER_RE: H, SLASH: O, SLASH_SLASH: P, BRACE_START: I, BANG: L, ONE_DOT: N, TWO_DOTS: k, GLOBSTAR: $, SLASH_GLOBSTAR: D, ANYMATCH_OPTS: F, STRING_TYPE: M, FUNCTION_TYPE: W, EMPTY_STR: G, EMPTY_FN: B, isWindows: U, isMacos: K, isIBMi: V } = __nccwpck_require__(240);
|
|
3619
|
+
const j = n(r.stat);
|
|
3620
|
+
const Y = n(r.readdir);
|
|
3621
|
+
const arrify = (t = [])=>Array.isArray(t) ? t : [
|
|
3622
|
+
t
|
|
3623
|
+
];
|
|
3624
|
+
const flatten = (t, e = [])=>{
|
|
3625
|
+
t.forEach((t)=>{
|
|
3626
|
+
if (Array.isArray(t)) flatten(t, e);
|
|
3627
|
+
else e.push(t);
|
|
3628
|
+
});
|
|
3629
|
+
return e;
|
|
3630
|
+
};
|
|
3631
|
+
const unifyPaths = (t)=>{
|
|
3632
|
+
const e = flatten(arrify(t));
|
|
3633
|
+
if (!e.every((t)=>typeof t === M)) throw new TypeError(`Non-string provided as watch path: ${e}`);
|
|
3634
|
+
return e.map(normalizePathToUnix);
|
|
3635
|
+
};
|
|
3636
|
+
const toUnix = (t)=>{
|
|
3637
|
+
let e = t.replace(S, O);
|
|
3638
|
+
let s = false;
|
|
3639
|
+
if (e.startsWith(P)) s = true;
|
|
3640
|
+
while(e.match(C))e = e.replace(C, O);
|
|
3641
|
+
if (s) e = O + e;
|
|
3642
|
+
return e;
|
|
3643
|
+
};
|
|
3644
|
+
const normalizePathToUnix = (t)=>toUnix(i.normalize(toUnix(t)));
|
|
3645
|
+
const normalizeIgnored = (t = G)=>(e)=>{
|
|
3646
|
+
if (typeof e !== M) return e;
|
|
3647
|
+
return normalizePathToUnix(i.isAbsolute(e) ? e : i.join(t, e));
|
|
3648
|
+
};
|
|
3649
|
+
const getAbsolutePath = (t, e)=>{
|
|
3650
|
+
if (i.isAbsolute(t)) return t;
|
|
3651
|
+
if (t.startsWith(L)) return L + i.join(e, t.slice(1));
|
|
3652
|
+
return i.join(e, t);
|
|
3653
|
+
};
|
|
3654
|
+
const undef = (t, e)=>void 0 === t[e];
|
|
3655
|
+
class DirEntry {
|
|
3656
|
+
constructor(t, e){
|
|
3657
|
+
this.path = t;
|
|
3658
|
+
this._removeWatcher = e;
|
|
3659
|
+
this.items = new Set;
|
|
3660
|
+
}
|
|
3661
|
+
add(t) {
|
|
3662
|
+
const { items: e } = this;
|
|
3663
|
+
if (!e) return;
|
|
3664
|
+
if (t !== N && t !== k) e.add(t);
|
|
3665
|
+
}
|
|
3666
|
+
async remove(t) {
|
|
3667
|
+
const { items: e } = this;
|
|
3668
|
+
if (!e) return;
|
|
3669
|
+
e.delete(t);
|
|
3670
|
+
if (e.size > 0) return;
|
|
3671
|
+
const s = this.path;
|
|
3672
|
+
try {
|
|
3673
|
+
await Y(s);
|
|
3674
|
+
} catch (t) {
|
|
3675
|
+
if (this._removeWatcher) this._removeWatcher(i.dirname(s), i.basename(s));
|
|
3676
|
+
}
|
|
3677
|
+
}
|
|
3678
|
+
has(t) {
|
|
3679
|
+
const { items: e } = this;
|
|
3680
|
+
if (!e) return;
|
|
3681
|
+
return e.has(t);
|
|
3682
|
+
}
|
|
3683
|
+
getChildren() {
|
|
3684
|
+
const { items: t } = this;
|
|
3685
|
+
if (!t) return;
|
|
3686
|
+
return [
|
|
3687
|
+
...t.values()
|
|
3688
|
+
];
|
|
3689
|
+
}
|
|
3690
|
+
dispose() {
|
|
3691
|
+
this.items.clear();
|
|
3692
|
+
delete this.path;
|
|
3693
|
+
delete this._removeWatcher;
|
|
3694
|
+
delete this.items;
|
|
3695
|
+
Object.freeze(this);
|
|
3696
|
+
}
|
|
3697
|
+
}
|
|
3698
|
+
const z = "stat";
|
|
3699
|
+
const q = "lstat";
|
|
3700
|
+
class WatchHelper {
|
|
3701
|
+
constructor(t, e, s, r){
|
|
3702
|
+
this.fsw = r;
|
|
3703
|
+
this.path = t = t.replace(H, G);
|
|
3704
|
+
this.watchPath = e;
|
|
3705
|
+
this.fullWatchPath = i.resolve(e);
|
|
3706
|
+
this.hasGlob = e !== t;
|
|
3707
|
+
if (t === G) this.hasGlob = false;
|
|
3708
|
+
this.globSymlink = this.hasGlob && s ? void 0 : false;
|
|
3709
|
+
this.globFilter = this.hasGlob ? a(t, void 0, F) : false;
|
|
3710
|
+
this.dirParts = this.getDirParts(t);
|
|
3711
|
+
this.dirParts.forEach((t)=>{
|
|
3712
|
+
if (t.length > 1) t.pop();
|
|
3713
|
+
});
|
|
3714
|
+
this.followSymlinks = s;
|
|
3715
|
+
this.statMethod = s ? z : q;
|
|
3716
|
+
}
|
|
3717
|
+
checkGlobSymlink(t) {
|
|
3718
|
+
if (void 0 === this.globSymlink) this.globSymlink = t.fullParentDir === this.fullWatchPath ? false : {
|
|
3719
|
+
realPath: t.fullParentDir,
|
|
3720
|
+
linkPath: this.fullWatchPath
|
|
3721
|
+
};
|
|
3722
|
+
if (this.globSymlink) return t.fullPath.replace(this.globSymlink.realPath, this.globSymlink.linkPath);
|
|
3723
|
+
return t.fullPath;
|
|
3724
|
+
}
|
|
3725
|
+
entryPath(t) {
|
|
3726
|
+
return i.join(this.watchPath, i.relative(this.watchPath, this.checkGlobSymlink(t)));
|
|
3727
|
+
}
|
|
3728
|
+
filterPath(t) {
|
|
3729
|
+
const { stats: e } = t;
|
|
3730
|
+
if (e && e.isSymbolicLink()) return this.filterDir(t);
|
|
3731
|
+
const s = this.entryPath(t);
|
|
3732
|
+
const r = this.hasGlob && typeof this.globFilter === W ? this.globFilter(s) : true;
|
|
3733
|
+
return r && this.fsw._isntIgnored(s, e) && this.fsw._hasReadPermissions(e);
|
|
3734
|
+
}
|
|
3735
|
+
getDirParts(t) {
|
|
3736
|
+
if (!this.hasGlob) return [];
|
|
3737
|
+
const e = [];
|
|
3738
|
+
const s = t.includes(I) ? c.expand(t) : [
|
|
3739
|
+
t
|
|
3740
|
+
];
|
|
3741
|
+
s.forEach((t)=>{
|
|
3742
|
+
e.push(i.relative(this.watchPath, t).split(x));
|
|
3743
|
+
});
|
|
3744
|
+
return e;
|
|
3745
|
+
}
|
|
3746
|
+
filterDir(t) {
|
|
3747
|
+
if (this.hasGlob) {
|
|
3748
|
+
const e = this.getDirParts(this.checkGlobSymlink(t));
|
|
3749
|
+
let s = false;
|
|
3750
|
+
this.unmatchedGlob = !this.dirParts.some((t)=>t.every((t, r)=>{
|
|
3751
|
+
if (t === $) s = true;
|
|
3752
|
+
return s || !e[0][r] || a(t, e[0][r], F);
|
|
3753
|
+
}));
|
|
3754
|
+
}
|
|
3755
|
+
return !this.unmatchedGlob && this.fsw._isntIgnored(this.entryPath(t), t.stats);
|
|
3756
|
+
}
|
|
3757
|
+
}
|
|
3758
|
+
class FSWatcher extends e {
|
|
3759
|
+
constructor(t){
|
|
3760
|
+
super();
|
|
3761
|
+
const e = {};
|
|
3762
|
+
if (t) Object.assign(e, t);
|
|
3763
|
+
this._watched = new Map;
|
|
3764
|
+
this._closers = new Map;
|
|
3765
|
+
this._ignoredPaths = new Set;
|
|
3766
|
+
this._throttled = new Map;
|
|
3767
|
+
this._symlinkPaths = new Map;
|
|
3768
|
+
this._streams = new Set;
|
|
3769
|
+
this.closed = false;
|
|
3770
|
+
if (undef(e, "persistent")) e.persistent = true;
|
|
3771
|
+
if (undef(e, "ignoreInitial")) e.ignoreInitial = false;
|
|
3772
|
+
if (undef(e, "ignorePermissionErrors")) e.ignorePermissionErrors = false;
|
|
3773
|
+
if (undef(e, "interval")) e.interval = 100;
|
|
3774
|
+
if (undef(e, "binaryInterval")) e.binaryInterval = 300;
|
|
3775
|
+
if (undef(e, "disableGlobbing")) e.disableGlobbing = false;
|
|
3776
|
+
e.enableBinaryInterval = e.binaryInterval !== e.interval;
|
|
3777
|
+
if (undef(e, "useFsEvents")) e.useFsEvents = !e.usePolling;
|
|
3778
|
+
const s = p.canUse();
|
|
3779
|
+
if (!s) e.useFsEvents = false;
|
|
3780
|
+
if (undef(e, "usePolling") && !e.useFsEvents) e.usePolling = K;
|
|
3781
|
+
if (V) e.usePolling = true;
|
|
3782
|
+
const r = process.env.CHOKIDAR_USEPOLLING;
|
|
3783
|
+
if (void 0 !== r) {
|
|
3784
|
+
const t = r.toLowerCase();
|
|
3785
|
+
if ("false" === t || "0" === t) e.usePolling = false;
|
|
3786
|
+
else if ("true" === t || "1" === t) e.usePolling = true;
|
|
3787
|
+
else e.usePolling = !!t;
|
|
3788
|
+
}
|
|
3789
|
+
const i = process.env.CHOKIDAR_INTERVAL;
|
|
3790
|
+
if (i) e.interval = Number.parseInt(i, 10);
|
|
3791
|
+
if (undef(e, "atomic")) e.atomic = !e.usePolling && !e.useFsEvents;
|
|
3792
|
+
if (e.atomic) this._pendingUnlinks = new Map;
|
|
3793
|
+
if (undef(e, "followSymlinks")) e.followSymlinks = true;
|
|
3794
|
+
if (undef(e, "awaitWriteFinish")) e.awaitWriteFinish = false;
|
|
3795
|
+
if (true === e.awaitWriteFinish) e.awaitWriteFinish = {};
|
|
3796
|
+
const n = e.awaitWriteFinish;
|
|
3797
|
+
if (n) {
|
|
3798
|
+
if (!n.stabilityThreshold) n.stabilityThreshold = 2e3;
|
|
3799
|
+
if (!n.pollInterval) n.pollInterval = 100;
|
|
3800
|
+
this._pendingWrites = new Map;
|
|
3801
|
+
}
|
|
3802
|
+
if (e.ignored) e.ignored = arrify(e.ignored);
|
|
3803
|
+
let o = 0;
|
|
3804
|
+
this._emitReady = ()=>{
|
|
3805
|
+
o++;
|
|
3806
|
+
if (o >= this._readyCount) {
|
|
3807
|
+
this._emitReady = B;
|
|
3808
|
+
this._readyEmitted = true;
|
|
3809
|
+
process.nextTick(()=>this.emit(_));
|
|
3810
|
+
}
|
|
3811
|
+
};
|
|
3812
|
+
this._emitRaw = (...t)=>this.emit(w, ...t);
|
|
3813
|
+
this._readyEmitted = false;
|
|
3814
|
+
this.options = e;
|
|
3815
|
+
if (e.useFsEvents) this._fsEventsHandler = new p(this);
|
|
3816
|
+
else this._nodeFsHandler = new h(this);
|
|
3817
|
+
Object.freeze(e);
|
|
3818
|
+
}
|
|
3819
|
+
add(t, e, s) {
|
|
3820
|
+
const { cwd: r, disableGlobbing: n } = this.options;
|
|
3821
|
+
this.closed = false;
|
|
3822
|
+
let o = unifyPaths(t);
|
|
3823
|
+
if (r) o = o.map((t)=>{
|
|
3824
|
+
const e = getAbsolutePath(t, r);
|
|
3825
|
+
if (n || !l(t)) return e;
|
|
3826
|
+
return f(e);
|
|
3827
|
+
});
|
|
3828
|
+
o = o.filter((t)=>{
|
|
3829
|
+
if (t.startsWith(L)) {
|
|
3830
|
+
this._ignoredPaths.add(t.slice(1));
|
|
3831
|
+
return false;
|
|
3832
|
+
}
|
|
3833
|
+
this._ignoredPaths.delete(t);
|
|
3834
|
+
this._ignoredPaths.delete(t + D);
|
|
3835
|
+
this._userIgnored = void 0;
|
|
3836
|
+
return true;
|
|
3837
|
+
});
|
|
3838
|
+
if (this.options.useFsEvents && this._fsEventsHandler) {
|
|
3839
|
+
if (!this._readyCount) this._readyCount = o.length;
|
|
3840
|
+
if (this.options.persistent) this._readyCount *= 2;
|
|
3841
|
+
o.forEach((t)=>this._fsEventsHandler._addToFsEvents(t));
|
|
3842
|
+
} else {
|
|
3843
|
+
if (!this._readyCount) this._readyCount = 0;
|
|
3844
|
+
this._readyCount += o.length;
|
|
3845
|
+
Promise.all(o.map(async (t)=>{
|
|
3846
|
+
const r = await this._nodeFsHandler._addToNodeFs(t, !s, 0, 0, e);
|
|
3847
|
+
if (r) this._emitReady();
|
|
3848
|
+
return r;
|
|
3849
|
+
})).then((t)=>{
|
|
3850
|
+
if (this.closed) return;
|
|
3851
|
+
t.filter((t)=>t).forEach((t)=>{
|
|
3852
|
+
this.add(i.dirname(t), i.basename(e || t));
|
|
3853
|
+
});
|
|
3854
|
+
});
|
|
3855
|
+
}
|
|
3856
|
+
return this;
|
|
3857
|
+
}
|
|
3858
|
+
unwatch(t) {
|
|
3859
|
+
if (this.closed) return this;
|
|
3860
|
+
const e = unifyPaths(t);
|
|
3861
|
+
const { cwd: s } = this.options;
|
|
3862
|
+
e.forEach((t)=>{
|
|
3863
|
+
if (!i.isAbsolute(t) && !this._closers.has(t)) {
|
|
3864
|
+
if (s) t = i.join(s, t);
|
|
3865
|
+
t = i.resolve(t);
|
|
3866
|
+
}
|
|
3867
|
+
this._closePath(t);
|
|
3868
|
+
this._ignoredPaths.add(t);
|
|
3869
|
+
if (this._watched.has(t)) this._ignoredPaths.add(t + D);
|
|
3870
|
+
this._userIgnored = void 0;
|
|
3871
|
+
});
|
|
3872
|
+
return this;
|
|
3873
|
+
}
|
|
3874
|
+
close() {
|
|
3875
|
+
if (this.closed) return this._closePromise;
|
|
3876
|
+
this.closed = true;
|
|
3877
|
+
this.removeAllListeners();
|
|
3878
|
+
const t = [];
|
|
3879
|
+
this._closers.forEach((e)=>e.forEach((e)=>{
|
|
3880
|
+
const s = e();
|
|
3881
|
+
if (s instanceof Promise) t.push(s);
|
|
3882
|
+
}));
|
|
3883
|
+
this._streams.forEach((t)=>t.destroy());
|
|
3884
|
+
this._userIgnored = void 0;
|
|
3885
|
+
this._readyCount = 0;
|
|
3886
|
+
this._readyEmitted = false;
|
|
3887
|
+
this._watched.forEach((t)=>t.dispose());
|
|
3888
|
+
[
|
|
3889
|
+
"closers",
|
|
3890
|
+
"watched",
|
|
3891
|
+
"streams",
|
|
3892
|
+
"symlinkPaths",
|
|
3893
|
+
"throttled"
|
|
3894
|
+
].forEach((t)=>{
|
|
3895
|
+
this[`_${t}`].clear();
|
|
3896
|
+
});
|
|
3897
|
+
this._closePromise = t.length ? Promise.all(t).then(()=>void 0) : Promise.resolve();
|
|
3898
|
+
return this._closePromise;
|
|
3899
|
+
}
|
|
3900
|
+
getWatched() {
|
|
3901
|
+
const t = {};
|
|
3902
|
+
this._watched.forEach((e, s)=>{
|
|
3903
|
+
const r = this.options.cwd ? i.relative(this.options.cwd, s) : s;
|
|
3904
|
+
t[r || N] = e.getChildren().sort();
|
|
3905
|
+
});
|
|
3906
|
+
return t;
|
|
3907
|
+
}
|
|
3908
|
+
emitWithAll(t, e) {
|
|
3909
|
+
this.emit(...e);
|
|
3910
|
+
if (t !== A) this.emit(d, ...e);
|
|
3911
|
+
}
|
|
3912
|
+
async _emit(t, e, s, r, n) {
|
|
3913
|
+
if (this.closed) return;
|
|
3914
|
+
const o = this.options;
|
|
3915
|
+
if (U) e = i.normalize(e);
|
|
3916
|
+
if (o.cwd) e = i.relative(o.cwd, e);
|
|
3917
|
+
const a = [
|
|
3918
|
+
t,
|
|
3919
|
+
e
|
|
3920
|
+
];
|
|
3921
|
+
if (void 0 !== n) a.push(s, r, n);
|
|
3922
|
+
else if (void 0 !== r) a.push(s, r);
|
|
3923
|
+
else if (void 0 !== s) a.push(s);
|
|
3924
|
+
const u = o.awaitWriteFinish;
|
|
3925
|
+
let l;
|
|
3926
|
+
if (u && (l = this._pendingWrites.get(e))) {
|
|
3927
|
+
l.lastChange = new Date;
|
|
3928
|
+
return this;
|
|
3929
|
+
}
|
|
3930
|
+
if (o.atomic) {
|
|
3931
|
+
if (t === m) {
|
|
3932
|
+
this._pendingUnlinks.set(e, a);
|
|
3933
|
+
setTimeout(()=>{
|
|
3934
|
+
this._pendingUnlinks.forEach((t, e)=>{
|
|
3935
|
+
this.emit(...t);
|
|
3936
|
+
this.emit(d, ...t);
|
|
3937
|
+
this._pendingUnlinks.delete(e);
|
|
3938
|
+
});
|
|
3939
|
+
}, "number" == typeof o.atomic ? o.atomic : 100);
|
|
3940
|
+
return this;
|
|
3941
|
+
}
|
|
3942
|
+
if (t === E && this._pendingUnlinks.has(e)) {
|
|
3943
|
+
t = a[0] = g;
|
|
3944
|
+
this._pendingUnlinks.delete(e);
|
|
3945
|
+
}
|
|
3946
|
+
}
|
|
3947
|
+
if (u && (t === E || t === g) && this._readyEmitted) {
|
|
3948
|
+
const awfEmit = (e, s)=>{
|
|
3949
|
+
if (e) {
|
|
3950
|
+
t = a[0] = A;
|
|
3951
|
+
a[1] = e;
|
|
3952
|
+
this.emitWithAll(t, a);
|
|
3953
|
+
} else if (s) {
|
|
3954
|
+
if (a.length > 2) a[2] = s;
|
|
3955
|
+
else a.push(s);
|
|
3956
|
+
this.emitWithAll(t, a);
|
|
3957
|
+
}
|
|
3958
|
+
};
|
|
3959
|
+
this._awaitWriteFinish(e, u.stabilityThreshold, t, awfEmit);
|
|
3960
|
+
return this;
|
|
3961
|
+
}
|
|
3962
|
+
if (t === g) {
|
|
3963
|
+
const t = !this._throttle(g, e, 50);
|
|
3964
|
+
if (t) return this;
|
|
3965
|
+
}
|
|
3966
|
+
if (o.alwaysStat && void 0 === s && (t === E || t === y || t === g)) {
|
|
3967
|
+
const t = o.cwd ? i.join(o.cwd, e) : e;
|
|
3968
|
+
let s;
|
|
3969
|
+
try {
|
|
3970
|
+
s = await j(t);
|
|
3971
|
+
} catch (t) {}
|
|
3972
|
+
if (!s || this.closed) return;
|
|
3973
|
+
a.push(s);
|
|
3974
|
+
}
|
|
3975
|
+
this.emitWithAll(t, a);
|
|
3976
|
+
return this;
|
|
3977
|
+
}
|
|
3978
|
+
_handleError(t) {
|
|
3979
|
+
const e = t && t.code;
|
|
3980
|
+
if (t && "ENOENT" !== e && "ENOTDIR" !== e && (!this.options.ignorePermissionErrors || "EPERM" !== e && "EACCES" !== e)) this.emit(A, t);
|
|
3981
|
+
return t || this.closed;
|
|
3982
|
+
}
|
|
3983
|
+
_throttle(t, e, s) {
|
|
3984
|
+
if (!this._throttled.has(t)) this._throttled.set(t, new Map);
|
|
3985
|
+
const r = this._throttled.get(t);
|
|
3986
|
+
const i = r.get(e);
|
|
3987
|
+
if (i) {
|
|
3988
|
+
i.count++;
|
|
3989
|
+
return false;
|
|
3990
|
+
}
|
|
3991
|
+
let n;
|
|
3992
|
+
const clear = ()=>{
|
|
3993
|
+
const t = r.get(e);
|
|
3994
|
+
const s = t ? t.count : 0;
|
|
3995
|
+
r.delete(e);
|
|
3996
|
+
clearTimeout(n);
|
|
3997
|
+
if (t) clearTimeout(t.timeoutObject);
|
|
3998
|
+
return s;
|
|
3999
|
+
};
|
|
4000
|
+
n = setTimeout(clear, s);
|
|
4001
|
+
const o = {
|
|
4002
|
+
timeoutObject: n,
|
|
4003
|
+
clear: clear,
|
|
4004
|
+
count: 0
|
|
4005
|
+
};
|
|
4006
|
+
r.set(e, o);
|
|
4007
|
+
return o;
|
|
4008
|
+
}
|
|
4009
|
+
_incrReadyCount() {
|
|
4010
|
+
return this._readyCount++;
|
|
4011
|
+
}
|
|
4012
|
+
_awaitWriteFinish(t, e, s, n) {
|
|
4013
|
+
let o;
|
|
4014
|
+
let a = t;
|
|
4015
|
+
if (this.options.cwd && !i.isAbsolute(t)) a = i.join(this.options.cwd, t);
|
|
4016
|
+
const u = new Date;
|
|
4017
|
+
const awaitWriteFinish = (s)=>{
|
|
4018
|
+
r.stat(a, (r, i)=>{
|
|
4019
|
+
if (r || !this._pendingWrites.has(t)) {
|
|
4020
|
+
if (r && "ENOENT" !== r.code) n(r);
|
|
4021
|
+
return;
|
|
4022
|
+
}
|
|
4023
|
+
const a = Number(new Date);
|
|
4024
|
+
if (s && i.size !== s.size) this._pendingWrites.get(t).lastChange = a;
|
|
4025
|
+
const u = this._pendingWrites.get(t);
|
|
4026
|
+
const l = a - u.lastChange;
|
|
4027
|
+
if (l >= e) {
|
|
4028
|
+
this._pendingWrites.delete(t);
|
|
4029
|
+
n(void 0, i);
|
|
4030
|
+
} else o = setTimeout(awaitWriteFinish, this.options.awaitWriteFinish.pollInterval, i);
|
|
4031
|
+
});
|
|
4032
|
+
};
|
|
4033
|
+
if (!this._pendingWrites.has(t)) {
|
|
4034
|
+
this._pendingWrites.set(t, {
|
|
4035
|
+
lastChange: u,
|
|
4036
|
+
cancelWait: ()=>{
|
|
4037
|
+
this._pendingWrites.delete(t);
|
|
4038
|
+
clearTimeout(o);
|
|
4039
|
+
return s;
|
|
4040
|
+
}
|
|
4041
|
+
});
|
|
4042
|
+
o = setTimeout(awaitWriteFinish, this.options.awaitWriteFinish.pollInterval);
|
|
4043
|
+
}
|
|
4044
|
+
}
|
|
4045
|
+
_getGlobIgnored() {
|
|
4046
|
+
return [
|
|
4047
|
+
...this._ignoredPaths.values()
|
|
4048
|
+
];
|
|
4049
|
+
}
|
|
4050
|
+
_isIgnored(t, e) {
|
|
4051
|
+
if (this.options.atomic && T.test(t)) return true;
|
|
4052
|
+
if (!this._userIgnored) {
|
|
4053
|
+
const { cwd: t } = this.options;
|
|
4054
|
+
const e = this.options.ignored;
|
|
4055
|
+
const s = e && e.map(normalizeIgnored(t));
|
|
4056
|
+
const r = arrify(s).filter((t)=>typeof t === M && !l(t)).map((t)=>t + D);
|
|
4057
|
+
const i = this._getGlobIgnored().map(normalizeIgnored(t)).concat(s, r);
|
|
4058
|
+
this._userIgnored = a(i, void 0, F);
|
|
4059
|
+
}
|
|
4060
|
+
return this._userIgnored([
|
|
4061
|
+
t,
|
|
4062
|
+
e
|
|
4063
|
+
]);
|
|
4064
|
+
}
|
|
4065
|
+
_isntIgnored(t, e) {
|
|
4066
|
+
return !this._isIgnored(t, e);
|
|
4067
|
+
}
|
|
4068
|
+
_getWatchHelpers(t, e) {
|
|
4069
|
+
const s = e || this.options.disableGlobbing || !l(t) ? t : u(t);
|
|
4070
|
+
const r = this.options.followSymlinks;
|
|
4071
|
+
return new WatchHelper(t, s, r, this);
|
|
4072
|
+
}
|
|
4073
|
+
_getWatchedDir(t) {
|
|
4074
|
+
if (!this._boundRemove) this._boundRemove = this._remove.bind(this);
|
|
4075
|
+
const e = i.resolve(t);
|
|
4076
|
+
if (!this._watched.has(e)) this._watched.set(e, new DirEntry(e, this._boundRemove));
|
|
4077
|
+
return this._watched.get(e);
|
|
4078
|
+
}
|
|
4079
|
+
_hasReadPermissions(t) {
|
|
4080
|
+
if (this.options.ignorePermissionErrors) return true;
|
|
4081
|
+
const e = t && Number.parseInt(t.mode, 10);
|
|
4082
|
+
const s = 511 & e;
|
|
4083
|
+
const r = Number.parseInt(s.toString(8)[0], 10);
|
|
4084
|
+
return Boolean(4 & r);
|
|
4085
|
+
}
|
|
4086
|
+
_remove(t, e, s) {
|
|
4087
|
+
const r = i.join(t, e);
|
|
4088
|
+
const n = i.resolve(r);
|
|
4089
|
+
s = null != s ? s : this._watched.has(r) || this._watched.has(n);
|
|
4090
|
+
if (!this._throttle("remove", r, 100)) return;
|
|
4091
|
+
if (!s && !this.options.useFsEvents && 1 === this._watched.size) this.add(t, e, true);
|
|
4092
|
+
const o = this._getWatchedDir(r);
|
|
4093
|
+
const a = o.getChildren();
|
|
4094
|
+
a.forEach((t)=>this._remove(r, t));
|
|
4095
|
+
const u = this._getWatchedDir(t);
|
|
4096
|
+
const l = u.has(e);
|
|
4097
|
+
u.remove(e);
|
|
4098
|
+
if (this._symlinkPaths.has(n)) this._symlinkPaths.delete(n);
|
|
4099
|
+
let c = r;
|
|
4100
|
+
if (this.options.cwd) c = i.relative(this.options.cwd, r);
|
|
4101
|
+
if (this.options.awaitWriteFinish && this._pendingWrites.has(c)) {
|
|
4102
|
+
const t = this._pendingWrites.get(c).cancelWait();
|
|
4103
|
+
if (t === E) return;
|
|
4104
|
+
}
|
|
4105
|
+
this._watched.delete(r);
|
|
4106
|
+
this._watched.delete(n);
|
|
4107
|
+
const f = s ? R : m;
|
|
4108
|
+
if (l && !this._isIgnored(r)) this._emit(f, r);
|
|
4109
|
+
if (!this.options.useFsEvents) this._closePath(r);
|
|
4110
|
+
}
|
|
4111
|
+
_closePath(t) {
|
|
4112
|
+
this._closeFile(t);
|
|
4113
|
+
const e = i.dirname(t);
|
|
4114
|
+
this._getWatchedDir(e).remove(i.basename(t));
|
|
4115
|
+
}
|
|
4116
|
+
_closeFile(t) {
|
|
4117
|
+
const e = this._closers.get(t);
|
|
4118
|
+
if (!e) return;
|
|
4119
|
+
e.forEach((t)=>t());
|
|
4120
|
+
this._closers.delete(t);
|
|
4121
|
+
}
|
|
4122
|
+
_addPathCloser(t, e) {
|
|
4123
|
+
if (!e) return;
|
|
4124
|
+
let s = this._closers.get(t);
|
|
4125
|
+
if (!s) {
|
|
4126
|
+
s = [];
|
|
4127
|
+
this._closers.set(t, s);
|
|
4128
|
+
}
|
|
4129
|
+
s.push(e);
|
|
4130
|
+
}
|
|
4131
|
+
_readdirp(t, e) {
|
|
4132
|
+
if (this.closed) return;
|
|
4133
|
+
const s = {
|
|
4134
|
+
type: d,
|
|
4135
|
+
alwaysStat: true,
|
|
4136
|
+
lstat: true,
|
|
4137
|
+
...e
|
|
4138
|
+
};
|
|
4139
|
+
let r = o(t, s);
|
|
4140
|
+
this._streams.add(r);
|
|
4141
|
+
r.once(b, ()=>{
|
|
4142
|
+
r = void 0;
|
|
4143
|
+
});
|
|
4144
|
+
r.once(v, ()=>{
|
|
4145
|
+
if (r) {
|
|
4146
|
+
this._streams.delete(r);
|
|
4147
|
+
r = void 0;
|
|
4148
|
+
}
|
|
4149
|
+
});
|
|
4150
|
+
return r;
|
|
4151
|
+
}
|
|
4152
|
+
}
|
|
4153
|
+
t.FSWatcher = FSWatcher;
|
|
4154
|
+
const watch = (t, e)=>{
|
|
4155
|
+
const s = new FSWatcher(e);
|
|
4156
|
+
s.add(t);
|
|
4157
|
+
return s;
|
|
4158
|
+
};
|
|
4159
|
+
t.watch = watch;
|
|
4160
|
+
})();
|
|
4161
|
+
module.exports = s;
|
|
4162
|
+
})();
|