rrdir 10.0.2 → 10.0.3

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 (3) hide show
  1. package/README.md +1 -1
  2. package/index.js +3 -4
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  > Recursive directory reader with a delightful API
5
5
 
6
- `rrdir` recursively reads a directory and returns entries within via an async iterator or async/sync as Array. It has minimal dependencies and can typically iterate millions of files in a matter of seconds. Memory usage is `O(1)` for the async iterator and `O(n)` for the Array variants.
6
+ `rrdir` recursively reads a directory and returns entries within via an async iterator or async/sync as Array. It has no dependencies and can typically iterate millions of files in a matter of seconds. Memory usage is `O(1)` for the async iterator and `O(n)` for the Array variants.
7
7
 
8
8
  ## Usage
9
9
  ```console
package/index.js CHANGED
@@ -30,11 +30,10 @@ function build(dirent, path, stats, opts) {
30
30
  }
31
31
 
32
32
  function makeMatcher(filters) {
33
+ const res = filters.map(f => new RegExp(`${f.replace(/\*+/g, ".*").replace(/\/\.\*/, ".*")}$`));
33
34
  return str => {
34
- for (const filter of filters) {
35
- const re = new RegExp(`${filter.replace(/\*+/g, ".*").replace(/\/\.\*/, ".*")}$`);
36
- const matches = re.test(str);
37
- if (matches) return true;
35
+ for (const re of res) {
36
+ if (re.test(str)) return true;
38
37
  }
39
38
  return false;
40
39
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rrdir",
3
- "version": "10.0.2",
3
+ "version": "10.0.3",
4
4
  "description": "Recursive directory reader with a delightful API",
5
5
  "author": "silverwind <me@silverwind.io>",
6
6
  "repository": "silverwind/rrdir",
@@ -20,8 +20,8 @@
20
20
  "jest": "29.0.3",
21
21
  "semver": "7.3.7",
22
22
  "tempy": "3.0.0",
23
- "updates": "13.1.5",
24
- "versions": "9.3.0"
23
+ "updates": "13.1.7",
24
+ "versions": "9.3.2"
25
25
  },
26
26
  "keywords": [
27
27
  "recursive readdir",