@visulima/fs 5.0.0-alpha.1 → 5.0.0-alpha.11
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 +177 -0
- package/LICENSE.md +157 -128
- package/dist/eol.d.ts +6 -35
- package/dist/error.d.ts +43 -7
- package/dist/error.js +1 -1
- package/dist/glob-parent.d.ts +5 -0
- package/dist/glob-parent.js +90 -0
- package/dist/glob.d.ts +5 -0
- package/dist/glob.js +2 -0
- package/dist/index.d.ts +81 -36
- package/dist/index.js +32 -27
- package/dist/ini.d.ts +10 -0
- package/dist/ini.js +4 -0
- package/dist/is-glob.d.ts +5 -0
- package/dist/is-glob.js +9 -0
- package/dist/json5.d.ts +12 -0
- package/dist/json5.js +4 -0
- package/dist/jsonc.d.ts +10 -0
- package/dist/jsonc.js +4 -0
- package/dist/match.d.ts +5 -0
- package/dist/match.js +15 -0
- package/dist/packem_shared/{WalkError-DUdQd6FT.js → WalkError-DER5A43G.js} +1 -1
- package/dist/packem_shared/_commonjsHelpers-BqLXS_qQ.js +5 -0
- package/dist/packem_shared/build-rm-options-Cl3VDY4O.js +12 -0
- package/dist/packem_shared/{collect-DcBwsYYd.js → collect-CqQ3eVab.js} +1 -1
- package/dist/packem_shared/{collectSync-Bkjf9Dbm.js → collectSync-noE08NNv.js} +1 -1
- package/dist/packem_shared/{emptyDir-CYB5Tict.js → emptyDir-DnwENOaV.js} +5 -2
- package/dist/packem_shared/{emptyDirSync-BD8-1Ytl.js → emptyDirSync-6WiHBo8a.js} +3 -1
- package/dist/packem_shared/{ensureDir-C_kuQ5Ik.js → ensureDir-DNlPftys.js} +2 -2
- package/dist/packem_shared/{ensureDirSync-CI5g-uBI.js → ensureDirSync-DcPZFMy5.js} +2 -2
- package/dist/packem_shared/{ensureFile-BUtXGlGT.js → ensureFile-BRQpUOUM.js} +2 -2
- package/dist/packem_shared/{ensureFileSync-C8hASR-1.js → ensureFileSync-SBY7A9-C.js} +2 -2
- package/dist/packem_shared/{ensureLink-BPnAG5-P.js → ensureLink-DJQeauEn.js} +4 -3
- package/dist/packem_shared/{ensureLinkSync-B-Z7X0ub.js → ensureLinkSync-D9RVAglV.js} +4 -3
- package/dist/packem_shared/{ensureSymlink-U5B6J0BN.js → ensureSymlink-CoRYDRwr.js} +10 -3
- package/dist/packem_shared/{ensureSymlinkSync-DHnZj-9F.js → ensureSymlinkSync-CFimFlgh.js} +10 -3
- package/dist/packem_shared/{findUp-BSnyGqer.js → findUp-YcNLKdfV.js} +3 -4
- package/dist/packem_shared/{findUpSync-jRHbSCMV.js → findUpSync-BfA5fheN.js} +1 -3
- package/dist/packem_shared/glob-DY8l7izD.js +5 -0
- package/dist/packem_shared/glob-sync.d-BlGjS68e.d.ts +4 -0
- package/dist/packem_shared/globSync-5P2KJf_g.js +5 -0
- package/dist/packem_shared/index-C8W8sfzP.js +830 -0
- package/dist/packem_shared/index-bhgnhm4u.js +167 -0
- package/dist/packem_shared/index-xe4o3cYi.js +1784 -0
- package/dist/packem_shared/{parseJson-C8xb-3LR.js → indexToLineColumn-BUb0GPKl-BF770uX7.js} +8 -68
- package/dist/packem_shared/ini-preserve-Dq_Q_Jgb.js +251 -0
- package/dist/packem_shared/{isFsCaseSensitive-D-ayleCy.js → isFsCaseSensitive-DunL7Iry.js} +6 -6
- package/dist/packem_shared/json-error.d-DgKaeuIf.d.ts +10 -0
- package/dist/packem_shared/jsonc-merge-C6jWcfWh.js +72 -0
- package/dist/packem_shared/parseJson-BIp89Xjo.js +63 -0
- package/dist/packem_shared/{readFileSync-6GEIrOnl.js → readFileSync-gm9yfIhh.js} +2 -1
- package/dist/packem_shared/readIni-CJ2xfpjB.js +10 -0
- package/dist/packem_shared/readIniSync-9LUjaSSp.js +10 -0
- package/dist/packem_shared/{readJson-vddQ97Ll.js → readJson-C_rwm-wq.js} +1 -1
- package/dist/packem_shared/readJson5-mBoTZppy.js +15 -0
- package/dist/packem_shared/readJson5Sync-8WS2yUok.js +15 -0
- package/dist/packem_shared/{readJsonSync-DzeAdYZl.js → readJsonSync-BMEmCcJ6.js} +2 -2
- package/dist/packem_shared/readJsonc-j-OS-APg.js +28 -0
- package/dist/packem_shared/readJsoncSync-Aw6EMlWO.js +16 -0
- package/dist/packem_shared/readToml-B2MHaSes.js +9 -0
- package/dist/packem_shared/readTomlSync-DNbK8NEb.js +9 -0
- package/dist/packem_shared/{readYamlSync-DMV4U-gi.js → readYamlSync-BKX-PAfq.js} +1 -1
- package/dist/packem_shared/{remove-_oDY3uKo.js → remove-C8_gl3jF.js} +2 -1
- package/dist/packem_shared/{removeSync-DETRj7Qn.js → removeSync-BJR_wTwN.js} +2 -1
- package/dist/packem_shared/{sanitize-lOzE6k2A.js → sanitize-BZoLN9Fg.js} +3 -3
- package/dist/packem_shared/types.d-CYpAhWov.d.ts +145 -0
- package/dist/packem_shared/{walk-BhTbpr3y.js → walk-CSZgCuDx.js} +19 -10
- package/dist/packem_shared/{walkSync-DDBq95s8.js → walkSync-C4Cy28xb.js} +25 -16
- package/dist/packem_shared/{writeFile-DSHERs0Z.js → writeFile-B8HX0JIQ.js} +1 -3
- package/dist/packem_shared/{writeFileSync-CJp1kXQR.js → writeFileSync-DB8vv8xR.js} +1 -3
- package/dist/packem_shared/writeIni-i55QrL8y.js +65 -0
- package/dist/packem_shared/writeIniSync-CLqJE5t3.js +64 -0
- package/dist/packem_shared/{writeJson-C0OfLDbe.js → writeJson-Bo7C2UHw.js} +1 -1
- package/dist/packem_shared/writeJson5-vVmHUQOd.js +53 -0
- package/dist/packem_shared/writeJson5Sync-oJ546h5k.js +53 -0
- package/dist/packem_shared/{writeJsonSync-Cs21FE7v.js → writeJsonSync-BKZ_9Acr.js} +1 -1
- package/dist/packem_shared/writeJsonc-BufH_oC5.js +60 -0
- package/dist/packem_shared/writeJsoncSync-DB9be1YL.js +59 -0
- package/dist/packem_shared/writeToml-DgTW_-7F.js +8 -0
- package/dist/packem_shared/writeTomlSync-DiBiE9ja.js +8 -0
- package/dist/packem_shared/{writeYaml-n4xzYN9a.js → writeYaml-BWCOome-.js} +3 -3
- package/dist/packem_shared/{writeYamlSync-DnOEnP10.js → writeYamlSync-DBVnXmuY.js} +3 -3
- package/dist/size.d.ts +10 -254
- package/dist/size.js +6 -4
- package/dist/toml.d.ts +9 -0
- package/dist/toml.js +4 -0
- package/dist/utils.d.ts +15 -6
- package/dist/utils.js +1 -1
- package/dist/yaml.d.ts +14 -5
- package/dist/yaml.js +3 -3
- package/package.json +60 -6
- package/dist/constants.d.ts +0 -42
- package/dist/ensure/ensure-dir-sync.d.ts +0 -14
- package/dist/ensure/ensure-dir.d.ts +0 -14
- package/dist/ensure/ensure-file-sync.d.ts +0 -15
- package/dist/ensure/ensure-file.d.ts +0 -27
- package/dist/ensure/ensure-link-sync.d.ts +0 -16
- package/dist/ensure/ensure-link.d.ts +0 -16
- package/dist/ensure/ensure-symlink-sync.d.ts +0 -23
- package/dist/ensure/ensure-symlink.d.ts +0 -23
- package/dist/ensure/utils/get-file-info-type.d.ts +0 -7
- package/dist/ensure/utils/is-stats-identical.d.ts +0 -3
- package/dist/ensure/utils/resolve-symlink-target.d.ts +0 -2
- package/dist/error/already-exists-error.d.ts +0 -39
- package/dist/error/directory-error.d.ts +0 -47
- package/dist/error/json-error.d.ts +0 -52
- package/dist/error/not-empty-error.d.ts +0 -51
- package/dist/error/not-found-error.d.ts +0 -44
- package/dist/error/permission-error.d.ts +0 -45
- package/dist/error/walk-error.d.ts +0 -51
- package/dist/find/collect-sync.d.ts +0 -31
- package/dist/find/collect.d.ts +0 -35
- package/dist/find/find-up-sync.d.ts +0 -42
- package/dist/find/find-up.d.ts +0 -46
- package/dist/find/utils/glob-to-regexp.d.ts +0 -2
- package/dist/find/utils/walk-include.d.ts +0 -2
- package/dist/find/walk-sync.d.ts +0 -34
- package/dist/find/walk.d.ts +0 -37
- package/dist/is-accessible-sync.d.ts +0 -3
- package/dist/is-accessible.d.ts +0 -29
- package/dist/move/index.d.ts +0 -68
- package/dist/move/types.d.ts +0 -36
- package/dist/move/utils/internal-move-file-sync.d.ts +0 -3
- package/dist/move/utils/internal-move-file.d.ts +0 -3
- package/dist/move/utils/validate-same-directory.d.ts +0 -2
- package/dist/read/read-file-sync.d.ts +0 -37
- package/dist/read/read-file.d.ts +0 -41
- package/dist/read/read-json-sync.d.ts +0 -5
- package/dist/read/read-json.d.ts +0 -5
- package/dist/read/read-yaml-sync.d.ts +0 -4
- package/dist/read/read-yaml.d.ts +0 -4
- package/dist/remove/empty-dir-sync.d.ts +0 -23
- package/dist/remove/empty-dir.d.ts +0 -28
- package/dist/remove/remove-sync.d.ts +0 -27
- package/dist/remove/remove.d.ts +0 -32
- package/dist/sanitize.d.ts +0 -31
- package/dist/types.d.ts +0 -304
- package/dist/utils/assert-valid-file-contents.d.ts +0 -27
- package/dist/utils/assert-valid-file-or-directory-path.d.ts +0 -26
- package/dist/utils/parse-json.d.ts +0 -5
- package/dist/utils/strip-json-comments.d.ts +0 -44
- package/dist/write/utils/to-uint-8-array.d.ts +0 -2
- package/dist/write/write-file-sync.d.ts +0 -30
- package/dist/write/write-file.d.ts +0 -30
- package/dist/write/write-json-sync.d.ts +0 -29
- package/dist/write/write-json.d.ts +0 -30
- package/dist/write/write-yaml-sync.d.ts +0 -4
- package/dist/write/write-yaml.d.ts +0 -4
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { createRequire as __cjs_createRequire } from "node:module";
|
|
2
|
+
|
|
3
|
+
const __cjs_require = __cjs_createRequire(import.meta.url);
|
|
4
|
+
|
|
5
|
+
const __cjs_getProcess = typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" ? globalThis.process : process;
|
|
6
|
+
|
|
7
|
+
const __cjs_getBuiltinModule = (module) => {
|
|
8
|
+
// Check if we're in Node.js and version supports getBuiltinModule
|
|
9
|
+
if (typeof __cjs_getProcess !== "undefined" && __cjs_getProcess.versions && __cjs_getProcess.versions.node) {
|
|
10
|
+
const [major, minor] = __cjs_getProcess.versions.node.split(".").map(Number);
|
|
11
|
+
// Node.js 20.16.0+ and 22.3.0+
|
|
12
|
+
if (major > 22 || (major === 22 && minor >= 3) || (major === 20 && minor >= 16)) {
|
|
13
|
+
return __cjs_getProcess.getBuiltinModule(module);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
// Fallback to createRequire
|
|
17
|
+
return __cjs_require(module);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
import { g as getDefaultExportFromCjs } from './packem_shared/_commonjsHelpers-BqLXS_qQ.js';
|
|
21
|
+
import { r as requireIsGlob } from './packem_shared/index-bhgnhm4u.js';
|
|
22
|
+
const require$$1 = __cjs_getBuiltinModule("path");
|
|
23
|
+
const require$$2 = __cjs_getBuiltinModule("os");
|
|
24
|
+
|
|
25
|
+
var globParent$1;
|
|
26
|
+
var hasRequiredGlobParent;
|
|
27
|
+
|
|
28
|
+
function requireGlobParent () {
|
|
29
|
+
if (hasRequiredGlobParent) return globParent$1;
|
|
30
|
+
hasRequiredGlobParent = 1;
|
|
31
|
+
var isGlob = requireIsGlob();
|
|
32
|
+
var pathPosixDirname = require$$1.posix.dirname;
|
|
33
|
+
var isWin32 = require$$2.platform() === "win32";
|
|
34
|
+
var slash = "/";
|
|
35
|
+
var backslash = /\\/g;
|
|
36
|
+
var escaped = /\\([!*?|[\](){}])/g;
|
|
37
|
+
globParent$1 = function globParent(str, opts) {
|
|
38
|
+
var options = Object.assign({ flipBackslashes: true }, opts);
|
|
39
|
+
if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {
|
|
40
|
+
str = str.replace(backslash, slash);
|
|
41
|
+
}
|
|
42
|
+
if (isEnclosure(str)) {
|
|
43
|
+
str += slash;
|
|
44
|
+
}
|
|
45
|
+
str += "a";
|
|
46
|
+
do {
|
|
47
|
+
str = pathPosixDirname(str);
|
|
48
|
+
} while (isGlobby(str));
|
|
49
|
+
return str.replace(escaped, "$1");
|
|
50
|
+
};
|
|
51
|
+
function isEnclosure(str) {
|
|
52
|
+
var lastChar = str.slice(-1);
|
|
53
|
+
var enclosureStart;
|
|
54
|
+
switch (lastChar) {
|
|
55
|
+
case "}":
|
|
56
|
+
enclosureStart = "{";
|
|
57
|
+
break;
|
|
58
|
+
case "]":
|
|
59
|
+
enclosureStart = "[";
|
|
60
|
+
break;
|
|
61
|
+
default:
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
var foundIndex = str.indexOf(enclosureStart);
|
|
65
|
+
if (foundIndex < 0) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
return str.slice(foundIndex + 1, -1).includes(slash);
|
|
69
|
+
}
|
|
70
|
+
function isGlobby(str) {
|
|
71
|
+
if (/\([^()]+$/.test(str)) {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
if (str[0] === "{" || str[0] === "[") {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
if (/[^\\][{[]/.test(str)) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
return isGlob(str);
|
|
81
|
+
}
|
|
82
|
+
return globParent$1;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
var globParentExports = requireGlobParent();
|
|
86
|
+
const globParentImpl = /*@__PURE__*/getDefaultExportFromCjs(globParentExports);
|
|
87
|
+
|
|
88
|
+
const globParent = (pattern, options) => globParentImpl(pattern, options);
|
|
89
|
+
|
|
90
|
+
export { globParent as default };
|
package/dist/glob.d.ts
ADDED
package/dist/glob.js
ADDED
package/dist/index.d.ts
CHANGED
|
@@ -1,36 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export { default as
|
|
7
|
-
export { default as
|
|
8
|
-
export {
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
1
|
+
import { q as WalkOptions, F as FindUpName, r as FindUpOptions, s as FindUpNameSync, t as WalkEntry, u as ReadFileOptions, v as ContentType, w as ReadJsonOptions, J as JsonReviver, x as RetryOptions, y as WriteFileOptions, z as WriteJsonOptions } from "./packem_shared/types.d-CYpAhWov.js";
|
|
2
|
+
export { type A as CodeFrameLocation, type C as CodeFrameOptions, B as FIND_UP_STOP, D as F_OK, type E as FindUpNameFnResult, type H as FindUpNameSyncFnResult, type G as GlobOptions, type b as JsonReplacer, K as R_OK, type L as ReadFileEncoding, M as W_OK, X as X_OK } from "./packem_shared/types.d-CYpAhWov.js";
|
|
3
|
+
import { symlink } from 'node:fs';
|
|
4
|
+
export { CRLF, EOL, LF, detect, format } from "./eol.js";
|
|
5
|
+
export { g as glob, a as globSync } from "./packem_shared/glob-sync.d-BlGjS68e.js";
|
|
6
|
+
export { type GlobParentOptions, default as globParent } from "./glob-parent.js";
|
|
7
|
+
export { type IsGlobOptions, default as isGlob } from "./is-glob.js";
|
|
8
|
+
export { type MatchOptions, match, matcher } from "./match.js";
|
|
9
|
+
import { JsonValue } from 'type-fest';
|
|
10
|
+
export { isFsCaseSensitive } from 'is-fs-case-sensitive';
|
|
11
|
+
import 'tinyglobby';
|
|
12
|
+
import './options';
|
|
13
|
+
import 'picomatch';
|
|
14
|
+
declare const ensureDir: (directory: URL | string) => Promise<void>;
|
|
15
|
+
declare const ensureDirSync: (directory: URL | string) => void;
|
|
16
|
+
declare const ensureFile: (filePath: URL | string) => Promise<void>;
|
|
17
|
+
declare const ensureFileSync: (filePath: URL | string) => void;
|
|
18
|
+
declare const ensureLink: (source: URL | string, destination: URL | string) => Promise<void>;
|
|
19
|
+
declare const ensureLinkSync: (source: URL | string, destination: URL | string) => void;
|
|
20
|
+
declare const ensureSymlink: (target: URL | string, linkName: URL | string, type?: symlink.Type) => Promise<void>;
|
|
21
|
+
declare const ensureSymlinkSync: (target: URL | string, linkName: URL | string, type?: symlink.Type) => void;
|
|
22
|
+
declare const collect: (directory: string, options?: WalkOptions) => Promise<string[]>;
|
|
23
|
+
declare const collectSync: (directory: string, options?: WalkOptions) => string[];
|
|
24
|
+
declare const findUp: (name: FindUpName, options?: FindUpOptions) => Promise<string | undefined>;
|
|
25
|
+
declare const findUpSync: (name: FindUpNameSync, options?: FindUpOptions) => string | undefined;
|
|
26
|
+
declare function walk(directory: URL | string, {
|
|
27
|
+
extensions,
|
|
28
|
+
followSymlinks,
|
|
29
|
+
includeDirs: includeDirectories,
|
|
30
|
+
includeFiles,
|
|
31
|
+
includeSymlinks,
|
|
32
|
+
match,
|
|
33
|
+
maxDepth,
|
|
34
|
+
skip
|
|
35
|
+
}?: WalkOptions): AsyncIterableIterator<WalkEntry>;
|
|
36
|
+
declare function walkSync(directory: URL | string, {
|
|
37
|
+
extensions,
|
|
38
|
+
followSymlinks,
|
|
39
|
+
includeDirs: includeDirectories,
|
|
40
|
+
includeFiles,
|
|
41
|
+
includeSymlinks,
|
|
42
|
+
match,
|
|
43
|
+
maxDepth,
|
|
44
|
+
skip
|
|
45
|
+
}?: WalkOptions): IterableIterator<WalkEntry>;
|
|
46
|
+
declare function isAccessible(path: URL | string, mode?: number): Promise<boolean>;
|
|
47
|
+
declare function isAccessibleSync(path: URL | string, mode?: number): boolean;
|
|
48
|
+
type Options = {
|
|
49
|
+
cwd?: URL | string;
|
|
50
|
+
readonly directoryMode?: number;
|
|
51
|
+
readonly overwrite?: boolean;
|
|
52
|
+
};
|
|
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;
|
|
57
|
+
type DecompressionMethod$1 = (buffer: Buffer, callback: (error: Error | null, result: Buffer) => void) => void;
|
|
58
|
+
declare const decompressionMethods$1: Record<string, DecompressionMethod$1>;
|
|
59
|
+
declare const readFile: <O extends ReadFileOptions<keyof typeof decompressionMethods$1> | undefined = undefined>(path: URL | string, options?: O) => Promise<ContentType<O>>;
|
|
60
|
+
type DecompressionMethod = (buffer: Buffer) => Buffer;
|
|
61
|
+
declare const decompressionMethods: Record<string, DecompressionMethod>;
|
|
62
|
+
declare const readFileSync: <O extends ReadFileOptions<keyof typeof decompressionMethods> | undefined = undefined>(path: URL | string, options?: O) => ContentType<O>;
|
|
63
|
+
declare function readJson<T extends JsonValue>(path: URL | string, options?: ReadJsonOptions): Promise<T>;
|
|
64
|
+
declare function readJson<T extends JsonValue>(path: URL | string, reviver: JsonReviver, options?: ReadJsonOptions): Promise<T>;
|
|
65
|
+
declare function readJsonSync(path: URL | string, options?: ReadJsonOptions): JsonValue;
|
|
66
|
+
declare function readJsonSync(path: URL | string, reviver: JsonReviver, options?: ReadJsonOptions): JsonValue;
|
|
67
|
+
declare const emptyDir: (dir: URL | string, options?: RetryOptions) => Promise<void>;
|
|
68
|
+
declare const emptyDirSync: (dir: URL | string, options?: RetryOptions) => void;
|
|
69
|
+
declare const remove: (path: URL | string, options?: RetryOptions) => Promise<void>;
|
|
70
|
+
declare const removeSync: (path: URL | string, options?: RetryOptions) => void;
|
|
71
|
+
type FileSystemType = "win32" | "unix" | "darwin" | "fat32" | "auto";
|
|
72
|
+
interface SanitizeOptions {
|
|
73
|
+
filesystem?: FileSystemType;
|
|
74
|
+
maxLength?: number;
|
|
75
|
+
}
|
|
76
|
+
declare const sanitize: (name: string, options?: Partial<SanitizeOptions>) => string;
|
|
77
|
+
declare const writeFile: (path: URL | string, content: ArrayBuffer | ArrayBufferView | string, options?: WriteFileOptions) => Promise<void>;
|
|
78
|
+
declare const writeFileSync: (path: URL | string, content: ArrayBuffer | ArrayBufferView | string, options?: WriteFileOptions) => void;
|
|
79
|
+
declare const writeJson: (path: URL | string, data: unknown, options?: WriteJsonOptions) => Promise<void>;
|
|
80
|
+
declare const writeJsonSync: (path: URL | string, data: unknown, options?: WriteJsonOptions) => void;
|
|
81
|
+
export { type ContentType, type FindUpName, type FindUpNameSync, type FindUpOptions, type JsonReviver, type Options as MoveOptions, type ReadFileOptions, type ReadJsonOptions, type SanitizeOptions, type WalkEntry, type WalkOptions, type WriteFileOptions, type 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, sanitize, walk, walkSync, writeFile, writeFileSync, writeJson, writeJsonSync };
|
package/dist/index.js
CHANGED
|
@@ -1,33 +1,38 @@
|
|
|
1
1
|
export { FIND_UP_STOP, F_OK, R_OK, W_OK, X_OK } from './packem_shared/F_OK-MldBaGxb.js';
|
|
2
|
-
export { default as ensureDir } from './packem_shared/ensureDir-
|
|
3
|
-
export { default as ensureDirSync } from './packem_shared/ensureDirSync-
|
|
4
|
-
export { default as ensureFile } from './packem_shared/ensureFile-
|
|
5
|
-
export { default as ensureFileSync } from './packem_shared/ensureFileSync-
|
|
6
|
-
export { default as ensureLink } from './packem_shared/ensureLink-
|
|
7
|
-
export { default as ensureLinkSync } from './packem_shared/ensureLinkSync-
|
|
8
|
-
export { default as ensureSymlink } from './packem_shared/ensureSymlink-
|
|
9
|
-
export { default as ensureSymlinkSync } from './packem_shared/ensureSymlinkSync-
|
|
2
|
+
export { default as ensureDir } from './packem_shared/ensureDir-DNlPftys.js';
|
|
3
|
+
export { default as ensureDirSync } from './packem_shared/ensureDirSync-DcPZFMy5.js';
|
|
4
|
+
export { default as ensureFile } from './packem_shared/ensureFile-BRQpUOUM.js';
|
|
5
|
+
export { default as ensureFileSync } from './packem_shared/ensureFileSync-SBY7A9-C.js';
|
|
6
|
+
export { default as ensureLink } from './packem_shared/ensureLink-DJQeauEn.js';
|
|
7
|
+
export { default as ensureLinkSync } from './packem_shared/ensureLinkSync-D9RVAglV.js';
|
|
8
|
+
export { default as ensureSymlink } from './packem_shared/ensureSymlink-CoRYDRwr.js';
|
|
9
|
+
export { default as ensureSymlinkSync } from './packem_shared/ensureSymlinkSync-CFimFlgh.js';
|
|
10
10
|
export { CRLF, EOL, LF, detect, format } from './eol.js';
|
|
11
|
-
export { default as collect } from './packem_shared/collect-
|
|
12
|
-
export { default as collectSync } from './packem_shared/collectSync-
|
|
13
|
-
export { default as findUp } from './packem_shared/findUp-
|
|
14
|
-
export { default as findUpSync } from './packem_shared/findUpSync-
|
|
15
|
-
export { default as
|
|
16
|
-
export { default as
|
|
11
|
+
export { default as collect } from './packem_shared/collect-CqQ3eVab.js';
|
|
12
|
+
export { default as collectSync } from './packem_shared/collectSync-noE08NNv.js';
|
|
13
|
+
export { default as findUp } from './packem_shared/findUp-YcNLKdfV.js';
|
|
14
|
+
export { default as findUpSync } from './packem_shared/findUpSync-BfA5fheN.js';
|
|
15
|
+
export { default as glob } from './packem_shared/glob-DY8l7izD.js';
|
|
16
|
+
export { default as globSync } from './packem_shared/globSync-5P2KJf_g.js';
|
|
17
|
+
export { default as walk } from './packem_shared/walk-CSZgCuDx.js';
|
|
18
|
+
export { default as walkSync } from './packem_shared/walkSync-C4Cy28xb.js';
|
|
19
|
+
export { default as globParent } from './glob-parent.js';
|
|
17
20
|
export { default as isAccessible } from './packem_shared/isAccessible-DuVrTNFV.js';
|
|
18
21
|
export { default as isAccessibleSync } from './packem_shared/isAccessibleSync-DI8mM0fA.js';
|
|
22
|
+
export { default as isGlob } from './is-glob.js';
|
|
23
|
+
export { match, matcher } from './match.js';
|
|
19
24
|
export { move, moveSync, rename, renameSync } from './packem_shared/move-DbpW5_vA.js';
|
|
20
25
|
export { default as readFile } from './packem_shared/readFile-Iz7kvCCk.js';
|
|
21
|
-
export { default as readFileSync } from './packem_shared/readFileSync-
|
|
22
|
-
export { default as readJson } from './packem_shared/readJson-
|
|
23
|
-
export { default as readJsonSync } from './packem_shared/readJsonSync-
|
|
24
|
-
export { default as emptyDir } from './packem_shared/emptyDir-
|
|
25
|
-
export { default as emptyDirSync } from './packem_shared/emptyDirSync-
|
|
26
|
-
export { default as remove } from './packem_shared/remove-
|
|
27
|
-
export { default as removeSync } from './packem_shared/removeSync-
|
|
28
|
-
export { sanitize } from './packem_shared/sanitize-
|
|
29
|
-
export { default as writeFile } from './packem_shared/writeFile-
|
|
30
|
-
export { default as writeFileSync } from './packem_shared/writeFileSync-
|
|
31
|
-
export { default as writeJson } from './packem_shared/writeJson-
|
|
32
|
-
export { default as writeJsonSync } from './packem_shared/writeJsonSync-
|
|
33
|
-
export { isFsCaseSensitive } from './packem_shared/isFsCaseSensitive-
|
|
26
|
+
export { default as readFileSync } from './packem_shared/readFileSync-gm9yfIhh.js';
|
|
27
|
+
export { default as readJson } from './packem_shared/readJson-C_rwm-wq.js';
|
|
28
|
+
export { default as readJsonSync } from './packem_shared/readJsonSync-BMEmCcJ6.js';
|
|
29
|
+
export { default as emptyDir } from './packem_shared/emptyDir-DnwENOaV.js';
|
|
30
|
+
export { default as emptyDirSync } from './packem_shared/emptyDirSync-6WiHBo8a.js';
|
|
31
|
+
export { default as remove } from './packem_shared/remove-C8_gl3jF.js';
|
|
32
|
+
export { default as removeSync } from './packem_shared/removeSync-BJR_wTwN.js';
|
|
33
|
+
export { sanitize } from './packem_shared/sanitize-BZoLN9Fg.js';
|
|
34
|
+
export { default as writeFile } from './packem_shared/writeFile-B8HX0JIQ.js';
|
|
35
|
+
export { default as writeFileSync } from './packem_shared/writeFileSync-DB8vv8xR.js';
|
|
36
|
+
export { default as writeJson } from './packem_shared/writeJson-Bo7C2UHw.js';
|
|
37
|
+
export { default as writeJsonSync } from './packem_shared/writeJsonSync-BKZ_9Acr.js';
|
|
38
|
+
export { isFsCaseSensitive } from './packem_shared/isFsCaseSensitive-DunL7Iry.js';
|
package/dist/ini.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as CompressionType, n as ReadIniOptions, o as WriteIniOptions } from "./packem_shared/types.d-CYpAhWov.js";
|
|
2
|
+
export { type I as IniEncodeOptions, type p as IniLineEnding } from "./packem_shared/types.d-CYpAhWov.js";
|
|
3
|
+
import 'node:fs';
|
|
4
|
+
import 'tinyglobby';
|
|
5
|
+
import './options';
|
|
6
|
+
declare const readIni: <R = Record<string, unknown>>(path: URL | string, options?: ReadIniOptions<CompressionType>) => Promise<R>;
|
|
7
|
+
declare const readIniSync: (path: URL | string, options?: ReadIniOptions<CompressionType>) => Record<string, unknown>;
|
|
8
|
+
declare const writeIni: (path: URL | string, data: Record<string, unknown>, options?: WriteIniOptions) => Promise<void>;
|
|
9
|
+
declare const writeIniSync: (path: URL | string, data: Record<string, unknown>, options?: WriteIniOptions) => void;
|
|
10
|
+
export { type ReadIniOptions, type WriteIniOptions, readIni, readIniSync, writeIni, writeIniSync };
|
package/dist/ini.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as readIni } from './packem_shared/readIni-CJ2xfpjB.js';
|
|
2
|
+
export { default as readIniSync } from './packem_shared/readIniSync-9LUjaSSp.js';
|
|
3
|
+
export { default as writeIni } from './packem_shared/writeIni-i55QrL8y.js';
|
|
4
|
+
export { default as writeIniSync } from './packem_shared/writeIniSync-CLqJE5t3.js';
|
package/dist/is-glob.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { g as getDefaultExportFromCjs } from './packem_shared/_commonjsHelpers-BqLXS_qQ.js';
|
|
2
|
+
import { r as requireIsGlob } from './packem_shared/index-bhgnhm4u.js';
|
|
3
|
+
|
|
4
|
+
var isGlobExports = requireIsGlob();
|
|
5
|
+
const isGlobImpl = /*@__PURE__*/getDefaultExportFromCjs(isGlobExports);
|
|
6
|
+
|
|
7
|
+
const isGlob = (value, options) => isGlobImpl(value, options);
|
|
8
|
+
|
|
9
|
+
export { isGlob as default };
|
package/dist/json5.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { a as CompressionType, j as ReadJson5Options, k as Json5Reviver, l as WriteJson5Options } from "./packem_shared/types.d-CYpAhWov.js";
|
|
2
|
+
export { type m as Json5Replacer } from "./packem_shared/types.d-CYpAhWov.js";
|
|
3
|
+
import 'node:fs';
|
|
4
|
+
import 'tinyglobby';
|
|
5
|
+
import './options';
|
|
6
|
+
declare function readJson5<R = unknown>(path: URL | string, options?: ReadJson5Options<CompressionType>): Promise<R>;
|
|
7
|
+
declare function readJson5<R = unknown>(path: URL | string, reviver: Json5Reviver, options?: ReadJson5Options<CompressionType>): Promise<R>;
|
|
8
|
+
declare function readJson5Sync(path: URL | string, options?: ReadJson5Options<CompressionType>): unknown;
|
|
9
|
+
declare function readJson5Sync(path: URL | string, reviver: Json5Reviver, options?: ReadJson5Options<CompressionType>): unknown;
|
|
10
|
+
declare const writeJson5: (path: URL | string, data: unknown, options?: WriteJson5Options) => Promise<void>;
|
|
11
|
+
declare const writeJson5Sync: (path: URL | string, data: unknown, options?: WriteJson5Options) => void;
|
|
12
|
+
export { type Json5Reviver, type ReadJson5Options, type WriteJson5Options, readJson5, readJson5Sync, writeJson5, writeJson5Sync };
|
package/dist/json5.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as readJson5 } from './packem_shared/readJson5-mBoTZppy.js';
|
|
2
|
+
export { default as readJson5Sync } from './packem_shared/readJson5Sync-8WS2yUok.js';
|
|
3
|
+
export { default as writeJson5 } from './packem_shared/writeJson5-vVmHUQOd.js';
|
|
4
|
+
export { default as writeJson5Sync } from './packem_shared/writeJson5Sync-oJ546h5k.js';
|
package/dist/jsonc.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as CompressionType, d as ReadJsoncOptions, e as WriteJsoncOptions } from "./packem_shared/types.d-CYpAhWov.js";
|
|
2
|
+
export { type f as JsoncFormattingOptions, type g as JsoncParseOptions } from "./packem_shared/types.d-CYpAhWov.js";
|
|
3
|
+
import 'node:fs';
|
|
4
|
+
import 'tinyglobby';
|
|
5
|
+
import './options';
|
|
6
|
+
declare const readJsonc: (path: URL | string, options?: ReadJsoncOptions<CompressionType>) => Promise<unknown>;
|
|
7
|
+
declare const readJsoncSync: (path: URL | string, options?: ReadJsoncOptions<CompressionType>) => unknown;
|
|
8
|
+
declare const writeJsonc: (path: URL | string, data: unknown, options?: WriteJsoncOptions) => Promise<void>;
|
|
9
|
+
declare const writeJsoncSync: (path: URL | string, data: unknown, options?: WriteJsoncOptions) => void;
|
|
10
|
+
export { type ReadJsoncOptions, type WriteJsoncOptions, readJsonc, readJsoncSync, writeJsonc, writeJsoncSync };
|
package/dist/jsonc.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as readJsonc } from './packem_shared/readJsonc-j-OS-APg.js';
|
|
2
|
+
export { default as readJsoncSync } from './packem_shared/readJsoncSync-Aw6EMlWO.js';
|
|
3
|
+
export { default as writeJsonc } from './packem_shared/writeJsonc-BufH_oC5.js';
|
|
4
|
+
export { default as writeJsoncSync } from './packem_shared/writeJsoncSync-DB9be1YL.js';
|
package/dist/match.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PicomatchOptions } from 'picomatch';
|
|
2
|
+
type MatchOptions = PicomatchOptions;
|
|
3
|
+
declare const match: (value: string | string[], pattern: string | string[], options?: MatchOptions) => boolean;
|
|
4
|
+
declare const matcher: (pattern: string | string[], options?: MatchOptions) => (value: string) => boolean;
|
|
5
|
+
export { MatchOptions, match, matcher };
|
package/dist/match.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { p as picomatch } from './packem_shared/index-xe4o3cYi.js';
|
|
2
|
+
|
|
3
|
+
const match = (value, pattern, options) => {
|
|
4
|
+
const isMatch = picomatch(pattern, options);
|
|
5
|
+
if (Array.isArray(value)) {
|
|
6
|
+
return value.some((entry) => isMatch(entry));
|
|
7
|
+
}
|
|
8
|
+
return isMatch(value);
|
|
9
|
+
};
|
|
10
|
+
const matcher = (pattern, options) => {
|
|
11
|
+
const isMatch = picomatch(pattern, options);
|
|
12
|
+
return (value) => isMatch(value);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { match, matcher };
|
|
@@ -7,7 +7,7 @@ class WalkError extends Error {
|
|
|
7
7
|
* @param root The root directory path where the walk operation started or encountered the error.
|
|
8
8
|
*/
|
|
9
9
|
constructor(cause, root) {
|
|
10
|
-
super(`${cause instanceof Error ? cause.message : cause} for path "${root}"`);
|
|
10
|
+
super(`${cause instanceof Error ? cause.message : String(cause)} for path "${root}"`);
|
|
11
11
|
this.cause = cause;
|
|
12
12
|
this.root = root;
|
|
13
13
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const buildRmOptions = (options) => {
|
|
2
|
+
const rmOptions = { force: true, recursive: true };
|
|
3
|
+
if (options?.maxRetries !== void 0) {
|
|
4
|
+
rmOptions.maxRetries = options.maxRetries;
|
|
5
|
+
}
|
|
6
|
+
if (options?.retryDelay !== void 0) {
|
|
7
|
+
rmOptions.retryDelay = options.retryDelay;
|
|
8
|
+
}
|
|
9
|
+
return rmOptions;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { buildRmOptions as b };
|
|
@@ -28,6 +28,7 @@ const {
|
|
|
28
28
|
import { join } from '@visulima/path';
|
|
29
29
|
import { toPath } from '@visulima/path/utils';
|
|
30
30
|
import assertValidFileOrDirectoryPath from './assertValidFileOrDirectoryPath-8HANmVjk.js';
|
|
31
|
+
import { b as buildRmOptions } from './build-rm-options-Cl3VDY4O.js';
|
|
31
32
|
|
|
32
33
|
const emptyDir = async (dir, options) => {
|
|
33
34
|
assertValidFileOrDirectoryPath(dir);
|
|
@@ -35,8 +36,10 @@ const emptyDir = async (dir, options) => {
|
|
|
35
36
|
await mkdir(dir, { recursive: true });
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
const items = await readdir(dir);
|
|
40
|
+
const rmOptions = buildRmOptions(options);
|
|
41
|
+
for (const item of items) {
|
|
42
|
+
await rm(join(toPath(dir), item), rmOptions);
|
|
40
43
|
}
|
|
41
44
|
};
|
|
42
45
|
|
|
@@ -26,6 +26,7 @@ const {
|
|
|
26
26
|
import { join } from '@visulima/path';
|
|
27
27
|
import { toPath } from '@visulima/path/utils';
|
|
28
28
|
import assertValidFileOrDirectoryPath from './assertValidFileOrDirectoryPath-8HANmVjk.js';
|
|
29
|
+
import { b as buildRmOptions } from './build-rm-options-Cl3VDY4O.js';
|
|
29
30
|
|
|
30
31
|
const emptyDirSync = (dir, options) => {
|
|
31
32
|
assertValidFileOrDirectoryPath(dir);
|
|
@@ -33,8 +34,9 @@ const emptyDirSync = (dir, options) => {
|
|
|
33
34
|
mkdirSync(dir, { recursive: true });
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
37
|
+
const rmOptions = buildRmOptions(options);
|
|
36
38
|
for (const item of readdirSync(dir)) {
|
|
37
|
-
rmSync(join(toPath(dir), item),
|
|
39
|
+
rmSync(join(toPath(dir), item), rmOptions);
|
|
38
40
|
}
|
|
39
41
|
};
|
|
40
42
|
|
|
@@ -29,7 +29,7 @@ const ensureDir = async (directory) => {
|
|
|
29
29
|
try {
|
|
30
30
|
const fileInfo = await lstat(directory);
|
|
31
31
|
if (!fileInfo.isDirectory()) {
|
|
32
|
-
throw new Error(`Ensure path exists, expected 'dir', got '${getFileInfoType(fileInfo)}'`);
|
|
32
|
+
throw new Error(`Ensure path exists, expected 'dir', got '${String(getFileInfoType(fileInfo))}'`);
|
|
33
33
|
}
|
|
34
34
|
return;
|
|
35
35
|
} catch (error) {
|
|
@@ -45,7 +45,7 @@ const ensureDir = async (directory) => {
|
|
|
45
45
|
}
|
|
46
46
|
const fileInfo = await lstat(directory);
|
|
47
47
|
if (!fileInfo.isDirectory()) {
|
|
48
|
-
throw new Error(`Ensure path exists, expected 'dir', got '${getFileInfoType(fileInfo)}'
|
|
48
|
+
throw new Error(`Ensure path exists, expected 'dir', got '${String(getFileInfoType(fileInfo))}'`, { cause: error });
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
};
|
|
@@ -29,7 +29,7 @@ const ensureDirSync = (directory) => {
|
|
|
29
29
|
try {
|
|
30
30
|
const fileInfo = lstatSync(directory);
|
|
31
31
|
if (!fileInfo.isDirectory()) {
|
|
32
|
-
throw new Error(`Ensure path exists, expected 'dir', got '${getFileInfoType(fileInfo)}'`);
|
|
32
|
+
throw new Error(`Ensure path exists, expected 'dir', got '${String(getFileInfoType(fileInfo))}'`);
|
|
33
33
|
}
|
|
34
34
|
return;
|
|
35
35
|
} catch (error) {
|
|
@@ -45,7 +45,7 @@ const ensureDirSync = (directory) => {
|
|
|
45
45
|
}
|
|
46
46
|
const fileInfo = lstatSync(directory);
|
|
47
47
|
if (!fileInfo.isDirectory()) {
|
|
48
|
-
throw new Error(`Ensure path exists, expected 'dir', got '${getFileInfoType(fileInfo)}'
|
|
48
|
+
throw new Error(`Ensure path exists, expected 'dir', got '${String(getFileInfoType(fileInfo))}'`, { cause: error });
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
};
|
|
@@ -24,7 +24,7 @@ const {
|
|
|
24
24
|
import { dirname } from '@visulima/path';
|
|
25
25
|
import { toPath } from '@visulima/path/utils';
|
|
26
26
|
import assertValidFileOrDirectoryPath from './assertValidFileOrDirectoryPath-8HANmVjk.js';
|
|
27
|
-
import ensureDir from './ensureDir-
|
|
27
|
+
import ensureDir from './ensureDir-DNlPftys.js';
|
|
28
28
|
import { g as getFileInfoType } from './get-file-info-type-FD4-jsyg.js';
|
|
29
29
|
|
|
30
30
|
const ensureFile = async (filePath) => {
|
|
@@ -32,7 +32,7 @@ const ensureFile = async (filePath) => {
|
|
|
32
32
|
try {
|
|
33
33
|
const stat = await lstat(filePath);
|
|
34
34
|
if (!stat.isFile()) {
|
|
35
|
-
throw new Error(`Ensure path exists, expected 'file', got '${getFileInfoType(stat)}'`);
|
|
35
|
+
throw new Error(`Ensure path exists, expected 'file', got '${String(getFileInfoType(stat))}'`);
|
|
36
36
|
}
|
|
37
37
|
} catch (error) {
|
|
38
38
|
if (error.code === "ENOENT") {
|
|
@@ -24,7 +24,7 @@ const {
|
|
|
24
24
|
import { dirname } from '@visulima/path';
|
|
25
25
|
import { toPath } from '@visulima/path/utils';
|
|
26
26
|
import assertValidFileOrDirectoryPath from './assertValidFileOrDirectoryPath-8HANmVjk.js';
|
|
27
|
-
import ensureDirSync from './ensureDirSync-
|
|
27
|
+
import ensureDirSync from './ensureDirSync-DcPZFMy5.js';
|
|
28
28
|
import { g as getFileInfoType } from './get-file-info-type-FD4-jsyg.js';
|
|
29
29
|
|
|
30
30
|
const ensureFileSync = (filePath) => {
|
|
@@ -32,7 +32,7 @@ const ensureFileSync = (filePath) => {
|
|
|
32
32
|
try {
|
|
33
33
|
const stat = lstatSync(filePath);
|
|
34
34
|
if (!stat.isFile()) {
|
|
35
|
-
throw new Error(`Ensure path exists, expected 'file', got '${getFileInfoType(stat)}'`);
|
|
35
|
+
throw new Error(`Ensure path exists, expected 'file', got '${String(getFileInfoType(stat))}'`);
|
|
36
36
|
}
|
|
37
37
|
} catch (error) {
|
|
38
38
|
if (error.code === "ENOENT") {
|
|
@@ -24,7 +24,7 @@ const {
|
|
|
24
24
|
import { toNamespacedPath, dirname } from '@visulima/path';
|
|
25
25
|
import { toPath } from '@visulima/path/utils';
|
|
26
26
|
import assertValidFileOrDirectoryPath from './assertValidFileOrDirectoryPath-8HANmVjk.js';
|
|
27
|
-
import ensureDir from './ensureDir-
|
|
27
|
+
import ensureDir from './ensureDir-DNlPftys.js';
|
|
28
28
|
import { i as isStatsIdentical } from './is-stats-identical-D8FxpvQU.js';
|
|
29
29
|
|
|
30
30
|
const ensureLink = async (source, destination) => {
|
|
@@ -41,8 +41,9 @@ const ensureLink = async (source, destination) => {
|
|
|
41
41
|
try {
|
|
42
42
|
sourceStat = await lstat(source);
|
|
43
43
|
} catch (error) {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
const nodeError = error;
|
|
45
|
+
nodeError.message = nodeError.message.replace("lstat", "ensureLink");
|
|
46
|
+
throw nodeError;
|
|
46
47
|
}
|
|
47
48
|
if (destinationStat && isStatsIdentical(sourceStat, destinationStat)) {
|
|
48
49
|
return;
|
|
@@ -24,7 +24,7 @@ const {
|
|
|
24
24
|
import { toNamespacedPath, dirname } from '@visulima/path';
|
|
25
25
|
import { toPath } from '@visulima/path/utils';
|
|
26
26
|
import assertValidFileOrDirectoryPath from './assertValidFileOrDirectoryPath-8HANmVjk.js';
|
|
27
|
-
import ensureDirSync from './ensureDirSync-
|
|
27
|
+
import ensureDirSync from './ensureDirSync-DcPZFMy5.js';
|
|
28
28
|
import { i as isStatsIdentical } from './is-stats-identical-D8FxpvQU.js';
|
|
29
29
|
|
|
30
30
|
const ensureLinkSync = (source, destination) => {
|
|
@@ -41,8 +41,9 @@ const ensureLinkSync = (source, destination) => {
|
|
|
41
41
|
try {
|
|
42
42
|
sourceStat = lstatSync(source);
|
|
43
43
|
} catch (error) {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
const nodeError = error;
|
|
45
|
+
nodeError.message = nodeError.message.replace("lstat", "ensureLink");
|
|
46
|
+
throw nodeError;
|
|
46
47
|
}
|
|
47
48
|
if (destinationStat && isStatsIdentical(sourceStat, destinationStat)) {
|
|
48
49
|
return;
|