@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.
Files changed (233) hide show
  1. package/dist/cjs/cli/alias.js +76 -70
  2. package/dist/cjs/cli/applyOptionsChain.js +44 -45
  3. package/dist/cjs/cli/babel.js +100 -119
  4. package/dist/cjs/cli/commands.js +61 -59
  5. package/dist/cjs/cli/common.js +45 -37
  6. package/dist/cjs/cli/config.js +36 -30
  7. package/dist/cjs/cli/constants.js +124 -161
  8. package/dist/cjs/cli/ensure.js +52 -45
  9. package/dist/cjs/cli/fs.js +41 -38
  10. package/dist/cjs/cli/get/config.js +43 -38
  11. package/dist/cjs/cli/get/data.js +108 -125
  12. package/dist/cjs/cli/get/index.js +109 -58
  13. package/dist/cjs/cli/index.js +202 -63
  14. package/dist/cjs/cli/is/config.js +75 -71
  15. package/dist/cjs/cli/is/env.js +49 -37
  16. package/dist/cjs/cli/is/index.js +76 -25
  17. package/dist/cjs/cli/is/project.js +139 -135
  18. package/dist/cjs/cli/is/type.js +65 -49
  19. package/dist/cjs/cli/logger.js +36 -27
  20. package/dist/cjs/cli/monorepo.js +100 -96
  21. package/dist/cjs/cli/package.js +85 -82
  22. package/dist/cjs/cli/path.js +101 -82
  23. package/dist/cjs/cli/port.js +71 -74
  24. package/dist/cjs/cli/prettyInstructions.js +106 -116
  25. package/dist/cjs/cli/require.js +116 -136
  26. package/dist/cjs/cli/route.js +67 -77
  27. package/dist/cjs/cli/runtimeExports.js +16 -70
  28. package/dist/cjs/cli/version.js +53 -42
  29. package/dist/cjs/cli/watch.js +79 -72
  30. package/dist/cjs/compiled.js +199 -128
  31. package/dist/cjs/import.js +58 -33
  32. package/dist/cjs/index.js +69 -23
  33. package/dist/cjs/universal/constants.js +77 -67
  34. package/dist/cjs/universal/index.js +33 -25
  35. package/dist/cjs/universal/path.js +33 -27
  36. package/dist/cjs/universal/pluginDagSort.js +69 -68
  37. package/dist/compiled/address/index.js +171 -1
  38. package/dist/compiled/browserslist/index.js +1329 -1
  39. package/dist/compiled/chalk/index.js +2368 -1
  40. package/dist/compiled/chokidar/index.js +4138 -16
  41. package/dist/compiled/chokidar/index.js.LICENSE.txt +41 -0
  42. package/dist/compiled/commander/index.js +1540 -1
  43. package/dist/compiled/debug/index.js +621 -1
  44. package/dist/compiled/dotenv/index.js +101 -1
  45. package/dist/compiled/dotenv-expand/index.js +54 -1
  46. package/dist/compiled/execa/index.js +1738 -1
  47. package/dist/compiled/fast-glob/index.js +4645 -17
  48. package/dist/compiled/fast-glob/index.js.LICENSE.txt +38 -0
  49. package/dist/compiled/filesize/index.js +193 -4
  50. package/dist/compiled/filesize/index.js.LICENSE.txt +7 -0
  51. package/dist/compiled/fs-extra/index.js +2222 -1
  52. package/dist/compiled/glob/index.js +2011 -1
  53. package/dist/compiled/globby/index.js +690 -1
  54. package/dist/compiled/gzip-size/index.js +157 -1
  55. package/dist/compiled/import-lazy/index.js +45 -1
  56. package/dist/compiled/inquirer/index.js +20162 -4
  57. package/dist/compiled/inquirer/index.js.LICENSE.txt +7 -0
  58. package/dist/compiled/js-yaml/index.js +2188 -1
  59. package/dist/compiled/json5/index.js +983 -1
  60. package/dist/compiled/lodash/index.js +0 -4
  61. package/dist/compiled/mime-types/index.js +108 -6
  62. package/dist/compiled/mime-types/index.js.LICENSE.txt +13 -0
  63. package/dist/compiled/minimist/index.js +202 -1
  64. package/dist/compiled/nanoid/index.js +83 -1
  65. package/dist/compiled/ora/index.js +3936 -3
  66. package/dist/compiled/ora/index.js.LICENSE.txt +1 -0
  67. package/dist/compiled/pkg-up/index.js +177 -1
  68. package/dist/compiled/semver/index.js +1779 -1
  69. package/dist/compiled/signale/index.js +1704 -1
  70. package/dist/compiled/slash/index.js +32 -1
  71. package/dist/compiled/strip-ansi/index.js +34 -1
  72. package/dist/compiled/tsconfig-paths/index.js +629 -1
  73. package/dist/compiled/upath/index.js +135 -1
  74. package/dist/compiled/url-join/index.js +61 -1
  75. package/dist/compiled/webpack-chain/index.js +1475 -1
  76. package/dist/esm/cli/alias.mjs +31 -0
  77. package/dist/esm/cli/applyOptionsChain.mjs +16 -0
  78. package/dist/esm/cli/babel.mjs +76 -0
  79. package/dist/esm/cli/commands.mjs +23 -0
  80. package/dist/esm/cli/common.mjs +11 -0
  81. package/dist/esm/cli/config.mjs +5 -0
  82. package/dist/esm/cli/constants.mjs +29 -0
  83. package/dist/esm/cli/ensure.mjs +9 -0
  84. package/dist/esm/cli/fs.mjs +9 -0
  85. package/dist/esm/cli/get/config.mjs +14 -0
  86. package/dist/esm/cli/get/data.mjs +57 -0
  87. package/dist/esm/cli/get/index.mjs +18 -0
  88. package/dist/{esm-node/cli/index.js → esm/cli/index.mjs} +0 -1
  89. package/dist/esm/cli/is/config.mjs +34 -0
  90. package/dist/esm/cli/is/env.mjs +6 -0
  91. package/dist/esm/cli/is/project.mjs +104 -0
  92. package/dist/esm/cli/is/type.mjs +26 -0
  93. package/dist/esm/cli/logger.mjs +2 -0
  94. package/dist/esm/cli/monorepo.mjs +50 -0
  95. package/dist/esm/cli/package.mjs +51 -0
  96. package/dist/esm/cli/path.mjs +35 -0
  97. package/dist/esm/cli/port.mjs +35 -0
  98. package/dist/esm/cli/prettyInstructions.mjs +68 -0
  99. package/dist/esm/cli/require.mjs +79 -0
  100. package/dist/esm/cli/route.mjs +36 -0
  101. package/dist/esm/cli/runtimeExports.mjs +0 -0
  102. package/dist/esm/cli/version.mjs +21 -0
  103. package/dist/esm/cli/watch.mjs +40 -0
  104. package/dist/esm/compiled.mjs +115 -0
  105. package/dist/esm/import.mjs +25 -0
  106. package/dist/esm/universal/constants.mjs +13 -0
  107. package/dist/{esm-node/universal/index.js → esm/universal/index.mjs} +1 -3
  108. package/dist/esm/universal/path.mjs +2 -0
  109. package/dist/esm/universal/pluginDagSort.mjs +41 -0
  110. package/dist/esm-node/cli/alias.mjs +31 -0
  111. package/dist/esm-node/cli/applyOptionsChain.mjs +16 -0
  112. package/dist/esm-node/cli/babel.mjs +76 -0
  113. package/dist/esm-node/cli/commands.mjs +23 -0
  114. package/dist/esm-node/cli/common.mjs +11 -0
  115. package/dist/esm-node/cli/config.mjs +5 -0
  116. package/dist/esm-node/cli/constants.mjs +29 -0
  117. package/dist/esm-node/cli/ensure.mjs +9 -0
  118. package/dist/esm-node/cli/fs.mjs +9 -0
  119. package/dist/esm-node/cli/get/config.mjs +14 -0
  120. package/dist/esm-node/cli/get/data.mjs +57 -0
  121. package/dist/esm-node/cli/get/index.mjs +18 -0
  122. package/dist/esm-node/cli/index.mjs +22 -0
  123. package/dist/esm-node/cli/is/config.mjs +34 -0
  124. package/dist/esm-node/cli/is/env.mjs +6 -0
  125. package/dist/esm-node/cli/is/index.mjs +4 -0
  126. package/dist/esm-node/cli/is/project.mjs +104 -0
  127. package/dist/esm-node/cli/is/type.mjs +26 -0
  128. package/dist/esm-node/cli/logger.mjs +2 -0
  129. package/dist/esm-node/cli/monorepo.mjs +50 -0
  130. package/dist/esm-node/cli/package.mjs +51 -0
  131. package/dist/esm-node/cli/path.mjs +35 -0
  132. package/dist/esm-node/cli/port.mjs +35 -0
  133. package/dist/esm-node/cli/prettyInstructions.mjs +68 -0
  134. package/dist/esm-node/cli/require.mjs +79 -0
  135. package/dist/esm-node/cli/route.mjs +36 -0
  136. package/dist/esm-node/cli/runtimeExports.mjs +0 -0
  137. package/dist/esm-node/cli/version.mjs +21 -0
  138. package/dist/esm-node/cli/watch.mjs +40 -0
  139. package/dist/esm-node/compiled.mjs +115 -0
  140. package/dist/esm-node/import.mjs +25 -0
  141. package/dist/esm-node/index.mjs +3 -0
  142. package/dist/esm-node/universal/constants.mjs +13 -0
  143. package/dist/esm-node/universal/index.mjs +2 -0
  144. package/dist/esm-node/universal/path.mjs +2 -0
  145. package/dist/esm-node/universal/pluginDagSort.mjs +41 -0
  146. package/dist/types/cli/constants.d.ts +2 -26
  147. package/dist/types/cli/get/data.d.ts +0 -1
  148. package/dist/types/cli/index.d.ts +0 -1
  149. package/dist/types/cli/is/config.d.ts +1 -1
  150. package/dist/types/cli/runtimeExports.d.ts +1 -4
  151. package/dist/types/cli/watch.d.ts +1 -1
  152. package/dist/types/compiled.d.ts +0 -5
  153. package/dist/types/universal/constants.d.ts +4 -7
  154. package/package.json +27 -27
  155. package/rslib.config.mts +140 -0
  156. package/dist/cjs/cli/action.js +0 -55
  157. package/dist/cjs/universal/formatWebpack.js +0 -127
  158. package/dist/esm/cli/action.js +0 -68
  159. package/dist/esm/cli/alias.js +0 -43
  160. package/dist/esm/cli/applyOptionsChain.js +0 -29
  161. package/dist/esm/cli/babel.js +0 -122
  162. package/dist/esm/cli/commands.js +0 -39
  163. package/dist/esm/cli/common.js +0 -20
  164. package/dist/esm/cli/config.js +0 -11
  165. package/dist/esm/cli/constants.js +0 -114
  166. package/dist/esm/cli/ensure.js +0 -16
  167. package/dist/esm/cli/fs.js +0 -65
  168. package/dist/esm/cli/get/config.js +0 -19
  169. package/dist/esm/cli/get/data.js +0 -143
  170. package/dist/esm/cli/get/index.js +0 -38
  171. package/dist/esm/cli/index.js +0 -23
  172. package/dist/esm/cli/is/config.js +0 -70
  173. package/dist/esm/cli/is/env.js +0 -22
  174. package/dist/esm/cli/is/index.js +0 -4
  175. package/dist/esm/cli/is/project.js +0 -146
  176. package/dist/esm/cli/is/type.js +0 -39
  177. package/dist/esm/cli/logger.js +0 -5
  178. package/dist/esm/cli/monorepo.js +0 -82
  179. package/dist/esm/cli/package.js +0 -203
  180. package/dist/esm/cli/path.js +0 -66
  181. package/dist/esm/cli/port.js +0 -97
  182. package/dist/esm/cli/prettyInstructions.js +0 -102
  183. package/dist/esm/cli/require.js +0 -235
  184. package/dist/esm/cli/route.js +0 -64
  185. package/dist/esm/cli/runtimeExports.js +0 -44
  186. package/dist/esm/cli/version.js +0 -26
  187. package/dist/esm/cli/watch.js +0 -112
  188. package/dist/esm/compiled.js +0 -66
  189. package/dist/esm/import.js +0 -11
  190. package/dist/esm/index.js +0 -3
  191. package/dist/esm/universal/constants.js +0 -32
  192. package/dist/esm/universal/formatWebpack.js +0 -95
  193. package/dist/esm/universal/index.js +0 -4
  194. package/dist/esm/universal/path.js +0 -6
  195. package/dist/esm/universal/pluginDagSort.js +0 -73
  196. package/dist/esm-node/cli/action.js +0 -30
  197. package/dist/esm-node/cli/alias.js +0 -40
  198. package/dist/esm-node/cli/applyOptionsChain.js +0 -27
  199. package/dist/esm-node/cli/babel.js +0 -107
  200. package/dist/esm-node/cli/commands.js +0 -39
  201. package/dist/esm-node/cli/common.js +0 -15
  202. package/dist/esm-node/cli/config.js +0 -9
  203. package/dist/esm-node/cli/constants.js +0 -114
  204. package/dist/esm-node/cli/ensure.js +0 -14
  205. package/dist/esm-node/cli/fs.js +0 -18
  206. package/dist/esm-node/cli/get/config.js +0 -19
  207. package/dist/esm-node/cli/get/data.js +0 -96
  208. package/dist/esm-node/cli/get/index.js +0 -22
  209. package/dist/esm-node/cli/is/config.js +0 -50
  210. package/dist/esm-node/cli/is/env.js +0 -12
  211. package/dist/esm-node/cli/is/project.js +0 -105
  212. package/dist/esm-node/cli/is/type.js +0 -36
  213. package/dist/esm-node/cli/logger.js +0 -5
  214. package/dist/esm-node/cli/monorepo.js +0 -67
  215. package/dist/esm-node/cli/package.js +0 -66
  216. package/dist/esm-node/cli/path.js +0 -48
  217. package/dist/esm-node/cli/port.js +0 -48
  218. package/dist/esm-node/cli/prettyInstructions.js +0 -90
  219. package/dist/esm-node/cli/require.js +0 -111
  220. package/dist/esm-node/cli/route.js +0 -60
  221. package/dist/esm-node/cli/runtimeExports.js +0 -38
  222. package/dist/esm-node/cli/version.js +0 -26
  223. package/dist/esm-node/cli/watch.js +0 -45
  224. package/dist/esm-node/compiled.js +0 -66
  225. package/dist/esm-node/import.js +0 -11
  226. package/dist/esm-node/universal/constants.js +0 -32
  227. package/dist/esm-node/universal/formatWebpack.js +0 -102
  228. package/dist/esm-node/universal/path.js +0 -6
  229. package/dist/esm-node/universal/pluginDagSort.js +0 -50
  230. package/dist/types/cli/action.d.ts +0 -2
  231. package/dist/types/universal/formatWebpack.d.ts +0 -26
  232. /package/dist/{esm-node/cli/is/index.js → esm/cli/is/index.mjs} +0 -0
  233. /package/dist/{esm-node/index.js → esm/index.mjs} +0 -0
@@ -1 +1,690 @@
1
- (()=>{var t={337:t=>{"use strict";t.exports=(...t)=>[...new Set([].concat(...t))]},352:(t,e,r)=>{"use strict";const n=r(17);const s=r(223);const getExtensions=t=>t.length>1?`{${t.join(",")}}`:t[0];const getPath=(t,e)=>{const r=t[0]==="!"?t.slice(1):t;return n.isAbsolute(r)?r:n.join(e,r)};const addExtensions=(t,e)=>{if(n.extname(t)){return`**/${t}`}return`**/${t}.${getExtensions(e)}`};const getGlob=(t,e)=>{if(e.files&&!Array.isArray(e.files)){throw new TypeError(`Expected \`files\` to be of type \`Array\` but received type \`${typeof e.files}\``)}if(e.extensions&&!Array.isArray(e.extensions)){throw new TypeError(`Expected \`extensions\` to be of type \`Array\` but received type \`${typeof e.extensions}\``)}if(e.files&&e.extensions){return e.files.map((r=>n.posix.join(t,addExtensions(r,e.extensions))))}if(e.files){return e.files.map((e=>n.posix.join(t,`**/${e}`)))}if(e.extensions){return[n.posix.join(t,`**/*.${getExtensions(e.extensions)}`)]}return[n.posix.join(t,"**")]};t.exports=async(t,e)=>{e={cwd:process.cwd(),...e};if(typeof e.cwd!=="string"){throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof e.cwd}\``)}const r=await Promise.all([].concat(t).map((async t=>{const r=await s.isDirectory(getPath(t,e.cwd));return r?getGlob(t,e):t})));return[].concat.apply([],r)};t.exports.sync=(t,e)=>{e={cwd:process.cwd(),...e};if(typeof e.cwd!=="string"){throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof e.cwd}\``)}const r=[].concat(t).map((t=>s.isDirectorySync(getPath(t,e.cwd))?getGlob(t,e):t));return[].concat.apply([],r)}},153:(t,e,r)=>{"use strict";const{promisify:n}=r(837);const s=r(147);const o=r(17);const i=r(592);const c=r(302);const a=r(398);const p=["**/node_modules/**","**/flow-typed/**","**/coverage/**","**/.git"];const u=n(s.readFile);const mapGitIgnorePatternTo=t=>e=>{if(e.startsWith("!")){return"!"+o.posix.join(t,e.slice(1))}return o.posix.join(t,e)};const parseGitIgnore=(t,e)=>{const r=a(o.relative(e.cwd,o.dirname(e.fileName)));return t.split(/\r?\n/).filter(Boolean).filter((t=>!t.startsWith("#"))).map(mapGitIgnorePatternTo(r))};const reduceIgnore=t=>{const e=c();for(const r of t){e.add(parseGitIgnore(r.content,{cwd:r.cwd,fileName:r.filePath}))}return e};const ensureAbsolutePathForCwd=(t,e)=>{t=a(t);if(o.isAbsolute(e)){if(a(e).startsWith(t)){return e}throw new Error(`Path ${e} is not in cwd ${t}`)}return o.join(t,e)};const getIsIgnoredPredecate=(t,e)=>r=>t.ignores(a(o.relative(e,ensureAbsolutePathForCwd(e,r.path||r))));const getFile=async(t,e)=>{const r=o.join(e,t);const n=await u(r,"utf8");return{cwd:e,filePath:r,content:n}};const getFileSync=(t,e)=>{const r=o.join(e,t);const n=s.readFileSync(r,"utf8");return{cwd:e,filePath:r,content:n}};const normalizeOptions=({ignore:t=[],cwd:e=a(process.cwd())}={})=>({ignore:t,cwd:e});t.exports=async t=>{t=normalizeOptions(t);const e=await i("**/.gitignore",{ignore:p.concat(t.ignore),cwd:t.cwd});const r=await Promise.all(e.map((e=>getFile(e,t.cwd))));const n=reduceIgnore(r);return getIsIgnoredPredecate(n,t.cwd)};t.exports.sync=t=>{t=normalizeOptions(t);const e=i.sync("**/.gitignore",{ignore:p.concat(t.ignore),cwd:t.cwd});const r=e.map((e=>getFileSync(e,t.cwd)));const n=reduceIgnore(r);return getIsIgnoredPredecate(n,t.cwd)}},718:(t,e,r)=>{"use strict";const n=r(147);const s=r(337);const o=r(382);const i=r(592);const c=r(352);const a=r(153);const{FilterStream:p,UniqueStream:u}=r(546);const DEFAULT_FILTER=()=>false;const isNegative=t=>t[0]==="!";const assertPatternsInput=t=>{if(!t.every((t=>typeof t==="string"))){throw new TypeError("Patterns must be a string or an array of strings")}};const checkCwdOption=(t={})=>{if(!t.cwd){return}let e;try{e=n.statSync(t.cwd)}catch{return}if(!e.isDirectory()){throw new Error("The `cwd` option must be a path to a directory")}};const getPathString=t=>t.stats instanceof n.Stats?t.path:t;const generateGlobTasks=(t,e)=>{t=s([].concat(t));assertPatternsInput(t);checkCwdOption(e);const r=[];e={ignore:[],expandDirectories:true,...e};for(const[n,s]of t.entries()){if(isNegative(s)){continue}const o=t.slice(n).filter((t=>isNegative(t))).map((t=>t.slice(1)));const i={...e,ignore:e.ignore.concat(o)};r.push({pattern:s,options:i})}return r};const globDirs=(t,e)=>{let r={};if(t.options.cwd){r.cwd=t.options.cwd}if(Array.isArray(t.options.expandDirectories)){r={...r,files:t.options.expandDirectories}}else if(typeof t.options.expandDirectories==="object"){r={...r,...t.options.expandDirectories}}return e(t.pattern,r)};const getPattern=(t,e)=>t.options.expandDirectories?globDirs(t,e):[t.pattern];const getFilterSync=t=>t&&t.gitignore?a.sync({cwd:t.cwd,ignore:t.ignore}):DEFAULT_FILTER;const globToTask=t=>e=>{const{options:r}=t;if(r.ignore&&Array.isArray(r.ignore)&&r.expandDirectories){r.ignore=c.sync(r.ignore)}return{pattern:e,options:r}};t.exports=async(t,e)=>{const r=generateGlobTasks(t,e);const getFilter=async()=>e&&e.gitignore?a({cwd:e.cwd,ignore:e.ignore}):DEFAULT_FILTER;const getTasks=async()=>{const t=await Promise.all(r.map((async t=>{const e=await getPattern(t,c);return Promise.all(e.map(globToTask(t)))})));return s(...t)};const[n,o]=await Promise.all([getFilter(),getTasks()]);const p=await Promise.all(o.map((t=>i(t.pattern,t.options))));return s(...p).filter((t=>!n(getPathString(t))))};t.exports.sync=(t,e)=>{const r=generateGlobTasks(t,e);const n=[];for(const t of r){const e=getPattern(t,c.sync).map(globToTask(t));n.push(...e)}const o=getFilterSync(e);let a=[];for(const t of n){a=s(a,i.sync(t.pattern,t.options))}return a.filter((t=>!o(t)))};t.exports.stream=(t,e)=>{const r=generateGlobTasks(t,e);const n=[];for(const t of r){const e=getPattern(t,c.sync).map(globToTask(t));n.push(...e)}const s=getFilterSync(e);const a=new p((t=>!s(t)));const l=new u;return o(n.map((t=>i.stream(t.pattern,t.options)))).pipe(a).pipe(l)};t.exports.generateGlobTasks=generateGlobTasks;t.exports.hasMagic=(t,e)=>[].concat(t).some((t=>i.isDynamicPattern(t,e)));t.exports.gitignore=a},546:(t,e,r)=>{"use strict";const{Transform:n}=r(781);class ObjectTransform extends n{constructor(){super({objectMode:true})}}class FilterStream extends ObjectTransform{constructor(t){super();this._filter=t}_transform(t,e,r){if(this._filter(t)){this.push(t)}r()}}class UniqueStream extends ObjectTransform{constructor(){super();this._pushed=new Set}_transform(t,e,r){if(!this._pushed.has(t)){this.push(t);this._pushed.add(t)}r()}}t.exports={FilterStream:FilterStream,UniqueStream:UniqueStream}},302:t=>{function makeArray(t){return Array.isArray(t)?t:[t]}const e="";const r=" ";const n="\\";const s=/^\s+$/;const o=/^\\!/;const i=/^\\#/;const c=/\r?\n/g;const a=/^\.*\/|^\.+$/;const p="/";const u=typeof Symbol!=="undefined"?Symbol.for("node-ignore"):"node-ignore";const define=(t,e,r)=>Object.defineProperty(t,e,{value:r});const l=/([0-z])-([0-z])/g;const RETURN_FALSE=()=>false;const sanitizeRange=t=>t.replace(l,((t,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?t:e));const cleanRangeBackSlash=t=>{const{length:e}=t;return t.slice(0,e-e%2)};const f=[[/\\?\s+$/,t=>t.indexOf("\\")===0?r:e],[/\\\s/g,()=>r],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function startingReplacer(){return!/\/(?!$)/.test(this)?"(?:^|\\/)":"^"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)\\\*(?=.+)/g,(t,e)=>`${e}[^\\/]*`],[/\\\\\\(?=[$.|*+(){^])/g,()=>n],[/\\\\/g,()=>n],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,s,o)=>e===n?`\\[${r}${cleanRangeBackSlash(s)}${o}`:o==="]"?s.length%2===0?`[${sanitizeRange(r)}${s}]`:"[]":"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,e)=>{const r=e?`${e}[^/]+`:"[^/]*";return`${r}(?=$|\\/$)`}]];const d=Object.create(null);const makeRegex=(t,e)=>{let r=d[t];if(!r){r=f.reduce(((e,r)=>e.replace(r[0],r[1].bind(t))),t);d[t]=r}return e?new RegExp(r,"i"):new RegExp(r)};const isString=t=>typeof t==="string";const checkPattern=t=>t&&isString(t)&&!s.test(t)&&t.indexOf("#")!==0;const splitPattern=t=>t.split(c);class IgnoreRule{constructor(t,e,r,n){this.origin=t;this.pattern=e;this.negative=r;this.regex=n}}const createRule=(t,e)=>{const r=t;let n=false;if(t.indexOf("!")===0){n=true;t=t.substr(1)}t=t.replace(o,"!").replace(i,"#");const s=makeRegex(t,e);return new IgnoreRule(r,t,n,s)};const throwError=(t,e)=>{throw new e(t)};const checkPath=(t,e,r)=>{if(!isString(t)){return r(`path must be a string, but got \`${e}\``,TypeError)}if(!t){return r(`path must not be empty`,TypeError)}if(checkPath.isNotRelative(t)){const t="`path.relative()`d";return r(`path should be a ${t} string, but got "${e}"`,RangeError)}return true};const isNotRelative=t=>a.test(t);checkPath.isNotRelative=isNotRelative;checkPath.convert=t=>t;class Ignore{constructor({ignorecase:t=true,ignoreCase:e=t,allowRelativePaths:r=false}={}){define(this,u,true);this._rules=[];this._ignoreCase=e;this._allowRelativePaths=r;this._initCache()}_initCache(){this._ignoreCache=Object.create(null);this._testCache=Object.create(null)}_addPattern(t){if(t&&t[u]){this._rules=this._rules.concat(t._rules);this._added=true;return}if(checkPattern(t)){const e=createRule(t,this._ignoreCase);this._added=true;this._rules.push(e)}}add(t){this._added=false;makeArray(isString(t)?splitPattern(t):t).forEach(this._addPattern,this);if(this._added){this._initCache()}return this}addPattern(t){return this.add(t)}_testOne(t,e){let r=false;let n=false;this._rules.forEach((s=>{const{negative:o}=s;if(n===o&&r!==n||o&&!r&&!n&&!e){return}const i=s.regex.test(t);if(i){r=!o;n=o}}));return{ignored:r,unignored:n}}_test(t,e,r,n){const s=t&&checkPath.convert(t);checkPath(s,t,this._allowRelativePaths?RETURN_FALSE:throwError);return this._t(s,e,r,n)}_t(t,e,r,n){if(t in e){return e[t]}if(!n){n=t.split(p)}n.pop();if(!n.length){return e[t]=this._testOne(t,r)}const s=this._t(n.join(p)+p,e,r,n);return e[t]=s.ignored?s:this._testOne(t,r)}ignores(t){return this._test(t,this._ignoreCache,false).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return makeArray(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,true)}}const factory=t=>new Ignore(t);const isPathValid=t=>checkPath(t&&checkPath.convert(t),t,RETURN_FALSE);factory.isPathValid=isPathValid;factory.default=factory;t.exports=factory;if(typeof process!=="undefined"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){const makePosix=t=>/^\\\\\?\\/.test(t)||/["<>|\u0000-\u001F]+/u.test(t)?t:t.replace(/\\/g,"/");checkPath.convert=makePosix;const t=/^[a-z]:\//i;checkPath.isNotRelative=e=>t.test(e)||isNotRelative(e)}},382:(t,e,r)=>{"use strict";const n=r(781);const s=n.PassThrough;const o=Array.prototype.slice;t.exports=merge2;function merge2(){const t=[];const e=o.call(arguments);let r=false;let n=e[e.length-1];if(n&&!Array.isArray(n)&&n.pipe==null){e.pop()}else{n={}}const i=n.end!==false;const c=n.pipeError===true;if(n.objectMode==null){n.objectMode=true}if(n.highWaterMark==null){n.highWaterMark=64*1024}const a=s(n);function addStream(){for(let e=0,r=arguments.length;e<r;e++){t.push(pauseStreams(arguments[e],n))}mergeStream();return this}function mergeStream(){if(r){return}r=true;let e=t.shift();if(!e){process.nextTick(endStream);return}if(!Array.isArray(e)){e=[e]}let n=e.length+1;function next(){if(--n>0){return}r=false;mergeStream()}function pipe(t){function onend(){t.removeListener("merge2UnpipeEnd",onend);t.removeListener("end",onend);if(c){t.removeListener("error",onerror)}next()}function onerror(t){a.emit("error",t)}if(t._readableState.endEmitted){return next()}t.on("merge2UnpipeEnd",onend);t.on("end",onend);if(c){t.on("error",onerror)}t.pipe(a,{end:false});t.resume()}for(let t=0;t<e.length;t++){pipe(e[t])}next()}function endStream(){r=false;a.emit("queueDrain");if(i){a.end()}}a.setMaxListeners(0);a.add=addStream;a.on("unpipe",(function(t){t.emit("merge2UnpipeEnd")}));if(e.length){addStream.apply(null,e)}return a}function pauseStreams(t,e){if(!Array.isArray(t)){if(!t._readableState&&t.pipe){t=t.pipe(s(e))}if(!t._readableState||!t.pause||!t.pipe){throw new Error("Only readable stream can be merged.")}t.pause()}else{for(let r=0,n=t.length;r<n;r++){t[r]=pauseStreams(t[r],e)}}return t}},223:(t,e,r)=>{"use strict";const{promisify:n}=r(837);const s=r(147);async function isType(t,e,r){if(typeof r!=="string"){throw new TypeError(`Expected a string, got ${typeof r}`)}try{const o=await n(s[t])(r);return o[e]()}catch(t){if(t.code==="ENOENT"){return false}throw t}}function isTypeSync(t,e,r){if(typeof r!=="string"){throw new TypeError(`Expected a string, got ${typeof r}`)}try{return s[t](r)[e]()}catch(t){if(t.code==="ENOENT"){return false}throw t}}e.isFile=isType.bind(null,"stat","isFile");e.isDirectory=isType.bind(null,"stat","isDirectory");e.isSymlink=isType.bind(null,"lstat","isSymbolicLink");e.isFileSync=isTypeSync.bind(null,"statSync","isFile");e.isDirectorySync=isTypeSync.bind(null,"statSync","isDirectory");e.isSymlinkSync=isTypeSync.bind(null,"lstatSync","isSymbolicLink")},398:t=>{"use strict";t.exports=t=>{const e=/^\\\\\?\\/.test(t);const r=/[^\u0000-\u0080]+/.test(t);if(e||r){return t}return t.replace(/\\/g,"/")}},592:t=>{"use strict";t.exports=require("../fast-glob")},147:t=>{"use strict";t.exports=require("fs")},17:t=>{"use strict";t.exports=require("path")},781:t=>{"use strict";t.exports=require("stream")},837:t=>{"use strict";t.exports=require("util")}};var e={};function __nccwpck_require__(r){var n=e[r];if(n!==undefined){return n.exports}var s=e[r]={exports:{}};var o=true;try{t[r](s,s.exports,__nccwpck_require__);o=false}finally{if(o)delete e[r]}return s.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(718);module.exports=r})();
1
+ (()=>{
2
+ var t = {
3
+ 337: (t)=>{
4
+ "use strict";
5
+ t.exports = (...t)=>[
6
+ ...new Set([].concat(...t))
7
+ ];
8
+ },
9
+ 352: (t, e, r)=>{
10
+ "use strict";
11
+ const n = r(17);
12
+ const s = r(223);
13
+ const getExtensions = (t)=>t.length > 1 ? `{${t.join(",")}}` : t[0];
14
+ const getPath = (t, e)=>{
15
+ const r = "!" === t[0] ? t.slice(1) : t;
16
+ return n.isAbsolute(r) ? r : n.join(e, r);
17
+ };
18
+ const addExtensions = (t, e)=>{
19
+ if (n.extname(t)) return `**/${t}`;
20
+ return `**/${t}.${getExtensions(e)}`;
21
+ };
22
+ const getGlob = (t, e)=>{
23
+ if (e.files && !Array.isArray(e.files)) throw new TypeError(`Expected \`files\` to be of type \`Array\` but received type \`${typeof e.files}\``);
24
+ if (e.extensions && !Array.isArray(e.extensions)) throw new TypeError(`Expected \`extensions\` to be of type \`Array\` but received type \`${typeof e.extensions}\``);
25
+ if (e.files && e.extensions) return e.files.map((r)=>n.posix.join(t, addExtensions(r, e.extensions)));
26
+ if (e.files) return e.files.map((e)=>n.posix.join(t, `**/${e}`));
27
+ if (e.extensions) return [
28
+ n.posix.join(t, `**/*.${getExtensions(e.extensions)}`)
29
+ ];
30
+ return [
31
+ n.posix.join(t, "**")
32
+ ];
33
+ };
34
+ t.exports = async (t, e)=>{
35
+ e = {
36
+ cwd: process.cwd(),
37
+ ...e
38
+ };
39
+ if ("string" != typeof e.cwd) throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof e.cwd}\``);
40
+ const r = await Promise.all([].concat(t).map(async (t)=>{
41
+ const r = await s.isDirectory(getPath(t, e.cwd));
42
+ return r ? getGlob(t, e) : t;
43
+ }));
44
+ return [].concat.apply([], r);
45
+ };
46
+ t.exports.sync = (t, e)=>{
47
+ e = {
48
+ cwd: process.cwd(),
49
+ ...e
50
+ };
51
+ if ("string" != typeof e.cwd) throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof e.cwd}\``);
52
+ const r = [].concat(t).map((t)=>s.isDirectorySync(getPath(t, e.cwd)) ? getGlob(t, e) : t);
53
+ return [].concat.apply([], r);
54
+ };
55
+ },
56
+ 153: (t, e, r)=>{
57
+ "use strict";
58
+ const { promisify: n } = r(837);
59
+ const s = r(147);
60
+ const o = r(17);
61
+ const i = r(592);
62
+ const c = r(302);
63
+ const a = r(398);
64
+ const p = [
65
+ "**/node_modules/**",
66
+ "**/flow-typed/**",
67
+ "**/coverage/**",
68
+ "**/.git"
69
+ ];
70
+ const u = n(s.readFile);
71
+ const mapGitIgnorePatternTo = (t)=>(e)=>{
72
+ if (e.startsWith("!")) return "!" + o.posix.join(t, e.slice(1));
73
+ return o.posix.join(t, e);
74
+ };
75
+ const parseGitIgnore = (t, e)=>{
76
+ const r = a(o.relative(e.cwd, o.dirname(e.fileName)));
77
+ return t.split(/\r?\n/).filter(Boolean).filter((t)=>!t.startsWith("#")).map(mapGitIgnorePatternTo(r));
78
+ };
79
+ const reduceIgnore = (t)=>{
80
+ const e = c();
81
+ for (const r of t)e.add(parseGitIgnore(r.content, {
82
+ cwd: r.cwd,
83
+ fileName: r.filePath
84
+ }));
85
+ return e;
86
+ };
87
+ const ensureAbsolutePathForCwd = (t, e)=>{
88
+ t = a(t);
89
+ if (o.isAbsolute(e)) {
90
+ if (a(e).startsWith(t)) return e;
91
+ throw new Error(`Path ${e} is not in cwd ${t}`);
92
+ }
93
+ return o.join(t, e);
94
+ };
95
+ const getIsIgnoredPredecate = (t, e)=>(r)=>t.ignores(a(o.relative(e, ensureAbsolutePathForCwd(e, r.path || r))));
96
+ const getFile = async (t, e)=>{
97
+ const r = o.join(e, t);
98
+ const n = await u(r, "utf8");
99
+ return {
100
+ cwd: e,
101
+ filePath: r,
102
+ content: n
103
+ };
104
+ };
105
+ const getFileSync = (t, e)=>{
106
+ const r = o.join(e, t);
107
+ const n = s.readFileSync(r, "utf8");
108
+ return {
109
+ cwd: e,
110
+ filePath: r,
111
+ content: n
112
+ };
113
+ };
114
+ const normalizeOptions = ({ ignore: t = [], cwd: e = a(process.cwd()) } = {})=>({
115
+ ignore: t,
116
+ cwd: e
117
+ });
118
+ t.exports = async (t)=>{
119
+ t = normalizeOptions(t);
120
+ const e = await i("**/.gitignore", {
121
+ ignore: p.concat(t.ignore),
122
+ cwd: t.cwd
123
+ });
124
+ const r = await Promise.all(e.map((e)=>getFile(e, t.cwd)));
125
+ const n = reduceIgnore(r);
126
+ return getIsIgnoredPredecate(n, t.cwd);
127
+ };
128
+ t.exports.sync = (t)=>{
129
+ t = normalizeOptions(t);
130
+ const e = i.sync("**/.gitignore", {
131
+ ignore: p.concat(t.ignore),
132
+ cwd: t.cwd
133
+ });
134
+ const r = e.map((e)=>getFileSync(e, t.cwd));
135
+ const n = reduceIgnore(r);
136
+ return getIsIgnoredPredecate(n, t.cwd);
137
+ };
138
+ },
139
+ 718: (t, e, r)=>{
140
+ "use strict";
141
+ const n = r(147);
142
+ const s = r(337);
143
+ const o = r(382);
144
+ const i = r(592);
145
+ const c = r(352);
146
+ const a = r(153);
147
+ const { FilterStream: p, UniqueStream: u } = r(546);
148
+ const DEFAULT_FILTER = ()=>false;
149
+ const isNegative = (t)=>"!" === t[0];
150
+ const assertPatternsInput = (t)=>{
151
+ if (!t.every((t)=>"string" == typeof t)) throw new TypeError("Patterns must be a string or an array of strings");
152
+ };
153
+ const checkCwdOption = (t = {})=>{
154
+ if (!t.cwd) return;
155
+ let e;
156
+ try {
157
+ e = n.statSync(t.cwd);
158
+ } catch {
159
+ return;
160
+ }
161
+ if (!e.isDirectory()) throw new Error("The `cwd` option must be a path to a directory");
162
+ };
163
+ const getPathString = (t)=>t.stats instanceof n.Stats ? t.path : t;
164
+ const generateGlobTasks = (t, e)=>{
165
+ t = s([].concat(t));
166
+ assertPatternsInput(t);
167
+ checkCwdOption(e);
168
+ const r = [];
169
+ e = {
170
+ ignore: [],
171
+ expandDirectories: true,
172
+ ...e
173
+ };
174
+ for (const [n, s] of t.entries()){
175
+ if (isNegative(s)) continue;
176
+ const o = t.slice(n).filter((t)=>isNegative(t)).map((t)=>t.slice(1));
177
+ const i = {
178
+ ...e,
179
+ ignore: e.ignore.concat(o)
180
+ };
181
+ r.push({
182
+ pattern: s,
183
+ options: i
184
+ });
185
+ }
186
+ return r;
187
+ };
188
+ const globDirs = (t, e)=>{
189
+ let r = {};
190
+ if (t.options.cwd) r.cwd = t.options.cwd;
191
+ if (Array.isArray(t.options.expandDirectories)) r = {
192
+ ...r,
193
+ files: t.options.expandDirectories
194
+ };
195
+ else if ("object" == typeof t.options.expandDirectories) r = {
196
+ ...r,
197
+ ...t.options.expandDirectories
198
+ };
199
+ return e(t.pattern, r);
200
+ };
201
+ const getPattern = (t, e)=>t.options.expandDirectories ? globDirs(t, e) : [
202
+ t.pattern
203
+ ];
204
+ const getFilterSync = (t)=>t && t.gitignore ? a.sync({
205
+ cwd: t.cwd,
206
+ ignore: t.ignore
207
+ }) : DEFAULT_FILTER;
208
+ const globToTask = (t)=>(e)=>{
209
+ const { options: r } = t;
210
+ if (r.ignore && Array.isArray(r.ignore) && r.expandDirectories) r.ignore = c.sync(r.ignore);
211
+ return {
212
+ pattern: e,
213
+ options: r
214
+ };
215
+ };
216
+ t.exports = async (t, e)=>{
217
+ const r = generateGlobTasks(t, e);
218
+ const getFilter = async ()=>e && e.gitignore ? a({
219
+ cwd: e.cwd,
220
+ ignore: e.ignore
221
+ }) : DEFAULT_FILTER;
222
+ const getTasks = async ()=>{
223
+ const t = await Promise.all(r.map(async (t)=>{
224
+ const e = await getPattern(t, c);
225
+ return Promise.all(e.map(globToTask(t)));
226
+ }));
227
+ return s(...t);
228
+ };
229
+ const [n, o] = await Promise.all([
230
+ getFilter(),
231
+ getTasks()
232
+ ]);
233
+ const p = await Promise.all(o.map((t)=>i(t.pattern, t.options)));
234
+ return s(...p).filter((t)=>!n(getPathString(t)));
235
+ };
236
+ t.exports.sync = (t, e)=>{
237
+ const r = generateGlobTasks(t, e);
238
+ const n = [];
239
+ for (const t of r){
240
+ const e = getPattern(t, c.sync).map(globToTask(t));
241
+ n.push(...e);
242
+ }
243
+ const o = getFilterSync(e);
244
+ let a = [];
245
+ for (const t of n)a = s(a, i.sync(t.pattern, t.options));
246
+ return a.filter((t)=>!o(t));
247
+ };
248
+ t.exports.stream = (t, e)=>{
249
+ const r = generateGlobTasks(t, e);
250
+ const n = [];
251
+ for (const t of r){
252
+ const e = getPattern(t, c.sync).map(globToTask(t));
253
+ n.push(...e);
254
+ }
255
+ const s = getFilterSync(e);
256
+ const a = new p((t)=>!s(t));
257
+ const l = new u;
258
+ return o(n.map((t)=>i.stream(t.pattern, t.options))).pipe(a).pipe(l);
259
+ };
260
+ t.exports.generateGlobTasks = generateGlobTasks;
261
+ t.exports.hasMagic = (t, e)=>[].concat(t).some((t)=>i.isDynamicPattern(t, e));
262
+ t.exports.gitignore = a;
263
+ },
264
+ 546: (t, e, r)=>{
265
+ "use strict";
266
+ const { Transform: n } = r(781);
267
+ class ObjectTransform extends n {
268
+ constructor(){
269
+ super({
270
+ objectMode: true
271
+ });
272
+ }
273
+ }
274
+ class FilterStream extends ObjectTransform {
275
+ constructor(t){
276
+ super();
277
+ this._filter = t;
278
+ }
279
+ _transform(t, e, r) {
280
+ if (this._filter(t)) this.push(t);
281
+ r();
282
+ }
283
+ }
284
+ class UniqueStream extends ObjectTransform {
285
+ constructor(){
286
+ super();
287
+ this._pushed = new Set;
288
+ }
289
+ _transform(t, e, r) {
290
+ if (!this._pushed.has(t)) {
291
+ this.push(t);
292
+ this._pushed.add(t);
293
+ }
294
+ r();
295
+ }
296
+ }
297
+ t.exports = {
298
+ FilterStream: FilterStream,
299
+ UniqueStream: UniqueStream
300
+ };
301
+ },
302
+ 302: (t)=>{
303
+ function makeArray(t) {
304
+ return Array.isArray(t) ? t : [
305
+ t
306
+ ];
307
+ }
308
+ const e = "";
309
+ const r = " ";
310
+ const n = "\\";
311
+ const s = /^\s+$/;
312
+ const o = /^\\!/;
313
+ const i = /^\\#/;
314
+ const c = /\r?\n/g;
315
+ const a = /^\.*\/|^\.+$/;
316
+ const p = "/";
317
+ const u = "u" > typeof Symbol ? Symbol.for("node-ignore") : "node-ignore";
318
+ const define = (t, e, r)=>Object.defineProperty(t, e, {
319
+ value: r
320
+ });
321
+ const l = /([0-z])-([0-z])/g;
322
+ const RETURN_FALSE = ()=>false;
323
+ const sanitizeRange = (t)=>t.replace(l, (t, r, n)=>r.charCodeAt(0) <= n.charCodeAt(0) ? t : e);
324
+ const cleanRangeBackSlash = (t)=>{
325
+ const { length: e } = t;
326
+ return t.slice(0, e - e % 2);
327
+ };
328
+ const f = [
329
+ [
330
+ /\\?\s+$/,
331
+ (t)=>0 === t.indexOf("\\") ? r : e
332
+ ],
333
+ [
334
+ /\\\s/g,
335
+ ()=>r
336
+ ],
337
+ [
338
+ /[\\$.|*+(){^]/g,
339
+ (t)=>`\\${t}`
340
+ ],
341
+ [
342
+ /(?!\\)\?/g,
343
+ ()=>"[^/]"
344
+ ],
345
+ [
346
+ /^\//,
347
+ ()=>"^"
348
+ ],
349
+ [
350
+ /\//g,
351
+ ()=>"\\/"
352
+ ],
353
+ [
354
+ /^\^*\\\*\\\*\\\//,
355
+ ()=>"^(?:.*\\/)?"
356
+ ],
357
+ [
358
+ /^(?=[^^])/,
359
+ function() {
360
+ return /\/(?!$)/.test(this) ? "^" : "(?:^|\\/)";
361
+ }
362
+ ],
363
+ [
364
+ /\\\/\\\*\\\*(?=\\\/|$)/g,
365
+ (t, e, r)=>e + 6 < r.length ? "(?:\\/[^\\/]+)*" : "\\/.+"
366
+ ],
367
+ [
368
+ /(^|[^\\]+)\\\*(?=.+)/g,
369
+ (t, e)=>`${e}[^\\/]*`
370
+ ],
371
+ [
372
+ /\\\\\\(?=[$.|*+(){^])/g,
373
+ ()=>n
374
+ ],
375
+ [
376
+ /\\\\/g,
377
+ ()=>n
378
+ ],
379
+ [
380
+ /(\\)?\[([^\]/]*?)(\\*)($|\])/g,
381
+ (t, e, r, s, o)=>e === n ? `\\[${r}${cleanRangeBackSlash(s)}${o}` : "]" === o ? s.length % 2 === 0 ? `[${sanitizeRange(r)}${s}]` : "[]" : "[]"
382
+ ],
383
+ [
384
+ /(?:[^*])$/,
385
+ (t)=>/\/$/.test(t) ? `${t}$` : `${t}(?=$|\\/$)`
386
+ ],
387
+ [
388
+ /(\^|\\\/)?\\\*$/,
389
+ (t, e)=>{
390
+ const r = e ? `${e}[^/]+` : "[^/]*";
391
+ return `${r}(?=$|\\/$)`;
392
+ }
393
+ ]
394
+ ];
395
+ const d = Object.create(null);
396
+ const makeRegex = (t, e)=>{
397
+ let r = d[t];
398
+ if (!r) {
399
+ r = f.reduce((e, r)=>e.replace(r[0], r[1].bind(t)), t);
400
+ d[t] = r;
401
+ }
402
+ return e ? new RegExp(r, "i") : new RegExp(r);
403
+ };
404
+ const isString = (t)=>"string" == typeof t;
405
+ const checkPattern = (t)=>t && isString(t) && !s.test(t) && 0 !== t.indexOf("#");
406
+ const splitPattern = (t)=>t.split(c);
407
+ class IgnoreRule {
408
+ constructor(t, e, r, n){
409
+ this.origin = t;
410
+ this.pattern = e;
411
+ this.negative = r;
412
+ this.regex = n;
413
+ }
414
+ }
415
+ const createRule = (t, e)=>{
416
+ const r = t;
417
+ let n = false;
418
+ if (0 === t.indexOf("!")) {
419
+ n = true;
420
+ t = t.substr(1);
421
+ }
422
+ t = t.replace(o, "!").replace(i, "#");
423
+ const s = makeRegex(t, e);
424
+ return new IgnoreRule(r, t, n, s);
425
+ };
426
+ const throwError = (t, e)=>{
427
+ throw new e(t);
428
+ };
429
+ const checkPath = (t, e, r)=>{
430
+ if (!isString(t)) return r(`path must be a string, but got \`${e}\``, TypeError);
431
+ if (!t) return r("path must not be empty", TypeError);
432
+ if (checkPath.isNotRelative(t)) {
433
+ const t = "`path.relative()`d";
434
+ return r(`path should be a ${t} string, but got "${e}"`, RangeError);
435
+ }
436
+ return true;
437
+ };
438
+ const isNotRelative = (t)=>a.test(t);
439
+ checkPath.isNotRelative = isNotRelative;
440
+ checkPath.convert = (t)=>t;
441
+ class Ignore {
442
+ constructor({ ignorecase: t = true, ignoreCase: e = t, allowRelativePaths: r = false } = {}){
443
+ define(this, u, true);
444
+ this._rules = [];
445
+ this._ignoreCase = e;
446
+ this._allowRelativePaths = r;
447
+ this._initCache();
448
+ }
449
+ _initCache() {
450
+ this._ignoreCache = Object.create(null);
451
+ this._testCache = Object.create(null);
452
+ }
453
+ _addPattern(t) {
454
+ if (t && t[u]) {
455
+ this._rules = this._rules.concat(t._rules);
456
+ this._added = true;
457
+ return;
458
+ }
459
+ if (checkPattern(t)) {
460
+ const e = createRule(t, this._ignoreCase);
461
+ this._added = true;
462
+ this._rules.push(e);
463
+ }
464
+ }
465
+ add(t) {
466
+ this._added = false;
467
+ makeArray(isString(t) ? splitPattern(t) : t).forEach(this._addPattern, this);
468
+ if (this._added) this._initCache();
469
+ return this;
470
+ }
471
+ addPattern(t) {
472
+ return this.add(t);
473
+ }
474
+ _testOne(t, e) {
475
+ let r = false;
476
+ let n = false;
477
+ this._rules.forEach((s)=>{
478
+ const { negative: o } = s;
479
+ if (n === o && r !== n || o && !r && !n && !e) return;
480
+ const i = s.regex.test(t);
481
+ if (i) {
482
+ r = !o;
483
+ n = o;
484
+ }
485
+ });
486
+ return {
487
+ ignored: r,
488
+ unignored: n
489
+ };
490
+ }
491
+ _test(t, e, r, n) {
492
+ const s = t && checkPath.convert(t);
493
+ checkPath(s, t, this._allowRelativePaths ? RETURN_FALSE : throwError);
494
+ return this._t(s, e, r, n);
495
+ }
496
+ _t(t, e, r, n) {
497
+ if (t in e) return e[t];
498
+ if (!n) n = t.split(p);
499
+ n.pop();
500
+ if (!n.length) return e[t] = this._testOne(t, r);
501
+ const s = this._t(n.join(p) + p, e, r, n);
502
+ return e[t] = s.ignored ? s : this._testOne(t, r);
503
+ }
504
+ ignores(t) {
505
+ return this._test(t, this._ignoreCache, false).ignored;
506
+ }
507
+ createFilter() {
508
+ return (t)=>!this.ignores(t);
509
+ }
510
+ filter(t) {
511
+ return makeArray(t).filter(this.createFilter());
512
+ }
513
+ test(t) {
514
+ return this._test(t, this._testCache, true);
515
+ }
516
+ }
517
+ const factory = (t)=>new Ignore(t);
518
+ const isPathValid = (t)=>checkPath(t && checkPath.convert(t), t, RETURN_FALSE);
519
+ factory.isPathValid = isPathValid;
520
+ factory.default = factory;
521
+ t.exports = factory;
522
+ if ("u" > typeof process && (process.env && process.env.IGNORE_TEST_WIN32 || "win32" === process.platform)) {
523
+ const makePosix = (t)=>/^\\\\\?\\/.test(t) || /["<>|\u0000-\u001F]+/u.test(t) ? t : t.replace(/\\/g, "/");
524
+ checkPath.convert = makePosix;
525
+ const t = /^[a-z]:\//i;
526
+ checkPath.isNotRelative = (e)=>t.test(e) || isNotRelative(e);
527
+ }
528
+ },
529
+ 382: (t, e, r)=>{
530
+ "use strict";
531
+ const n = r(781);
532
+ const s = n.PassThrough;
533
+ const o = Array.prototype.slice;
534
+ t.exports = merge2;
535
+ function merge2() {
536
+ const t = [];
537
+ const e = o.call(arguments);
538
+ let r = false;
539
+ let n = e[e.length - 1];
540
+ if (n && !Array.isArray(n) && null == n.pipe) e.pop();
541
+ else n = {};
542
+ const i = false !== n.end;
543
+ const c = true === n.pipeError;
544
+ if (null == n.objectMode) n.objectMode = true;
545
+ if (null == n.highWaterMark) n.highWaterMark = 65536;
546
+ const a = s(n);
547
+ function addStream() {
548
+ for(let e = 0, r = arguments.length; e < r; e++)t.push(pauseStreams(arguments[e], n));
549
+ mergeStream();
550
+ return this;
551
+ }
552
+ function mergeStream() {
553
+ if (r) return;
554
+ r = true;
555
+ let e = t.shift();
556
+ if (!e) return void process.nextTick(endStream);
557
+ if (!Array.isArray(e)) e = [
558
+ e
559
+ ];
560
+ let n = e.length + 1;
561
+ function next() {
562
+ if (--n > 0) return;
563
+ r = false;
564
+ mergeStream();
565
+ }
566
+ function pipe(t) {
567
+ function onend() {
568
+ t.removeListener("merge2UnpipeEnd", onend);
569
+ t.removeListener("end", onend);
570
+ if (c) t.removeListener("error", onerror);
571
+ next();
572
+ }
573
+ function onerror(t) {
574
+ a.emit("error", t);
575
+ }
576
+ if (t._readableState.endEmitted) return next();
577
+ t.on("merge2UnpipeEnd", onend);
578
+ t.on("end", onend);
579
+ if (c) t.on("error", onerror);
580
+ t.pipe(a, {
581
+ end: false
582
+ });
583
+ t.resume();
584
+ }
585
+ for(let t = 0; t < e.length; t++)pipe(e[t]);
586
+ next();
587
+ }
588
+ function endStream() {
589
+ r = false;
590
+ a.emit("queueDrain");
591
+ if (i) a.end();
592
+ }
593
+ a.setMaxListeners(0);
594
+ a.add = addStream;
595
+ a.on("unpipe", function(t) {
596
+ t.emit("merge2UnpipeEnd");
597
+ });
598
+ if (e.length) addStream.apply(null, e);
599
+ return a;
600
+ }
601
+ function pauseStreams(t, e) {
602
+ if (Array.isArray(t)) for(let r = 0, n = t.length; r < n; r++)t[r] = pauseStreams(t[r], e);
603
+ else {
604
+ if (!t._readableState && t.pipe) t = t.pipe(s(e));
605
+ if (!t._readableState || !t.pause || !t.pipe) throw new Error("Only readable stream can be merged.");
606
+ t.pause();
607
+ }
608
+ return t;
609
+ }
610
+ },
611
+ 223: (t, e, r)=>{
612
+ "use strict";
613
+ const { promisify: n } = r(837);
614
+ const s = r(147);
615
+ async function isType(t, e, r) {
616
+ if ("string" != typeof r) throw new TypeError(`Expected a string, got ${typeof r}`);
617
+ try {
618
+ const o = await n(s[t])(r);
619
+ return o[e]();
620
+ } catch (t) {
621
+ if ("ENOENT" === t.code) return false;
622
+ throw t;
623
+ }
624
+ }
625
+ function isTypeSync(t, e, r) {
626
+ if ("string" != typeof r) throw new TypeError(`Expected a string, got ${typeof r}`);
627
+ try {
628
+ return s[t](r)[e]();
629
+ } catch (t) {
630
+ if ("ENOENT" === t.code) return false;
631
+ throw t;
632
+ }
633
+ }
634
+ e.isFile = isType.bind(null, "stat", "isFile");
635
+ e.isDirectory = isType.bind(null, "stat", "isDirectory");
636
+ e.isSymlink = isType.bind(null, "lstat", "isSymbolicLink");
637
+ e.isFileSync = isTypeSync.bind(null, "statSync", "isFile");
638
+ e.isDirectorySync = isTypeSync.bind(null, "statSync", "isDirectory");
639
+ e.isSymlinkSync = isTypeSync.bind(null, "lstatSync", "isSymbolicLink");
640
+ },
641
+ 398: (t)=>{
642
+ "use strict";
643
+ t.exports = (t)=>{
644
+ const e = /^\\\\\?\\/.test(t);
645
+ const r = /[^\u0000-\u0080]+/.test(t);
646
+ if (e || r) return t;
647
+ return t.replace(/\\/g, "/");
648
+ };
649
+ },
650
+ 592: (t)=>{
651
+ "use strict";
652
+ t.exports = require("../fast-glob");
653
+ },
654
+ 147: (t)=>{
655
+ "use strict";
656
+ t.exports = require("fs");
657
+ },
658
+ 17: (t)=>{
659
+ "use strict";
660
+ t.exports = require("path");
661
+ },
662
+ 781: (t)=>{
663
+ "use strict";
664
+ t.exports = require("stream");
665
+ },
666
+ 837: (t)=>{
667
+ "use strict";
668
+ t.exports = require("util");
669
+ }
670
+ };
671
+ var e = {};
672
+ function __nccwpck_require__(r) {
673
+ var n = e[r];
674
+ if (void 0 !== n) return n.exports;
675
+ var s = e[r] = {
676
+ exports: {}
677
+ };
678
+ var o = true;
679
+ try {
680
+ t[r](s, s.exports, __nccwpck_require__);
681
+ o = false;
682
+ } finally{
683
+ if (o) delete e[r];
684
+ }
685
+ return s.exports;
686
+ }
687
+ if (void 0 !== __nccwpck_require__) __nccwpck_require__.ab = __dirname + "/";
688
+ var r = __nccwpck_require__(718);
689
+ module.exports = r;
690
+ })();