@visulima/fs 3.1.2 → 3.1.4
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/CHANGELOG.md +33 -0
- package/README.md +2328 -492
- package/dist/{packem_shared/LF-bB2qO80j.cjs → eol.cjs} +4 -4
- package/dist/eol.d.cts +7 -0
- package/dist/eol.d.mts +7 -0
- package/dist/eol.d.ts +7 -0
- package/dist/{packem_shared/LF-CU3KsvZC.mjs → eol.mjs} +4 -4
- package/dist/error.cjs +2 -2
- package/dist/error.mjs +2 -2
- package/dist/index.cjs +13 -13
- package/dist/index.d.cts +8 -19
- package/dist/index.d.mts +8 -19
- package/dist/index.d.ts +8 -19
- package/dist/index.mjs +8 -8
- package/dist/packem_shared/{JSONError-gkXvBSar.cjs → JSONError-5-wHnrxX.cjs} +4 -0
- package/dist/packem_shared/{JSONError-BCIIHvzq.mjs → JSONError-CaKt7MhC.mjs} +4 -0
- package/dist/packem_shared/{WalkError-B7_AVs7d.cjs → WalkError-B4-yr8Kk.cjs} +5 -1
- package/dist/packem_shared/{WalkError-H9EuRv7O.mjs → WalkError-DvEBTTaj.mjs} +5 -1
- package/dist/packem_shared/{collect-B615pR8z.mjs → collect-3Paj1Vqw.mjs} +1 -1
- package/dist/packem_shared/{collect-DHldhy_s.cjs → collect-DnfQeSOL.cjs} +1 -1
- package/dist/packem_shared/{collectSync-zahGoTi-.cjs → collectSync-D4vym4QD.cjs} +1 -1
- package/dist/packem_shared/{collectSync-CYuBdXWI.mjs → collectSync-DwJLL8SD.mjs} +1 -1
- package/dist/packem_shared/{emptyDirSync-BoknkGUe.cjs → emptyDirSync-BWA4n6TB.cjs} +3 -3
- package/dist/packem_shared/{emptyDirSync-DTGPXQ3v.mjs → emptyDirSync-DMAaCiC_.mjs} +3 -3
- package/dist/packem_shared/{parseJson-D7XcVuDD.mjs → parseJson-BA7Xrggq.mjs} +1 -1
- package/dist/packem_shared/{parseJson-5geAXtlm.cjs → parseJson-LgPGI5ic.cjs} +1 -1
- package/dist/packem_shared/{readJson-CG6Pm3bL.cjs → readJson-CEBHyuYq.cjs} +1 -1
- package/dist/packem_shared/{readJson-Ddq4aS0W.mjs → readJson-Ce9b06cu.mjs} +1 -1
- package/dist/packem_shared/{readJsonSync-DXVlgWNf.cjs → readJsonSync-B22hej0y.cjs} +1 -1
- package/dist/packem_shared/{readJsonSync-C1IyJccj.mjs → readJsonSync-CkUI9_z5.mjs} +1 -1
- package/dist/packem_shared/{types-Crz-rGlC.d.cts → types-BaMGfHdp.d.cts} +7 -3
- package/dist/packem_shared/{types-Crz-rGlC.d.mts → types-BaMGfHdp.d.mts} +7 -3
- package/dist/packem_shared/{types-Crz-rGlC.d.ts → types-BaMGfHdp.d.ts} +7 -3
- package/dist/packem_shared/{walk-PpNwjtjX.cjs → walk-CI3ygmrw.cjs} +1 -1
- package/dist/packem_shared/{walk-BIh3_ljI.mjs → walk-D7YA43g8.mjs} +1 -1
- package/dist/packem_shared/{walkSync-CFwkbDz9.mjs → walkSync-DLTsnwuJ.mjs} +1 -1
- package/dist/packem_shared/{walkSync-BidUqvMI.cjs → walkSync-oXkmn9ZA.cjs} +1 -1
- package/dist/packem_shared/writeYaml-3XQT2qtb.cjs +29 -0
- package/dist/packem_shared/writeYaml-BSFEuWp2.mjs +27 -0
- package/dist/packem_shared/writeYamlSync-B6VcXXIb.mjs +27 -0
- package/dist/packem_shared/writeYamlSync-BZR3If9v.cjs +29 -0
- package/dist/utils.cjs +2 -2
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.mts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.mjs +2 -2
- package/dist/yaml.cjs +2 -2
- package/dist/yaml.d.cts +6 -8
- package/dist/yaml.d.mts +6 -8
- package/dist/yaml.d.ts +6 -8
- package/dist/yaml.mjs +2 -2
- package/package.json +15 -2
- package/dist/packem_shared/writeYaml-C0YnZ1bp.cjs +0 -14
- package/dist/packem_shared/writeYaml-Cuj4H9ut.mjs +0 -12
- package/dist/packem_shared/writeYamlSync-BBNLBbQK.cjs +0 -14
- package/dist/packem_shared/writeYamlSync-cL8f07FV.mjs +0 -12
|
@@ -11,12 +11,12 @@ const LF = "\n";
|
|
|
11
11
|
const CRLF = "\r\n";
|
|
12
12
|
const EOL = node_process.platform === "win32" ? CRLF : LF;
|
|
13
13
|
const detect = /* @__PURE__ */ __name((content) => {
|
|
14
|
-
const
|
|
15
|
-
if (!
|
|
14
|
+
const matched = content.match(regDetect);
|
|
15
|
+
if (!matched || matched.length === 0) {
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
|
-
const crlf =
|
|
19
|
-
const lf =
|
|
18
|
+
const crlf = matched.filter((newline) => newline === CRLF).length;
|
|
19
|
+
const lf = matched.length - crlf;
|
|
20
20
|
return crlf > lf ? CRLF : LF;
|
|
21
21
|
}, "detect");
|
|
22
22
|
const format = /* @__PURE__ */ __name((content, eol) => content.replaceAll(regDetect, eol), "format");
|
package/dist/eol.d.cts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const LF: "\n";
|
|
2
|
+
declare const CRLF: "\r\n";
|
|
3
|
+
declare const EOL: "\n" | "\r\n";
|
|
4
|
+
declare const detect: (content: string) => typeof EOL | null;
|
|
5
|
+
declare const format: (content: string, eol: typeof EOL) => string;
|
|
6
|
+
|
|
7
|
+
export { CRLF, EOL, LF, detect, format };
|
package/dist/eol.d.mts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const LF: "\n";
|
|
2
|
+
declare const CRLF: "\r\n";
|
|
3
|
+
declare const EOL: "\n" | "\r\n";
|
|
4
|
+
declare const detect: (content: string) => typeof EOL | null;
|
|
5
|
+
declare const format: (content: string, eol: typeof EOL) => string;
|
|
6
|
+
|
|
7
|
+
export { CRLF, EOL, LF, detect, format };
|
package/dist/eol.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const LF: "\n";
|
|
2
|
+
declare const CRLF: "\r\n";
|
|
3
|
+
declare const EOL: "\n" | "\r\n";
|
|
4
|
+
declare const detect: (content: string) => typeof EOL | null;
|
|
5
|
+
declare const format: (content: string, eol: typeof EOL) => string;
|
|
6
|
+
|
|
7
|
+
export { CRLF, EOL, LF, detect, format };
|
|
@@ -7,12 +7,12 @@ const LF = "\n";
|
|
|
7
7
|
const CRLF = "\r\n";
|
|
8
8
|
const EOL = platform === "win32" ? CRLF : LF;
|
|
9
9
|
const detect = /* @__PURE__ */ __name((content) => {
|
|
10
|
-
const
|
|
11
|
-
if (!
|
|
10
|
+
const matched = content.match(regDetect);
|
|
11
|
+
if (!matched || matched.length === 0) {
|
|
12
12
|
return null;
|
|
13
13
|
}
|
|
14
|
-
const crlf =
|
|
15
|
-
const lf =
|
|
14
|
+
const crlf = matched.filter((newline) => newline === CRLF).length;
|
|
15
|
+
const lf = matched.length - crlf;
|
|
16
16
|
return crlf > lf ? CRLF : LF;
|
|
17
17
|
}, "detect");
|
|
18
18
|
const format = /* @__PURE__ */ __name((content, eol) => content.replaceAll(regDetect, eol), "format");
|
package/dist/error.cjs
CHANGED
|
@@ -4,11 +4,11 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
4
4
|
|
|
5
5
|
const AlreadyExistsError = require('./packem_shared/AlreadyExistsError-DpxtwQot.cjs');
|
|
6
6
|
const DirectoryError = require('./packem_shared/DirectoryError-D8FHcAqu.cjs');
|
|
7
|
-
const JSONError = require('./packem_shared/JSONError-
|
|
7
|
+
const JSONError = require('./packem_shared/JSONError-5-wHnrxX.cjs');
|
|
8
8
|
const NotEmptyError = require('./packem_shared/NotEmptyError-BCS_5pPt.cjs');
|
|
9
9
|
const NotFoundError = require('./packem_shared/NotFoundError-B_1nPl3K.cjs');
|
|
10
10
|
const PermissionError = require('./packem_shared/PermissionError-QFMKgk2l.cjs');
|
|
11
|
-
const WalkError = require('./packem_shared/WalkError-
|
|
11
|
+
const WalkError = require('./packem_shared/WalkError-B4-yr8Kk.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
package/dist/error.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as AlreadyExistsError } from './packem_shared/AlreadyExistsError-GK7J9fVA.mjs';
|
|
2
2
|
export { default as DirectoryError } from './packem_shared/DirectoryError-DByTWE7t.mjs';
|
|
3
|
-
export { default as JSONError } from './packem_shared/JSONError-
|
|
3
|
+
export { default as JSONError } from './packem_shared/JSONError-CaKt7MhC.mjs';
|
|
4
4
|
export { default as NotEmptyError } from './packem_shared/NotEmptyError-DCXooh5l.mjs';
|
|
5
5
|
export { default as NotFoundError } from './packem_shared/NotFoundError-CUdcC61I.mjs';
|
|
6
6
|
export { default as PermissionError } from './packem_shared/PermissionError-CqGMI9qC.mjs';
|
|
7
|
-
export { default as WalkError } from './packem_shared/WalkError-
|
|
7
|
+
export { default as WalkError } from './packem_shared/WalkError-DvEBTTaj.mjs';
|
package/dist/index.cjs
CHANGED
|
@@ -11,22 +11,22 @@ const ensureLink = require('./packem_shared/ensureLink-CrxLNmHE.cjs');
|
|
|
11
11
|
const ensureLinkSync = require('./packem_shared/ensureLinkSync-D8uMqLh4.cjs');
|
|
12
12
|
const ensureSymlink = require('./packem_shared/ensureSymlink-D_ieOVYa.cjs');
|
|
13
13
|
const ensureSymlinkSync = require('./packem_shared/ensureSymlinkSync-DTMvUYZD.cjs');
|
|
14
|
-
const
|
|
15
|
-
const collect = require('./packem_shared/collect-
|
|
16
|
-
const collectSync = require('./packem_shared/collectSync-
|
|
14
|
+
const eol = require('./eol.cjs');
|
|
15
|
+
const collect = require('./packem_shared/collect-DnfQeSOL.cjs');
|
|
16
|
+
const collectSync = require('./packem_shared/collectSync-D4vym4QD.cjs');
|
|
17
17
|
const findUp = require('./packem_shared/findUp-DVIYN2wV.cjs');
|
|
18
18
|
const findUpSync = require('./packem_shared/findUpSync-BOiVyUOx.cjs');
|
|
19
|
-
const walk = require('./packem_shared/walk-
|
|
20
|
-
const walkSync = require('./packem_shared/walkSync-
|
|
19
|
+
const walk = require('./packem_shared/walk-CI3ygmrw.cjs');
|
|
20
|
+
const walkSync = require('./packem_shared/walkSync-oXkmn9ZA.cjs');
|
|
21
21
|
const isAccessible = require('./packem_shared/isAccessible-ZNVGsSb7.cjs');
|
|
22
22
|
const isAccessibleSync = require('./packem_shared/isAccessibleSync-VWjQa-US.cjs');
|
|
23
23
|
const move = require('./packem_shared/move-Dh925GL9.cjs');
|
|
24
24
|
const readFile = require('./packem_shared/readFile-iFUhZHnh.cjs');
|
|
25
25
|
const readFileSync = require('./packem_shared/readFileSync-B3NTOR-W.cjs');
|
|
26
|
-
const readJson = require('./packem_shared/readJson-
|
|
27
|
-
const readJsonSync = require('./packem_shared/readJsonSync-
|
|
26
|
+
const readJson = require('./packem_shared/readJson-CEBHyuYq.cjs');
|
|
27
|
+
const readJsonSync = require('./packem_shared/readJsonSync-B22hej0y.cjs');
|
|
28
28
|
const emptyDir = require('./packem_shared/emptyDir-DcCfiNcf.cjs');
|
|
29
|
-
const emptyDirSync = require('./packem_shared/emptyDirSync-
|
|
29
|
+
const emptyDirSync = require('./packem_shared/emptyDirSync-BWA4n6TB.cjs');
|
|
30
30
|
const remove = require('./packem_shared/remove-BpDiVPns.cjs');
|
|
31
31
|
const removeSync = require('./packem_shared/removeSync-BosXW624.cjs');
|
|
32
32
|
const writeFile = require('./packem_shared/writeFile-DgCFRCe5.cjs');
|
|
@@ -49,11 +49,11 @@ exports.ensureLink = ensureLink;
|
|
|
49
49
|
exports.ensureLinkSync = ensureLinkSync;
|
|
50
50
|
exports.ensureSymlink = ensureSymlink;
|
|
51
51
|
exports.ensureSymlinkSync = ensureSymlinkSync;
|
|
52
|
-
exports.CRLF =
|
|
53
|
-
exports.EOL =
|
|
54
|
-
exports.LF =
|
|
55
|
-
exports.detect =
|
|
56
|
-
exports.format =
|
|
52
|
+
exports.CRLF = eol.CRLF;
|
|
53
|
+
exports.EOL = eol.EOL;
|
|
54
|
+
exports.LF = eol.LF;
|
|
55
|
+
exports.detect = eol.detect;
|
|
56
|
+
exports.format = eol.format;
|
|
57
57
|
exports.collect = collect;
|
|
58
58
|
exports.collectSync = collectSync;
|
|
59
59
|
exports.findUp = findUp;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { W as WalkOptions, F as FindUpName, a as FindUpOptions, b as FindUpNameSync, c as WalkEntry, R as ReadFileOptions, C as ContentType, d as ReadJsonOptions, J as JsonReviver,
|
|
2
|
-
export {
|
|
1
|
+
import { W as WalkOptions, F as FindUpName, a as FindUpOptions, b as FindUpNameSync, c as WalkEntry, R as ReadFileOptions, C as ContentType, d as ReadJsonOptions, J as JsonReviver, e as RetryOptions, f as WriteFileOptions, g as WriteJsonOptions } from './packem_shared/types-BaMGfHdp.cjs';
|
|
2
|
+
export { l as CodeFrameLocation, m as CodeFrameOptions, i as FIND_UP_STOP, h as F_OK, n as FindUpNameFnResult, o as FindUpNameSyncFnResult, p as JsonReplacer, j as R_OK, q as ReadFileEncoding, k as W_OK, X as X_OK } from './packem_shared/types-BaMGfHdp.cjs';
|
|
3
3
|
import { symlink } from 'node:fs';
|
|
4
|
+
export { CRLF, EOL, LF, detect, format } from './eol.cjs';
|
|
4
5
|
import { brotliDecompress, unzip, brotliDecompressSync, unzipSync } from 'node:zlib';
|
|
5
6
|
import { J as JsonValue } from './packem_shared/observable-like.d-BlD8q22s.cjs';
|
|
6
7
|
import 'yaml';
|
|
@@ -21,12 +22,6 @@ declare const ensureSymlink: (target: URL | string, linkName: URL | string, type
|
|
|
21
22
|
|
|
22
23
|
declare const ensureSymlinkSync: (target: URL | string, linkName: URL | string, type?: symlink.Type) => void;
|
|
23
24
|
|
|
24
|
-
declare const LF: "\n";
|
|
25
|
-
declare const CRLF: "\r\n";
|
|
26
|
-
declare const EOL: "\n" | "\r\n";
|
|
27
|
-
declare const detect: (content: string) => typeof EOL | null;
|
|
28
|
-
declare const format: (content: string, eol: typeof EOL) => string;
|
|
29
|
-
|
|
30
25
|
declare const collect: (directory: string, options?: WalkOptions) => Promise<string[]>;
|
|
31
26
|
|
|
32
27
|
declare const collectSync: (directory: string, options?: WalkOptions) => string[];
|
|
@@ -75,19 +70,13 @@ declare function readJson<T extends JsonValue>(path: URL | string, reviver: Json
|
|
|
75
70
|
declare function readJsonSync<T extends JsonValue>(path: URL | string, options?: ReadJsonOptions): T;
|
|
76
71
|
declare function readJsonSync<T extends JsonValue>(path: URL | string, reviver: JsonReviver, options?: ReadJsonOptions): T;
|
|
77
72
|
|
|
78
|
-
declare const emptyDir
|
|
73
|
+
declare const emptyDir: (dir: URL | string, options?: RetryOptions) => Promise<void>;
|
|
79
74
|
|
|
80
|
-
declare const
|
|
75
|
+
declare const emptyDirSync: (dir: URL | string, options?: RetryOptions) => void;
|
|
81
76
|
|
|
82
|
-
declare const remove: (path: URL | string, options?:
|
|
83
|
-
maxRetries?: number | undefined;
|
|
84
|
-
retryDelay?: number | undefined;
|
|
85
|
-
}) => Promise<void>;
|
|
77
|
+
declare const remove: (path: URL | string, options?: RetryOptions) => Promise<void>;
|
|
86
78
|
|
|
87
|
-
declare const removeSync: (path: URL | string, options?:
|
|
88
|
-
maxRetries?: number | undefined;
|
|
89
|
-
retryDelay?: number | undefined;
|
|
90
|
-
}) => void;
|
|
79
|
+
declare const removeSync: (path: URL | string, options?: RetryOptions) => void;
|
|
91
80
|
|
|
92
81
|
declare const writeFile: (path: URL | string, content: ArrayBuffer | ArrayBufferView | string, options?: WriteFileOptions) => Promise<void>;
|
|
93
82
|
|
|
@@ -97,4 +86,4 @@ declare const writeJson: (path: URL | string, data: unknown, options?: WriteJson
|
|
|
97
86
|
|
|
98
87
|
declare const writeJsonSync: (path: URL | string, data: unknown, options?: WriteJsonOptions) => void;
|
|
99
88
|
|
|
100
|
-
export {
|
|
89
|
+
export { ContentType, FindUpName, FindUpNameSync, FindUpOptions, JsonReviver, type Options as MoveOptions, ReadFileOptions, ReadJsonOptions, WalkEntry, WalkOptions, WriteFileOptions, WriteJsonOptions, collect, collectSync, emptyDir, emptyDirSync, ensureDir, ensureDirSync, ensureFile, ensureFileSync, ensureLink, ensureLinkSync, ensureSymlink, ensureSymlinkSync, findUp, findUpSync, isAccessible, isAccessibleSync, move, moveSync, readFile, readFileSync, readJson, readJsonSync, remove, removeSync, rename, renameSync, walk, walkSync, writeFile, writeFileSync, writeJson, writeJsonSync };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { W as WalkOptions, F as FindUpName, a as FindUpOptions, b as FindUpNameSync, c as WalkEntry, R as ReadFileOptions, C as ContentType, d as ReadJsonOptions, J as JsonReviver,
|
|
2
|
-
export {
|
|
1
|
+
import { W as WalkOptions, F as FindUpName, a as FindUpOptions, b as FindUpNameSync, c as WalkEntry, R as ReadFileOptions, C as ContentType, d as ReadJsonOptions, J as JsonReviver, e as RetryOptions, f as WriteFileOptions, g as WriteJsonOptions } from './packem_shared/types-BaMGfHdp.mjs';
|
|
2
|
+
export { l as CodeFrameLocation, m as CodeFrameOptions, i as FIND_UP_STOP, h as F_OK, n as FindUpNameFnResult, o as FindUpNameSyncFnResult, p as JsonReplacer, j as R_OK, q as ReadFileEncoding, k as W_OK, X as X_OK } from './packem_shared/types-BaMGfHdp.mjs';
|
|
3
3
|
import { symlink } from 'node:fs';
|
|
4
|
+
export { CRLF, EOL, LF, detect, format } from './eol.mjs';
|
|
4
5
|
import { brotliDecompress, unzip, brotliDecompressSync, unzipSync } from 'node:zlib';
|
|
5
6
|
import { J as JsonValue } from './packem_shared/observable-like.d-BlD8q22s.mjs';
|
|
6
7
|
import 'yaml';
|
|
@@ -21,12 +22,6 @@ declare const ensureSymlink: (target: URL | string, linkName: URL | string, type
|
|
|
21
22
|
|
|
22
23
|
declare const ensureSymlinkSync: (target: URL | string, linkName: URL | string, type?: symlink.Type) => void;
|
|
23
24
|
|
|
24
|
-
declare const LF: "\n";
|
|
25
|
-
declare const CRLF: "\r\n";
|
|
26
|
-
declare const EOL: "\n" | "\r\n";
|
|
27
|
-
declare const detect: (content: string) => typeof EOL | null;
|
|
28
|
-
declare const format: (content: string, eol: typeof EOL) => string;
|
|
29
|
-
|
|
30
25
|
declare const collect: (directory: string, options?: WalkOptions) => Promise<string[]>;
|
|
31
26
|
|
|
32
27
|
declare const collectSync: (directory: string, options?: WalkOptions) => string[];
|
|
@@ -75,19 +70,13 @@ declare function readJson<T extends JsonValue>(path: URL | string, reviver: Json
|
|
|
75
70
|
declare function readJsonSync<T extends JsonValue>(path: URL | string, options?: ReadJsonOptions): T;
|
|
76
71
|
declare function readJsonSync<T extends JsonValue>(path: URL | string, reviver: JsonReviver, options?: ReadJsonOptions): T;
|
|
77
72
|
|
|
78
|
-
declare const emptyDir
|
|
73
|
+
declare const emptyDir: (dir: URL | string, options?: RetryOptions) => Promise<void>;
|
|
79
74
|
|
|
80
|
-
declare const
|
|
75
|
+
declare const emptyDirSync: (dir: URL | string, options?: RetryOptions) => void;
|
|
81
76
|
|
|
82
|
-
declare const remove: (path: URL | string, options?:
|
|
83
|
-
maxRetries?: number | undefined;
|
|
84
|
-
retryDelay?: number | undefined;
|
|
85
|
-
}) => Promise<void>;
|
|
77
|
+
declare const remove: (path: URL | string, options?: RetryOptions) => Promise<void>;
|
|
86
78
|
|
|
87
|
-
declare const removeSync: (path: URL | string, options?:
|
|
88
|
-
maxRetries?: number | undefined;
|
|
89
|
-
retryDelay?: number | undefined;
|
|
90
|
-
}) => void;
|
|
79
|
+
declare const removeSync: (path: URL | string, options?: RetryOptions) => void;
|
|
91
80
|
|
|
92
81
|
declare const writeFile: (path: URL | string, content: ArrayBuffer | ArrayBufferView | string, options?: WriteFileOptions) => Promise<void>;
|
|
93
82
|
|
|
@@ -97,4 +86,4 @@ declare const writeJson: (path: URL | string, data: unknown, options?: WriteJson
|
|
|
97
86
|
|
|
98
87
|
declare const writeJsonSync: (path: URL | string, data: unknown, options?: WriteJsonOptions) => void;
|
|
99
88
|
|
|
100
|
-
export {
|
|
89
|
+
export { ContentType, FindUpName, FindUpNameSync, FindUpOptions, JsonReviver, type Options as MoveOptions, ReadFileOptions, ReadJsonOptions, WalkEntry, WalkOptions, WriteFileOptions, WriteJsonOptions, collect, collectSync, emptyDir, emptyDirSync, ensureDir, ensureDirSync, ensureFile, ensureFileSync, ensureLink, ensureLinkSync, ensureSymlink, ensureSymlinkSync, findUp, findUpSync, isAccessible, isAccessibleSync, move, moveSync, readFile, readFileSync, readJson, readJsonSync, remove, removeSync, rename, renameSync, walk, walkSync, writeFile, writeFileSync, writeJson, writeJsonSync };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { W as WalkOptions, F as FindUpName, a as FindUpOptions, b as FindUpNameSync, c as WalkEntry, R as ReadFileOptions, C as ContentType, d as ReadJsonOptions, J as JsonReviver,
|
|
2
|
-
export {
|
|
1
|
+
import { W as WalkOptions, F as FindUpName, a as FindUpOptions, b as FindUpNameSync, c as WalkEntry, R as ReadFileOptions, C as ContentType, d as ReadJsonOptions, J as JsonReviver, e as RetryOptions, f as WriteFileOptions, g as WriteJsonOptions } from './packem_shared/types-BaMGfHdp.js';
|
|
2
|
+
export { l as CodeFrameLocation, m as CodeFrameOptions, i as FIND_UP_STOP, h as F_OK, n as FindUpNameFnResult, o as FindUpNameSyncFnResult, p as JsonReplacer, j as R_OK, q as ReadFileEncoding, k as W_OK, X as X_OK } from './packem_shared/types-BaMGfHdp.js';
|
|
3
3
|
import { symlink } from 'node:fs';
|
|
4
|
+
export { CRLF, EOL, LF, detect, format } from './eol.js';
|
|
4
5
|
import { brotliDecompress, unzip, brotliDecompressSync, unzipSync } from 'node:zlib';
|
|
5
6
|
import { J as JsonValue } from './packem_shared/observable-like.d-BlD8q22s.js';
|
|
6
7
|
import 'yaml';
|
|
@@ -21,12 +22,6 @@ declare const ensureSymlink: (target: URL | string, linkName: URL | string, type
|
|
|
21
22
|
|
|
22
23
|
declare const ensureSymlinkSync: (target: URL | string, linkName: URL | string, type?: symlink.Type) => void;
|
|
23
24
|
|
|
24
|
-
declare const LF: "\n";
|
|
25
|
-
declare const CRLF: "\r\n";
|
|
26
|
-
declare const EOL: "\n" | "\r\n";
|
|
27
|
-
declare const detect: (content: string) => typeof EOL | null;
|
|
28
|
-
declare const format: (content: string, eol: typeof EOL) => string;
|
|
29
|
-
|
|
30
25
|
declare const collect: (directory: string, options?: WalkOptions) => Promise<string[]>;
|
|
31
26
|
|
|
32
27
|
declare const collectSync: (directory: string, options?: WalkOptions) => string[];
|
|
@@ -75,19 +70,13 @@ declare function readJson<T extends JsonValue>(path: URL | string, reviver: Json
|
|
|
75
70
|
declare function readJsonSync<T extends JsonValue>(path: URL | string, options?: ReadJsonOptions): T;
|
|
76
71
|
declare function readJsonSync<T extends JsonValue>(path: URL | string, reviver: JsonReviver, options?: ReadJsonOptions): T;
|
|
77
72
|
|
|
78
|
-
declare const emptyDir
|
|
73
|
+
declare const emptyDir: (dir: URL | string, options?: RetryOptions) => Promise<void>;
|
|
79
74
|
|
|
80
|
-
declare const
|
|
75
|
+
declare const emptyDirSync: (dir: URL | string, options?: RetryOptions) => void;
|
|
81
76
|
|
|
82
|
-
declare const remove: (path: URL | string, options?:
|
|
83
|
-
maxRetries?: number | undefined;
|
|
84
|
-
retryDelay?: number | undefined;
|
|
85
|
-
}) => Promise<void>;
|
|
77
|
+
declare const remove: (path: URL | string, options?: RetryOptions) => Promise<void>;
|
|
86
78
|
|
|
87
|
-
declare const removeSync: (path: URL | string, options?:
|
|
88
|
-
maxRetries?: number | undefined;
|
|
89
|
-
retryDelay?: number | undefined;
|
|
90
|
-
}) => void;
|
|
79
|
+
declare const removeSync: (path: URL | string, options?: RetryOptions) => void;
|
|
91
80
|
|
|
92
81
|
declare const writeFile: (path: URL | string, content: ArrayBuffer | ArrayBufferView | string, options?: WriteFileOptions) => Promise<void>;
|
|
93
82
|
|
|
@@ -97,4 +86,4 @@ declare const writeJson: (path: URL | string, data: unknown, options?: WriteJson
|
|
|
97
86
|
|
|
98
87
|
declare const writeJsonSync: (path: URL | string, data: unknown, options?: WriteJsonOptions) => void;
|
|
99
88
|
|
|
100
|
-
export {
|
|
89
|
+
export { ContentType, FindUpName, FindUpNameSync, FindUpOptions, JsonReviver, type Options as MoveOptions, ReadFileOptions, ReadJsonOptions, WalkEntry, WalkOptions, WriteFileOptions, WriteJsonOptions, collect, collectSync, emptyDir, emptyDirSync, ensureDir, ensureDirSync, ensureFile, ensureFileSync, ensureLink, ensureLinkSync, ensureSymlink, ensureSymlinkSync, findUp, findUpSync, isAccessible, isAccessibleSync, move, moveSync, readFile, readFileSync, readJson, readJsonSync, remove, removeSync, rename, renameSync, walk, walkSync, writeFile, writeFileSync, writeJson, writeJsonSync };
|
package/dist/index.mjs
CHANGED
|
@@ -7,22 +7,22 @@ export { default as ensureLink } from './packem_shared/ensureLink-ChsWDTK5.mjs';
|
|
|
7
7
|
export { default as ensureLinkSync } from './packem_shared/ensureLinkSync-CG-DTUoV.mjs';
|
|
8
8
|
export { default as ensureSymlink } from './packem_shared/ensureSymlink-BwJ_QhzJ.mjs';
|
|
9
9
|
export { default as ensureSymlinkSync } from './packem_shared/ensureSymlinkSync-BamG29QK.mjs';
|
|
10
|
-
export { CRLF, EOL, LF, detect, format } from './
|
|
11
|
-
export { default as collect } from './packem_shared/collect-
|
|
12
|
-
export { default as collectSync } from './packem_shared/collectSync-
|
|
10
|
+
export { CRLF, EOL, LF, detect, format } from './eol.mjs';
|
|
11
|
+
export { default as collect } from './packem_shared/collect-3Paj1Vqw.mjs';
|
|
12
|
+
export { default as collectSync } from './packem_shared/collectSync-DwJLL8SD.mjs';
|
|
13
13
|
export { default as findUp } from './packem_shared/findUp-D5W-MTpT.mjs';
|
|
14
14
|
export { default as findUpSync } from './packem_shared/findUpSync-DL3NPCYg.mjs';
|
|
15
|
-
export { default as walk } from './packem_shared/walk-
|
|
16
|
-
export { default as walkSync } from './packem_shared/walkSync-
|
|
15
|
+
export { default as walk } from './packem_shared/walk-D7YA43g8.mjs';
|
|
16
|
+
export { default as walkSync } from './packem_shared/walkSync-DLTsnwuJ.mjs';
|
|
17
17
|
export { default as isAccessible } from './packem_shared/isAccessible-Bonsm1Ez.mjs';
|
|
18
18
|
export { default as isAccessibleSync } from './packem_shared/isAccessibleSync-3gnUWUwX.mjs';
|
|
19
19
|
export { move, moveSync, rename, renameSync } from './packem_shared/move-DgF7Ul9L.mjs';
|
|
20
20
|
export { default as readFile } from './packem_shared/readFile-b7UBVv17.mjs';
|
|
21
21
|
export { default as readFileSync } from './packem_shared/readFileSync-CkEJBqZB.mjs';
|
|
22
|
-
export { default as readJson } from './packem_shared/readJson-
|
|
23
|
-
export { default as readJsonSync } from './packem_shared/readJsonSync-
|
|
22
|
+
export { default as readJson } from './packem_shared/readJson-Ce9b06cu.mjs';
|
|
23
|
+
export { default as readJsonSync } from './packem_shared/readJsonSync-CkUI9_z5.mjs';
|
|
24
24
|
export { default as emptyDir } from './packem_shared/emptyDir-Dw5xSBox.mjs';
|
|
25
|
-
export { default as emptyDirSync } from './packem_shared/emptyDirSync-
|
|
25
|
+
export { default as emptyDirSync } from './packem_shared/emptyDirSync-DMAaCiC_.mjs';
|
|
26
26
|
export { default as remove } from './packem_shared/remove-B2nxUObP.mjs';
|
|
27
27
|
export { default as removeSync } from './packem_shared/removeSync-C87yepDI.mjs';
|
|
28
28
|
export { default as writeFile } from './packem_shared/writeFile-BZ4JBQxc.mjs';
|
|
@@ -11,6 +11,10 @@ class JSONError extends Error {
|
|
|
11
11
|
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
|
|
12
12
|
name = "JSONError";
|
|
13
13
|
#message;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a new JSONError instance.
|
|
16
|
+
* @param message The primary error message.
|
|
17
|
+
*/
|
|
14
18
|
constructor(message) {
|
|
15
19
|
super();
|
|
16
20
|
this.#message = message;
|
|
@@ -9,6 +9,10 @@ class JSONError extends Error {
|
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
|
|
10
10
|
name = "JSONError";
|
|
11
11
|
#message;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a new JSONError instance.
|
|
14
|
+
* @param message The primary error message.
|
|
15
|
+
*/
|
|
12
16
|
constructor(message) {
|
|
13
17
|
super();
|
|
14
18
|
this.#message = message;
|
|
@@ -8,7 +8,11 @@ class WalkError extends Error {
|
|
|
8
8
|
}
|
|
9
9
|
/** File path of the root that's being walked. */
|
|
10
10
|
root;
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Constructs a new instance.
|
|
13
|
+
* @param cause The underlying error or reason for the walk failure.
|
|
14
|
+
* @param root The root directory path where the walk operation started or encountered the error.
|
|
15
|
+
*/
|
|
12
16
|
constructor(cause, root) {
|
|
13
17
|
super(`${cause instanceof Error ? cause.message : cause} for path "${root}"`);
|
|
14
18
|
this.cause = cause;
|
|
@@ -6,7 +6,11 @@ class WalkError extends Error {
|
|
|
6
6
|
}
|
|
7
7
|
/** File path of the root that's being walked. */
|
|
8
8
|
root;
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Constructs a new instance.
|
|
11
|
+
* @param cause The underlying error or reason for the walk failure.
|
|
12
|
+
* @param root The root directory path where the walk operation started or encountered the error.
|
|
13
|
+
*/
|
|
10
14
|
constructor(cause, root) {
|
|
11
15
|
super(`${cause instanceof Error ? cause.message : cause} for path "${root}"`);
|
|
12
16
|
this.cause = cause;
|
|
@@ -7,7 +7,7 @@ const assertValidFileOrDirectoryPath = require('./assertValidFileOrDirectoryPath
|
|
|
7
7
|
|
|
8
8
|
var __defProp = Object.defineProperty;
|
|
9
9
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
10
|
-
const
|
|
10
|
+
const emptyDirSync = /* @__PURE__ */ __name((dir, options) => {
|
|
11
11
|
assertValidFileOrDirectoryPath(dir);
|
|
12
12
|
if (!node_fs.existsSync(dir)) {
|
|
13
13
|
node_fs.mkdirSync(dir, { recursive: true });
|
|
@@ -16,6 +16,6 @@ const emptyDir = /* @__PURE__ */ __name((dir, options) => {
|
|
|
16
16
|
for (const item of node_fs.readdirSync(dir)) {
|
|
17
17
|
node_fs.rmSync(path.join(utils.toPath(dir), item), { ...options, force: true, recursive: true });
|
|
18
18
|
}
|
|
19
|
-
}, "
|
|
19
|
+
}, "emptyDirSync");
|
|
20
20
|
|
|
21
|
-
module.exports =
|
|
21
|
+
module.exports = emptyDirSync;
|
|
@@ -5,7 +5,7 @@ import assertValidFileOrDirectoryPath from './assertValidFileOrDirectoryPath-BWW
|
|
|
5
5
|
|
|
6
6
|
var __defProp = Object.defineProperty;
|
|
7
7
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
-
const
|
|
8
|
+
const emptyDirSync = /* @__PURE__ */ __name((dir, options) => {
|
|
9
9
|
assertValidFileOrDirectoryPath(dir);
|
|
10
10
|
if (!existsSync(dir)) {
|
|
11
11
|
mkdirSync(dir, { recursive: true });
|
|
@@ -14,6 +14,6 @@ const emptyDir = /* @__PURE__ */ __name((dir, options) => {
|
|
|
14
14
|
for (const item of readdirSync(dir)) {
|
|
15
15
|
rmSync(join(toPath(dir), item), { ...options, force: true, recursive: true });
|
|
16
16
|
}
|
|
17
|
-
}, "
|
|
17
|
+
}, "emptyDirSync");
|
|
18
18
|
|
|
19
|
-
export {
|
|
19
|
+
export { emptyDirSync as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const JSONError = require('./JSONError-
|
|
3
|
+
const JSONError = require('./JSONError-5-wHnrxX.cjs');
|
|
4
4
|
|
|
5
5
|
var __defProp$2 = Object.defineProperty;
|
|
6
6
|
var __name$2 = (target, value) => __defProp$2(target, "name", { value, configurable: true });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const utils = require('@visulima/path/utils');
|
|
4
|
-
const parseJson = require('./parseJson-
|
|
4
|
+
const parseJson = require('./parseJson-LgPGI5ic.cjs');
|
|
5
5
|
const readFile = require('./readFile-iFUhZHnh.cjs');
|
|
6
6
|
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const utils = require('@visulima/path/utils');
|
|
4
|
-
const parseJson = require('./parseJson-
|
|
4
|
+
const parseJson = require('./parseJson-LgPGI5ic.cjs');
|
|
5
5
|
const readFileSync = require('./readFileSync-B3NTOR-W.cjs');
|
|
6
6
|
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PathLike, Dirent } from 'node:fs';
|
|
2
|
-
import { DocumentOptions, ParseOptions, SchemaOptions, ToJSOptions } from 'yaml';
|
|
2
|
+
import { DocumentOptions, ParseOptions, SchemaOptions, ToJSOptions, CreateNodeOptions, ToStringOptions } from 'yaml';
|
|
3
3
|
|
|
4
4
|
declare const F_OK = 0;
|
|
5
5
|
declare const R_OK = 4;
|
|
@@ -75,11 +75,15 @@ type FindUpNameFnResult = PathLike | Promise<PathLike | typeof FIND_UP_STOP> | t
|
|
|
75
75
|
type FindUpName = string[] | string | ((directory: string) => FindUpNameFnResult);
|
|
76
76
|
type FindUpNameSyncFnResult = PathLike | typeof FIND_UP_STOP | undefined;
|
|
77
77
|
type FindUpNameSync = string[] | string | ((directory: string) => FindUpNameSyncFnResult);
|
|
78
|
-
type
|
|
78
|
+
type RetryOptions = {
|
|
79
79
|
maxRetries?: number | undefined;
|
|
80
80
|
retryDelay?: number | undefined;
|
|
81
81
|
};
|
|
82
82
|
type ReadYamlOptions<C> = DocumentOptions & ParseOptions & ReadFileOptions<C> & SchemaOptions & ToJSOptions;
|
|
83
83
|
type YamlReviver = (key: unknown, value: unknown) => unknown;
|
|
84
|
+
type WriteYamlOptions = WriteFileOptions & CreateNodeOptions & DocumentOptions & ParseOptions & SchemaOptions & ToStringOptions & {
|
|
85
|
+
replacer?: YamlReplacer;
|
|
86
|
+
space?: number | string;
|
|
87
|
+
};
|
|
84
88
|
|
|
85
|
-
export { type ContentType as C, type
|
|
89
|
+
export { type ContentType as C, type FindUpName as F, type JsonReviver as J, type ReadFileOptions as R, type WalkOptions as W, X_OK as X, type YamlReviver as Y, type FindUpOptions as a, type FindUpNameSync as b, type WalkEntry as c, type ReadJsonOptions as d, type RetryOptions as e, type WriteFileOptions as f, type WriteJsonOptions as g, F_OK as h, FIND_UP_STOP as i, R_OK as j, W_OK as k, type CodeFrameLocation as l, type CodeFrameOptions as m, type FindUpNameFnResult as n, type FindUpNameSyncFnResult as o, type JsonReplacer as p, type ReadFileEncoding as q, type ReadYamlOptions as r, type WriteYamlOptions as s, type YamlReplacer as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PathLike, Dirent } from 'node:fs';
|
|
2
|
-
import { DocumentOptions, ParseOptions, SchemaOptions, ToJSOptions } from 'yaml';
|
|
2
|
+
import { DocumentOptions, ParseOptions, SchemaOptions, ToJSOptions, CreateNodeOptions, ToStringOptions } from 'yaml';
|
|
3
3
|
|
|
4
4
|
declare const F_OK = 0;
|
|
5
5
|
declare const R_OK = 4;
|
|
@@ -75,11 +75,15 @@ type FindUpNameFnResult = PathLike | Promise<PathLike | typeof FIND_UP_STOP> | t
|
|
|
75
75
|
type FindUpName = string[] | string | ((directory: string) => FindUpNameFnResult);
|
|
76
76
|
type FindUpNameSyncFnResult = PathLike | typeof FIND_UP_STOP | undefined;
|
|
77
77
|
type FindUpNameSync = string[] | string | ((directory: string) => FindUpNameSyncFnResult);
|
|
78
|
-
type
|
|
78
|
+
type RetryOptions = {
|
|
79
79
|
maxRetries?: number | undefined;
|
|
80
80
|
retryDelay?: number | undefined;
|
|
81
81
|
};
|
|
82
82
|
type ReadYamlOptions<C> = DocumentOptions & ParseOptions & ReadFileOptions<C> & SchemaOptions & ToJSOptions;
|
|
83
83
|
type YamlReviver = (key: unknown, value: unknown) => unknown;
|
|
84
|
+
type WriteYamlOptions = WriteFileOptions & CreateNodeOptions & DocumentOptions & ParseOptions & SchemaOptions & ToStringOptions & {
|
|
85
|
+
replacer?: YamlReplacer;
|
|
86
|
+
space?: number | string;
|
|
87
|
+
};
|
|
84
88
|
|
|
85
|
-
export { type ContentType as C, type
|
|
89
|
+
export { type ContentType as C, type FindUpName as F, type JsonReviver as J, type ReadFileOptions as R, type WalkOptions as W, X_OK as X, type YamlReviver as Y, type FindUpOptions as a, type FindUpNameSync as b, type WalkEntry as c, type ReadJsonOptions as d, type RetryOptions as e, type WriteFileOptions as f, type WriteJsonOptions as g, F_OK as h, FIND_UP_STOP as i, R_OK as j, W_OK as k, type CodeFrameLocation as l, type CodeFrameOptions as m, type FindUpNameFnResult as n, type FindUpNameSyncFnResult as o, type JsonReplacer as p, type ReadFileEncoding as q, type ReadYamlOptions as r, type WriteYamlOptions as s, type YamlReplacer as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PathLike, Dirent } from 'node:fs';
|
|
2
|
-
import { DocumentOptions, ParseOptions, SchemaOptions, ToJSOptions } from 'yaml';
|
|
2
|
+
import { DocumentOptions, ParseOptions, SchemaOptions, ToJSOptions, CreateNodeOptions, ToStringOptions } from 'yaml';
|
|
3
3
|
|
|
4
4
|
declare const F_OK = 0;
|
|
5
5
|
declare const R_OK = 4;
|
|
@@ -75,11 +75,15 @@ type FindUpNameFnResult = PathLike | Promise<PathLike | typeof FIND_UP_STOP> | t
|
|
|
75
75
|
type FindUpName = string[] | string | ((directory: string) => FindUpNameFnResult);
|
|
76
76
|
type FindUpNameSyncFnResult = PathLike | typeof FIND_UP_STOP | undefined;
|
|
77
77
|
type FindUpNameSync = string[] | string | ((directory: string) => FindUpNameSyncFnResult);
|
|
78
|
-
type
|
|
78
|
+
type RetryOptions = {
|
|
79
79
|
maxRetries?: number | undefined;
|
|
80
80
|
retryDelay?: number | undefined;
|
|
81
81
|
};
|
|
82
82
|
type ReadYamlOptions<C> = DocumentOptions & ParseOptions & ReadFileOptions<C> & SchemaOptions & ToJSOptions;
|
|
83
83
|
type YamlReviver = (key: unknown, value: unknown) => unknown;
|
|
84
|
+
type WriteYamlOptions = WriteFileOptions & CreateNodeOptions & DocumentOptions & ParseOptions & SchemaOptions & ToStringOptions & {
|
|
85
|
+
replacer?: YamlReplacer;
|
|
86
|
+
space?: number | string;
|
|
87
|
+
};
|
|
84
88
|
|
|
85
|
-
export { type ContentType as C, type
|
|
89
|
+
export { type ContentType as C, type FindUpName as F, type JsonReviver as J, type ReadFileOptions as R, type WalkOptions as W, X_OK as X, type YamlReviver as Y, type FindUpOptions as a, type FindUpNameSync as b, type WalkEntry as c, type ReadJsonOptions as d, type RetryOptions as e, type WriteFileOptions as f, type WriteJsonOptions as g, F_OK as h, FIND_UP_STOP as i, R_OK as j, W_OK as k, type CodeFrameLocation as l, type CodeFrameOptions as m, type FindUpNameFnResult as n, type FindUpNameSyncFnResult as o, type JsonReplacer as p, type ReadFileEncoding as q, type ReadYamlOptions as r, type WriteYamlOptions as s, type YamlReplacer as t };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const promises = require('node:fs/promises');
|
|
4
4
|
const path = require('@visulima/path');
|
|
5
5
|
const utils = require('@visulima/path/utils');
|
|
6
|
-
const WalkError = require('./WalkError-
|
|
6
|
+
const WalkError = require('./WalkError-B4-yr8Kk.cjs');
|
|
7
7
|
const assertValidFileOrDirectoryPath = require('./assertValidFileOrDirectoryPath-BMbgA-eI.cjs');
|
|
8
8
|
const walkInclude = require('./walk-include-yUdRrF16.cjs');
|
|
9
9
|
|