@visulima/fs 1.7.1 → 1.9.0
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 +14 -0
- package/dist/index.cjs +36 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -5
- package/dist/index.d.ts +30 -5
- package/dist/index.js +14 -10
- package/dist/index.js.map +1 -1
- package/dist/{types-npDka8vJ.d.cts → types-HVB0D8On.d.cts} +12 -4
- package/dist/{types-npDka8vJ.d.ts → types-HVB0D8On.d.ts} +12 -4
- package/dist/utils.d.cts +2 -1
- package/dist/utils.d.ts +2 -1
- package/package.json +19 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Dirent } from 'node:fs';
|
|
2
|
+
import { DocumentOptions, ParseOptions, SchemaOptions, ToJSOptions } from 'yaml';
|
|
2
3
|
|
|
3
4
|
declare const F_OK = 0;
|
|
4
5
|
declare const R_OK = 4;
|
|
@@ -56,12 +57,13 @@ type WriteFileOptions = {
|
|
|
56
57
|
overwrite?: boolean;
|
|
57
58
|
recursive?: boolean;
|
|
58
59
|
};
|
|
59
|
-
type JsonReplacer = (this: unknown, key: string, value: unknown) => unknown;
|
|
60
|
+
type JsonReplacer = (number | string)[] | ((this: unknown, key: string, value: unknown) => unknown) | null;
|
|
61
|
+
type YamlReplacer = JsonReplacer;
|
|
60
62
|
type WriteJsonOptions = WriteFileOptions & {
|
|
61
63
|
detectIndent?: boolean;
|
|
62
64
|
indent?: number | string | undefined;
|
|
63
|
-
replacer?:
|
|
64
|
-
stringify?: (data: unknown, replacer: JsonReplacer
|
|
65
|
+
replacer?: JsonReplacer;
|
|
66
|
+
stringify?: (data: unknown, replacer: JsonReplacer, space: number | string | undefined) => string;
|
|
65
67
|
};
|
|
66
68
|
type FindUpOptions = {
|
|
67
69
|
cwd?: URL | string;
|
|
@@ -69,5 +71,11 @@ type FindUpOptions = {
|
|
|
69
71
|
type?: "directory" | "file";
|
|
70
72
|
};
|
|
71
73
|
type Match = string | typeof FIND_UP_STOP | undefined;
|
|
74
|
+
type EmptyDirOptions = {
|
|
75
|
+
maxRetries?: number | undefined;
|
|
76
|
+
retryDelay?: number | undefined;
|
|
77
|
+
};
|
|
78
|
+
type ReadYamlOptions<C> = DocumentOptions & ParseOptions & ReadFileOptions<C> & SchemaOptions & ToJSOptions;
|
|
79
|
+
type YamlReviver = (key: unknown, value: unknown) => unknown;
|
|
72
80
|
|
|
73
|
-
export { type ContentType as C, type FindUpOptions as F, type JsonReviver as J, type Match as M, type ReadFileOptions as R, type WalkOptions as W, X_OK as X, type ReadJsonOptions as a, type
|
|
81
|
+
export { type ContentType as C, type EmptyDirOptions as E, type FindUpOptions as F, type JsonReviver as J, type Match as M, type ReadFileOptions as R, type WalkOptions as W, X_OK as X, type YamlReviver as Y, type ReadJsonOptions as a, type ReadYamlOptions as b, type WalkEntry as c, type WriteFileOptions as d, type WriteJsonOptions as e, type YamlReplacer as f, F_OK as g, FIND_UP_STOP as h, R_OK as i, W_OK as j, type CodeFrameLocation as k, type JsonReplacer as l, type ReadFileEncoding as m, type CodeFrameOptions as n };
|
package/dist/utils.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { J as JSONError } from './json-error-UVjLdb7z.cjs';
|
|
2
2
|
import { JsonValue } from 'type-fest';
|
|
3
|
-
import {
|
|
3
|
+
import { n as CodeFrameOptions, J as JsonReviver } from './types-HVB0D8On.cjs';
|
|
4
4
|
import 'node:fs';
|
|
5
|
+
import 'yaml';
|
|
5
6
|
|
|
6
7
|
declare function parseJson<T = JsonValue>(string: string, filename?: string, options?: CodeFrameOptions): T;
|
|
7
8
|
declare function parseJson<T = JsonValue>(string: string, reviver: JsonReviver, fileName?: string, options?: CodeFrameOptions): T;
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { J as JSONError } from './json-error-UVjLdb7z.js';
|
|
2
2
|
import { JsonValue } from 'type-fest';
|
|
3
|
-
import {
|
|
3
|
+
import { n as CodeFrameOptions, J as JsonReviver } from './types-HVB0D8On.js';
|
|
4
4
|
import 'node:fs';
|
|
5
|
+
import 'yaml';
|
|
5
6
|
|
|
6
7
|
declare function parseJson<T = JsonValue>(string: string, filename?: string, options?: CodeFrameOptions): T;
|
|
7
8
|
declare function parseJson<T = JsonValue>(string: string, reviver: JsonReviver, fileName?: string, options?: CodeFrameOptions): T;
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/fs",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "Human friendly file system utilities for Node.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
7
|
+
"detect-newline",
|
|
7
8
|
"dir",
|
|
8
9
|
"directory",
|
|
10
|
+
"eol",
|
|
11
|
+
"empty-dir",
|
|
9
12
|
"file",
|
|
10
13
|
"files",
|
|
11
14
|
"filesystem",
|
|
@@ -26,9 +29,12 @@
|
|
|
26
29
|
"path",
|
|
27
30
|
"read",
|
|
28
31
|
"read-file",
|
|
32
|
+
"read-yaml",
|
|
29
33
|
"resolve",
|
|
30
34
|
"safe",
|
|
31
35
|
"search",
|
|
36
|
+
"std",
|
|
37
|
+
"standard",
|
|
32
38
|
"up",
|
|
33
39
|
"visulima",
|
|
34
40
|
"walk",
|
|
@@ -36,7 +42,8 @@
|
|
|
36
42
|
"write",
|
|
37
43
|
"write-dir",
|
|
38
44
|
"write-file",
|
|
39
|
-
"write-safe"
|
|
45
|
+
"write-safe",
|
|
46
|
+
"yaml"
|
|
40
47
|
],
|
|
41
48
|
"homepage": "https://www.visulima.com/docs/package/fs",
|
|
42
49
|
"repository": {
|
|
@@ -151,7 +158,16 @@
|
|
|
151
158
|
"tempy": "^3.1.0",
|
|
152
159
|
"tsup": "^8.0.2",
|
|
153
160
|
"typescript": "^5.4.2",
|
|
154
|
-
"vitest": "^1.4.0"
|
|
161
|
+
"vitest": "^1.4.0",
|
|
162
|
+
"yaml": "^2.4.1"
|
|
163
|
+
},
|
|
164
|
+
"peerDependencies": {
|
|
165
|
+
"yaml": "^2.4.0"
|
|
166
|
+
},
|
|
167
|
+
"peerDependenciesMeta": {
|
|
168
|
+
"yaml": {
|
|
169
|
+
"optional": true
|
|
170
|
+
}
|
|
155
171
|
},
|
|
156
172
|
"engines": {
|
|
157
173
|
"node": ">=18.* <=21.*"
|