@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vanillaes/esmtk",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "ES Module Toolkit",
5
5
  "keywords": [
6
6
  "ecmascript",
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(pattern, { cwd, exclude: ignores }))
72
+ return await Array.fromAsync(glob(patterns, { cwd, exclude: ignores }))
72
73
  }
73
- return await Array.fromAsync(glob(pattern, { cwd }))
74
+ return await Array.fromAsync(glob(patterns, { cwd }))
74
75
  }
75
76
 
76
77
  /**