@vanillaes/esmtk 1.4.0 → 1.4.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/package.json +1 -1
- package/src/util.d.ts +1 -1
- package/src/util.js +4 -3
package/package.json
CHANGED
package/src/util.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export function installed(pkg: string): Promise<boolean>;
|
|
|
20
20
|
* Match glob(s)
|
|
21
21
|
* @param {string} pattern glob pattern(s) to match
|
|
22
22
|
* @param {string} cwd the current working directory
|
|
23
|
-
* @param {string} ignore glob of pattern(s) to ignore
|
|
23
|
+
* @param {string} [ignore] glob of pattern(s) to ignore
|
|
24
24
|
* @returns {Promise<string[]>} an array of paths
|
|
25
25
|
*/
|
|
26
26
|
export function match(pattern: string, cwd?: string, ignore?: string): Promise<string[]>;
|
package/src/util.js
CHANGED
|
@@ -62,15 +62,16 @@ export async function installed (pkg) {
|
|
|
62
62
|
* Match glob(s)
|
|
63
63
|
* @param {string} pattern glob pattern(s) to match
|
|
64
64
|
* @param {string} cwd the current working directory
|
|
65
|
-
* @param {string} ignore glob of pattern(s) to ignore
|
|
65
|
+
* @param {string} [ignore] glob of pattern(s) to ignore
|
|
66
66
|
* @returns {Promise<string[]>} an array of paths
|
|
67
67
|
*/
|
|
68
68
|
export async function match (pattern, cwd = process.cwd(), ignore = null) {
|
|
69
|
+
const patterns = pattern.includes(',') ? pattern.split(',') : [pattern]
|
|
69
70
|
if (ignore) {
|
|
70
71
|
const ignores = ignore.includes(',') ? ignore.split(',') : [ignore]
|
|
71
|
-
return await Array.fromAsync(glob(
|
|
72
|
+
return await Array.fromAsync(glob(patterns, { cwd, exclude: ignores }))
|
|
72
73
|
}
|
|
73
|
-
return await Array.fromAsync(glob(
|
|
74
|
+
return await Array.fromAsync(glob(patterns, { cwd }))
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
/**
|