@thi.ng/file-io 2.2.18 → 2.2.20

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/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](https://mastodon.thi.ng/@toxi)
8
8
 
9
9
  > [!NOTE]
10
- > This is one of 210 standalone projects, maintained as part
10
+ > This is one of 211 standalone projects, maintained as part
11
11
  > of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
12
12
  > and anti-framework.
13
13
  >
package/delete.js CHANGED
@@ -18,7 +18,7 @@ const deleteFileAsync = async (path, logger, dryRun = false) => {
18
18
  return unlink(path);
19
19
  };
20
20
  const deleteFiles = (paths, logger, dryRun = false) => {
21
- for (let path of paths) {
21
+ for (const path of paths) {
22
22
  try {
23
23
  deleteFile(path, logger, dryRun);
24
24
  } catch (e) {
@@ -31,7 +31,7 @@ const deleteFiles = (paths, logger, dryRun = false) => {
31
31
  };
32
32
  const deleteFilesAsync = async (paths, logger, dryRun = false) => {
33
33
  const promises = [];
34
- for (let path of paths) {
34
+ for (const path of paths) {
35
35
  promises.push(deleteFileAsync(path, logger, dryRun));
36
36
  }
37
37
  await Promise.allSettled(promises);
package/files.js CHANGED
@@ -7,7 +7,7 @@ const files = (dir, match = "", maxDepth = Infinity, logger) => __files(dir, mat
7
7
  function* __files(dir, match = "", logger, maxDepth = Infinity, depth = 0) {
8
8
  if (depth >= maxDepth) return;
9
9
  const pred = __ensurePred(match);
10
- for (let f of readdirSync(dir).sort()) {
10
+ for (const f of readdirSync(dir).sort()) {
11
11
  const curr = dir + sep + f;
12
12
  try {
13
13
  if (isDirectory(curr)) {
@@ -24,7 +24,7 @@ const dirs = (dir, match = "", maxDepth = Infinity, logger) => __dirs(dir, match
24
24
  function* __dirs(dir, match = "", logger, maxDepth = Infinity, depth = 0) {
25
25
  if (depth >= maxDepth) return;
26
26
  const pred = __ensurePred(match);
27
- for (let f of readdirSync(dir).sort()) {
27
+ for (const f of readdirSync(dir).sort()) {
28
28
  const curr = dir + sep + f;
29
29
  try {
30
30
  if (isDirectory(curr)) {
package/mask.js CHANGED
@@ -7,7 +7,7 @@ const addPathMask = (pattern, mask = "****") => {
7
7
  };
8
8
  const setPathMasks = (masks) => MASKS = masks;
9
9
  const maskedPath = (path) => {
10
- for (let [re, mask] of MASKS) {
10
+ for (const [re, mask] of MASKS) {
11
11
  path = path.replace(re, mask);
12
12
  }
13
13
  return path;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/file-io",
3
- "version": "2.2.18",
3
+ "version": "2.2.20",
4
4
  "description": "Assorted file I/O utils (w/ logging support) for NodeJS/Bun",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -39,11 +39,11 @@
39
39
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@thi.ng/api": "^8.12.8",
43
- "@thi.ng/checks": "^3.7.24",
44
- "@thi.ng/hex": "^2.4.1",
45
- "@thi.ng/logger": "^3.2.7",
46
- "@thi.ng/random": "^4.1.33"
42
+ "@thi.ng/api": "^8.12.10",
43
+ "@thi.ng/checks": "^3.8.0",
44
+ "@thi.ng/hex": "^2.4.3",
45
+ "@thi.ng/logger": "^3.2.9",
46
+ "@thi.ng/random": "^4.1.35"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/node": "^24.10.1",
@@ -134,5 +134,5 @@
134
134
  "status": "stable",
135
135
  "year": 2022
136
136
  },
137
- "gitHead": "be6e7657b1e5c54d7d648d1b52888a7297e95a17\n"
137
+ "gitHead": "824bf9047b5a10f777c5c5b4aeecf0c750a22c75\n"
138
138
  }
package/watch.js CHANGED
@@ -33,7 +33,7 @@ let Watcher = class {
33
33
  };
34
34
  }
35
35
  addAll(paths) {
36
- for (let p of paths) {
36
+ for (const p of paths) {
37
37
  isString(p) ? this.add(p) : this.add(...p);
38
38
  }
39
39
  }
@@ -80,7 +80,7 @@ let Watcher = class {
80
80
  return true;
81
81
  }
82
82
  removeAll(paths) {
83
- for (let p of paths) {
83
+ for (const p of paths) {
84
84
  this.remove(p);
85
85
  }
86
86
  }