@telia-ace/alliance-utilities 1.0.2 → 1.0.3-next.1
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 +12 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +970 -1024
- package/dist/index.js.map +1 -1
- package/dist/texts.d.ts +8 -0
- package/dist/translations.d.ts +57 -0
- package/package.json +3 -3
- package/typescript-config.json +0 -1
package/dist/index.js
CHANGED
|
@@ -1,56 +1,131 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
var Yt = Object.defineProperty;
|
|
2
|
+
var Vt = (e, t, n) => t in e ? Yt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var se = (e, t, n) => (Vt(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
+
import it from "fs";
|
|
5
|
+
import M from "path";
|
|
6
|
+
import { pipeline as zt } from "stream/promises";
|
|
7
|
+
var ot = /* @__PURE__ */ ((e) => (e[e.Yes = 0] = "Yes", e[e.No = 1] = "No", e[e.Done = 2] = "Done", e[e.NoWorkspaceName = 3] = "NoWorkspaceName", e[e.NoAppName = 4] = "NoAppName", e[e.AlreadyExists = 5] = "AlreadyExists", e[e.CwdIsNotWorkspace = 6] = "CwdIsNotWorkspace", e[e.NoAppOrWorkspaceInCurrentDirectory = 7] = "NoAppOrWorkspaceInCurrentDirectory", e[e.UnrecognizedCommand = 8] = "UnrecognizedCommand", e[e.WorkspaceCreated = 9] = "WorkspaceCreated", e[e.AppCreated = 10] = "AppCreated", e[e.ServedStopped = 11] = "ServedStopped", e[e.WorkspaceNameInquiry = 12] = "WorkspaceNameInquiry", e[e.AppNameInquiry = 13] = "AppNameInquiry", e[e.GatewayInquiry = 14] = "GatewayInquiry", e[e.CliVersionOption = 15] = "CliVersionOption", e[e.CreateWorkspaceDescription = 16] = "CreateWorkspaceDescription", e[e.CreateAppDescription = 17] = "CreateAppDescription", e[e.ServeDescription = 18] = "ServeDescription", e[e.BuildDescription = 19] = "BuildDescription", e[e.MissingTranslationKey = 20] = "MissingTranslationKey", e[e.ActionErrorOccured = 21] = "ActionErrorOccured", e[e.OperationStateSetError = 22] = "OperationStateSetError", e[e.OperationCancelled = 23] = "OperationCancelled", e[e.StopServerInstructions = 24] = "StopServerInstructions", e[e.LanguageInquiry = 25] = "LanguageInquiry", e[e.TemplateInquiry = 26] = "TemplateInquiry", e[e.NonSupportedBuildPlugin = 27] = "NonSupportedBuildPlugin", e[e.DevServerPortDescription = 28] = "DevServerPortDescription", e[e.ApiGatewayPortDescription = 29] = "ApiGatewayPortDescription", e[e.ApiServerModeDescription = 30] = "ApiServerModeDescription", e[e.DevServerOpenDescription = 31] = "DevServerOpenDescription", e[e.BuildWatchDescription = 32] = "BuildWatchDescription", e[e.CouldNotStartGatewayInDocker = 33] = "CouldNotStartGatewayInDocker", e[e.PullingLatestImage = 34] = "PullingLatestImage", e[e.PullLatestImageError = 35] = "PullLatestImageError", e[e.AppEntryBuildOptionDescription = 36] = "AppEntryBuildOptionDescription", e[e.ManifestEntryBuildOptionDescription = 37] = "ManifestEntryBuildOptionDescription", e[e.BuildPluginOptionDescription = 38] = "BuildPluginOptionDescription", e[e.BuildModeOptionDescription = 39] = "BuildModeOptionDescription", e[e.FetchPackageVersionError = 40] = "FetchPackageVersionError", e[e.UnknownArgumentDescription = 41] = "UnknownArgumentDescription", e[e.DockerNotStartedOrInstalled = 42] = "DockerNotStartedOrInstalled", e[e.PressAnyKeyToContinue = 43] = "PressAnyKeyToContinue", e[e.EnableDevAuthentication = 44] = "EnableDevAuthentication", e[e.UnsupportedBuildPlugin = 45] = "UnsupportedBuildPlugin", e[e.NoAppNameFound = 46] = "NoAppNameFound", e[e.AppConfigurationPath = 47] = "AppConfigurationPath", e[e.ServerGatewayMode = 48] = "ServerGatewayMode", e[e.ServerProxyMode = 49] = "ServerProxyMode", e[e.ServerMode = 50] = "ServerMode", e))(ot || {});
|
|
8
|
+
const Qt = {
|
|
9
|
+
[0]: "Yes",
|
|
10
|
+
[1]: "No",
|
|
11
|
+
[2]: "Done",
|
|
12
|
+
[3]: "No workspace name provided!",
|
|
13
|
+
[4]: "No app name provided!",
|
|
14
|
+
[5]: "File or directory '{0}' already exists!",
|
|
15
|
+
[6]: "Current directory is not an Alliance workspace.",
|
|
16
|
+
[7]: "Could not find any app entry file at '{0}' or any apps under the alliance.apps property in '{1}'!",
|
|
17
|
+
[8]: "Unrecognized command(s) {0}!",
|
|
18
|
+
[9]: "Workspace '{0}' was created on path '{1}'!",
|
|
19
|
+
[10]: "App '{0}' was created on path '{1}'!",
|
|
20
|
+
[11]: "Server stopped.",
|
|
21
|
+
[16]: "Creates an Alliance Workspace in the current directory.",
|
|
22
|
+
[17]: "Creates an Alliance Application in the current directory or Alliance Workspace.",
|
|
23
|
+
[18]: "Starts a Alliance development server using the current directory package.json.",
|
|
24
|
+
[15]: "Prints which version is currently is installed.",
|
|
25
|
+
[19]: "Builds an Alliance Application using Vite.",
|
|
26
|
+
[12]: "Enter the name of your workspace",
|
|
27
|
+
[14]: "Do you want to start the gateway?",
|
|
28
|
+
[13]: "Enter the name of your app",
|
|
29
|
+
[20]: "No translation key provided!",
|
|
30
|
+
[21]: "Error occured when running action number {0}, with the message: ",
|
|
31
|
+
[22]: "Tried to set already existing key '{0}' on OperationState.",
|
|
32
|
+
[23]: "Operation cancelled.",
|
|
33
|
+
[24]: `Press CTRL + C to stop the server.
|
|
34
|
+
`,
|
|
35
|
+
[25]: "Select preferred language",
|
|
36
|
+
[26]: "Select preferred framework template",
|
|
37
|
+
[27]: "Framework '{0}' not supported. Supported frameworks: {1}!",
|
|
38
|
+
[28]: "The port that the dev server should use.",
|
|
39
|
+
[29]: "The port that the api gateway should use.",
|
|
40
|
+
[30]: "Which components to start. [server|server-proxy|server-gateway].",
|
|
41
|
+
[31]: "Whether the dev server should automatically open in your browser or not.",
|
|
42
|
+
[32]: "Whether the build should start watching and rebuild when files change or not.",
|
|
43
|
+
[33]: "Could not start Docker container with Alliance gateway.",
|
|
44
|
+
[34]: "Pulling latest image...",
|
|
45
|
+
[35]: "Error when pulling latest image...",
|
|
46
|
+
[36]: "The entry file for the app (./src/app).",
|
|
47
|
+
[37]: "The entry file for the app manifest (./src/manifest).",
|
|
48
|
+
[38]: "The Vite build plugin to use.",
|
|
49
|
+
[39]: "Which mode to use when building the app. [production|development]",
|
|
50
|
+
[40]: "Failed to fetch package info from the NPM registry for package '${0}'!",
|
|
51
|
+
[41]: "Unknown value '{0}' for argument '{1}'",
|
|
52
|
+
[42]: "Docker not started or not installed.",
|
|
53
|
+
[43]: "Press any key to continue...",
|
|
54
|
+
[44]: "Whether user authentication should be enabled or not.",
|
|
55
|
+
[45]: "Build plugin '{0}' not supported.",
|
|
56
|
+
[46]: "Could not find app name in manifest.",
|
|
57
|
+
[47]: "The path to the app configuration file.",
|
|
58
|
+
[50]: "Server",
|
|
59
|
+
[49]: "Server with proxy",
|
|
60
|
+
[48]: "Server with gateway"
|
|
61
|
+
}, Se = class {
|
|
62
|
+
};
|
|
63
|
+
let te = Se;
|
|
64
|
+
se(te, "getTranslations", () => Qt), se(te, "getTranslation", (t, ...n) => {
|
|
65
|
+
const r = Se.getTranslations()[t];
|
|
66
|
+
if (!r)
|
|
67
|
+
throw new Error(`Could not find text with given key '${t}'.`);
|
|
68
|
+
return n.reduce(
|
|
69
|
+
(c, a, f) => c.toString().replace(`{${f}}`, a.toString()),
|
|
70
|
+
r
|
|
71
|
+
).toString();
|
|
72
|
+
}), se(te, "get", (t = ot.MissingTranslationKey, ...n) => Se.getTranslation(t, ...n));
|
|
73
|
+
var Oe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
74
|
+
function Ht(e) {
|
|
75
|
+
var t = e.default;
|
|
76
|
+
if (typeof t == "function") {
|
|
77
|
+
var n = function i() {
|
|
78
|
+
if (this instanceof i) {
|
|
79
|
+
var r = [null];
|
|
80
|
+
r.push.apply(r, arguments);
|
|
81
|
+
var o = Function.bind.apply(t, r);
|
|
82
|
+
return new o();
|
|
83
|
+
}
|
|
84
|
+
return t.apply(this, arguments);
|
|
10
85
|
};
|
|
11
|
-
|
|
86
|
+
n.prototype = t.prototype;
|
|
12
87
|
} else
|
|
13
|
-
|
|
14
|
-
return Object.defineProperty(
|
|
15
|
-
var
|
|
16
|
-
Object.defineProperty(
|
|
88
|
+
n = {};
|
|
89
|
+
return Object.defineProperty(n, "__esModule", { value: !0 }), Object.keys(e).forEach(function(i) {
|
|
90
|
+
var r = Object.getOwnPropertyDescriptor(e, i);
|
|
91
|
+
Object.defineProperty(n, i, r.get ? r : {
|
|
17
92
|
enumerable: !0,
|
|
18
93
|
get: function() {
|
|
19
|
-
return e[
|
|
94
|
+
return e[i];
|
|
20
95
|
}
|
|
21
96
|
});
|
|
22
|
-
}),
|
|
97
|
+
}), n;
|
|
23
98
|
}
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
return Object.defineProperty(function(...
|
|
27
|
-
if (typeof
|
|
28
|
-
e.apply(this,
|
|
99
|
+
var z = {}, W = {};
|
|
100
|
+
W.fromCallback = function(e) {
|
|
101
|
+
return Object.defineProperty(function(...t) {
|
|
102
|
+
if (typeof t[t.length - 1] == "function")
|
|
103
|
+
e.apply(this, t);
|
|
29
104
|
else
|
|
30
|
-
return new Promise((
|
|
105
|
+
return new Promise((n, i) => {
|
|
31
106
|
e.call(
|
|
32
107
|
this,
|
|
33
|
-
...
|
|
34
|
-
(
|
|
108
|
+
...t,
|
|
109
|
+
(r, o) => r != null ? i(r) : n(o)
|
|
35
110
|
);
|
|
36
111
|
});
|
|
37
112
|
}, "name", { value: e.name });
|
|
38
113
|
};
|
|
39
|
-
|
|
40
|
-
return Object.defineProperty(function(...
|
|
41
|
-
const
|
|
42
|
-
if (typeof
|
|
43
|
-
return e.apply(this,
|
|
44
|
-
e.apply(this,
|
|
114
|
+
W.fromPromise = function(e) {
|
|
115
|
+
return Object.defineProperty(function(...t) {
|
|
116
|
+
const n = t[t.length - 1];
|
|
117
|
+
if (typeof n != "function")
|
|
118
|
+
return e.apply(this, t);
|
|
119
|
+
e.apply(this, t.slice(0, -1)).then((i) => n(null, i), n);
|
|
45
120
|
}, "name", { value: e.name });
|
|
46
121
|
};
|
|
47
|
-
const
|
|
122
|
+
const Xt = {}, Zt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
48
123
|
__proto__: null,
|
|
49
|
-
default:
|
|
50
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
51
|
-
var
|
|
124
|
+
default: Xt
|
|
125
|
+
}, Symbol.toStringTag, { value: "Module" })), ae = /* @__PURE__ */ Ht(Zt);
|
|
126
|
+
var U = ae, Tt = process.cwd, de = null, Kt = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
52
127
|
process.cwd = function() {
|
|
53
|
-
return
|
|
128
|
+
return de || (de = Tt.call(process)), de;
|
|
54
129
|
};
|
|
55
130
|
try {
|
|
56
131
|
process.cwd();
|
|
@@ -59,85 +134,85 @@ try {
|
|
|
59
134
|
if (typeof process.chdir == "function") {
|
|
60
135
|
var Ue = process.chdir;
|
|
61
136
|
process.chdir = function(e) {
|
|
62
|
-
|
|
137
|
+
de = null, Ue.call(process, e);
|
|
63
138
|
}, Object.setPrototypeOf && Object.setPrototypeOf(process.chdir, Ue);
|
|
64
139
|
}
|
|
65
|
-
var
|
|
66
|
-
function
|
|
67
|
-
|
|
68
|
-
|
|
140
|
+
var en = tn;
|
|
141
|
+
function tn(e) {
|
|
142
|
+
U.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./) && t(e), e.lutimes || n(e), e.chown = o(e.chown), e.fchown = o(e.fchown), e.lchown = o(e.lchown), e.chmod = i(e.chmod), e.fchmod = i(e.fchmod), e.lchmod = i(e.lchmod), e.chownSync = c(e.chownSync), e.fchownSync = c(e.fchownSync), e.lchownSync = c(e.lchownSync), e.chmodSync = r(e.chmodSync), e.fchmodSync = r(e.fchmodSync), e.lchmodSync = r(e.lchmodSync), e.stat = a(e.stat), e.fstat = a(e.fstat), e.lstat = a(e.lstat), e.statSync = f(e.statSync), e.fstatSync = f(e.fstatSync), e.lstatSync = f(e.lstatSync), e.chmod && !e.lchmod && (e.lchmod = function(u, s, m) {
|
|
143
|
+
m && process.nextTick(m);
|
|
69
144
|
}, e.lchmodSync = function() {
|
|
70
|
-
}), e.chown && !e.lchown && (e.lchown = function(u, s,
|
|
145
|
+
}), e.chown && !e.lchown && (e.lchown = function(u, s, m, l) {
|
|
71
146
|
l && process.nextTick(l);
|
|
72
147
|
}, e.lchownSync = function() {
|
|
73
|
-
}),
|
|
74
|
-
function s(
|
|
75
|
-
var
|
|
76
|
-
u(
|
|
77
|
-
if (
|
|
148
|
+
}), Kt === "win32" && (e.rename = typeof e.rename != "function" ? e.rename : function(u) {
|
|
149
|
+
function s(m, l, y) {
|
|
150
|
+
var g = Date.now(), v = 0;
|
|
151
|
+
u(m, l, function $(R) {
|
|
152
|
+
if (R && (R.code === "EACCES" || R.code === "EPERM") && Date.now() - g < 6e4) {
|
|
78
153
|
setTimeout(function() {
|
|
79
|
-
e.stat(l, function(
|
|
80
|
-
|
|
154
|
+
e.stat(l, function(A, ee) {
|
|
155
|
+
A && A.code === "ENOENT" ? u(m, l, $) : y(R);
|
|
81
156
|
});
|
|
82
157
|
}, v), v < 100 && (v += 10);
|
|
83
158
|
return;
|
|
84
159
|
}
|
|
85
|
-
|
|
160
|
+
y && y(R);
|
|
86
161
|
});
|
|
87
162
|
}
|
|
88
163
|
return Object.setPrototypeOf && Object.setPrototypeOf(s, u), s;
|
|
89
164
|
}(e.rename)), e.read = typeof e.read != "function" ? e.read : function(u) {
|
|
90
|
-
function s(
|
|
91
|
-
var
|
|
92
|
-
if (
|
|
93
|
-
var
|
|
94
|
-
|
|
95
|
-
if (
|
|
96
|
-
return
|
|
97
|
-
|
|
165
|
+
function s(m, l, y, g, v, $) {
|
|
166
|
+
var R;
|
|
167
|
+
if ($ && typeof $ == "function") {
|
|
168
|
+
var A = 0;
|
|
169
|
+
R = function(ee, Je, be) {
|
|
170
|
+
if (ee && ee.code === "EAGAIN" && A < 10)
|
|
171
|
+
return A++, u.call(e, m, l, y, g, v, R);
|
|
172
|
+
$.apply(this, arguments);
|
|
98
173
|
};
|
|
99
174
|
}
|
|
100
|
-
return u.call(e,
|
|
175
|
+
return u.call(e, m, l, y, g, v, R);
|
|
101
176
|
}
|
|
102
177
|
return Object.setPrototypeOf && Object.setPrototypeOf(s, u), s;
|
|
103
178
|
}(e.read), e.readSync = typeof e.readSync != "function" ? e.readSync : function(u) {
|
|
104
|
-
return function(s,
|
|
179
|
+
return function(s, m, l, y, g) {
|
|
105
180
|
for (var v = 0; ; )
|
|
106
181
|
try {
|
|
107
|
-
return u.call(e, s,
|
|
108
|
-
} catch (
|
|
109
|
-
if (
|
|
182
|
+
return u.call(e, s, m, l, y, g);
|
|
183
|
+
} catch ($) {
|
|
184
|
+
if ($.code === "EAGAIN" && v < 10) {
|
|
110
185
|
v++;
|
|
111
186
|
continue;
|
|
112
187
|
}
|
|
113
|
-
throw
|
|
188
|
+
throw $;
|
|
114
189
|
}
|
|
115
190
|
};
|
|
116
191
|
}(e.readSync);
|
|
117
|
-
function
|
|
118
|
-
u.lchmod = function(s,
|
|
192
|
+
function t(u) {
|
|
193
|
+
u.lchmod = function(s, m, l) {
|
|
119
194
|
u.open(
|
|
120
195
|
s,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
function(
|
|
124
|
-
if (
|
|
125
|
-
l && l(
|
|
196
|
+
U.O_WRONLY | U.O_SYMLINK,
|
|
197
|
+
m,
|
|
198
|
+
function(y, g) {
|
|
199
|
+
if (y) {
|
|
200
|
+
l && l(y);
|
|
126
201
|
return;
|
|
127
202
|
}
|
|
128
|
-
u.fchmod(
|
|
129
|
-
u.close(
|
|
130
|
-
l && l(v ||
|
|
203
|
+
u.fchmod(g, m, function(v) {
|
|
204
|
+
u.close(g, function($) {
|
|
205
|
+
l && l(v || $);
|
|
131
206
|
});
|
|
132
207
|
});
|
|
133
208
|
}
|
|
134
209
|
);
|
|
135
|
-
}, u.lchmodSync = function(s,
|
|
136
|
-
var l = u.openSync(s,
|
|
210
|
+
}, u.lchmodSync = function(s, m) {
|
|
211
|
+
var l = u.openSync(s, U.O_WRONLY | U.O_SYMLINK, m), y = !0, g;
|
|
137
212
|
try {
|
|
138
|
-
|
|
213
|
+
g = u.fchmodSync(l, m), y = !1;
|
|
139
214
|
} finally {
|
|
140
|
-
if (
|
|
215
|
+
if (y)
|
|
141
216
|
try {
|
|
142
217
|
u.closeSync(l);
|
|
143
218
|
} catch {
|
|
@@ -145,112 +220,112 @@ function ft(e) {
|
|
|
145
220
|
else
|
|
146
221
|
u.closeSync(l);
|
|
147
222
|
}
|
|
148
|
-
return
|
|
223
|
+
return g;
|
|
149
224
|
};
|
|
150
225
|
}
|
|
151
|
-
function
|
|
152
|
-
|
|
153
|
-
u.open(s,
|
|
154
|
-
if (
|
|
155
|
-
|
|
226
|
+
function n(u) {
|
|
227
|
+
U.hasOwnProperty("O_SYMLINK") && u.futimes ? (u.lutimes = function(s, m, l, y) {
|
|
228
|
+
u.open(s, U.O_SYMLINK, function(g, v) {
|
|
229
|
+
if (g) {
|
|
230
|
+
y && y(g);
|
|
156
231
|
return;
|
|
157
232
|
}
|
|
158
|
-
u.futimes(v,
|
|
159
|
-
u.close(v, function(
|
|
160
|
-
|
|
233
|
+
u.futimes(v, m, l, function($) {
|
|
234
|
+
u.close(v, function(R) {
|
|
235
|
+
y && y($ || R);
|
|
161
236
|
});
|
|
162
237
|
});
|
|
163
238
|
});
|
|
164
|
-
}, u.lutimesSync = function(s,
|
|
165
|
-
var
|
|
239
|
+
}, u.lutimesSync = function(s, m, l) {
|
|
240
|
+
var y = u.openSync(s, U.O_SYMLINK), g, v = !0;
|
|
166
241
|
try {
|
|
167
|
-
|
|
242
|
+
g = u.futimesSync(y, m, l), v = !1;
|
|
168
243
|
} finally {
|
|
169
244
|
if (v)
|
|
170
245
|
try {
|
|
171
|
-
u.closeSync(
|
|
246
|
+
u.closeSync(y);
|
|
172
247
|
} catch {
|
|
173
248
|
}
|
|
174
249
|
else
|
|
175
|
-
u.closeSync(
|
|
250
|
+
u.closeSync(y);
|
|
176
251
|
}
|
|
177
|
-
return
|
|
178
|
-
}) : u.futimes && (u.lutimes = function(s,
|
|
179
|
-
|
|
252
|
+
return g;
|
|
253
|
+
}) : u.futimes && (u.lutimes = function(s, m, l, y) {
|
|
254
|
+
y && process.nextTick(y);
|
|
180
255
|
}, u.lutimesSync = function() {
|
|
181
256
|
});
|
|
182
257
|
}
|
|
183
|
-
function
|
|
184
|
-
return u && function(s,
|
|
185
|
-
return u.call(e, s,
|
|
186
|
-
|
|
258
|
+
function i(u) {
|
|
259
|
+
return u && function(s, m, l) {
|
|
260
|
+
return u.call(e, s, m, function(y) {
|
|
261
|
+
p(y) && (y = null), l && l.apply(this, arguments);
|
|
187
262
|
});
|
|
188
263
|
};
|
|
189
264
|
}
|
|
190
|
-
function
|
|
191
|
-
return u && function(s,
|
|
265
|
+
function r(u) {
|
|
266
|
+
return u && function(s, m) {
|
|
192
267
|
try {
|
|
193
|
-
return u.call(e, s,
|
|
268
|
+
return u.call(e, s, m);
|
|
194
269
|
} catch (l) {
|
|
195
|
-
if (!
|
|
270
|
+
if (!p(l))
|
|
196
271
|
throw l;
|
|
197
272
|
}
|
|
198
273
|
};
|
|
199
274
|
}
|
|
200
275
|
function o(u) {
|
|
201
|
-
return u && function(s,
|
|
202
|
-
return u.call(e, s,
|
|
203
|
-
|
|
276
|
+
return u && function(s, m, l, y) {
|
|
277
|
+
return u.call(e, s, m, l, function(g) {
|
|
278
|
+
p(g) && (g = null), y && y.apply(this, arguments);
|
|
204
279
|
});
|
|
205
280
|
};
|
|
206
281
|
}
|
|
207
282
|
function c(u) {
|
|
208
|
-
return u && function(s,
|
|
283
|
+
return u && function(s, m, l) {
|
|
209
284
|
try {
|
|
210
|
-
return u.call(e, s,
|
|
211
|
-
} catch (
|
|
212
|
-
if (!
|
|
213
|
-
throw
|
|
285
|
+
return u.call(e, s, m, l);
|
|
286
|
+
} catch (y) {
|
|
287
|
+
if (!p(y))
|
|
288
|
+
throw y;
|
|
214
289
|
}
|
|
215
290
|
};
|
|
216
291
|
}
|
|
217
292
|
function a(u) {
|
|
218
|
-
return u && function(s,
|
|
219
|
-
typeof
|
|
220
|
-
function
|
|
293
|
+
return u && function(s, m, l) {
|
|
294
|
+
typeof m == "function" && (l = m, m = null);
|
|
295
|
+
function y(g, v) {
|
|
221
296
|
v && (v.uid < 0 && (v.uid += 4294967296), v.gid < 0 && (v.gid += 4294967296)), l && l.apply(this, arguments);
|
|
222
297
|
}
|
|
223
|
-
return
|
|
298
|
+
return m ? u.call(e, s, m, y) : u.call(e, s, y);
|
|
224
299
|
};
|
|
225
300
|
}
|
|
226
301
|
function f(u) {
|
|
227
|
-
return u && function(s,
|
|
228
|
-
var l =
|
|
302
|
+
return u && function(s, m) {
|
|
303
|
+
var l = m ? u.call(e, s, m) : u.call(e, s);
|
|
229
304
|
return l && (l.uid < 0 && (l.uid += 4294967296), l.gid < 0 && (l.gid += 4294967296)), l;
|
|
230
305
|
};
|
|
231
306
|
}
|
|
232
|
-
function
|
|
307
|
+
function p(u) {
|
|
233
308
|
if (!u || u.code === "ENOSYS")
|
|
234
309
|
return !0;
|
|
235
310
|
var s = !process.getuid || process.getuid() !== 0;
|
|
236
311
|
return !!(s && (u.code === "EINVAL" || u.code === "EPERM"));
|
|
237
312
|
}
|
|
238
313
|
}
|
|
239
|
-
var
|
|
240
|
-
function
|
|
314
|
+
var qe = ae.Stream, nn = rn;
|
|
315
|
+
function rn(e) {
|
|
241
316
|
return {
|
|
242
|
-
ReadStream:
|
|
243
|
-
WriteStream:
|
|
317
|
+
ReadStream: t,
|
|
318
|
+
WriteStream: n
|
|
244
319
|
};
|
|
245
|
-
function
|
|
246
|
-
if (!(this instanceof
|
|
247
|
-
return new
|
|
248
|
-
|
|
320
|
+
function t(i, r) {
|
|
321
|
+
if (!(this instanceof t))
|
|
322
|
+
return new t(i, r);
|
|
323
|
+
qe.call(this);
|
|
249
324
|
var o = this;
|
|
250
|
-
this.path =
|
|
251
|
-
for (var c = Object.keys(
|
|
252
|
-
var
|
|
253
|
-
this[
|
|
325
|
+
this.path = i, this.fd = null, this.readable = !0, this.paused = !1, this.flags = "r", this.mode = 438, this.bufferSize = 64 * 1024, r = r || {};
|
|
326
|
+
for (var c = Object.keys(r), a = 0, f = c.length; a < f; a++) {
|
|
327
|
+
var p = c[a];
|
|
328
|
+
this[p] = r[p];
|
|
254
329
|
}
|
|
255
330
|
if (this.encoding && this.setEncoding(this.encoding), this.start !== void 0) {
|
|
256
331
|
if (typeof this.start != "number")
|
|
@@ -277,13 +352,13 @@ function lt(e) {
|
|
|
277
352
|
o.fd = s, o.emit("open", s), o._read();
|
|
278
353
|
});
|
|
279
354
|
}
|
|
280
|
-
function
|
|
281
|
-
if (!(this instanceof
|
|
282
|
-
return new
|
|
283
|
-
|
|
284
|
-
for (var o = Object.keys(
|
|
355
|
+
function n(i, r) {
|
|
356
|
+
if (!(this instanceof n))
|
|
357
|
+
return new n(i, r);
|
|
358
|
+
qe.call(this), this.path = i, this.fd = null, this.writable = !0, this.flags = "w", this.encoding = "binary", this.mode = 438, this.bytesWritten = 0, r = r || {};
|
|
359
|
+
for (var o = Object.keys(r), c = 0, a = o.length; c < a; c++) {
|
|
285
360
|
var f = o[c];
|
|
286
|
-
this[f] =
|
|
361
|
+
this[f] = r[f];
|
|
287
362
|
}
|
|
288
363
|
if (this.start !== void 0) {
|
|
289
364
|
if (typeof this.start != "number")
|
|
@@ -295,175 +370,175 @@ function lt(e) {
|
|
|
295
370
|
this.busy = !1, this._queue = [], this.fd === null && (this._open = e.open, this._queue.push([this._open, this.path, this.flags, this.mode, void 0]), this.flush());
|
|
296
371
|
}
|
|
297
372
|
}
|
|
298
|
-
var
|
|
373
|
+
var on = un, cn = Object.getPrototypeOf || function(e) {
|
|
299
374
|
return e.__proto__;
|
|
300
375
|
};
|
|
301
|
-
function
|
|
376
|
+
function un(e) {
|
|
302
377
|
if (e === null || typeof e != "object")
|
|
303
378
|
return e;
|
|
304
379
|
if (e instanceof Object)
|
|
305
|
-
var
|
|
380
|
+
var t = { __proto__: cn(e) };
|
|
306
381
|
else
|
|
307
|
-
var
|
|
308
|
-
return Object.getOwnPropertyNames(e).forEach(function(
|
|
309
|
-
Object.defineProperty(
|
|
310
|
-
}),
|
|
382
|
+
var t = /* @__PURE__ */ Object.create(null);
|
|
383
|
+
return Object.getOwnPropertyNames(e).forEach(function(n) {
|
|
384
|
+
Object.defineProperty(t, n, Object.getOwnPropertyDescriptor(e, n));
|
|
385
|
+
}), t;
|
|
311
386
|
}
|
|
312
|
-
var
|
|
313
|
-
typeof Symbol == "function" && typeof Symbol.for == "function" ? (
|
|
314
|
-
function
|
|
387
|
+
var F = it, an = en, fn = nn, sn = on, le = ae, I, he;
|
|
388
|
+
typeof Symbol == "function" && typeof Symbol.for == "function" ? (I = Symbol.for("graceful-fs.queue"), he = Symbol.for("graceful-fs.previous")) : (I = "___graceful-fs.queue", he = "___graceful-fs.previous");
|
|
389
|
+
function ln() {
|
|
315
390
|
}
|
|
316
|
-
function
|
|
317
|
-
Object.defineProperty(e,
|
|
391
|
+
function ct(e, t) {
|
|
392
|
+
Object.defineProperty(e, I, {
|
|
318
393
|
get: function() {
|
|
319
|
-
return
|
|
394
|
+
return t;
|
|
320
395
|
}
|
|
321
396
|
});
|
|
322
397
|
}
|
|
323
|
-
var V =
|
|
398
|
+
var V = ln;
|
|
324
399
|
le.debuglog ? V = le.debuglog("gfs4") : /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && (V = function() {
|
|
325
400
|
var e = le.format.apply(le, arguments);
|
|
326
401
|
e = "GFS4: " + e.split(/\n/).join(`
|
|
327
402
|
GFS4: `), console.error(e);
|
|
328
403
|
});
|
|
329
|
-
if (!
|
|
330
|
-
var
|
|
331
|
-
|
|
332
|
-
function n
|
|
333
|
-
return e.call(
|
|
334
|
-
|
|
404
|
+
if (!F[I]) {
|
|
405
|
+
var mn = Oe[I] || [];
|
|
406
|
+
ct(F, mn), F.close = function(e) {
|
|
407
|
+
function t(n, i) {
|
|
408
|
+
return e.call(F, n, function(r) {
|
|
409
|
+
r || Ge(), typeof i == "function" && i.apply(this, arguments);
|
|
335
410
|
});
|
|
336
411
|
}
|
|
337
|
-
return Object.defineProperty(
|
|
412
|
+
return Object.defineProperty(t, he, {
|
|
338
413
|
value: e
|
|
339
|
-
}),
|
|
340
|
-
}(
|
|
341
|
-
function n
|
|
342
|
-
e.apply(
|
|
414
|
+
}), t;
|
|
415
|
+
}(F.close), F.closeSync = function(e) {
|
|
416
|
+
function t(n) {
|
|
417
|
+
e.apply(F, arguments), Ge();
|
|
343
418
|
}
|
|
344
|
-
return Object.defineProperty(
|
|
419
|
+
return Object.defineProperty(t, he, {
|
|
345
420
|
value: e
|
|
346
|
-
}),
|
|
347
|
-
}(
|
|
348
|
-
V(
|
|
421
|
+
}), t;
|
|
422
|
+
}(F.closeSync), /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && process.on("exit", function() {
|
|
423
|
+
V(F[I]), ae.equal(F[I].length, 0);
|
|
349
424
|
});
|
|
350
425
|
}
|
|
351
|
-
|
|
352
|
-
var
|
|
353
|
-
process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !
|
|
354
|
-
function
|
|
355
|
-
|
|
356
|
-
var
|
|
357
|
-
e.readFile =
|
|
358
|
-
function
|
|
359
|
-
return typeof
|
|
360
|
-
function
|
|
361
|
-
return
|
|
362
|
-
|
|
426
|
+
Oe[I] || ct(Oe, F[I]);
|
|
427
|
+
var B = Ae(sn(F));
|
|
428
|
+
process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !F.__patched && (B = Ae(F), F.__patched = !0);
|
|
429
|
+
function Ae(e) {
|
|
430
|
+
an(e), e.gracefulify = Ae, e.createReadStream = Je, e.createWriteStream = be;
|
|
431
|
+
var t = e.readFile;
|
|
432
|
+
e.readFile = n;
|
|
433
|
+
function n(d, S, h) {
|
|
434
|
+
return typeof S == "function" && (h = S, S = null), C(d, S, h);
|
|
435
|
+
function C(N, P, E, D) {
|
|
436
|
+
return t(N, P, function(w) {
|
|
437
|
+
w && (w.code === "EMFILE" || w.code === "ENFILE") ? H([C, [N, P, E], w, D || Date.now(), Date.now()]) : typeof E == "function" && E.apply(this, arguments);
|
|
363
438
|
});
|
|
364
439
|
}
|
|
365
440
|
}
|
|
366
|
-
var
|
|
367
|
-
e.writeFile =
|
|
368
|
-
function
|
|
369
|
-
return typeof
|
|
370
|
-
function
|
|
371
|
-
return
|
|
372
|
-
k && (k.code === "EMFILE" || k.code === "ENFILE") ?
|
|
441
|
+
var i = e.writeFile;
|
|
442
|
+
e.writeFile = r;
|
|
443
|
+
function r(d, S, h, C) {
|
|
444
|
+
return typeof h == "function" && (C = h, h = null), N(d, S, h, C);
|
|
445
|
+
function N(P, E, D, w, _) {
|
|
446
|
+
return i(P, E, D, function(k) {
|
|
447
|
+
k && (k.code === "EMFILE" || k.code === "ENFILE") ? H([N, [P, E, D, w], k, _ || Date.now(), Date.now()]) : typeof w == "function" && w.apply(this, arguments);
|
|
373
448
|
});
|
|
374
449
|
}
|
|
375
450
|
}
|
|
376
451
|
var o = e.appendFile;
|
|
377
452
|
o && (e.appendFile = c);
|
|
378
|
-
function c(d,
|
|
379
|
-
return typeof
|
|
380
|
-
function
|
|
381
|
-
return o(
|
|
382
|
-
k && (k.code === "EMFILE" || k.code === "ENFILE") ?
|
|
453
|
+
function c(d, S, h, C) {
|
|
454
|
+
return typeof h == "function" && (C = h, h = null), N(d, S, h, C);
|
|
455
|
+
function N(P, E, D, w, _) {
|
|
456
|
+
return o(P, E, D, function(k) {
|
|
457
|
+
k && (k.code === "EMFILE" || k.code === "ENFILE") ? H([N, [P, E, D, w], k, _ || Date.now(), Date.now()]) : typeof w == "function" && w.apply(this, arguments);
|
|
383
458
|
});
|
|
384
459
|
}
|
|
385
460
|
}
|
|
386
461
|
var a = e.copyFile;
|
|
387
462
|
a && (e.copyFile = f);
|
|
388
|
-
function f(d,
|
|
389
|
-
return typeof
|
|
390
|
-
function
|
|
391
|
-
return a(
|
|
392
|
-
k && (k.code === "EMFILE" || k.code === "ENFILE") ?
|
|
463
|
+
function f(d, S, h, C) {
|
|
464
|
+
return typeof h == "function" && (C = h, h = 0), N(d, S, h, C);
|
|
465
|
+
function N(P, E, D, w, _) {
|
|
466
|
+
return a(P, E, D, function(k) {
|
|
467
|
+
k && (k.code === "EMFILE" || k.code === "ENFILE") ? H([N, [P, E, D, w], k, _ || Date.now(), Date.now()]) : typeof w == "function" && w.apply(this, arguments);
|
|
393
468
|
});
|
|
394
469
|
}
|
|
395
470
|
}
|
|
396
|
-
var
|
|
471
|
+
var p = e.readdir;
|
|
397
472
|
e.readdir = s;
|
|
398
473
|
var u = /^v[0-5]\./;
|
|
399
|
-
function s(d,
|
|
400
|
-
typeof
|
|
401
|
-
var
|
|
402
|
-
return
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
474
|
+
function s(d, S, h) {
|
|
475
|
+
typeof S == "function" && (h = S, S = null);
|
|
476
|
+
var C = u.test(process.version) ? function(E, D, w, _) {
|
|
477
|
+
return p(E, N(
|
|
478
|
+
E,
|
|
479
|
+
D,
|
|
480
|
+
w,
|
|
481
|
+
_
|
|
407
482
|
));
|
|
408
|
-
} : function(
|
|
409
|
-
return
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
483
|
+
} : function(E, D, w, _) {
|
|
484
|
+
return p(E, D, N(
|
|
485
|
+
E,
|
|
486
|
+
D,
|
|
487
|
+
w,
|
|
488
|
+
_
|
|
414
489
|
));
|
|
415
490
|
};
|
|
416
|
-
return
|
|
417
|
-
function
|
|
418
|
-
return function(
|
|
419
|
-
|
|
420
|
-
T,
|
|
421
|
-
[D, F, O],
|
|
491
|
+
return C(d, S, h);
|
|
492
|
+
function N(P, E, D, w) {
|
|
493
|
+
return function(_, k) {
|
|
494
|
+
_ && (_.code === "EMFILE" || _.code === "ENFILE") ? H([
|
|
422
495
|
C,
|
|
423
|
-
|
|
496
|
+
[P, E, D],
|
|
497
|
+
_,
|
|
498
|
+
w || Date.now(),
|
|
424
499
|
Date.now()
|
|
425
|
-
]) : (k && k.sort && k.sort(), typeof
|
|
500
|
+
]) : (k && k.sort && k.sort(), typeof D == "function" && D.call(this, _, k));
|
|
426
501
|
};
|
|
427
502
|
}
|
|
428
503
|
}
|
|
429
504
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
430
|
-
var
|
|
431
|
-
|
|
505
|
+
var m = fn(e);
|
|
506
|
+
$ = m.ReadStream, A = m.WriteStream;
|
|
432
507
|
}
|
|
433
508
|
var l = e.ReadStream;
|
|
434
|
-
l && (
|
|
435
|
-
var
|
|
436
|
-
|
|
509
|
+
l && ($.prototype = Object.create(l.prototype), $.prototype.open = R);
|
|
510
|
+
var y = e.WriteStream;
|
|
511
|
+
y && (A.prototype = Object.create(y.prototype), A.prototype.open = ee), Object.defineProperty(e, "ReadStream", {
|
|
437
512
|
get: function() {
|
|
438
|
-
return
|
|
513
|
+
return $;
|
|
439
514
|
},
|
|
440
515
|
set: function(d) {
|
|
441
|
-
|
|
516
|
+
$ = d;
|
|
442
517
|
},
|
|
443
518
|
enumerable: !0,
|
|
444
519
|
configurable: !0
|
|
445
520
|
}), Object.defineProperty(e, "WriteStream", {
|
|
446
521
|
get: function() {
|
|
447
|
-
return
|
|
522
|
+
return A;
|
|
448
523
|
},
|
|
449
524
|
set: function(d) {
|
|
450
|
-
|
|
525
|
+
A = d;
|
|
451
526
|
},
|
|
452
527
|
enumerable: !0,
|
|
453
528
|
configurable: !0
|
|
454
529
|
});
|
|
455
|
-
var
|
|
530
|
+
var g = $;
|
|
456
531
|
Object.defineProperty(e, "FileReadStream", {
|
|
457
532
|
get: function() {
|
|
458
|
-
return
|
|
533
|
+
return g;
|
|
459
534
|
},
|
|
460
535
|
set: function(d) {
|
|
461
|
-
|
|
536
|
+
g = d;
|
|
462
537
|
},
|
|
463
538
|
enumerable: !0,
|
|
464
539
|
configurable: !0
|
|
465
540
|
});
|
|
466
|
-
var v =
|
|
541
|
+
var v = A;
|
|
467
542
|
Object.defineProperty(e, "FileWriteStream", {
|
|
468
543
|
get: function() {
|
|
469
544
|
return v;
|
|
@@ -474,69 +549,69 @@ function je(e) {
|
|
|
474
549
|
enumerable: !0,
|
|
475
550
|
configurable: !0
|
|
476
551
|
});
|
|
477
|
-
function
|
|
478
|
-
return this instanceof
|
|
552
|
+
function $(d, S) {
|
|
553
|
+
return this instanceof $ ? (l.apply(this, arguments), this) : $.apply(Object.create($.prototype), arguments);
|
|
479
554
|
}
|
|
480
|
-
function
|
|
555
|
+
function R() {
|
|
481
556
|
var d = this;
|
|
482
|
-
|
|
483
|
-
|
|
557
|
+
$e(d.path, d.flags, d.mode, function(S, h) {
|
|
558
|
+
S ? (d.autoClose && d.destroy(), d.emit("error", S)) : (d.fd = h, d.emit("open", h), d.read());
|
|
484
559
|
});
|
|
485
560
|
}
|
|
486
|
-
function
|
|
487
|
-
return this instanceof
|
|
561
|
+
function A(d, S) {
|
|
562
|
+
return this instanceof A ? (y.apply(this, arguments), this) : A.apply(Object.create(A.prototype), arguments);
|
|
488
563
|
}
|
|
489
|
-
function
|
|
564
|
+
function ee() {
|
|
490
565
|
var d = this;
|
|
491
|
-
|
|
492
|
-
|
|
566
|
+
$e(d.path, d.flags, d.mode, function(S, h) {
|
|
567
|
+
S ? (d.destroy(), d.emit("error", S)) : (d.fd = h, d.emit("open", h));
|
|
493
568
|
});
|
|
494
569
|
}
|
|
495
|
-
function
|
|
496
|
-
return new e.ReadStream(d,
|
|
570
|
+
function Je(d, S) {
|
|
571
|
+
return new e.ReadStream(d, S);
|
|
497
572
|
}
|
|
498
|
-
function
|
|
499
|
-
return new e.WriteStream(d,
|
|
573
|
+
function be(d, S) {
|
|
574
|
+
return new e.WriteStream(d, S);
|
|
500
575
|
}
|
|
501
|
-
var
|
|
502
|
-
e.open =
|
|
503
|
-
function
|
|
504
|
-
return typeof
|
|
505
|
-
function
|
|
506
|
-
return
|
|
507
|
-
k && (k.code === "EMFILE" || k.code === "ENFILE") ?
|
|
576
|
+
var Gt = e.open;
|
|
577
|
+
e.open = $e;
|
|
578
|
+
function $e(d, S, h, C) {
|
|
579
|
+
return typeof h == "function" && (C = h, h = null), N(d, S, h, C);
|
|
580
|
+
function N(P, E, D, w, _) {
|
|
581
|
+
return Gt(P, E, D, function(k, Pi) {
|
|
582
|
+
k && (k.code === "EMFILE" || k.code === "ENFILE") ? H([N, [P, E, D, w], k, _ || Date.now(), Date.now()]) : typeof w == "function" && w.apply(this, arguments);
|
|
508
583
|
});
|
|
509
584
|
}
|
|
510
585
|
}
|
|
511
586
|
return e;
|
|
512
587
|
}
|
|
513
|
-
function
|
|
514
|
-
V("ENQUEUE", e[0].name, e[1]),
|
|
515
|
-
}
|
|
516
|
-
var
|
|
517
|
-
function
|
|
518
|
-
for (var e = Date.now(),
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
}
|
|
522
|
-
function
|
|
523
|
-
if (clearTimeout(
|
|
524
|
-
var e =
|
|
525
|
-
if (
|
|
526
|
-
V("RETRY",
|
|
527
|
-
else if (Date.now() -
|
|
528
|
-
V("TIMEOUT",
|
|
529
|
-
var c =
|
|
530
|
-
typeof c == "function" && c.call(null,
|
|
588
|
+
function H(e) {
|
|
589
|
+
V("ENQUEUE", e[0].name, e[1]), F[I].push(e), xe();
|
|
590
|
+
}
|
|
591
|
+
var me;
|
|
592
|
+
function Ge() {
|
|
593
|
+
for (var e = Date.now(), t = 0; t < F[I].length; ++t)
|
|
594
|
+
F[I][t].length > 2 && (F[I][t][3] = e, F[I][t][4] = e);
|
|
595
|
+
xe();
|
|
596
|
+
}
|
|
597
|
+
function xe() {
|
|
598
|
+
if (clearTimeout(me), me = void 0, F[I].length !== 0) {
|
|
599
|
+
var e = F[I].shift(), t = e[0], n = e[1], i = e[2], r = e[3], o = e[4];
|
|
600
|
+
if (r === void 0)
|
|
601
|
+
V("RETRY", t.name, n), t.apply(null, n);
|
|
602
|
+
else if (Date.now() - r >= 6e4) {
|
|
603
|
+
V("TIMEOUT", t.name, n);
|
|
604
|
+
var c = n.pop();
|
|
605
|
+
typeof c == "function" && c.call(null, i);
|
|
531
606
|
} else {
|
|
532
|
-
var a = Date.now() - o, f = Math.max(o -
|
|
533
|
-
a >=
|
|
607
|
+
var a = Date.now() - o, f = Math.max(o - r, 1), p = Math.min(f * 1.2, 100);
|
|
608
|
+
a >= p ? (V("RETRY", t.name, n), t.apply(null, n.concat([r]))) : F[I].push(e);
|
|
534
609
|
}
|
|
535
|
-
|
|
610
|
+
me === void 0 && (me = setTimeout(xe, 0));
|
|
536
611
|
}
|
|
537
612
|
}
|
|
538
613
|
(function(e) {
|
|
539
|
-
const
|
|
614
|
+
const t = W.fromCallback, n = B, i = [
|
|
540
615
|
"access",
|
|
541
616
|
"appendFile",
|
|
542
617
|
"chmod",
|
|
@@ -571,1059 +646,930 @@ function Ie() {
|
|
|
571
646
|
"unlink",
|
|
572
647
|
"utimes",
|
|
573
648
|
"writeFile"
|
|
574
|
-
].filter((
|
|
575
|
-
Object.assign(e,
|
|
576
|
-
e[
|
|
577
|
-
}), e.exists = function(
|
|
578
|
-
return typeof o == "function" ?
|
|
579
|
-
}, e.read = function(
|
|
580
|
-
return typeof
|
|
581
|
-
|
|
582
|
-
if (
|
|
583
|
-
return s(
|
|
584
|
-
u({ bytesRead: l, buffer:
|
|
649
|
+
].filter((r) => typeof n[r] == "function");
|
|
650
|
+
Object.assign(e, n), i.forEach((r) => {
|
|
651
|
+
e[r] = t(n[r]);
|
|
652
|
+
}), e.exists = function(r, o) {
|
|
653
|
+
return typeof o == "function" ? n.exists(r, o) : new Promise((c) => n.exists(r, c));
|
|
654
|
+
}, e.read = function(r, o, c, a, f, p) {
|
|
655
|
+
return typeof p == "function" ? n.read(r, o, c, a, f, p) : new Promise((u, s) => {
|
|
656
|
+
n.read(r, o, c, a, f, (m, l, y) => {
|
|
657
|
+
if (m)
|
|
658
|
+
return s(m);
|
|
659
|
+
u({ bytesRead: l, buffer: y });
|
|
585
660
|
});
|
|
586
661
|
});
|
|
587
|
-
}, e.write = function(
|
|
588
|
-
return typeof c[c.length - 1] == "function" ?
|
|
589
|
-
|
|
590
|
-
if (
|
|
591
|
-
return f(
|
|
662
|
+
}, e.write = function(r, o, ...c) {
|
|
663
|
+
return typeof c[c.length - 1] == "function" ? n.write(r, o, ...c) : new Promise((a, f) => {
|
|
664
|
+
n.write(r, o, ...c, (p, u, s) => {
|
|
665
|
+
if (p)
|
|
666
|
+
return f(p);
|
|
592
667
|
a({ bytesWritten: u, buffer: s });
|
|
593
668
|
});
|
|
594
669
|
});
|
|
595
|
-
},
|
|
596
|
-
return typeof c[c.length - 1] == "function" ?
|
|
597
|
-
|
|
598
|
-
if (
|
|
599
|
-
return f(
|
|
670
|
+
}, e.readv = function(r, o, ...c) {
|
|
671
|
+
return typeof c[c.length - 1] == "function" ? n.readv(r, o, ...c) : new Promise((a, f) => {
|
|
672
|
+
n.readv(r, o, ...c, (p, u, s) => {
|
|
673
|
+
if (p)
|
|
674
|
+
return f(p);
|
|
675
|
+
a({ bytesRead: u, buffers: s });
|
|
676
|
+
});
|
|
677
|
+
});
|
|
678
|
+
}, e.writev = function(r, o, ...c) {
|
|
679
|
+
return typeof c[c.length - 1] == "function" ? n.writev(r, o, ...c) : new Promise((a, f) => {
|
|
680
|
+
n.writev(r, o, ...c, (p, u, s) => {
|
|
681
|
+
if (p)
|
|
682
|
+
return f(p);
|
|
600
683
|
a({ bytesWritten: u, buffers: s });
|
|
601
684
|
});
|
|
602
685
|
});
|
|
603
|
-
}
|
|
686
|
+
}, typeof n.realpath.native == "function" ? e.realpath.native = t(n.realpath.native) : process.emitWarning(
|
|
604
687
|
"fs.realpath.native is not a function. Is fs being monkey-patched?",
|
|
605
688
|
"Warning",
|
|
606
689
|
"fs-extra-WARN0003"
|
|
607
690
|
);
|
|
608
|
-
})(
|
|
609
|
-
var Le = {},
|
|
610
|
-
const
|
|
611
|
-
|
|
612
|
-
if (process.platform === "win32" && /[<>:"|?*]/.test(
|
|
613
|
-
const
|
|
614
|
-
throw
|
|
691
|
+
})(z);
|
|
692
|
+
var Le = {}, ut = {};
|
|
693
|
+
const yn = M;
|
|
694
|
+
ut.checkPath = function(t) {
|
|
695
|
+
if (process.platform === "win32" && /[<>:"|?*]/.test(t.replace(yn.parse(t).root, ""))) {
|
|
696
|
+
const i = new Error(`Path contains invalid characters: ${t}`);
|
|
697
|
+
throw i.code = "EINVAL", i;
|
|
615
698
|
}
|
|
616
699
|
};
|
|
617
|
-
const
|
|
618
|
-
const
|
|
619
|
-
return typeof e == "number" ? e : { ...
|
|
700
|
+
const at = z, { checkPath: ft } = ut, st = (e) => {
|
|
701
|
+
const t = { mode: 511 };
|
|
702
|
+
return typeof e == "number" ? e : { ...t, ...e }.mode;
|
|
620
703
|
};
|
|
621
|
-
Le.makeDir = async (e,
|
|
622
|
-
mode:
|
|
704
|
+
Le.makeDir = async (e, t) => (ft(e), at.mkdir(e, {
|
|
705
|
+
mode: st(t),
|
|
623
706
|
recursive: !0
|
|
624
707
|
}));
|
|
625
|
-
Le.makeDirSync = (e,
|
|
626
|
-
mode:
|
|
708
|
+
Le.makeDirSync = (e, t) => (ft(e), at.mkdirSync(e, {
|
|
709
|
+
mode: st(t),
|
|
627
710
|
recursive: !0
|
|
628
711
|
}));
|
|
629
|
-
const
|
|
630
|
-
var
|
|
631
|
-
mkdirs:
|
|
632
|
-
mkdirsSync:
|
|
633
|
-
mkdirp:
|
|
634
|
-
mkdirpSync:
|
|
635
|
-
ensureDir:
|
|
636
|
-
ensureDirSync:
|
|
712
|
+
const pn = W.fromPromise, { makeDir: dn, makeDirSync: Ee } = Le, Fe = pn(dn);
|
|
713
|
+
var b = {
|
|
714
|
+
mkdirs: Fe,
|
|
715
|
+
mkdirsSync: Ee,
|
|
716
|
+
mkdirp: Fe,
|
|
717
|
+
mkdirpSync: Ee,
|
|
718
|
+
ensureDir: Fe,
|
|
719
|
+
ensureDirSync: Ee
|
|
637
720
|
};
|
|
638
|
-
const
|
|
639
|
-
function
|
|
640
|
-
return
|
|
721
|
+
const hn = W.fromPromise, lt = z;
|
|
722
|
+
function Sn(e) {
|
|
723
|
+
return lt.access(e).then(() => !0).catch(() => !1);
|
|
641
724
|
}
|
|
642
|
-
var
|
|
643
|
-
pathExists:
|
|
644
|
-
pathExistsSync:
|
|
725
|
+
var Q = {
|
|
726
|
+
pathExists: hn(Sn),
|
|
727
|
+
pathExistsSync: lt.existsSync
|
|
645
728
|
};
|
|
646
|
-
const
|
|
647
|
-
function
|
|
648
|
-
|
|
649
|
-
if (
|
|
650
|
-
return r
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
729
|
+
const X = B;
|
|
730
|
+
function vn(e, t, n, i) {
|
|
731
|
+
X.open(e, "r+", (r, o) => {
|
|
732
|
+
if (r)
|
|
733
|
+
return i(r);
|
|
734
|
+
X.futimes(o, t, n, (c) => {
|
|
735
|
+
X.close(o, (a) => {
|
|
736
|
+
i && i(c || a);
|
|
654
737
|
});
|
|
655
738
|
});
|
|
656
739
|
});
|
|
657
740
|
}
|
|
658
|
-
function
|
|
659
|
-
const
|
|
660
|
-
return
|
|
741
|
+
function wn(e, t, n) {
|
|
742
|
+
const i = X.openSync(e, "r+");
|
|
743
|
+
return X.futimesSync(i, t, n), X.closeSync(i);
|
|
661
744
|
}
|
|
662
|
-
var
|
|
663
|
-
utimesMillis:
|
|
664
|
-
utimesMillisSync:
|
|
745
|
+
var mt = {
|
|
746
|
+
utimesMillis: vn,
|
|
747
|
+
utimesMillisSync: wn
|
|
665
748
|
};
|
|
666
|
-
const
|
|
667
|
-
function
|
|
668
|
-
const
|
|
749
|
+
const Z = z, O = M, gn = ae;
|
|
750
|
+
function kn(e, t, n) {
|
|
751
|
+
const i = n.dereference ? (r) => Z.stat(r, { bigint: !0 }) : (r) => Z.lstat(r, { bigint: !0 });
|
|
669
752
|
return Promise.all([
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
if (
|
|
753
|
+
i(e),
|
|
754
|
+
i(t).catch((r) => {
|
|
755
|
+
if (r.code === "ENOENT")
|
|
673
756
|
return null;
|
|
674
|
-
throw
|
|
757
|
+
throw r;
|
|
675
758
|
})
|
|
676
|
-
]).then(([
|
|
759
|
+
]).then(([r, o]) => ({ srcStat: r, destStat: o }));
|
|
677
760
|
}
|
|
678
|
-
function
|
|
679
|
-
let
|
|
680
|
-
const
|
|
761
|
+
function $n(e, t, n) {
|
|
762
|
+
let i;
|
|
763
|
+
const r = n.dereference ? (c) => Z.statSync(c, { bigint: !0 }) : (c) => Z.lstatSync(c, { bigint: !0 }), o = r(e);
|
|
681
764
|
try {
|
|
682
|
-
|
|
765
|
+
i = r(t);
|
|
683
766
|
} catch (c) {
|
|
684
767
|
if (c.code === "ENOENT")
|
|
685
768
|
return { srcStat: o, destStat: null };
|
|
686
769
|
throw c;
|
|
687
770
|
}
|
|
688
|
-
return { srcStat: o, destStat:
|
|
771
|
+
return { srcStat: o, destStat: i };
|
|
689
772
|
}
|
|
690
|
-
function
|
|
691
|
-
|
|
773
|
+
function En(e, t, n, i, r) {
|
|
774
|
+
gn.callbackify(kn)(e, t, i, (o, c) => {
|
|
692
775
|
if (o)
|
|
693
|
-
return
|
|
776
|
+
return r(o);
|
|
694
777
|
const { srcStat: a, destStat: f } = c;
|
|
695
778
|
if (f) {
|
|
696
|
-
if (
|
|
697
|
-
const
|
|
698
|
-
return
|
|
779
|
+
if (fe(a, f)) {
|
|
780
|
+
const p = O.basename(e), u = O.basename(t);
|
|
781
|
+
return n === "move" && p !== u && p.toLowerCase() === u.toLowerCase() ? r(null, { srcStat: a, destStat: f, isChangingCase: !0 }) : r(new Error("Source and destination must not be the same."));
|
|
699
782
|
}
|
|
700
783
|
if (a.isDirectory() && !f.isDirectory())
|
|
701
|
-
return
|
|
784
|
+
return r(new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`));
|
|
702
785
|
if (!a.isDirectory() && f.isDirectory())
|
|
703
|
-
return
|
|
786
|
+
return r(new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`));
|
|
704
787
|
}
|
|
705
|
-
return a.isDirectory() &&
|
|
788
|
+
return a.isDirectory() && We(e, t) ? r(new Error(ve(e, t, n))) : r(null, { srcStat: a, destStat: f });
|
|
706
789
|
});
|
|
707
790
|
}
|
|
708
|
-
function
|
|
709
|
-
const { srcStat:
|
|
791
|
+
function Fn(e, t, n, i) {
|
|
792
|
+
const { srcStat: r, destStat: o } = $n(e, t, i);
|
|
710
793
|
if (o) {
|
|
711
|
-
if (
|
|
712
|
-
const c =
|
|
713
|
-
if (
|
|
714
|
-
return { srcStat:
|
|
794
|
+
if (fe(r, o)) {
|
|
795
|
+
const c = O.basename(e), a = O.basename(t);
|
|
796
|
+
if (n === "move" && c !== a && c.toLowerCase() === a.toLowerCase())
|
|
797
|
+
return { srcStat: r, destStat: o, isChangingCase: !0 };
|
|
715
798
|
throw new Error("Source and destination must not be the same.");
|
|
716
799
|
}
|
|
717
|
-
if (
|
|
718
|
-
throw new Error(`Cannot overwrite non-directory '${
|
|
719
|
-
if (!
|
|
720
|
-
throw new Error(`Cannot overwrite directory '${
|
|
800
|
+
if (r.isDirectory() && !o.isDirectory())
|
|
801
|
+
throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);
|
|
802
|
+
if (!r.isDirectory() && o.isDirectory())
|
|
803
|
+
throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`);
|
|
721
804
|
}
|
|
722
|
-
if (
|
|
723
|
-
throw new Error(
|
|
724
|
-
return { srcStat:
|
|
725
|
-
}
|
|
726
|
-
function
|
|
727
|
-
const o =
|
|
728
|
-
if (c === o || c ===
|
|
729
|
-
return
|
|
730
|
-
|
|
731
|
-
}
|
|
732
|
-
function
|
|
733
|
-
const
|
|
734
|
-
if (o ===
|
|
805
|
+
if (r.isDirectory() && We(e, t))
|
|
806
|
+
throw new Error(ve(e, t, n));
|
|
807
|
+
return { srcStat: r, destStat: o };
|
|
808
|
+
}
|
|
809
|
+
function yt(e, t, n, i, r) {
|
|
810
|
+
const o = O.resolve(O.dirname(e)), c = O.resolve(O.dirname(n));
|
|
811
|
+
if (c === o || c === O.parse(c).root)
|
|
812
|
+
return r();
|
|
813
|
+
Z.stat(c, { bigint: !0 }, (a, f) => a ? a.code === "ENOENT" ? r() : r(a) : fe(t, f) ? r(new Error(ve(e, n, i))) : yt(e, t, c, i, r));
|
|
814
|
+
}
|
|
815
|
+
function pt(e, t, n, i) {
|
|
816
|
+
const r = O.resolve(O.dirname(e)), o = O.resolve(O.dirname(n));
|
|
817
|
+
if (o === r || o === O.parse(o).root)
|
|
735
818
|
return;
|
|
736
819
|
let c;
|
|
737
820
|
try {
|
|
738
|
-
c =
|
|
821
|
+
c = Z.statSync(o, { bigint: !0 });
|
|
739
822
|
} catch (a) {
|
|
740
823
|
if (a.code === "ENOENT")
|
|
741
824
|
return;
|
|
742
825
|
throw a;
|
|
743
826
|
}
|
|
744
|
-
if (
|
|
745
|
-
throw new Error(
|
|
746
|
-
return
|
|
747
|
-
}
|
|
748
|
-
function
|
|
749
|
-
return
|
|
750
|
-
}
|
|
751
|
-
function
|
|
752
|
-
const
|
|
753
|
-
return
|
|
754
|
-
}
|
|
755
|
-
function
|
|
756
|
-
return `Cannot ${
|
|
757
|
-
}
|
|
758
|
-
var
|
|
759
|
-
checkPaths:
|
|
760
|
-
checkPathsSync:
|
|
761
|
-
checkParentPaths:
|
|
762
|
-
checkParentPathsSync:
|
|
763
|
-
isSrcSubdir:
|
|
764
|
-
areIdentical:
|
|
827
|
+
if (fe(t, c))
|
|
828
|
+
throw new Error(ve(e, n, i));
|
|
829
|
+
return pt(e, t, o, i);
|
|
830
|
+
}
|
|
831
|
+
function fe(e, t) {
|
|
832
|
+
return t.ino && t.dev && t.ino === e.ino && t.dev === e.dev;
|
|
833
|
+
}
|
|
834
|
+
function We(e, t) {
|
|
835
|
+
const n = O.resolve(e).split(O.sep).filter((r) => r), i = O.resolve(t).split(O.sep).filter((r) => r);
|
|
836
|
+
return n.reduce((r, o, c) => r && i[c] === o, !0);
|
|
837
|
+
}
|
|
838
|
+
function ve(e, t, n) {
|
|
839
|
+
return `Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`;
|
|
840
|
+
}
|
|
841
|
+
var K = {
|
|
842
|
+
checkPaths: En,
|
|
843
|
+
checkPathsSync: Fn,
|
|
844
|
+
checkParentPaths: yt,
|
|
845
|
+
checkParentPathsSync: pt,
|
|
846
|
+
isSrcSubdir: We,
|
|
847
|
+
areIdentical: fe
|
|
765
848
|
};
|
|
766
|
-
const
|
|
767
|
-
function
|
|
768
|
-
typeof
|
|
769
|
-
},
|
|
849
|
+
const j = B, ie = M, Dn = b.mkdirs, Pn = Q.pathExists, On = mt.utimesMillis, oe = K;
|
|
850
|
+
function Cn(e, t, n, i) {
|
|
851
|
+
typeof n == "function" && !i ? (i = n, n = {}) : typeof n == "function" && (n = { filter: n }), i = i || function() {
|
|
852
|
+
}, n = n || {}, n.clobber = "clobber" in n ? !!n.clobber : !0, n.overwrite = "overwrite" in n ? !!n.overwrite : n.clobber, n.preserveTimestamps && process.arch === "ia32" && process.emitWarning(
|
|
770
853
|
`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
771
854
|
|
|
772
855
|
see https://github.com/jprichardson/node-fs-extra/issues/269`,
|
|
773
856
|
"Warning",
|
|
774
857
|
"fs-extra-WARN0001"
|
|
775
|
-
),
|
|
776
|
-
if (
|
|
777
|
-
return r
|
|
858
|
+
), oe.checkPaths(e, t, "copy", n, (r, o) => {
|
|
859
|
+
if (r)
|
|
860
|
+
return i(r);
|
|
778
861
|
const { srcStat: c, destStat: a } = o;
|
|
779
|
-
|
|
862
|
+
oe.checkParentPaths(e, c, t, "copy", (f) => {
|
|
863
|
+
if (f)
|
|
864
|
+
return i(f);
|
|
865
|
+
dt(e, t, n, (p, u) => {
|
|
866
|
+
if (p)
|
|
867
|
+
return i(p);
|
|
868
|
+
if (!u)
|
|
869
|
+
return i();
|
|
870
|
+
Nn(a, e, t, n, i);
|
|
871
|
+
});
|
|
872
|
+
});
|
|
780
873
|
});
|
|
781
874
|
}
|
|
782
|
-
function
|
|
783
|
-
const o =
|
|
784
|
-
|
|
875
|
+
function Nn(e, t, n, i, r) {
|
|
876
|
+
const o = ie.dirname(n);
|
|
877
|
+
Pn(o, (c, a) => {
|
|
785
878
|
if (c)
|
|
786
|
-
return
|
|
879
|
+
return r(c);
|
|
787
880
|
if (a)
|
|
788
|
-
return
|
|
789
|
-
|
|
881
|
+
return Ce(e, t, n, i, r);
|
|
882
|
+
Dn(o, (f) => f ? r(f) : Ce(e, t, n, i, r));
|
|
790
883
|
});
|
|
791
884
|
}
|
|
792
|
-
function
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
return r.filter ? kn(Ee, e, n, t, r, i) : Ee(e, n, t, r, i);
|
|
885
|
+
function dt(e, t, n, i) {
|
|
886
|
+
if (!n.filter)
|
|
887
|
+
return i(null, !0);
|
|
888
|
+
Promise.resolve(n.filter(e, t)).then((r) => i(null, r), (r) => i(r));
|
|
797
889
|
}
|
|
798
|
-
function
|
|
799
|
-
(
|
|
890
|
+
function Ce(e, t, n, i, r) {
|
|
891
|
+
(i.dereference ? j.stat : j.lstat)(t, (c, a) => c ? r(c) : a.isDirectory() ? jn(a, e, t, n, i, r) : a.isFile() || a.isCharacterDevice() || a.isBlockDevice() ? _n(a, e, t, n, i, r) : a.isSymbolicLink() ? Rn(e, t, n, i, r) : a.isSocket() ? r(new Error(`Cannot copy a socket file: ${t}`)) : a.isFIFO() ? r(new Error(`Cannot copy a FIFO pipe: ${t}`)) : r(new Error(`Unknown file: ${t}`)));
|
|
800
892
|
}
|
|
801
|
-
function
|
|
802
|
-
return
|
|
893
|
+
function _n(e, t, n, i, r, o) {
|
|
894
|
+
return t ? In(e, n, i, r, o) : ht(e, n, i, r, o);
|
|
803
895
|
}
|
|
804
|
-
function
|
|
805
|
-
if (
|
|
806
|
-
|
|
896
|
+
function In(e, t, n, i, r) {
|
|
897
|
+
if (i.overwrite)
|
|
898
|
+
j.unlink(n, (o) => o ? r(o) : ht(e, t, n, i, r));
|
|
807
899
|
else
|
|
808
|
-
return
|
|
900
|
+
return i.errorOnExist ? r(new Error(`'${n}' already exists`)) : r();
|
|
809
901
|
}
|
|
810
|
-
function
|
|
811
|
-
|
|
902
|
+
function ht(e, t, n, i, r) {
|
|
903
|
+
j.copyFile(t, n, (o) => o ? r(o) : i.preserveTimestamps ? An(e.mode, t, n, r) : we(n, e.mode, r));
|
|
812
904
|
}
|
|
813
|
-
function
|
|
814
|
-
return
|
|
905
|
+
function An(e, t, n, i) {
|
|
906
|
+
return xn(e) ? Ln(n, e, (r) => r ? i(r) : Ye(e, t, n, i)) : Ye(e, t, n, i);
|
|
815
907
|
}
|
|
816
|
-
function
|
|
908
|
+
function xn(e) {
|
|
817
909
|
return (e & 128) === 0;
|
|
818
910
|
}
|
|
819
|
-
function
|
|
820
|
-
return
|
|
911
|
+
function Ln(e, t, n) {
|
|
912
|
+
return we(e, t | 128, n);
|
|
821
913
|
}
|
|
822
|
-
function
|
|
823
|
-
|
|
914
|
+
function Ye(e, t, n, i) {
|
|
915
|
+
Wn(t, n, (r) => r ? i(r) : we(n, e, i));
|
|
824
916
|
}
|
|
825
|
-
function
|
|
826
|
-
return
|
|
917
|
+
function we(e, t, n) {
|
|
918
|
+
return j.chmod(e, t, n);
|
|
827
919
|
}
|
|
828
|
-
function
|
|
829
|
-
|
|
920
|
+
function Wn(e, t, n) {
|
|
921
|
+
j.stat(e, (i, r) => i ? n(i) : On(t, r.atime, r.mtime, n));
|
|
830
922
|
}
|
|
831
|
-
function
|
|
832
|
-
return
|
|
923
|
+
function jn(e, t, n, i, r, o) {
|
|
924
|
+
return t ? St(n, i, r, o) : Mn(e.mode, n, i, r, o);
|
|
833
925
|
}
|
|
834
|
-
function
|
|
835
|
-
|
|
926
|
+
function Mn(e, t, n, i, r) {
|
|
927
|
+
j.mkdir(n, (o) => {
|
|
836
928
|
if (o)
|
|
837
|
-
return
|
|
838
|
-
|
|
929
|
+
return r(o);
|
|
930
|
+
St(t, n, i, (c) => c ? r(c) : we(n, e, r));
|
|
839
931
|
});
|
|
840
932
|
}
|
|
841
|
-
function
|
|
842
|
-
|
|
933
|
+
function St(e, t, n, i) {
|
|
934
|
+
j.readdir(e, (r, o) => r ? i(r) : Ne(o, e, t, n, i));
|
|
843
935
|
}
|
|
844
|
-
function
|
|
936
|
+
function Ne(e, t, n, i, r) {
|
|
845
937
|
const o = e.pop();
|
|
846
|
-
return o ?
|
|
938
|
+
return o ? Bn(e, o, t, n, i, r) : r();
|
|
847
939
|
}
|
|
848
|
-
function
|
|
849
|
-
const c =
|
|
850
|
-
|
|
940
|
+
function Bn(e, t, n, i, r, o) {
|
|
941
|
+
const c = ie.join(n, t), a = ie.join(i, t);
|
|
942
|
+
dt(c, a, r, (f, p) => {
|
|
851
943
|
if (f)
|
|
852
944
|
return o(f);
|
|
853
|
-
|
|
854
|
-
|
|
945
|
+
if (!p)
|
|
946
|
+
return Ne(e, n, i, r, o);
|
|
947
|
+
oe.checkPaths(c, a, "copy", r, (u, s) => {
|
|
948
|
+
if (u)
|
|
949
|
+
return o(u);
|
|
950
|
+
const { destStat: m } = s;
|
|
951
|
+
Ce(m, c, a, r, (l) => l ? o(l) : Ne(e, n, i, r, o));
|
|
952
|
+
});
|
|
855
953
|
});
|
|
856
954
|
}
|
|
857
|
-
function
|
|
858
|
-
|
|
955
|
+
function Rn(e, t, n, i, r) {
|
|
956
|
+
j.readlink(t, (o, c) => {
|
|
859
957
|
if (o)
|
|
860
|
-
return
|
|
861
|
-
if (
|
|
862
|
-
|
|
958
|
+
return r(o);
|
|
959
|
+
if (i.dereference && (c = ie.resolve(process.cwd(), c)), e)
|
|
960
|
+
j.readlink(n, (a, f) => a ? a.code === "EINVAL" || a.code === "UNKNOWN" ? j.symlink(c, n, r) : r(a) : (i.dereference && (f = ie.resolve(process.cwd(), f)), oe.isSrcSubdir(c, f) ? r(new Error(`Cannot copy '${c}' to a subdirectory of itself, '${f}'.`)) : oe.isSrcSubdir(f, c) ? r(new Error(`Cannot overwrite '${f}' with '${c}'.`)) : Jn(c, n, r)));
|
|
863
961
|
else
|
|
864
|
-
return
|
|
962
|
+
return j.symlink(c, n, r);
|
|
865
963
|
});
|
|
866
964
|
}
|
|
867
|
-
function
|
|
868
|
-
|
|
965
|
+
function Jn(e, t, n) {
|
|
966
|
+
j.unlink(t, (i) => i ? n(i) : j.symlink(e, t, n));
|
|
869
967
|
}
|
|
870
|
-
var
|
|
871
|
-
const
|
|
872
|
-
function
|
|
873
|
-
typeof
|
|
968
|
+
var bn = Cn;
|
|
969
|
+
const x = B, ce = M, Un = b.mkdirsSync, qn = mt.utimesMillisSync, ue = K;
|
|
970
|
+
function Gn(e, t, n) {
|
|
971
|
+
typeof n == "function" && (n = { filter: n }), n = n || {}, n.clobber = "clobber" in n ? !!n.clobber : !0, n.overwrite = "overwrite" in n ? !!n.overwrite : n.clobber, n.preserveTimestamps && process.arch === "ia32" && process.emitWarning(
|
|
874
972
|
`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
875
973
|
|
|
876
974
|
see https://github.com/jprichardson/node-fs-extra/issues/269`,
|
|
877
975
|
"Warning",
|
|
878
976
|
"fs-extra-WARN0002"
|
|
879
977
|
);
|
|
880
|
-
const { srcStat:
|
|
881
|
-
|
|
882
|
-
}
|
|
883
|
-
function bt(e, n, t, r) {
|
|
884
|
-
if (r.filter && !r.filter(n, t))
|
|
978
|
+
const { srcStat: i, destStat: r } = ue.checkPathsSync(e, t, "copy", n);
|
|
979
|
+
if (ue.checkParentPathsSync(e, i, t, "copy"), n.filter && !n.filter(e, t))
|
|
885
980
|
return;
|
|
886
|
-
const
|
|
887
|
-
return
|
|
888
|
-
}
|
|
889
|
-
function Zt(e, n, t, r) {
|
|
890
|
-
if (!(r.filter && !r.filter(n, t)))
|
|
891
|
-
return On(e, n, t, r);
|
|
981
|
+
const o = ce.dirname(t);
|
|
982
|
+
return x.existsSync(o) || Un(o), vt(r, e, t, n);
|
|
892
983
|
}
|
|
893
|
-
function
|
|
894
|
-
const o = (
|
|
984
|
+
function vt(e, t, n, i) {
|
|
985
|
+
const o = (i.dereference ? x.statSync : x.lstatSync)(t);
|
|
895
986
|
if (o.isDirectory())
|
|
896
|
-
return
|
|
987
|
+
return Zn(o, e, t, n, i);
|
|
897
988
|
if (o.isFile() || o.isCharacterDevice() || o.isBlockDevice())
|
|
898
|
-
return
|
|
989
|
+
return Yn(o, e, t, n, i);
|
|
899
990
|
if (o.isSymbolicLink())
|
|
900
|
-
return
|
|
901
|
-
throw o.isSocket() ? new Error(`Cannot copy a socket file: ${
|
|
991
|
+
return er(e, t, n, i);
|
|
992
|
+
throw o.isSocket() ? new Error(`Cannot copy a socket file: ${t}`) : o.isFIFO() ? new Error(`Cannot copy a FIFO pipe: ${t}`) : new Error(`Unknown file: ${t}`);
|
|
902
993
|
}
|
|
903
|
-
function
|
|
904
|
-
return
|
|
994
|
+
function Yn(e, t, n, i, r) {
|
|
995
|
+
return t ? Vn(e, n, i, r) : wt(e, n, i, r);
|
|
905
996
|
}
|
|
906
|
-
function
|
|
907
|
-
if (
|
|
908
|
-
return
|
|
909
|
-
if (
|
|
910
|
-
throw new Error(`'${
|
|
997
|
+
function Vn(e, t, n, i) {
|
|
998
|
+
if (i.overwrite)
|
|
999
|
+
return x.unlinkSync(n), wt(e, t, n, i);
|
|
1000
|
+
if (i.errorOnExist)
|
|
1001
|
+
throw new Error(`'${n}' already exists`);
|
|
911
1002
|
}
|
|
912
|
-
function
|
|
913
|
-
return
|
|
1003
|
+
function wt(e, t, n, i) {
|
|
1004
|
+
return x.copyFileSync(t, n), i.preserveTimestamps && zn(e.mode, t, n), je(n, e.mode);
|
|
914
1005
|
}
|
|
915
|
-
function
|
|
916
|
-
return
|
|
1006
|
+
function zn(e, t, n) {
|
|
1007
|
+
return Qn(e) && Hn(n, e), Xn(t, n);
|
|
917
1008
|
}
|
|
918
|
-
function
|
|
1009
|
+
function Qn(e) {
|
|
919
1010
|
return (e & 128) === 0;
|
|
920
1011
|
}
|
|
921
|
-
function
|
|
922
|
-
return
|
|
1012
|
+
function Hn(e, t) {
|
|
1013
|
+
return je(e, t | 128);
|
|
923
1014
|
}
|
|
924
|
-
function
|
|
925
|
-
return
|
|
1015
|
+
function je(e, t) {
|
|
1016
|
+
return x.chmodSync(e, t);
|
|
926
1017
|
}
|
|
927
|
-
function
|
|
928
|
-
const
|
|
929
|
-
return
|
|
1018
|
+
function Xn(e, t) {
|
|
1019
|
+
const n = x.statSync(e);
|
|
1020
|
+
return qn(t, n.atime, n.mtime);
|
|
930
1021
|
}
|
|
931
|
-
function
|
|
932
|
-
return
|
|
1022
|
+
function Zn(e, t, n, i, r) {
|
|
1023
|
+
return t ? gt(n, i, r) : Tn(e.mode, n, i, r);
|
|
933
1024
|
}
|
|
934
|
-
function
|
|
935
|
-
return
|
|
1025
|
+
function Tn(e, t, n, i) {
|
|
1026
|
+
return x.mkdirSync(n), gt(t, n, i), je(n, e);
|
|
936
1027
|
}
|
|
937
|
-
function
|
|
938
|
-
|
|
1028
|
+
function gt(e, t, n) {
|
|
1029
|
+
x.readdirSync(e).forEach((i) => Kn(i, e, t, n));
|
|
939
1030
|
}
|
|
940
|
-
function
|
|
941
|
-
const
|
|
942
|
-
|
|
1031
|
+
function Kn(e, t, n, i) {
|
|
1032
|
+
const r = ce.join(t, e), o = ce.join(n, e);
|
|
1033
|
+
if (i.filter && !i.filter(r, o))
|
|
1034
|
+
return;
|
|
1035
|
+
const { destStat: c } = ue.checkPathsSync(r, o, "copy", i);
|
|
1036
|
+
return vt(c, r, o, i);
|
|
943
1037
|
}
|
|
944
|
-
function
|
|
945
|
-
let
|
|
946
|
-
if (
|
|
1038
|
+
function er(e, t, n, i) {
|
|
1039
|
+
let r = x.readlinkSync(t);
|
|
1040
|
+
if (i.dereference && (r = ce.resolve(process.cwd(), r)), e) {
|
|
947
1041
|
let o;
|
|
948
1042
|
try {
|
|
949
|
-
o =
|
|
1043
|
+
o = x.readlinkSync(n);
|
|
950
1044
|
} catch (c) {
|
|
951
1045
|
if (c.code === "EINVAL" || c.code === "UNKNOWN")
|
|
952
|
-
return
|
|
1046
|
+
return x.symlinkSync(r, n);
|
|
953
1047
|
throw c;
|
|
954
1048
|
}
|
|
955
|
-
if (
|
|
956
|
-
throw new Error(`Cannot copy '${
|
|
957
|
-
if (
|
|
958
|
-
throw new Error(`Cannot overwrite '${o}' with '${
|
|
959
|
-
return
|
|
1049
|
+
if (i.dereference && (o = ce.resolve(process.cwd(), o)), ue.isSrcSubdir(r, o))
|
|
1050
|
+
throw new Error(`Cannot copy '${r}' to a subdirectory of itself, '${o}'.`);
|
|
1051
|
+
if (ue.isSrcSubdir(o, r))
|
|
1052
|
+
throw new Error(`Cannot overwrite '${o}' with '${r}'.`);
|
|
1053
|
+
return tr(r, n);
|
|
960
1054
|
} else
|
|
961
|
-
return
|
|
1055
|
+
return x.symlinkSync(r, n);
|
|
962
1056
|
}
|
|
963
|
-
function
|
|
964
|
-
return
|
|
1057
|
+
function tr(e, t) {
|
|
1058
|
+
return x.unlinkSync(t), x.symlinkSync(e, t);
|
|
965
1059
|
}
|
|
966
|
-
var
|
|
967
|
-
const
|
|
968
|
-
var
|
|
969
|
-
copy:
|
|
970
|
-
copySync:
|
|
1060
|
+
var nr = Gn;
|
|
1061
|
+
const rr = W.fromCallback;
|
|
1062
|
+
var Me = {
|
|
1063
|
+
copy: rr(bn),
|
|
1064
|
+
copySync: nr
|
|
971
1065
|
};
|
|
972
|
-
const
|
|
973
|
-
function
|
|
974
|
-
|
|
975
|
-
"unlink",
|
|
976
|
-
"chmod",
|
|
977
|
-
"stat",
|
|
978
|
-
"lstat",
|
|
979
|
-
"rmdir",
|
|
980
|
-
"readdir"
|
|
981
|
-
].forEach((t) => {
|
|
982
|
-
e[t] = e[t] || Xe[t], t = t + "Sync", e[t] = e[t] || Xe[t];
|
|
983
|
-
}), e.maxBusyTries = e.maxBusyTries || 3;
|
|
984
|
-
}
|
|
985
|
-
function Ae(e, n, t) {
|
|
986
|
-
let r = 0;
|
|
987
|
-
typeof n == "function" && (t = n, n = {}), E(e, "rimraf: missing path"), E.strictEqual(typeof e, "string", "rimraf: path should be a string"), E.strictEqual(typeof t, "function", "rimraf: callback function required"), E(n, "rimraf: invalid options argument provided"), E.strictEqual(typeof n, "object", "rimraf: options should be object"), _n(n), ze(e, n, function i(o) {
|
|
988
|
-
if (o) {
|
|
989
|
-
if ((o.code === "EBUSY" || o.code === "ENOTEMPTY" || o.code === "EPERM") && r < n.maxBusyTries) {
|
|
990
|
-
r++;
|
|
991
|
-
const c = r * 100;
|
|
992
|
-
return setTimeout(() => ze(e, n, i), c);
|
|
993
|
-
}
|
|
994
|
-
o.code === "ENOENT" && (o = null);
|
|
995
|
-
}
|
|
996
|
-
t(o);
|
|
997
|
-
});
|
|
1066
|
+
const kt = B, ir = W.fromCallback;
|
|
1067
|
+
function or(e, t) {
|
|
1068
|
+
kt.rm(e, { recursive: !0, force: !0 }, t);
|
|
998
1069
|
}
|
|
999
|
-
function
|
|
1000
|
-
|
|
1001
|
-
if (r && r.code === "ENOENT")
|
|
1002
|
-
return t(null);
|
|
1003
|
-
if (r && r.code === "EPERM" && fe)
|
|
1004
|
-
return He(e, n, r, t);
|
|
1005
|
-
if (i && i.isDirectory())
|
|
1006
|
-
return Se(e, n, r, t);
|
|
1007
|
-
n.unlink(e, (o) => {
|
|
1008
|
-
if (o) {
|
|
1009
|
-
if (o.code === "ENOENT")
|
|
1010
|
-
return t(null);
|
|
1011
|
-
if (o.code === "EPERM")
|
|
1012
|
-
return fe ? He(e, n, o, t) : Se(e, n, o, t);
|
|
1013
|
-
if (o.code === "EISDIR")
|
|
1014
|
-
return Se(e, n, o, t);
|
|
1015
|
-
}
|
|
1016
|
-
return t(o);
|
|
1017
|
-
});
|
|
1018
|
-
});
|
|
1019
|
-
}
|
|
1020
|
-
function He(e, n, t, r) {
|
|
1021
|
-
E(e), E(n), E(typeof r == "function"), n.chmod(e, 438, (i) => {
|
|
1022
|
-
i ? r(i.code === "ENOENT" ? null : t) : n.stat(e, (o, c) => {
|
|
1023
|
-
o ? r(o.code === "ENOENT" ? null : t) : c.isDirectory() ? Se(e, n, t, r) : n.unlink(e, r);
|
|
1024
|
-
});
|
|
1025
|
-
});
|
|
1026
|
-
}
|
|
1027
|
-
function be(e, n, t) {
|
|
1028
|
-
let r;
|
|
1029
|
-
E(e), E(n);
|
|
1030
|
-
try {
|
|
1031
|
-
n.chmodSync(e, 438);
|
|
1032
|
-
} catch (i) {
|
|
1033
|
-
if (i.code === "ENOENT")
|
|
1034
|
-
return;
|
|
1035
|
-
throw t;
|
|
1036
|
-
}
|
|
1037
|
-
try {
|
|
1038
|
-
r = n.statSync(e);
|
|
1039
|
-
} catch (i) {
|
|
1040
|
-
if (i.code === "ENOENT")
|
|
1041
|
-
return;
|
|
1042
|
-
throw t;
|
|
1043
|
-
}
|
|
1044
|
-
r.isDirectory() ? we(e, n, t) : n.unlinkSync(e);
|
|
1045
|
-
}
|
|
1046
|
-
function Se(e, n, t, r) {
|
|
1047
|
-
E(e), E(n), E(typeof r == "function"), n.rmdir(e, (i) => {
|
|
1048
|
-
i && (i.code === "ENOTEMPTY" || i.code === "EEXIST" || i.code === "EPERM") ? mr(e, n, r) : i && i.code === "ENOTDIR" ? r(t) : r(i);
|
|
1049
|
-
});
|
|
1050
|
-
}
|
|
1051
|
-
function mr(e, n, t) {
|
|
1052
|
-
E(e), E(n), E(typeof t == "function"), n.readdir(e, (r, i) => {
|
|
1053
|
-
if (r)
|
|
1054
|
-
return t(r);
|
|
1055
|
-
let o = i.length, c;
|
|
1056
|
-
if (o === 0)
|
|
1057
|
-
return n.rmdir(e, t);
|
|
1058
|
-
i.forEach((a) => {
|
|
1059
|
-
Ae(Tn.join(e, a), n, (f) => {
|
|
1060
|
-
if (!c) {
|
|
1061
|
-
if (f)
|
|
1062
|
-
return t(c = f);
|
|
1063
|
-
--o === 0 && n.rmdir(e, t);
|
|
1064
|
-
}
|
|
1065
|
-
});
|
|
1066
|
-
});
|
|
1067
|
-
});
|
|
1068
|
-
}
|
|
1069
|
-
function Cn(e, n) {
|
|
1070
|
-
let t;
|
|
1071
|
-
n = n || {}, _n(n), E(e, "rimraf: missing path"), E.strictEqual(typeof e, "string", "rimraf: path should be a string"), E(n, "rimraf: missing options"), E.strictEqual(typeof n, "object", "rimraf: options should be object");
|
|
1072
|
-
try {
|
|
1073
|
-
t = n.lstatSync(e);
|
|
1074
|
-
} catch (r) {
|
|
1075
|
-
if (r.code === "ENOENT")
|
|
1076
|
-
return;
|
|
1077
|
-
r.code === "EPERM" && fe && be(e, n, r);
|
|
1078
|
-
}
|
|
1079
|
-
try {
|
|
1080
|
-
t && t.isDirectory() ? we(e, n, null) : n.unlinkSync(e);
|
|
1081
|
-
} catch (r) {
|
|
1082
|
-
if (r.code === "ENOENT")
|
|
1083
|
-
return;
|
|
1084
|
-
if (r.code === "EPERM")
|
|
1085
|
-
return fe ? be(e, n, r) : we(e, n, r);
|
|
1086
|
-
if (r.code !== "EISDIR")
|
|
1087
|
-
throw r;
|
|
1088
|
-
we(e, n, r);
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
function we(e, n, t) {
|
|
1092
|
-
E(e), E(n);
|
|
1093
|
-
try {
|
|
1094
|
-
n.rmdirSync(e);
|
|
1095
|
-
} catch (r) {
|
|
1096
|
-
if (r.code === "ENOTDIR")
|
|
1097
|
-
throw t;
|
|
1098
|
-
if (r.code === "ENOTEMPTY" || r.code === "EEXIST" || r.code === "EPERM")
|
|
1099
|
-
dr(e, n);
|
|
1100
|
-
else if (r.code !== "ENOENT")
|
|
1101
|
-
throw r;
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
function dr(e, n) {
|
|
1105
|
-
if (E(e), E(n), n.readdirSync(e).forEach((t) => Cn(Tn.join(e, t), n)), fe) {
|
|
1106
|
-
const t = Date.now();
|
|
1107
|
-
do
|
|
1108
|
-
try {
|
|
1109
|
-
return n.rmdirSync(e, n);
|
|
1110
|
-
} catch {
|
|
1111
|
-
}
|
|
1112
|
-
while (Date.now() - t < 500);
|
|
1113
|
-
} else
|
|
1114
|
-
return n.rmdirSync(e, n);
|
|
1115
|
-
}
|
|
1116
|
-
var hr = Ae;
|
|
1117
|
-
Ae.sync = Cn;
|
|
1118
|
-
const pe = W, Sr = M.fromCallback, xn = hr;
|
|
1119
|
-
function wr(e, n) {
|
|
1120
|
-
if (pe.rm)
|
|
1121
|
-
return pe.rm(e, { recursive: !0, force: !0 }, n);
|
|
1122
|
-
xn(e, n);
|
|
1123
|
-
}
|
|
1124
|
-
function vr(e) {
|
|
1125
|
-
if (pe.rmSync)
|
|
1126
|
-
return pe.rmSync(e, { recursive: !0, force: !0 });
|
|
1127
|
-
xn.sync(e);
|
|
1070
|
+
function cr(e) {
|
|
1071
|
+
kt.rmSync(e, { recursive: !0, force: !0 });
|
|
1128
1072
|
}
|
|
1129
1073
|
var ge = {
|
|
1130
|
-
remove:
|
|
1131
|
-
removeSync:
|
|
1074
|
+
remove: ir(or),
|
|
1075
|
+
removeSync: cr
|
|
1132
1076
|
};
|
|
1133
|
-
const
|
|
1134
|
-
let
|
|
1077
|
+
const ur = W.fromPromise, $t = z, Et = M, Ft = b, Dt = ge, Ve = ur(async function(t) {
|
|
1078
|
+
let n;
|
|
1135
1079
|
try {
|
|
1136
|
-
|
|
1080
|
+
n = await $t.readdir(t);
|
|
1137
1081
|
} catch {
|
|
1138
|
-
return
|
|
1082
|
+
return Ft.mkdirs(t);
|
|
1139
1083
|
}
|
|
1140
|
-
return Promise.all(
|
|
1084
|
+
return Promise.all(n.map((i) => Dt.remove(Et.join(t, i))));
|
|
1141
1085
|
});
|
|
1142
|
-
function
|
|
1143
|
-
let
|
|
1086
|
+
function ze(e) {
|
|
1087
|
+
let t;
|
|
1144
1088
|
try {
|
|
1145
|
-
|
|
1089
|
+
t = $t.readdirSync(e);
|
|
1146
1090
|
} catch {
|
|
1147
|
-
return
|
|
1091
|
+
return Ft.mkdirsSync(e);
|
|
1148
1092
|
}
|
|
1149
|
-
|
|
1150
|
-
|
|
1093
|
+
t.forEach((n) => {
|
|
1094
|
+
n = Et.join(e, n), Dt.removeSync(n);
|
|
1151
1095
|
});
|
|
1152
1096
|
}
|
|
1153
|
-
var
|
|
1154
|
-
emptyDirSync:
|
|
1155
|
-
emptydirSync:
|
|
1156
|
-
emptyDir:
|
|
1157
|
-
emptydir:
|
|
1097
|
+
var ar = {
|
|
1098
|
+
emptyDirSync: ze,
|
|
1099
|
+
emptydirSync: ze,
|
|
1100
|
+
emptyDir: Ve,
|
|
1101
|
+
emptydir: Ve
|
|
1158
1102
|
};
|
|
1159
|
-
const
|
|
1160
|
-
function
|
|
1161
|
-
function
|
|
1162
|
-
G.writeFile(e, "", (
|
|
1163
|
-
if (
|
|
1164
|
-
return
|
|
1165
|
-
|
|
1103
|
+
const fr = W.fromCallback, Pt = M, G = B, Ot = b;
|
|
1104
|
+
function sr(e, t) {
|
|
1105
|
+
function n() {
|
|
1106
|
+
G.writeFile(e, "", (i) => {
|
|
1107
|
+
if (i)
|
|
1108
|
+
return t(i);
|
|
1109
|
+
t();
|
|
1166
1110
|
});
|
|
1167
1111
|
}
|
|
1168
|
-
G.stat(e, (
|
|
1169
|
-
if (!
|
|
1170
|
-
return
|
|
1171
|
-
const o =
|
|
1112
|
+
G.stat(e, (i, r) => {
|
|
1113
|
+
if (!i && r.isFile())
|
|
1114
|
+
return t();
|
|
1115
|
+
const o = Pt.dirname(e);
|
|
1172
1116
|
G.stat(o, (c, a) => {
|
|
1173
1117
|
if (c)
|
|
1174
|
-
return c.code === "ENOENT" ?
|
|
1118
|
+
return c.code === "ENOENT" ? Ot.mkdirs(o, (f) => {
|
|
1175
1119
|
if (f)
|
|
1176
|
-
return
|
|
1177
|
-
|
|
1178
|
-
}) :
|
|
1179
|
-
a.isDirectory() ?
|
|
1120
|
+
return t(f);
|
|
1121
|
+
n();
|
|
1122
|
+
}) : t(c);
|
|
1123
|
+
a.isDirectory() ? n() : G.readdir(o, (f) => {
|
|
1180
1124
|
if (f)
|
|
1181
|
-
return
|
|
1125
|
+
return t(f);
|
|
1182
1126
|
});
|
|
1183
1127
|
});
|
|
1184
1128
|
});
|
|
1185
1129
|
}
|
|
1186
|
-
function
|
|
1187
|
-
let
|
|
1130
|
+
function lr(e) {
|
|
1131
|
+
let t;
|
|
1188
1132
|
try {
|
|
1189
|
-
|
|
1133
|
+
t = G.statSync(e);
|
|
1190
1134
|
} catch {
|
|
1191
1135
|
}
|
|
1192
|
-
if (
|
|
1136
|
+
if (t && t.isFile())
|
|
1193
1137
|
return;
|
|
1194
|
-
const
|
|
1138
|
+
const n = Pt.dirname(e);
|
|
1195
1139
|
try {
|
|
1196
|
-
G.statSync(
|
|
1197
|
-
} catch (
|
|
1198
|
-
if (
|
|
1199
|
-
|
|
1140
|
+
G.statSync(n).isDirectory() || G.readdirSync(n);
|
|
1141
|
+
} catch (i) {
|
|
1142
|
+
if (i && i.code === "ENOENT")
|
|
1143
|
+
Ot.mkdirsSync(n);
|
|
1200
1144
|
else
|
|
1201
|
-
throw
|
|
1145
|
+
throw i;
|
|
1202
1146
|
}
|
|
1203
1147
|
G.writeFileSync(e, "");
|
|
1204
1148
|
}
|
|
1205
|
-
var
|
|
1206
|
-
createFile:
|
|
1207
|
-
createFileSync:
|
|
1149
|
+
var mr = {
|
|
1150
|
+
createFile: fr(sr),
|
|
1151
|
+
createFileSync: lr
|
|
1208
1152
|
};
|
|
1209
|
-
const
|
|
1210
|
-
function
|
|
1211
|
-
function r
|
|
1212
|
-
|
|
1153
|
+
const yr = W.fromCallback, Ct = M, q = B, Nt = b, pr = Q.pathExists, { areIdentical: _t } = K;
|
|
1154
|
+
function dr(e, t, n) {
|
|
1155
|
+
function i(r, o) {
|
|
1156
|
+
q.link(r, o, (c) => {
|
|
1213
1157
|
if (c)
|
|
1214
|
-
return
|
|
1215
|
-
|
|
1158
|
+
return n(c);
|
|
1159
|
+
n(null);
|
|
1216
1160
|
});
|
|
1217
1161
|
}
|
|
1218
|
-
|
|
1219
|
-
|
|
1162
|
+
q.lstat(t, (r, o) => {
|
|
1163
|
+
q.lstat(e, (c, a) => {
|
|
1220
1164
|
if (c)
|
|
1221
|
-
return c.message = c.message.replace("lstat", "ensureLink"),
|
|
1222
|
-
if (o &&
|
|
1223
|
-
return
|
|
1224
|
-
const f =
|
|
1225
|
-
|
|
1226
|
-
if (
|
|
1227
|
-
return
|
|
1165
|
+
return c.message = c.message.replace("lstat", "ensureLink"), n(c);
|
|
1166
|
+
if (o && _t(a, o))
|
|
1167
|
+
return n(null);
|
|
1168
|
+
const f = Ct.dirname(t);
|
|
1169
|
+
pr(f, (p, u) => {
|
|
1170
|
+
if (p)
|
|
1171
|
+
return n(p);
|
|
1228
1172
|
if (u)
|
|
1229
|
-
return
|
|
1230
|
-
|
|
1173
|
+
return i(e, t);
|
|
1174
|
+
Nt.mkdirs(f, (s) => {
|
|
1231
1175
|
if (s)
|
|
1232
|
-
return
|
|
1233
|
-
|
|
1176
|
+
return n(s);
|
|
1177
|
+
i(e, t);
|
|
1234
1178
|
});
|
|
1235
1179
|
});
|
|
1236
1180
|
});
|
|
1237
1181
|
});
|
|
1238
1182
|
}
|
|
1239
|
-
function
|
|
1240
|
-
let
|
|
1183
|
+
function hr(e, t) {
|
|
1184
|
+
let n;
|
|
1241
1185
|
try {
|
|
1242
|
-
|
|
1186
|
+
n = q.lstatSync(t);
|
|
1243
1187
|
} catch {
|
|
1244
1188
|
}
|
|
1245
1189
|
try {
|
|
1246
|
-
const o =
|
|
1247
|
-
if (
|
|
1190
|
+
const o = q.lstatSync(e);
|
|
1191
|
+
if (n && _t(o, n))
|
|
1248
1192
|
return;
|
|
1249
1193
|
} catch (o) {
|
|
1250
1194
|
throw o.message = o.message.replace("lstat", "ensureLink"), o;
|
|
1251
1195
|
}
|
|
1252
|
-
const
|
|
1253
|
-
return
|
|
1196
|
+
const i = Ct.dirname(t);
|
|
1197
|
+
return q.existsSync(i) || Nt.mkdirsSync(i), q.linkSync(e, t);
|
|
1254
1198
|
}
|
|
1255
|
-
var
|
|
1256
|
-
createLink:
|
|
1257
|
-
createLinkSync:
|
|
1199
|
+
var Sr = {
|
|
1200
|
+
createLink: yr(dr),
|
|
1201
|
+
createLinkSync: hr
|
|
1258
1202
|
};
|
|
1259
|
-
const
|
|
1260
|
-
function
|
|
1261
|
-
if (
|
|
1262
|
-
return
|
|
1203
|
+
const Y = M, ne = B, vr = Q.pathExists;
|
|
1204
|
+
function wr(e, t, n) {
|
|
1205
|
+
if (Y.isAbsolute(e))
|
|
1206
|
+
return ne.lstat(e, (i) => i ? (i.message = i.message.replace("lstat", "ensureSymlink"), n(i)) : n(null, {
|
|
1263
1207
|
toCwd: e,
|
|
1264
1208
|
toDst: e
|
|
1265
1209
|
}));
|
|
1266
1210
|
{
|
|
1267
|
-
const
|
|
1268
|
-
return
|
|
1269
|
-
toCwd:
|
|
1211
|
+
const i = Y.dirname(t), r = Y.join(i, e);
|
|
1212
|
+
return vr(r, (o, c) => o ? n(o) : c ? n(null, {
|
|
1213
|
+
toCwd: r,
|
|
1270
1214
|
toDst: e
|
|
1271
|
-
}) :
|
|
1215
|
+
}) : ne.lstat(e, (a) => a ? (a.message = a.message.replace("lstat", "ensureSymlink"), n(a)) : n(null, {
|
|
1272
1216
|
toCwd: e,
|
|
1273
|
-
toDst:
|
|
1217
|
+
toDst: Y.relative(i, e)
|
|
1274
1218
|
})));
|
|
1275
1219
|
}
|
|
1276
1220
|
}
|
|
1277
|
-
function
|
|
1278
|
-
let
|
|
1279
|
-
if (
|
|
1280
|
-
if (
|
|
1221
|
+
function gr(e, t) {
|
|
1222
|
+
let n;
|
|
1223
|
+
if (Y.isAbsolute(e)) {
|
|
1224
|
+
if (n = ne.existsSync(e), !n)
|
|
1281
1225
|
throw new Error("absolute srcpath does not exist");
|
|
1282
1226
|
return {
|
|
1283
1227
|
toCwd: e,
|
|
1284
1228
|
toDst: e
|
|
1285
1229
|
};
|
|
1286
1230
|
} else {
|
|
1287
|
-
const
|
|
1288
|
-
if (
|
|
1231
|
+
const i = Y.dirname(t), r = Y.join(i, e);
|
|
1232
|
+
if (n = ne.existsSync(r), n)
|
|
1289
1233
|
return {
|
|
1290
|
-
toCwd:
|
|
1234
|
+
toCwd: r,
|
|
1291
1235
|
toDst: e
|
|
1292
1236
|
};
|
|
1293
|
-
if (
|
|
1237
|
+
if (n = ne.existsSync(e), !n)
|
|
1294
1238
|
throw new Error("relative srcpath does not exist");
|
|
1295
1239
|
return {
|
|
1296
1240
|
toCwd: e,
|
|
1297
|
-
toDst:
|
|
1241
|
+
toDst: Y.relative(i, e)
|
|
1298
1242
|
};
|
|
1299
1243
|
}
|
|
1300
1244
|
}
|
|
1301
|
-
var
|
|
1302
|
-
symlinkPaths:
|
|
1303
|
-
symlinkPathsSync:
|
|
1245
|
+
var kr = {
|
|
1246
|
+
symlinkPaths: wr,
|
|
1247
|
+
symlinkPathsSync: gr
|
|
1304
1248
|
};
|
|
1305
|
-
const
|
|
1306
|
-
function
|
|
1307
|
-
if (
|
|
1308
|
-
return
|
|
1309
|
-
|
|
1310
|
-
if (
|
|
1311
|
-
return
|
|
1312
|
-
|
|
1249
|
+
const It = B;
|
|
1250
|
+
function $r(e, t, n) {
|
|
1251
|
+
if (n = typeof t == "function" ? t : n, t = typeof t == "function" ? !1 : t, t)
|
|
1252
|
+
return n(null, t);
|
|
1253
|
+
It.lstat(e, (i, r) => {
|
|
1254
|
+
if (i)
|
|
1255
|
+
return n(null, "file");
|
|
1256
|
+
t = r && r.isDirectory() ? "dir" : "file", n(null, t);
|
|
1313
1257
|
});
|
|
1314
1258
|
}
|
|
1315
|
-
function
|
|
1316
|
-
let
|
|
1317
|
-
if (
|
|
1318
|
-
return
|
|
1259
|
+
function Er(e, t) {
|
|
1260
|
+
let n;
|
|
1261
|
+
if (t)
|
|
1262
|
+
return t;
|
|
1319
1263
|
try {
|
|
1320
|
-
|
|
1264
|
+
n = It.lstatSync(e);
|
|
1321
1265
|
} catch {
|
|
1322
1266
|
return "file";
|
|
1323
1267
|
}
|
|
1324
|
-
return
|
|
1268
|
+
return n && n.isDirectory() ? "dir" : "file";
|
|
1325
1269
|
}
|
|
1326
|
-
var
|
|
1327
|
-
symlinkType:
|
|
1328
|
-
symlinkTypeSync:
|
|
1270
|
+
var Fr = {
|
|
1271
|
+
symlinkType: $r,
|
|
1272
|
+
symlinkTypeSync: Er
|
|
1329
1273
|
};
|
|
1330
|
-
const
|
|
1331
|
-
function
|
|
1332
|
-
|
|
1333
|
-
!
|
|
1334
|
-
|
|
1335
|
-
|
|
1274
|
+
const Dr = W.fromCallback, At = M, J = z, xt = b, Pr = xt.mkdirs, Or = xt.mkdirsSync, Lt = kr, Cr = Lt.symlinkPaths, Nr = Lt.symlinkPathsSync, Wt = Fr, _r = Wt.symlinkType, Ir = Wt.symlinkTypeSync, Ar = Q.pathExists, { areIdentical: jt } = K;
|
|
1275
|
+
function xr(e, t, n, i) {
|
|
1276
|
+
i = typeof n == "function" ? n : i, n = typeof n == "function" ? !1 : n, J.lstat(t, (r, o) => {
|
|
1277
|
+
!r && o.isSymbolicLink() ? Promise.all([
|
|
1278
|
+
J.stat(e),
|
|
1279
|
+
J.stat(t)
|
|
1336
1280
|
]).then(([c, a]) => {
|
|
1337
|
-
if (
|
|
1338
|
-
return
|
|
1339
|
-
|
|
1340
|
-
}) :
|
|
1281
|
+
if (jt(c, a))
|
|
1282
|
+
return i(null);
|
|
1283
|
+
Qe(e, t, n, i);
|
|
1284
|
+
}) : Qe(e, t, n, i);
|
|
1341
1285
|
});
|
|
1342
1286
|
}
|
|
1343
|
-
function
|
|
1344
|
-
|
|
1345
|
-
if (
|
|
1346
|
-
return r
|
|
1347
|
-
e = o.toDst,
|
|
1287
|
+
function Qe(e, t, n, i) {
|
|
1288
|
+
Cr(e, t, (r, o) => {
|
|
1289
|
+
if (r)
|
|
1290
|
+
return i(r);
|
|
1291
|
+
e = o.toDst, _r(o.toCwd, n, (c, a) => {
|
|
1348
1292
|
if (c)
|
|
1349
|
-
return
|
|
1350
|
-
const f =
|
|
1351
|
-
|
|
1352
|
-
if (
|
|
1353
|
-
return
|
|
1293
|
+
return i(c);
|
|
1294
|
+
const f = At.dirname(t);
|
|
1295
|
+
Ar(f, (p, u) => {
|
|
1296
|
+
if (p)
|
|
1297
|
+
return i(p);
|
|
1354
1298
|
if (u)
|
|
1355
|
-
return
|
|
1356
|
-
|
|
1299
|
+
return J.symlink(e, t, a, i);
|
|
1300
|
+
Pr(f, (s) => {
|
|
1357
1301
|
if (s)
|
|
1358
|
-
return
|
|
1359
|
-
|
|
1302
|
+
return i(s);
|
|
1303
|
+
J.symlink(e, t, a, i);
|
|
1360
1304
|
});
|
|
1361
1305
|
});
|
|
1362
1306
|
});
|
|
1363
1307
|
});
|
|
1364
1308
|
}
|
|
1365
|
-
function
|
|
1366
|
-
let
|
|
1309
|
+
function Lr(e, t, n) {
|
|
1310
|
+
let i;
|
|
1367
1311
|
try {
|
|
1368
|
-
|
|
1312
|
+
i = J.lstatSync(t);
|
|
1369
1313
|
} catch {
|
|
1370
1314
|
}
|
|
1371
|
-
if (
|
|
1372
|
-
const a =
|
|
1373
|
-
if (
|
|
1315
|
+
if (i && i.isSymbolicLink()) {
|
|
1316
|
+
const a = J.statSync(e), f = J.statSync(t);
|
|
1317
|
+
if (jt(a, f))
|
|
1374
1318
|
return;
|
|
1375
1319
|
}
|
|
1376
|
-
const
|
|
1377
|
-
e =
|
|
1378
|
-
const o =
|
|
1379
|
-
return
|
|
1380
|
-
}
|
|
1381
|
-
var
|
|
1382
|
-
createSymlink:
|
|
1383
|
-
createSymlinkSync:
|
|
1320
|
+
const r = Nr(e, t);
|
|
1321
|
+
e = r.toDst, n = Ir(r.toCwd, n);
|
|
1322
|
+
const o = At.dirname(t);
|
|
1323
|
+
return J.existsSync(o) || Or(o), J.symlinkSync(e, t, n);
|
|
1324
|
+
}
|
|
1325
|
+
var Wr = {
|
|
1326
|
+
createSymlink: Dr(xr),
|
|
1327
|
+
createSymlinkSync: Lr
|
|
1384
1328
|
};
|
|
1385
|
-
const { createFile:
|
|
1386
|
-
var
|
|
1387
|
-
createFile:
|
|
1388
|
-
createFileSync:
|
|
1389
|
-
ensureFile:
|
|
1390
|
-
ensureFileSync:
|
|
1391
|
-
createLink:
|
|
1392
|
-
createLinkSync:
|
|
1393
|
-
ensureLink:
|
|
1394
|
-
ensureLinkSync:
|
|
1395
|
-
createSymlink:
|
|
1396
|
-
createSymlinkSync:
|
|
1397
|
-
ensureSymlink:
|
|
1398
|
-
ensureSymlinkSync:
|
|
1329
|
+
const { createFile: He, createFileSync: Xe } = mr, { createLink: Ze, createLinkSync: Te } = Sr, { createSymlink: Ke, createSymlinkSync: et } = Wr;
|
|
1330
|
+
var jr = {
|
|
1331
|
+
createFile: He,
|
|
1332
|
+
createFileSync: Xe,
|
|
1333
|
+
ensureFile: He,
|
|
1334
|
+
ensureFileSync: Xe,
|
|
1335
|
+
createLink: Ze,
|
|
1336
|
+
createLinkSync: Te,
|
|
1337
|
+
ensureLink: Ze,
|
|
1338
|
+
ensureLinkSync: Te,
|
|
1339
|
+
createSymlink: Ke,
|
|
1340
|
+
createSymlinkSync: et,
|
|
1341
|
+
ensureSymlink: Ke,
|
|
1342
|
+
ensureSymlinkSync: et
|
|
1399
1343
|
};
|
|
1400
|
-
function
|
|
1401
|
-
`, finalEOL:
|
|
1402
|
-
const o =
|
|
1403
|
-
return JSON.stringify(e,
|
|
1344
|
+
function Mr(e, { EOL: t = `
|
|
1345
|
+
`, finalEOL: n = !0, replacer: i = null, spaces: r } = {}) {
|
|
1346
|
+
const o = n ? t : "";
|
|
1347
|
+
return JSON.stringify(e, i, r).replace(/\n/g, t) + o;
|
|
1404
1348
|
}
|
|
1405
|
-
function
|
|
1349
|
+
function Br(e) {
|
|
1406
1350
|
return Buffer.isBuffer(e) && (e = e.toString("utf8")), e.replace(/^\uFEFF/, "");
|
|
1407
1351
|
}
|
|
1408
|
-
var
|
|
1409
|
-
let
|
|
1352
|
+
var Be = { stringify: Mr, stripBom: Br };
|
|
1353
|
+
let T;
|
|
1410
1354
|
try {
|
|
1411
|
-
|
|
1355
|
+
T = B;
|
|
1412
1356
|
} catch {
|
|
1413
|
-
|
|
1414
|
-
}
|
|
1415
|
-
const
|
|
1416
|
-
async function
|
|
1417
|
-
typeof
|
|
1418
|
-
const
|
|
1419
|
-
let
|
|
1420
|
-
|
|
1357
|
+
T = it;
|
|
1358
|
+
}
|
|
1359
|
+
const ke = W, { stringify: Mt, stripBom: Bt } = Be;
|
|
1360
|
+
async function Rr(e, t = {}) {
|
|
1361
|
+
typeof t == "string" && (t = { encoding: t });
|
|
1362
|
+
const n = t.fs || T, i = "throws" in t ? t.throws : !0;
|
|
1363
|
+
let r = await ke.fromCallback(n.readFile)(e, t);
|
|
1364
|
+
r = Bt(r);
|
|
1421
1365
|
let o;
|
|
1422
1366
|
try {
|
|
1423
|
-
o = JSON.parse(
|
|
1367
|
+
o = JSON.parse(r, t ? t.reviver : null);
|
|
1424
1368
|
} catch (c) {
|
|
1425
|
-
if (
|
|
1369
|
+
if (i)
|
|
1426
1370
|
throw c.message = `${e}: ${c.message}`, c;
|
|
1427
1371
|
return null;
|
|
1428
1372
|
}
|
|
1429
1373
|
return o;
|
|
1430
1374
|
}
|
|
1431
|
-
const
|
|
1432
|
-
function
|
|
1433
|
-
typeof
|
|
1434
|
-
const
|
|
1375
|
+
const Jr = ke.fromPromise(Rr);
|
|
1376
|
+
function br(e, t = {}) {
|
|
1377
|
+
typeof t == "string" && (t = { encoding: t });
|
|
1378
|
+
const n = t.fs || T, i = "throws" in t ? t.throws : !0;
|
|
1435
1379
|
try {
|
|
1436
|
-
let
|
|
1437
|
-
return
|
|
1438
|
-
} catch (
|
|
1439
|
-
if (
|
|
1440
|
-
throw
|
|
1380
|
+
let r = n.readFileSync(e, t);
|
|
1381
|
+
return r = Bt(r), JSON.parse(r, t.reviver);
|
|
1382
|
+
} catch (r) {
|
|
1383
|
+
if (i)
|
|
1384
|
+
throw r.message = `${e}: ${r.message}`, r;
|
|
1441
1385
|
return null;
|
|
1442
1386
|
}
|
|
1443
1387
|
}
|
|
1444
|
-
async function
|
|
1445
|
-
const
|
|
1446
|
-
await
|
|
1388
|
+
async function Ur(e, t, n = {}) {
|
|
1389
|
+
const i = n.fs || T, r = Mt(t, n);
|
|
1390
|
+
await ke.fromCallback(i.writeFile)(e, r, n);
|
|
1447
1391
|
}
|
|
1448
|
-
const
|
|
1449
|
-
function
|
|
1450
|
-
const
|
|
1451
|
-
return
|
|
1392
|
+
const qr = ke.fromPromise(Ur);
|
|
1393
|
+
function Gr(e, t, n = {}) {
|
|
1394
|
+
const i = n.fs || T, r = Mt(t, n);
|
|
1395
|
+
return i.writeFileSync(e, r, n);
|
|
1452
1396
|
}
|
|
1453
|
-
const
|
|
1454
|
-
readFile:
|
|
1455
|
-
readFileSync:
|
|
1456
|
-
writeFile:
|
|
1457
|
-
writeFileSync:
|
|
1397
|
+
const Yr = {
|
|
1398
|
+
readFile: Jr,
|
|
1399
|
+
readFileSync: br,
|
|
1400
|
+
writeFile: qr,
|
|
1401
|
+
writeFileSync: Gr
|
|
1458
1402
|
};
|
|
1459
|
-
var
|
|
1460
|
-
const
|
|
1461
|
-
var
|
|
1462
|
-
readJson:
|
|
1463
|
-
readJsonSync:
|
|
1464
|
-
writeJson:
|
|
1465
|
-
writeJsonSync:
|
|
1403
|
+
var Vr = Yr;
|
|
1404
|
+
const ye = Vr;
|
|
1405
|
+
var zr = {
|
|
1406
|
+
readJson: ye.readFile,
|
|
1407
|
+
readJsonSync: ye.readFileSync,
|
|
1408
|
+
writeJson: ye.writeFile,
|
|
1409
|
+
writeJsonSync: ye.writeFileSync
|
|
1466
1410
|
};
|
|
1467
|
-
const
|
|
1468
|
-
function
|
|
1469
|
-
typeof
|
|
1470
|
-
const
|
|
1471
|
-
|
|
1411
|
+
const Qr = W.fromCallback, re = B, Rt = M, Jt = b, Hr = Q.pathExists;
|
|
1412
|
+
function Xr(e, t, n, i) {
|
|
1413
|
+
typeof n == "function" && (i = n, n = "utf8");
|
|
1414
|
+
const r = Rt.dirname(e);
|
|
1415
|
+
Hr(r, (o, c) => {
|
|
1472
1416
|
if (o)
|
|
1473
|
-
return
|
|
1417
|
+
return i(o);
|
|
1474
1418
|
if (c)
|
|
1475
|
-
return
|
|
1476
|
-
|
|
1419
|
+
return re.writeFile(e, t, n, i);
|
|
1420
|
+
Jt.mkdirs(r, (a) => {
|
|
1477
1421
|
if (a)
|
|
1478
|
-
return
|
|
1479
|
-
|
|
1422
|
+
return i(a);
|
|
1423
|
+
re.writeFile(e, t, n, i);
|
|
1480
1424
|
});
|
|
1481
1425
|
});
|
|
1482
1426
|
}
|
|
1483
|
-
function
|
|
1484
|
-
const
|
|
1485
|
-
if (
|
|
1486
|
-
return
|
|
1487
|
-
|
|
1427
|
+
function Zr(e, ...t) {
|
|
1428
|
+
const n = Rt.dirname(e);
|
|
1429
|
+
if (re.existsSync(n))
|
|
1430
|
+
return re.writeFileSync(e, ...t);
|
|
1431
|
+
Jt.mkdirsSync(n), re.writeFileSync(e, ...t);
|
|
1488
1432
|
}
|
|
1489
|
-
var
|
|
1490
|
-
outputFile:
|
|
1491
|
-
outputFileSync:
|
|
1433
|
+
var Re = {
|
|
1434
|
+
outputFile: Qr(Xr),
|
|
1435
|
+
outputFileSync: Zr
|
|
1492
1436
|
};
|
|
1493
|
-
const { stringify:
|
|
1494
|
-
async function
|
|
1495
|
-
const
|
|
1496
|
-
await
|
|
1497
|
-
}
|
|
1498
|
-
var
|
|
1499
|
-
const { stringify:
|
|
1500
|
-
function
|
|
1501
|
-
const
|
|
1502
|
-
|
|
1503
|
-
}
|
|
1504
|
-
var
|
|
1505
|
-
const
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
var
|
|
1515
|
-
const
|
|
1516
|
-
function
|
|
1517
|
-
typeof
|
|
1518
|
-
const
|
|
1519
|
-
|
|
1437
|
+
const { stringify: Tr } = Be, { outputFile: Kr } = Re;
|
|
1438
|
+
async function ei(e, t, n = {}) {
|
|
1439
|
+
const i = Tr(t, n);
|
|
1440
|
+
await Kr(e, i, n);
|
|
1441
|
+
}
|
|
1442
|
+
var ti = ei;
|
|
1443
|
+
const { stringify: ni } = Be, { outputFileSync: ri } = Re;
|
|
1444
|
+
function ii(e, t, n) {
|
|
1445
|
+
const i = ni(t, n);
|
|
1446
|
+
ri(e, i, n);
|
|
1447
|
+
}
|
|
1448
|
+
var oi = ii;
|
|
1449
|
+
const ci = W.fromPromise, L = zr;
|
|
1450
|
+
L.outputJson = ci(ti);
|
|
1451
|
+
L.outputJsonSync = oi;
|
|
1452
|
+
L.outputJSON = L.outputJson;
|
|
1453
|
+
L.outputJSONSync = L.outputJsonSync;
|
|
1454
|
+
L.writeJSON = L.writeJson;
|
|
1455
|
+
L.writeJSONSync = L.writeJsonSync;
|
|
1456
|
+
L.readJSON = L.readJson;
|
|
1457
|
+
L.readJSONSync = L.readJsonSync;
|
|
1458
|
+
var ui = L;
|
|
1459
|
+
const ai = B, _e = M, fi = Me.copy, bt = ge.remove, si = b.mkdirp, li = Q.pathExists, tt = K;
|
|
1460
|
+
function mi(e, t, n, i) {
|
|
1461
|
+
typeof n == "function" && (i = n, n = {}), n = n || {};
|
|
1462
|
+
const r = n.overwrite || n.clobber || !1;
|
|
1463
|
+
tt.checkPaths(e, t, "move", n, (o, c) => {
|
|
1520
1464
|
if (o)
|
|
1521
|
-
return
|
|
1465
|
+
return i(o);
|
|
1522
1466
|
const { srcStat: a, isChangingCase: f = !1 } = c;
|
|
1523
|
-
|
|
1524
|
-
if (
|
|
1525
|
-
return
|
|
1526
|
-
if (
|
|
1527
|
-
return
|
|
1528
|
-
|
|
1467
|
+
tt.checkParentPaths(e, a, t, "move", (p) => {
|
|
1468
|
+
if (p)
|
|
1469
|
+
return i(p);
|
|
1470
|
+
if (yi(t))
|
|
1471
|
+
return nt(e, t, r, f, i);
|
|
1472
|
+
si(_e.dirname(t), (u) => u ? i(u) : nt(e, t, r, f, i));
|
|
1529
1473
|
});
|
|
1530
1474
|
});
|
|
1531
1475
|
}
|
|
1532
|
-
function
|
|
1533
|
-
const
|
|
1534
|
-
return
|
|
1476
|
+
function yi(e) {
|
|
1477
|
+
const t = _e.dirname(e);
|
|
1478
|
+
return _e.parse(t).root === t;
|
|
1535
1479
|
}
|
|
1536
|
-
function
|
|
1537
|
-
if (
|
|
1538
|
-
return
|
|
1539
|
-
if (
|
|
1540
|
-
return
|
|
1541
|
-
|
|
1480
|
+
function nt(e, t, n, i, r) {
|
|
1481
|
+
if (i)
|
|
1482
|
+
return De(e, t, n, r);
|
|
1483
|
+
if (n)
|
|
1484
|
+
return bt(t, (o) => o ? r(o) : De(e, t, n, r));
|
|
1485
|
+
li(t, (o, c) => o ? r(o) : c ? r(new Error("dest already exists.")) : De(e, t, n, r));
|
|
1542
1486
|
}
|
|
1543
|
-
function
|
|
1544
|
-
|
|
1487
|
+
function De(e, t, n, i) {
|
|
1488
|
+
ai.rename(e, t, (r) => r ? r.code !== "EXDEV" ? i(r) : pi(e, t, n, i) : i());
|
|
1545
1489
|
}
|
|
1546
|
-
function
|
|
1547
|
-
|
|
1548
|
-
overwrite:
|
|
1490
|
+
function pi(e, t, n, i) {
|
|
1491
|
+
fi(e, t, {
|
|
1492
|
+
overwrite: n,
|
|
1549
1493
|
errorOnExist: !0
|
|
1550
|
-
}, (o) => o ?
|
|
1551
|
-
}
|
|
1552
|
-
var
|
|
1553
|
-
const
|
|
1554
|
-
function
|
|
1555
|
-
|
|
1556
|
-
const
|
|
1557
|
-
return
|
|
1558
|
-
}
|
|
1559
|
-
function
|
|
1560
|
-
const
|
|
1561
|
-
return
|
|
1562
|
-
}
|
|
1563
|
-
function
|
|
1564
|
-
if (
|
|
1565
|
-
return
|
|
1566
|
-
if (
|
|
1567
|
-
return
|
|
1568
|
-
if (
|
|
1494
|
+
}, (o) => o ? i(o) : bt(e, i));
|
|
1495
|
+
}
|
|
1496
|
+
var di = mi;
|
|
1497
|
+
const Ut = B, Ie = M, hi = Me.copySync, qt = ge.removeSync, Si = b.mkdirpSync, rt = K;
|
|
1498
|
+
function vi(e, t, n) {
|
|
1499
|
+
n = n || {};
|
|
1500
|
+
const i = n.overwrite || n.clobber || !1, { srcStat: r, isChangingCase: o = !1 } = rt.checkPathsSync(e, t, "move", n);
|
|
1501
|
+
return rt.checkParentPathsSync(e, r, t, "move"), wi(t) || Si(Ie.dirname(t)), gi(e, t, i, o);
|
|
1502
|
+
}
|
|
1503
|
+
function wi(e) {
|
|
1504
|
+
const t = Ie.dirname(e);
|
|
1505
|
+
return Ie.parse(t).root === t;
|
|
1506
|
+
}
|
|
1507
|
+
function gi(e, t, n, i) {
|
|
1508
|
+
if (i)
|
|
1509
|
+
return Pe(e, t, n);
|
|
1510
|
+
if (n)
|
|
1511
|
+
return qt(t), Pe(e, t, n);
|
|
1512
|
+
if (Ut.existsSync(t))
|
|
1569
1513
|
throw new Error("dest already exists.");
|
|
1570
|
-
return
|
|
1514
|
+
return Pe(e, t, n);
|
|
1571
1515
|
}
|
|
1572
|
-
function
|
|
1516
|
+
function Pe(e, t, n) {
|
|
1573
1517
|
try {
|
|
1574
|
-
|
|
1575
|
-
} catch (
|
|
1576
|
-
if (
|
|
1577
|
-
throw
|
|
1578
|
-
return
|
|
1518
|
+
Ut.renameSync(e, t);
|
|
1519
|
+
} catch (i) {
|
|
1520
|
+
if (i.code !== "EXDEV")
|
|
1521
|
+
throw i;
|
|
1522
|
+
return ki(e, t, n);
|
|
1579
1523
|
}
|
|
1580
1524
|
}
|
|
1581
|
-
function
|
|
1582
|
-
return
|
|
1583
|
-
overwrite:
|
|
1525
|
+
function ki(e, t, n) {
|
|
1526
|
+
return hi(e, t, {
|
|
1527
|
+
overwrite: n,
|
|
1584
1528
|
errorOnExist: !0
|
|
1585
|
-
}),
|
|
1586
|
-
}
|
|
1587
|
-
var
|
|
1588
|
-
const
|
|
1589
|
-
var
|
|
1590
|
-
move:
|
|
1591
|
-
moveSync:
|
|
1592
|
-
},
|
|
1529
|
+
}), qt(e);
|
|
1530
|
+
}
|
|
1531
|
+
var $i = vi;
|
|
1532
|
+
const Ei = W.fromCallback;
|
|
1533
|
+
var Fi = {
|
|
1534
|
+
move: Ei(di),
|
|
1535
|
+
moveSync: $i
|
|
1536
|
+
}, Di = {
|
|
1537
|
+
...z,
|
|
1538
|
+
...Me,
|
|
1539
|
+
...ar,
|
|
1540
|
+
...jr,
|
|
1541
|
+
...ui,
|
|
1542
|
+
...b,
|
|
1543
|
+
...Fi,
|
|
1544
|
+
...Re,
|
|
1593
1545
|
...Q,
|
|
1594
|
-
...We,
|
|
1595
|
-
...pr,
|
|
1596
|
-
...Qr,
|
|
1597
|
-
...Ei,
|
|
1598
|
-
...q,
|
|
1599
|
-
...Ri,
|
|
1600
|
-
...Be,
|
|
1601
|
-
...X,
|
|
1602
1546
|
...ge
|
|
1603
1547
|
};
|
|
1604
|
-
const
|
|
1605
|
-
function
|
|
1548
|
+
const pe = Di;
|
|
1549
|
+
function Ii(e, t) {
|
|
1606
1550
|
return {
|
|
1607
1551
|
name: "vite-plugin-css-import",
|
|
1608
1552
|
apply: "build",
|
|
1609
1553
|
enforce: "post",
|
|
1610
|
-
writeBundle: async (
|
|
1611
|
-
const
|
|
1612
|
-
if (!
|
|
1554
|
+
writeBundle: async (n, i) => {
|
|
1555
|
+
const r = Object.keys(i).filter((u) => u.endsWith(".css"));
|
|
1556
|
+
if (!r.length)
|
|
1613
1557
|
return;
|
|
1614
|
-
const o =
|
|
1615
|
-
`, ""), c =
|
|
1558
|
+
const o = r.reduce((u, s) => `${u}import "./${s}";
|
|
1559
|
+
`, ""), c = M.resolve(
|
|
1616
1560
|
process.cwd(),
|
|
1617
1561
|
e,
|
|
1618
|
-
`${
|
|
1619
|
-
), a =
|
|
1562
|
+
`${t}-temp.js`
|
|
1563
|
+
), a = M.resolve(process.cwd(), e, `${t}.js`), f = pe.createWriteStream(c);
|
|
1620
1564
|
f.write(o, "utf8");
|
|
1621
|
-
const
|
|
1622
|
-
await
|
|
1565
|
+
const p = pe.createReadStream(a);
|
|
1566
|
+
await zt(p, f), await pe.remove(a), await pe.rename(c, a), f.end();
|
|
1623
1567
|
}
|
|
1624
1568
|
};
|
|
1625
1569
|
}
|
|
1626
1570
|
export {
|
|
1627
|
-
|
|
1571
|
+
te as Texts,
|
|
1572
|
+
ot as TranslationsKey,
|
|
1573
|
+
Ii as viteCssImportPlugin
|
|
1628
1574
|
};
|
|
1629
1575
|
//# sourceMappingURL=index.js.map
|