@visulima/fs 2.3.7 → 3.0.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 +31 -0
- package/README.md +1531 -1166
- package/dist/index.cjs +4 -12
- package/dist/index.d.cts +11 -24
- package/dist/index.d.mts +11 -24
- package/dist/index.d.ts +11 -24
- package/dist/index.mjs +4 -8
- package/dist/packem_shared/observable-like.d-BlD8q22s.d.cts +40 -0
- package/dist/packem_shared/observable-like.d-BlD8q22s.d.mjs +40 -0
- package/dist/packem_shared/observable-like.d-BlD8q22s.d.mts +40 -0
- package/dist/packem_shared/{observable-like.d-CJo2GVD9.d.cts → types-CiwAWOQj.d.cts} +1 -40
- package/dist/packem_shared/{observable-like.d-CJo2GVD9.d.mjs → types-CiwAWOQj.d.mjs} +1 -40
- package/dist/packem_shared/{observable-like.d-CJo2GVD9.d.mts → types-CiwAWOQj.d.mts} +1 -40
- package/dist/packem_shared/{writeFile-DKu5-M8x.cjs → writeFile-CnWc2ZOW.cjs} +3 -3
- package/dist/packem_shared/{writeFile-B7dhfseN.mjs → writeFile-CzpkxDqy.mjs} +3 -3
- package/dist/packem_shared/{writeFileSync-mMGYqOc8.mjs → writeFileSync-DYRpumrj.mjs} +3 -3
- package/dist/packem_shared/{writeFileSync-Db6pmY0q.cjs → writeFileSync-da4qD9Nz.cjs} +3 -3
- package/dist/packem_shared/{writeJson-DtnnjTix.cjs → writeJson-9_C3v2B3.cjs} +1 -1
- package/dist/packem_shared/{writeJson-BSQE2uFN.mjs → writeJson-V9KBXfw2.mjs} +1 -1
- package/dist/packem_shared/{writeJsonSync-Dz5-B2PD.cjs → writeJsonSync-C5kkxqE7.cjs} +1 -1
- package/dist/packem_shared/{writeJsonSync-C_i6LsGT.mjs → writeJsonSync-CyaXNy3X.mjs} +1 -1
- package/dist/packem_shared/{writeYaml-B-KoZN0E.cjs → writeYaml-DDLK7NDr.cjs} +1 -1
- package/dist/packem_shared/{writeYaml-DSTzKc0_.mjs → writeYaml-DJ17fqNj.mjs} +1 -1
- package/dist/packem_shared/{writeYamlSync-agxYIea0.mjs → writeYamlSync-C6nrcP2e.mjs} +1 -1
- package/dist/packem_shared/{writeYamlSync-D6borSP1.cjs → writeYamlSync-DST-W6N7.cjs} +1 -1
- package/dist/utils.d.cts +2 -1
- package/dist/utils.d.mts +2 -1
- package/dist/utils.d.ts +2 -1
- package/dist/yaml.cjs +15 -0
- package/dist/yaml.d.cts +19 -0
- package/dist/yaml.d.mts +19 -0
- package/dist/yaml.d.ts +19 -0
- package/dist/yaml.mjs +4 -0
- package/package.json +21 -73
package/dist/index.cjs
CHANGED
|
@@ -25,18 +25,14 @@ const readFile = require('./packem_shared/readFile-iFUhZHnh.cjs');
|
|
|
25
25
|
const readFileSync = require('./packem_shared/readFileSync-B3NTOR-W.cjs');
|
|
26
26
|
const readJson = require('./packem_shared/readJson-JrCHMN3m.cjs');
|
|
27
27
|
const readJsonSync = require('./packem_shared/readJsonSync-o_MAOlUv.cjs');
|
|
28
|
-
const readYaml = require('./packem_shared/readYaml-sR4bqUel.cjs');
|
|
29
|
-
const readYamlSync = require('./packem_shared/readYamlSync-C3oOzxiN.cjs');
|
|
30
28
|
const emptyDir = require('./packem_shared/emptyDir-DcCfiNcf.cjs');
|
|
31
29
|
const emptyDirSync = require('./packem_shared/emptyDirSync-BoknkGUe.cjs');
|
|
32
30
|
const remove = require('./packem_shared/remove-BpDiVPns.cjs');
|
|
33
31
|
const removeSync = require('./packem_shared/removeSync-BosXW624.cjs');
|
|
34
|
-
const writeFile = require('./packem_shared/writeFile-
|
|
35
|
-
const writeFileSync = require('./packem_shared/writeFileSync-
|
|
36
|
-
const writeJson = require('./packem_shared/writeJson-
|
|
37
|
-
const writeJsonSync = require('./packem_shared/writeJsonSync-
|
|
38
|
-
const writeYaml = require('./packem_shared/writeYaml-B-KoZN0E.cjs');
|
|
39
|
-
const writeYamlSync = require('./packem_shared/writeYamlSync-D6borSP1.cjs');
|
|
32
|
+
const writeFile = require('./packem_shared/writeFile-CnWc2ZOW.cjs');
|
|
33
|
+
const writeFileSync = require('./packem_shared/writeFileSync-da4qD9Nz.cjs');
|
|
34
|
+
const writeJson = require('./packem_shared/writeJson-9_C3v2B3.cjs');
|
|
35
|
+
const writeJsonSync = require('./packem_shared/writeJsonSync-C5kkxqE7.cjs');
|
|
40
36
|
|
|
41
37
|
|
|
42
38
|
|
|
@@ -74,8 +70,6 @@ exports.readFile = readFile;
|
|
|
74
70
|
exports.readFileSync = readFileSync;
|
|
75
71
|
exports.readJson = readJson;
|
|
76
72
|
exports.readJsonSync = readJsonSync;
|
|
77
|
-
exports.readYaml = readYaml;
|
|
78
|
-
exports.readYamlSync = readYamlSync;
|
|
79
73
|
exports.emptyDir = emptyDir;
|
|
80
74
|
exports.emptyDirSync = emptyDirSync;
|
|
81
75
|
exports.remove = remove;
|
|
@@ -84,5 +78,3 @@ exports.writeFile = writeFile;
|
|
|
84
78
|
exports.writeFileSync = writeFileSync;
|
|
85
79
|
exports.writeJson = writeJson;
|
|
86
80
|
exports.writeJsonSync = writeJsonSync;
|
|
87
|
-
exports.writeYaml = writeYaml;
|
|
88
|
-
exports.writeYamlSync = writeYamlSync;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { W as WalkOptions, F as FindUpName, a as FindUpOptions, b as FindUpNameSync, c as WalkEntry, R as ReadFileOptions, C as ContentType,
|
|
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 EmptyDirOptions, e as WriteFileOptions, f as WriteJsonOptions } from './packem_shared/types-CiwAWOQj.cjs';
|
|
2
|
+
export { k as CodeFrameLocation, h as FIND_UP_STOP, g as F_OK, l as FindUpNameFnResult, m as FindUpNameSyncFnResult, n as JsonReplacer, i as R_OK, o as ReadFileEncoding, j as W_OK, X as X_OK } from './packem_shared/types-CiwAWOQj.cjs';
|
|
3
3
|
import { symlink } from 'node:fs';
|
|
4
4
|
import { brotliDecompress, unzip, brotliDecompressSync, unzipSync } from 'node:zlib';
|
|
5
|
-
import {
|
|
5
|
+
import { J as JsonValue } from './packem_shared/observable-like.d-BlD8q22s.cjs';
|
|
6
|
+
import 'yaml';
|
|
6
7
|
|
|
7
8
|
declare const ensureDir: (directory: URL | string) => Promise<void>;
|
|
8
9
|
|
|
@@ -43,16 +44,16 @@ declare function isAccessible(path: URL | string, mode?: number): Promise<boolea
|
|
|
43
44
|
declare function isAccessibleSync(path: URL | string, mode?: number): boolean;
|
|
44
45
|
|
|
45
46
|
type FilePermissions = number;
|
|
46
|
-
type Options
|
|
47
|
+
type Options = {
|
|
47
48
|
cwd?: URL | string;
|
|
48
49
|
readonly directoryMode?: FilePermissions;
|
|
49
50
|
readonly overwrite?: boolean;
|
|
50
51
|
};
|
|
51
52
|
|
|
52
|
-
declare const move: (sourcePath: string, destinationPath: string, options?: Options
|
|
53
|
-
declare const moveSync: (sourcePath: string, destinationPath: string, options?: Options
|
|
54
|
-
declare const rename: (source: string, destination: string, options?: Options
|
|
55
|
-
declare const renameSync: (source: string, destination: string, options?: Options
|
|
53
|
+
declare const move: (sourcePath: string, destinationPath: string, options?: Options) => Promise<void>;
|
|
54
|
+
declare const moveSync: (sourcePath: string, destinationPath: string, options?: Options) => void;
|
|
55
|
+
declare const rename: (source: string, destination: string, options?: Options) => Promise<void>;
|
|
56
|
+
declare const renameSync: (source: string, destination: string, options?: Options) => void;
|
|
56
57
|
|
|
57
58
|
declare const decompressionMethods$1: {
|
|
58
59
|
readonly brotli: typeof brotliDecompress;
|
|
@@ -64,7 +65,7 @@ declare const readFile: <O extends ReadFileOptions<keyof typeof decompressionMet
|
|
|
64
65
|
declare const decompressionMethods: {
|
|
65
66
|
readonly brotli: typeof brotliDecompressSync;
|
|
66
67
|
readonly gzip: typeof unzipSync;
|
|
67
|
-
readonly none: (buffer: Buffer) => Buffer
|
|
68
|
+
readonly none: (buffer: Buffer) => Buffer<ArrayBufferLike>;
|
|
68
69
|
};
|
|
69
70
|
declare const readFileSync: <O extends ReadFileOptions<keyof typeof decompressionMethods> | undefined = undefined>(path: URL | string, options?: O) => ContentType<O>;
|
|
70
71
|
|
|
@@ -74,12 +75,6 @@ declare function readJson<T extends JsonValue>(path: URL | string, reviver: Json
|
|
|
74
75
|
declare function readJsonSync<T extends JsonValue>(path: URL | string, options?: ReadJsonOptions): T;
|
|
75
76
|
declare function readJsonSync<T extends JsonValue>(path: URL | string, reviver: JsonReviver, options?: ReadJsonOptions): T;
|
|
76
77
|
|
|
77
|
-
declare function readYaml<R = Record<string, unknown>>(path: URL | string, options?: ReadYamlOptions<"brotli" | "gzip" | "none">): Promise<R>;
|
|
78
|
-
declare function readYaml<R = Record<string, unknown>>(path: URL | string, reviver?: YamlReviver, options?: ReadYamlOptions<"brotli" | "gzip" | "none">): Promise<R>;
|
|
79
|
-
|
|
80
|
-
declare function readYamlSync<R = Record<string, unknown>>(path: URL | string, options?: ReadYamlOptions<"brotli" | "gzip" | "none">): R;
|
|
81
|
-
declare function readYamlSync<R = Record<string, unknown>>(path: URL | string, reviver?: YamlReviver, options?: ReadYamlOptions<"brotli" | "gzip" | "none">): R;
|
|
82
|
-
|
|
83
78
|
declare const emptyDir$1: (dir: URL | string, options?: EmptyDirOptions) => Promise<void>;
|
|
84
79
|
|
|
85
80
|
declare const emptyDir: (dir: URL | string, options?: EmptyDirOptions) => void;
|
|
@@ -102,12 +97,4 @@ declare const writeJson: (path: URL | string, data: unknown, options?: WriteJson
|
|
|
102
97
|
|
|
103
98
|
declare const writeJsonSync: (path: URL | string, data: unknown, options?: WriteJsonOptions) => void;
|
|
104
99
|
|
|
105
|
-
type Options$1
|
|
106
|
-
declare function writeYaml(path: URL | string, data: any, options?: Options$1): Promise<void>;
|
|
107
|
-
declare function writeYaml(path: URL | string, data: any, replacer?: YamlReplacer, options?: Options$1 | number | string): Promise<void>;
|
|
108
|
-
|
|
109
|
-
type Options = CreateNodeOptions & DocumentOptions & ParseOptions & SchemaOptions & ToStringOptions;
|
|
110
|
-
declare function writeYamlSync(path: URL | string, data: any, options?: Options): void;
|
|
111
|
-
declare function writeYamlSync(path: URL | string, data: any, replacer?: YamlReplacer, options?: Options | number | string): void;
|
|
112
|
-
|
|
113
|
-
export { CRLF, EOL, EmptyDirOptions, FindUpName, FindUpNameSync, FindUpOptions, JsonReviver, LF, type Options$2 as MoveOptions, ReadFileOptions, ReadJsonOptions, WalkEntry, WalkOptions, WriteFileOptions, WriteJsonOptions, YamlReplacer, collect, collectSync, detect, emptyDir$1 as emptyDir, emptyDir as emptyDirSync, ensureDir, ensureDirSync, ensureFile, ensureFileSync, ensureLink, ensureLinkSync, ensureSymlink, ensureSymlinkSync, findUp, findUpSync, format, isAccessible, isAccessibleSync, move, moveSync, readFile, readFileSync, readJson, readJsonSync, readYaml, readYamlSync, remove, removeSync, rename, renameSync, walk, walkSync, writeFile, writeFileSync, writeJson, writeJsonSync, writeYaml, writeYamlSync };
|
|
100
|
+
export { CRLF, EOL, EmptyDirOptions, FindUpName, FindUpNameSync, FindUpOptions, JsonReviver, LF, type Options as MoveOptions, ReadFileOptions, ReadJsonOptions, WalkEntry, WalkOptions, WriteFileOptions, WriteJsonOptions, collect, collectSync, detect, emptyDir$1 as emptyDir, emptyDir as emptyDirSync, ensureDir, ensureDirSync, ensureFile, ensureFileSync, ensureLink, ensureLinkSync, ensureSymlink, ensureSymlinkSync, findUp, findUpSync, format, 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,8 +1,9 @@
|
|
|
1
|
-
import { W as WalkOptions, F as FindUpName, a as FindUpOptions, b as FindUpNameSync, c as WalkEntry, R as ReadFileOptions, C as ContentType,
|
|
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 EmptyDirOptions, e as WriteFileOptions, f as WriteJsonOptions } from './packem_shared/types-CiwAWOQj.mjs';
|
|
2
|
+
export { k as CodeFrameLocation, h as FIND_UP_STOP, g as F_OK, l as FindUpNameFnResult, m as FindUpNameSyncFnResult, n as JsonReplacer, i as R_OK, o as ReadFileEncoding, j as W_OK, X as X_OK } from './packem_shared/types-CiwAWOQj.mjs';
|
|
3
3
|
import { symlink } from 'node:fs';
|
|
4
4
|
import { brotliDecompress, unzip, brotliDecompressSync, unzipSync } from 'node:zlib';
|
|
5
|
-
import {
|
|
5
|
+
import { J as JsonValue } from './packem_shared/observable-like.d-BlD8q22s.mjs';
|
|
6
|
+
import 'yaml';
|
|
6
7
|
|
|
7
8
|
declare const ensureDir: (directory: URL | string) => Promise<void>;
|
|
8
9
|
|
|
@@ -43,16 +44,16 @@ declare function isAccessible(path: URL | string, mode?: number): Promise<boolea
|
|
|
43
44
|
declare function isAccessibleSync(path: URL | string, mode?: number): boolean;
|
|
44
45
|
|
|
45
46
|
type FilePermissions = number;
|
|
46
|
-
type Options
|
|
47
|
+
type Options = {
|
|
47
48
|
cwd?: URL | string;
|
|
48
49
|
readonly directoryMode?: FilePermissions;
|
|
49
50
|
readonly overwrite?: boolean;
|
|
50
51
|
};
|
|
51
52
|
|
|
52
|
-
declare const move: (sourcePath: string, destinationPath: string, options?: Options
|
|
53
|
-
declare const moveSync: (sourcePath: string, destinationPath: string, options?: Options
|
|
54
|
-
declare const rename: (source: string, destination: string, options?: Options
|
|
55
|
-
declare const renameSync: (source: string, destination: string, options?: Options
|
|
53
|
+
declare const move: (sourcePath: string, destinationPath: string, options?: Options) => Promise<void>;
|
|
54
|
+
declare const moveSync: (sourcePath: string, destinationPath: string, options?: Options) => void;
|
|
55
|
+
declare const rename: (source: string, destination: string, options?: Options) => Promise<void>;
|
|
56
|
+
declare const renameSync: (source: string, destination: string, options?: Options) => void;
|
|
56
57
|
|
|
57
58
|
declare const decompressionMethods$1: {
|
|
58
59
|
readonly brotli: typeof brotliDecompress;
|
|
@@ -64,7 +65,7 @@ declare const readFile: <O extends ReadFileOptions<keyof typeof decompressionMet
|
|
|
64
65
|
declare const decompressionMethods: {
|
|
65
66
|
readonly brotli: typeof brotliDecompressSync;
|
|
66
67
|
readonly gzip: typeof unzipSync;
|
|
67
|
-
readonly none: (buffer: Buffer) => Buffer
|
|
68
|
+
readonly none: (buffer: Buffer) => Buffer<ArrayBufferLike>;
|
|
68
69
|
};
|
|
69
70
|
declare const readFileSync: <O extends ReadFileOptions<keyof typeof decompressionMethods> | undefined = undefined>(path: URL | string, options?: O) => ContentType<O>;
|
|
70
71
|
|
|
@@ -74,12 +75,6 @@ declare function readJson<T extends JsonValue>(path: URL | string, reviver: Json
|
|
|
74
75
|
declare function readJsonSync<T extends JsonValue>(path: URL | string, options?: ReadJsonOptions): T;
|
|
75
76
|
declare function readJsonSync<T extends JsonValue>(path: URL | string, reviver: JsonReviver, options?: ReadJsonOptions): T;
|
|
76
77
|
|
|
77
|
-
declare function readYaml<R = Record<string, unknown>>(path: URL | string, options?: ReadYamlOptions<"brotli" | "gzip" | "none">): Promise<R>;
|
|
78
|
-
declare function readYaml<R = Record<string, unknown>>(path: URL | string, reviver?: YamlReviver, options?: ReadYamlOptions<"brotli" | "gzip" | "none">): Promise<R>;
|
|
79
|
-
|
|
80
|
-
declare function readYamlSync<R = Record<string, unknown>>(path: URL | string, options?: ReadYamlOptions<"brotli" | "gzip" | "none">): R;
|
|
81
|
-
declare function readYamlSync<R = Record<string, unknown>>(path: URL | string, reviver?: YamlReviver, options?: ReadYamlOptions<"brotli" | "gzip" | "none">): R;
|
|
82
|
-
|
|
83
78
|
declare const emptyDir$1: (dir: URL | string, options?: EmptyDirOptions) => Promise<void>;
|
|
84
79
|
|
|
85
80
|
declare const emptyDir: (dir: URL | string, options?: EmptyDirOptions) => void;
|
|
@@ -102,12 +97,4 @@ declare const writeJson: (path: URL | string, data: unknown, options?: WriteJson
|
|
|
102
97
|
|
|
103
98
|
declare const writeJsonSync: (path: URL | string, data: unknown, options?: WriteJsonOptions) => void;
|
|
104
99
|
|
|
105
|
-
type Options$1
|
|
106
|
-
declare function writeYaml(path: URL | string, data: any, options?: Options$1): Promise<void>;
|
|
107
|
-
declare function writeYaml(path: URL | string, data: any, replacer?: YamlReplacer, options?: Options$1 | number | string): Promise<void>;
|
|
108
|
-
|
|
109
|
-
type Options = CreateNodeOptions & DocumentOptions & ParseOptions & SchemaOptions & ToStringOptions;
|
|
110
|
-
declare function writeYamlSync(path: URL | string, data: any, options?: Options): void;
|
|
111
|
-
declare function writeYamlSync(path: URL | string, data: any, replacer?: YamlReplacer, options?: Options | number | string): void;
|
|
112
|
-
|
|
113
|
-
export { CRLF, EOL, EmptyDirOptions, FindUpName, FindUpNameSync, FindUpOptions, JsonReviver, LF, type Options$2 as MoveOptions, ReadFileOptions, ReadJsonOptions, WalkEntry, WalkOptions, WriteFileOptions, WriteJsonOptions, YamlReplacer, collect, collectSync, detect, emptyDir$1 as emptyDir, emptyDir as emptyDirSync, ensureDir, ensureDirSync, ensureFile, ensureFileSync, ensureLink, ensureLinkSync, ensureSymlink, ensureSymlinkSync, findUp, findUpSync, format, isAccessible, isAccessibleSync, move, moveSync, readFile, readFileSync, readJson, readJsonSync, readYaml, readYamlSync, remove, removeSync, rename, renameSync, walk, walkSync, writeFile, writeFileSync, writeJson, writeJsonSync, writeYaml, writeYamlSync };
|
|
100
|
+
export { CRLF, EOL, EmptyDirOptions, FindUpName, FindUpNameSync, FindUpOptions, JsonReviver, LF, type Options as MoveOptions, ReadFileOptions, ReadJsonOptions, WalkEntry, WalkOptions, WriteFileOptions, WriteJsonOptions, collect, collectSync, detect, emptyDir$1 as emptyDir, emptyDir as emptyDirSync, ensureDir, ensureDirSync, ensureFile, ensureFileSync, ensureLink, ensureLinkSync, ensureSymlink, ensureSymlinkSync, findUp, findUpSync, format, 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,8 +1,9 @@
|
|
|
1
|
-
import { W as WalkOptions, F as FindUpName, a as FindUpOptions, b as FindUpNameSync, c as WalkEntry, R as ReadFileOptions, C as ContentType,
|
|
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 EmptyDirOptions, e as WriteFileOptions, f as WriteJsonOptions } from './packem_shared/types-CiwAWOQj.d.mjs';
|
|
2
|
+
export { k as CodeFrameLocation, h as FIND_UP_STOP, g as F_OK, l as FindUpNameFnResult, m as FindUpNameSyncFnResult, n as JsonReplacer, i as R_OK, o as ReadFileEncoding, j as W_OK, X as X_OK } from './packem_shared/types-CiwAWOQj.d.mjs';
|
|
3
3
|
import { symlink } from 'node:fs';
|
|
4
4
|
import { brotliDecompress, unzip, brotliDecompressSync, unzipSync } from 'node:zlib';
|
|
5
|
-
import {
|
|
5
|
+
import { J as JsonValue } from './packem_shared/observable-like.d-BlD8q22s.d.mjs';
|
|
6
|
+
import 'yaml';
|
|
6
7
|
|
|
7
8
|
declare const ensureDir: (directory: URL | string) => Promise<void>;
|
|
8
9
|
|
|
@@ -43,16 +44,16 @@ declare function isAccessible(path: URL | string, mode?: number): Promise<boolea
|
|
|
43
44
|
declare function isAccessibleSync(path: URL | string, mode?: number): boolean;
|
|
44
45
|
|
|
45
46
|
type FilePermissions = number;
|
|
46
|
-
type Options
|
|
47
|
+
type Options = {
|
|
47
48
|
cwd?: URL | string;
|
|
48
49
|
readonly directoryMode?: FilePermissions;
|
|
49
50
|
readonly overwrite?: boolean;
|
|
50
51
|
};
|
|
51
52
|
|
|
52
|
-
declare const move: (sourcePath: string, destinationPath: string, options?: Options
|
|
53
|
-
declare const moveSync: (sourcePath: string, destinationPath: string, options?: Options
|
|
54
|
-
declare const rename: (source: string, destination: string, options?: Options
|
|
55
|
-
declare const renameSync: (source: string, destination: string, options?: Options
|
|
53
|
+
declare const move: (sourcePath: string, destinationPath: string, options?: Options) => Promise<void>;
|
|
54
|
+
declare const moveSync: (sourcePath: string, destinationPath: string, options?: Options) => void;
|
|
55
|
+
declare const rename: (source: string, destination: string, options?: Options) => Promise<void>;
|
|
56
|
+
declare const renameSync: (source: string, destination: string, options?: Options) => void;
|
|
56
57
|
|
|
57
58
|
declare const decompressionMethods$1: {
|
|
58
59
|
readonly brotli: typeof brotliDecompress;
|
|
@@ -64,7 +65,7 @@ declare const readFile: <O extends ReadFileOptions<keyof typeof decompressionMet
|
|
|
64
65
|
declare const decompressionMethods: {
|
|
65
66
|
readonly brotli: typeof brotliDecompressSync;
|
|
66
67
|
readonly gzip: typeof unzipSync;
|
|
67
|
-
readonly none: (buffer: Buffer) => Buffer
|
|
68
|
+
readonly none: (buffer: Buffer) => Buffer<ArrayBufferLike>;
|
|
68
69
|
};
|
|
69
70
|
declare const readFileSync: <O extends ReadFileOptions<keyof typeof decompressionMethods> | undefined = undefined>(path: URL | string, options?: O) => ContentType<O>;
|
|
70
71
|
|
|
@@ -74,12 +75,6 @@ declare function readJson<T extends JsonValue>(path: URL | string, reviver: Json
|
|
|
74
75
|
declare function readJsonSync<T extends JsonValue>(path: URL | string, options?: ReadJsonOptions): T;
|
|
75
76
|
declare function readJsonSync<T extends JsonValue>(path: URL | string, reviver: JsonReviver, options?: ReadJsonOptions): T;
|
|
76
77
|
|
|
77
|
-
declare function readYaml<R = Record<string, unknown>>(path: URL | string, options?: ReadYamlOptions<"brotli" | "gzip" | "none">): Promise<R>;
|
|
78
|
-
declare function readYaml<R = Record<string, unknown>>(path: URL | string, reviver?: YamlReviver, options?: ReadYamlOptions<"brotli" | "gzip" | "none">): Promise<R>;
|
|
79
|
-
|
|
80
|
-
declare function readYamlSync<R = Record<string, unknown>>(path: URL | string, options?: ReadYamlOptions<"brotli" | "gzip" | "none">): R;
|
|
81
|
-
declare function readYamlSync<R = Record<string, unknown>>(path: URL | string, reviver?: YamlReviver, options?: ReadYamlOptions<"brotli" | "gzip" | "none">): R;
|
|
82
|
-
|
|
83
78
|
declare const emptyDir$1: (dir: URL | string, options?: EmptyDirOptions) => Promise<void>;
|
|
84
79
|
|
|
85
80
|
declare const emptyDir: (dir: URL | string, options?: EmptyDirOptions) => void;
|
|
@@ -102,12 +97,4 @@ declare const writeJson: (path: URL | string, data: unknown, options?: WriteJson
|
|
|
102
97
|
|
|
103
98
|
declare const writeJsonSync: (path: URL | string, data: unknown, options?: WriteJsonOptions) => void;
|
|
104
99
|
|
|
105
|
-
type Options$1
|
|
106
|
-
declare function writeYaml(path: URL | string, data: any, options?: Options$1): Promise<void>;
|
|
107
|
-
declare function writeYaml(path: URL | string, data: any, replacer?: YamlReplacer, options?: Options$1 | number | string): Promise<void>;
|
|
108
|
-
|
|
109
|
-
type Options = CreateNodeOptions & DocumentOptions & ParseOptions & SchemaOptions & ToStringOptions;
|
|
110
|
-
declare function writeYamlSync(path: URL | string, data: any, options?: Options): void;
|
|
111
|
-
declare function writeYamlSync(path: URL | string, data: any, replacer?: YamlReplacer, options?: Options | number | string): void;
|
|
112
|
-
|
|
113
|
-
export { CRLF, EOL, EmptyDirOptions, FindUpName, FindUpNameSync, FindUpOptions, JsonReviver, LF, type Options$2 as MoveOptions, ReadFileOptions, ReadJsonOptions, WalkEntry, WalkOptions, WriteFileOptions, WriteJsonOptions, YamlReplacer, collect, collectSync, detect, emptyDir$1 as emptyDir, emptyDir as emptyDirSync, ensureDir, ensureDirSync, ensureFile, ensureFileSync, ensureLink, ensureLinkSync, ensureSymlink, ensureSymlinkSync, findUp, findUpSync, format, isAccessible, isAccessibleSync, move, moveSync, readFile, readFileSync, readJson, readJsonSync, readYaml, readYamlSync, remove, removeSync, rename, renameSync, walk, walkSync, writeFile, writeFileSync, writeJson, writeJsonSync, writeYaml, writeYamlSync };
|
|
100
|
+
export { CRLF, EOL, EmptyDirOptions, FindUpName, FindUpNameSync, FindUpOptions, JsonReviver, LF, type Options as MoveOptions, ReadFileOptions, ReadJsonOptions, WalkEntry, WalkOptions, WriteFileOptions, WriteJsonOptions, collect, collectSync, detect, emptyDir$1 as emptyDir, emptyDir as emptyDirSync, ensureDir, ensureDirSync, ensureFile, ensureFileSync, ensureLink, ensureLinkSync, ensureSymlink, ensureSymlinkSync, findUp, findUpSync, format, isAccessible, isAccessibleSync, move, moveSync, readFile, readFileSync, readJson, readJsonSync, remove, removeSync, rename, renameSync, walk, walkSync, writeFile, writeFileSync, writeJson, writeJsonSync };
|
package/dist/index.mjs
CHANGED
|
@@ -21,15 +21,11 @@ export { default as readFile } from './packem_shared/readFile-DUM-xNoB.mjs';
|
|
|
21
21
|
export { default as readFileSync } from './packem_shared/readFileSync-Cck96_o0.mjs';
|
|
22
22
|
export { default as readJson } from './packem_shared/readJson-DIHRleEE.mjs';
|
|
23
23
|
export { default as readJsonSync } from './packem_shared/readJsonSync-BPfxTuQL.mjs';
|
|
24
|
-
export { default as readYaml } from './packem_shared/readYaml-vVKK8ZzY.mjs';
|
|
25
|
-
export { default as readYamlSync } from './packem_shared/readYamlSync-MOLH4gXB.mjs';
|
|
26
24
|
export { default as emptyDir } from './packem_shared/emptyDir-Dw5xSBox.mjs';
|
|
27
25
|
export { default as emptyDirSync } from './packem_shared/emptyDirSync-DTGPXQ3v.mjs';
|
|
28
26
|
export { default as remove } from './packem_shared/remove-B2nxUObP.mjs';
|
|
29
27
|
export { default as removeSync } from './packem_shared/removeSync-C87yepDI.mjs';
|
|
30
|
-
export { default as writeFile } from './packem_shared/writeFile-
|
|
31
|
-
export { default as writeFileSync } from './packem_shared/writeFileSync-
|
|
32
|
-
export { default as writeJson } from './packem_shared/writeJson-
|
|
33
|
-
export { default as writeJsonSync } from './packem_shared/writeJsonSync-
|
|
34
|
-
export { default as writeYaml } from './packem_shared/writeYaml-DSTzKc0_.mjs';
|
|
35
|
-
export { default as writeYamlSync } from './packem_shared/writeYamlSync-agxYIea0.mjs';
|
|
28
|
+
export { default as writeFile } from './packem_shared/writeFile-CzpkxDqy.mjs';
|
|
29
|
+
export { default as writeFileSync } from './packem_shared/writeFileSync-DYRpumrj.mjs';
|
|
30
|
+
export { default as writeJson } from './packem_shared/writeJson-V9KBXfw2.mjs';
|
|
31
|
+
export { default as writeJsonSync } from './packem_shared/writeJsonSync-CyaXNy3X.mjs';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Matches a JSON object.
|
|
3
|
+
|
|
4
|
+
This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`.
|
|
5
|
+
|
|
6
|
+
@category JSON
|
|
7
|
+
*/
|
|
8
|
+
type JsonObject = {[Key in string]: JsonValue} & {[Key in string]?: JsonValue | undefined};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
Matches a JSON array.
|
|
12
|
+
|
|
13
|
+
@category JSON
|
|
14
|
+
*/
|
|
15
|
+
type JsonArray = JsonValue[] | readonly JsonValue[];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
Matches any valid JSON primitive value.
|
|
19
|
+
|
|
20
|
+
@category JSON
|
|
21
|
+
*/
|
|
22
|
+
type JsonPrimitive = string | number | boolean | null;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
Matches any valid JSON value.
|
|
26
|
+
|
|
27
|
+
@see `Jsonify` if you need to transform a type to one that is assignable to `JsonValue`.
|
|
28
|
+
|
|
29
|
+
@category JSON
|
|
30
|
+
*/
|
|
31
|
+
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
32
|
+
|
|
33
|
+
declare global {
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
35
|
+
interface SymbolConstructor {
|
|
36
|
+
readonly observable: symbol;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type { JsonValue as J };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Matches a JSON object.
|
|
3
|
+
|
|
4
|
+
This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`.
|
|
5
|
+
|
|
6
|
+
@category JSON
|
|
7
|
+
*/
|
|
8
|
+
type JsonObject = {[Key in string]: JsonValue} & {[Key in string]?: JsonValue | undefined};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
Matches a JSON array.
|
|
12
|
+
|
|
13
|
+
@category JSON
|
|
14
|
+
*/
|
|
15
|
+
type JsonArray = JsonValue[] | readonly JsonValue[];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
Matches any valid JSON primitive value.
|
|
19
|
+
|
|
20
|
+
@category JSON
|
|
21
|
+
*/
|
|
22
|
+
type JsonPrimitive = string | number | boolean | null;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
Matches any valid JSON value.
|
|
26
|
+
|
|
27
|
+
@see `Jsonify` if you need to transform a type to one that is assignable to `JsonValue`.
|
|
28
|
+
|
|
29
|
+
@category JSON
|
|
30
|
+
*/
|
|
31
|
+
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
32
|
+
|
|
33
|
+
declare global {
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
35
|
+
interface SymbolConstructor {
|
|
36
|
+
readonly observable: symbol;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type { JsonValue as J };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Matches a JSON object.
|
|
3
|
+
|
|
4
|
+
This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`.
|
|
5
|
+
|
|
6
|
+
@category JSON
|
|
7
|
+
*/
|
|
8
|
+
type JsonObject = {[Key in string]: JsonValue} & {[Key in string]?: JsonValue | undefined};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
Matches a JSON array.
|
|
12
|
+
|
|
13
|
+
@category JSON
|
|
14
|
+
*/
|
|
15
|
+
type JsonArray = JsonValue[] | readonly JsonValue[];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
Matches any valid JSON primitive value.
|
|
19
|
+
|
|
20
|
+
@category JSON
|
|
21
|
+
*/
|
|
22
|
+
type JsonPrimitive = string | number | boolean | null;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
Matches any valid JSON value.
|
|
26
|
+
|
|
27
|
+
@see `Jsonify` if you need to transform a type to one that is assignable to `JsonValue`.
|
|
28
|
+
|
|
29
|
+
@category JSON
|
|
30
|
+
*/
|
|
31
|
+
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
32
|
+
|
|
33
|
+
declare global {
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
35
|
+
interface SymbolConstructor {
|
|
36
|
+
readonly observable: symbol;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type { JsonValue as J };
|
|
@@ -82,43 +82,4 @@ type EmptyDirOptions = {
|
|
|
82
82
|
type ReadYamlOptions<C> = DocumentOptions & ParseOptions & ReadFileOptions<C> & SchemaOptions & ToJSOptions;
|
|
83
83
|
type YamlReviver = (key: unknown, value: unknown) => unknown;
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
Matches a JSON object.
|
|
87
|
-
|
|
88
|
-
This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`.
|
|
89
|
-
|
|
90
|
-
@category JSON
|
|
91
|
-
*/
|
|
92
|
-
type JsonObject = {[Key in string]: JsonValue} & {[Key in string]?: JsonValue | undefined};
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
Matches a JSON array.
|
|
96
|
-
|
|
97
|
-
@category JSON
|
|
98
|
-
*/
|
|
99
|
-
type JsonArray = JsonValue[] | readonly JsonValue[];
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
Matches any valid JSON primitive value.
|
|
103
|
-
|
|
104
|
-
@category JSON
|
|
105
|
-
*/
|
|
106
|
-
type JsonPrimitive = string | number | boolean | null;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
Matches any valid JSON value.
|
|
110
|
-
|
|
111
|
-
@see `Jsonify` if you need to transform a type to one that is assignable to `JsonValue`.
|
|
112
|
-
|
|
113
|
-
@category JSON
|
|
114
|
-
*/
|
|
115
|
-
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
116
|
-
|
|
117
|
-
declare global {
|
|
118
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
119
|
-
interface SymbolConstructor {
|
|
120
|
-
readonly observable: symbol;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export { type ContentType as C, type EmptyDirOptions as E, type FindUpName as F, type JsonValue 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 JsonReviver as e, type ReadYamlOptions as f, type WriteFileOptions as g, type WriteJsonOptions as h, type YamlReplacer as i, F_OK as j, FIND_UP_STOP as k, R_OK as l, W_OK as m, type CodeFrameLocation as n, type FindUpNameFnResult as o, type FindUpNameSyncFnResult as p, type JsonReplacer as q, type ReadFileEncoding as r, type CodeFrameOptions as s };
|
|
85
|
+
export { type ContentType as C, type EmptyDirOptions as E, 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 WriteFileOptions as e, type WriteJsonOptions as f, F_OK as g, FIND_UP_STOP as h, R_OK as i, W_OK as j, type CodeFrameLocation as k, type FindUpNameFnResult as l, type FindUpNameSyncFnResult as m, type JsonReplacer as n, type ReadFileEncoding as o, type CodeFrameOptions as p, type ReadYamlOptions as q, type YamlReplacer as r };
|
|
@@ -82,43 +82,4 @@ type EmptyDirOptions = {
|
|
|
82
82
|
type ReadYamlOptions<C> = DocumentOptions & ParseOptions & ReadFileOptions<C> & SchemaOptions & ToJSOptions;
|
|
83
83
|
type YamlReviver = (key: unknown, value: unknown) => unknown;
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
Matches a JSON object.
|
|
87
|
-
|
|
88
|
-
This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`.
|
|
89
|
-
|
|
90
|
-
@category JSON
|
|
91
|
-
*/
|
|
92
|
-
type JsonObject = {[Key in string]: JsonValue} & {[Key in string]?: JsonValue | undefined};
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
Matches a JSON array.
|
|
96
|
-
|
|
97
|
-
@category JSON
|
|
98
|
-
*/
|
|
99
|
-
type JsonArray = JsonValue[] | readonly JsonValue[];
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
Matches any valid JSON primitive value.
|
|
103
|
-
|
|
104
|
-
@category JSON
|
|
105
|
-
*/
|
|
106
|
-
type JsonPrimitive = string | number | boolean | null;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
Matches any valid JSON value.
|
|
110
|
-
|
|
111
|
-
@see `Jsonify` if you need to transform a type to one that is assignable to `JsonValue`.
|
|
112
|
-
|
|
113
|
-
@category JSON
|
|
114
|
-
*/
|
|
115
|
-
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
116
|
-
|
|
117
|
-
declare global {
|
|
118
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
119
|
-
interface SymbolConstructor {
|
|
120
|
-
readonly observable: symbol;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export { type ContentType as C, type EmptyDirOptions as E, type FindUpName as F, type JsonValue 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 JsonReviver as e, type ReadYamlOptions as f, type WriteFileOptions as g, type WriteJsonOptions as h, type YamlReplacer as i, F_OK as j, FIND_UP_STOP as k, R_OK as l, W_OK as m, type CodeFrameLocation as n, type FindUpNameFnResult as o, type FindUpNameSyncFnResult as p, type JsonReplacer as q, type ReadFileEncoding as r, type CodeFrameOptions as s };
|
|
85
|
+
export { type ContentType as C, type EmptyDirOptions as E, 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 WriteFileOptions as e, type WriteJsonOptions as f, F_OK as g, FIND_UP_STOP as h, R_OK as i, W_OK as j, type CodeFrameLocation as k, type FindUpNameFnResult as l, type FindUpNameSyncFnResult as m, type JsonReplacer as n, type ReadFileEncoding as o, type CodeFrameOptions as p, type ReadYamlOptions as q, type YamlReplacer as r };
|
|
@@ -82,43 +82,4 @@ type EmptyDirOptions = {
|
|
|
82
82
|
type ReadYamlOptions<C> = DocumentOptions & ParseOptions & ReadFileOptions<C> & SchemaOptions & ToJSOptions;
|
|
83
83
|
type YamlReviver = (key: unknown, value: unknown) => unknown;
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
Matches a JSON object.
|
|
87
|
-
|
|
88
|
-
This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`.
|
|
89
|
-
|
|
90
|
-
@category JSON
|
|
91
|
-
*/
|
|
92
|
-
type JsonObject = {[Key in string]: JsonValue} & {[Key in string]?: JsonValue | undefined};
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
Matches a JSON array.
|
|
96
|
-
|
|
97
|
-
@category JSON
|
|
98
|
-
*/
|
|
99
|
-
type JsonArray = JsonValue[] | readonly JsonValue[];
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
Matches any valid JSON primitive value.
|
|
103
|
-
|
|
104
|
-
@category JSON
|
|
105
|
-
*/
|
|
106
|
-
type JsonPrimitive = string | number | boolean | null;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
Matches any valid JSON value.
|
|
110
|
-
|
|
111
|
-
@see `Jsonify` if you need to transform a type to one that is assignable to `JsonValue`.
|
|
112
|
-
|
|
113
|
-
@category JSON
|
|
114
|
-
*/
|
|
115
|
-
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
116
|
-
|
|
117
|
-
declare global {
|
|
118
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
119
|
-
interface SymbolConstructor {
|
|
120
|
-
readonly observable: symbol;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export { type ContentType as C, type EmptyDirOptions as E, type FindUpName as F, type JsonValue 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 JsonReviver as e, type ReadYamlOptions as f, type WriteFileOptions as g, type WriteJsonOptions as h, type YamlReplacer as i, F_OK as j, FIND_UP_STOP as k, R_OK as l, W_OK as m, type CodeFrameLocation as n, type FindUpNameFnResult as o, type FindUpNameSyncFnResult as p, type JsonReplacer as q, type ReadFileEncoding as r, type CodeFrameOptions as s };
|
|
85
|
+
export { type ContentType as C, type EmptyDirOptions as E, 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 WriteFileOptions as e, type WriteJsonOptions as f, F_OK as g, FIND_UP_STOP as h, R_OK as i, W_OK as j, type CodeFrameLocation as k, type FindUpNameFnResult as l, type FindUpNameSyncFnResult as m, type JsonReplacer as n, type ReadFileEncoding as o, type CodeFrameOptions as p, type ReadYamlOptions as q, type YamlReplacer as r };
|
|
@@ -22,6 +22,7 @@ const writeFile = /* @__PURE__ */ __name(async (path$1, content, options) => {
|
|
|
22
22
|
assertValidFileOrDirectoryPath(path$1);
|
|
23
23
|
assertValidFileContents(content);
|
|
24
24
|
path$1 = utils.toPath(path$1);
|
|
25
|
+
const temporaryPath = `${path$1}.tmp`;
|
|
25
26
|
try {
|
|
26
27
|
const pathExists = await isAccessible(path$1, F_OK.F_OK);
|
|
27
28
|
if (!pathExists && options.recursive) {
|
|
@@ -31,7 +32,7 @@ const writeFile = /* @__PURE__ */ __name(async (path$1, content, options) => {
|
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
let stat;
|
|
34
|
-
await promises.writeFile(
|
|
35
|
+
await promises.writeFile(temporaryPath, toUint8Array.toUint8Array(content), { encoding: options.encoding, flag: options.flag });
|
|
35
36
|
if (pathExists && !options.overwrite) {
|
|
36
37
|
stat = await promises.stat(path$1);
|
|
37
38
|
if (options.chown === undefined) {
|
|
@@ -39,7 +40,6 @@ const writeFile = /* @__PURE__ */ __name(async (path$1, content, options) => {
|
|
|
39
40
|
}
|
|
40
41
|
await promises.rename(path$1, `${path$1}.bak`);
|
|
41
42
|
}
|
|
42
|
-
const temporaryPath = `${path$1}.tmp`;
|
|
43
43
|
if (options.chown) {
|
|
44
44
|
try {
|
|
45
45
|
await promises.chown(temporaryPath, options.chown.uid, options.chown.gid);
|
|
@@ -51,7 +51,7 @@ const writeFile = /* @__PURE__ */ __name(async (path$1, content, options) => {
|
|
|
51
51
|
} catch (error) {
|
|
52
52
|
throw new Error(`Failed to write file at: ${path$1} - ${error.message}`, { cause: error });
|
|
53
53
|
} finally {
|
|
54
|
-
if (await isAccessible(
|
|
54
|
+
if (await isAccessible(temporaryPath)) {
|
|
55
55
|
await promises.unlink(`${path$1}.tmp`);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -20,6 +20,7 @@ const writeFile = /* @__PURE__ */ __name(async (path, content, options) => {
|
|
|
20
20
|
assertValidFileOrDirectoryPath(path);
|
|
21
21
|
assertValidFileContents(content);
|
|
22
22
|
path = toPath(path);
|
|
23
|
+
const temporaryPath = `${path}.tmp`;
|
|
23
24
|
try {
|
|
24
25
|
const pathExists = await isAccessible(path, F_OK);
|
|
25
26
|
if (!pathExists && options.recursive) {
|
|
@@ -29,7 +30,7 @@ const writeFile = /* @__PURE__ */ __name(async (path, content, options) => {
|
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
let stat$1;
|
|
32
|
-
await writeFile$1(
|
|
33
|
+
await writeFile$1(temporaryPath, toUint8Array(content), { encoding: options.encoding, flag: options.flag });
|
|
33
34
|
if (pathExists && !options.overwrite) {
|
|
34
35
|
stat$1 = await stat(path);
|
|
35
36
|
if (options.chown === undefined) {
|
|
@@ -37,7 +38,6 @@ const writeFile = /* @__PURE__ */ __name(async (path, content, options) => {
|
|
|
37
38
|
}
|
|
38
39
|
await rename(path, `${path}.bak`);
|
|
39
40
|
}
|
|
40
|
-
const temporaryPath = `${path}.tmp`;
|
|
41
41
|
if (options.chown) {
|
|
42
42
|
try {
|
|
43
43
|
await chown(temporaryPath, options.chown.uid, options.chown.gid);
|
|
@@ -49,7 +49,7 @@ const writeFile = /* @__PURE__ */ __name(async (path, content, options) => {
|
|
|
49
49
|
} catch (error) {
|
|
50
50
|
throw new Error(`Failed to write file at: ${path} - ${error.message}`, { cause: error });
|
|
51
51
|
} finally {
|
|
52
|
-
if (await isAccessible(
|
|
52
|
+
if (await isAccessible(temporaryPath)) {
|
|
53
53
|
await unlink(`${path}.tmp`);
|
|
54
54
|
}
|
|
55
55
|
}
|