rrdir 13.1.0 → 13.1.2

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 (2) hide show
  1. package/dist/index.js +5 -5
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -37,8 +37,8 @@ function makeMatchers({ include, exclude, insensitive }) {
37
37
  flags: insensitive ? "i" : void 0
38
38
  };
39
39
  return {
40
- includeMatcher: (include == null ? void 0 : include.length) ? (path) => picomatch(include, opts)(resolve(path)) : null,
41
- excludeMatcher: (exclude == null ? void 0 : exclude.length) ? (path) => picomatch(exclude, opts)(resolve(path)) : null
40
+ includeMatcher: include?.length ? (path) => picomatch(include, opts)(resolve(path)) : null,
41
+ excludeMatcher: exclude?.length ? (path) => picomatch(exclude, opts)(resolve(path)) : null
42
42
  };
43
43
  }
44
44
  async function* rrdir(dir, opts = {}, { includeMatcher, excludeMatcher, encoding } = {}) {
@@ -61,7 +61,7 @@ async function* rrdir(dir, opts = {}, { includeMatcher, excludeMatcher, encoding
61
61
  return;
62
62
  for (const dirent of dirents) {
63
63
  const path = makePath(dirent, dir, encoding);
64
- if (excludeMatcher == null ? void 0 : excludeMatcher(encoding === "buffer" ? toString(path) : path))
64
+ if (excludeMatcher?.(encoding === "buffer" ? toString(path) : path))
65
65
  continue;
66
66
  const isSymbolicLink = opts.followSymlinks && dirent.isSymbolicLink();
67
67
  const encodedPath = encoding === "buffer" ? toString(path) : path;
@@ -116,7 +116,7 @@ async function rrdirAsync(dir, opts = {}, { includeMatcher, excludeMatcher, enco
116
116
  return results;
117
117
  await Promise.all(dirents.map(async (dirent) => {
118
118
  const path = makePath(dirent, dir, encoding);
119
- if (excludeMatcher == null ? void 0 : excludeMatcher(encoding === "buffer" ? toString(path) : path))
119
+ if (excludeMatcher?.(encoding === "buffer" ? toString(path) : path))
120
120
  return;
121
121
  const isSymbolicLink = opts.followSymlinks && dirent.isSymbolicLink();
122
122
  const encodedPath = encoding === "buffer" ? toString(path) : path;
@@ -172,7 +172,7 @@ function rrdirSync(dir, opts = {}, { includeMatcher, excludeMatcher, encoding }
172
172
  return results;
173
173
  for (const dirent of dirents) {
174
174
  const path = makePath(dirent, dir, encoding);
175
- if (excludeMatcher == null ? void 0 : excludeMatcher(encoding === "buffer" ? toString(path) : path))
175
+ if (excludeMatcher?.(encoding === "buffer" ? toString(path) : path))
176
176
  continue;
177
177
  const isSymbolicLink = opts.followSymlinks && dirent.isSymbolicLink();
178
178
  const encodedPath = encoding === "buffer" ? toString(path) : path;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rrdir",
3
- "version": "13.1.0",
3
+ "version": "13.1.2",
4
4
  "description": "Recursive directory reader with a delightful API",
5
5
  "author": "silverwind <me@silverwind.io>",
6
6
  "repository": "silverwind/rrdir",
@@ -29,7 +29,7 @@
29
29
  "updates": "16.0.1",
30
30
  "versions": "12.0.1",
31
31
  "vite": "5.2.11",
32
- "vite-plugin-dts": "3.9.1",
32
+ "vite-config-silverwind": "2.1.0",
33
33
  "vitest": "1.5.0",
34
34
  "vitest-config-silverwind": "8.0.4"
35
35
  }