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