@stryke/fs 0.11.2 → 0.11.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.
@@ -9,16 +9,20 @@ var _joinPaths = require("@stryke/path/join-paths");
9
9
  var _promises = require("node:fs/promises");
10
10
  var _picomatch = _interopRequireDefault(require("picomatch"));
11
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
- async function listFiles(e, s = {}) {
12
+ async function listFiles(s, a) {
13
13
  const o = [],
14
+ n = (0, _picomatch.default)(s, {
15
+ dot: !0,
16
+ ...a
17
+ }),
14
18
  r = async t => {
15
- if (!(0, _picomatch.default)(t, s)) {
16
- const n = await (0, _promises.readdir)(t);
17
- await Promise.all(n.map(async m => {
18
- const i = (0, _joinPaths.joinPaths)(t, m);
19
- (0, _picomatch.default)(i, s) || ((0, _isFile.isDirectory)(i) ? await r(i) : o.push(i));
19
+ if (!n(t)) {
20
+ const e = await (0, _promises.readdir)(t);
21
+ await Promise.all(e.map(async c => {
22
+ const i = (0, _joinPaths.joinPaths)(t, c);
23
+ n(i) || ((0, _isFile.isDirectory)(i) ? await r(i) : o.push(i));
20
24
  }));
21
25
  }
22
26
  };
23
- return await r(e), o;
27
+ return await r(s), o;
24
28
  }
@@ -1 +1 @@
1
- import{isDirectory as c}from"@stryke/path/is-file";import{joinPaths as p}from"@stryke/path/join-paths";import{readdir as f}from"node:fs/promises";import a from"picomatch";export async function listFiles(e,s={}){const o=[],r=async t=>{if(!a(t,s)){const n=await f(t);await Promise.all(n.map(async m=>{const i=p(t,m);a(i,s)||(c(i)?await r(i):o.push(i))}))}};return await r(e),o}
1
+ import{isDirectory as m}from"@stryke/path/is-file";import{joinPaths as p}from"@stryke/path/join-paths";import{readdir as f}from"node:fs/promises";import l from"picomatch";export async function listFiles(s,a){const o=[],n=l(s,{dot:!0,...a}),r=async t=>{if(!n(t)){const e=await f(t);await Promise.all(e.map(async c=>{const i=p(t,c);n(i)||(m(i)?await r(i):o.push(i))}))}};return await r(s),o}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/fs",
3
- "version": "0.11.2",
3
+ "version": "0.11.3",
4
4
  "type": "module",
5
5
  "description": "A package containing various file system utilities that expand the functionality of NodeJs's built-in `fs` module.",
6
6
  "repository": {