elit 2.0.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +275 -128
- package/dist/build.d.mts +10 -1
- package/dist/build.d.ts +10 -1
- package/dist/build.js +670 -1
- package/dist/build.mjs +641 -1
- package/dist/chokidar.d.mts +134 -0
- package/dist/chokidar.d.ts +134 -0
- package/dist/chokidar.js +240 -0
- package/dist/chokidar.mjs +221 -0
- package/dist/cli.js +2792 -495
- package/dist/dom.d.mts +10 -3
- package/dist/dom.d.ts +10 -3
- package/dist/dom.js +676 -1
- package/dist/dom.mjs +647 -1
- package/dist/el.d.mts +16 -36
- package/dist/el.d.ts +16 -36
- package/dist/el.js +789 -1
- package/dist/el.mjs +583 -1
- package/dist/fs.d.mts +255 -0
- package/dist/fs.d.ts +255 -0
- package/dist/fs.js +513 -0
- package/dist/fs.mjs +469 -0
- package/dist/hmr.js +112 -1
- package/dist/hmr.mjs +91 -1
- package/dist/http.d.mts +163 -0
- package/dist/http.d.ts +163 -0
- package/dist/http.js +632 -0
- package/dist/http.mjs +605 -0
- package/dist/https.d.mts +108 -0
- package/dist/https.d.ts +108 -0
- package/dist/https.js +907 -0
- package/dist/https.mjs +901 -0
- package/dist/index.d.mts +613 -33
- package/dist/index.d.ts +613 -33
- package/dist/index.js +2589 -1
- package/dist/index.mjs +2312 -1
- package/dist/mime-types.d.mts +48 -0
- package/dist/mime-types.d.ts +48 -0
- package/dist/mime-types.js +197 -0
- package/dist/mime-types.mjs +166 -0
- package/dist/path.d.mts +163 -0
- package/dist/path.d.ts +163 -0
- package/dist/path.js +350 -0
- package/dist/path.mjs +310 -0
- package/dist/router.d.mts +3 -1
- package/dist/router.d.ts +3 -1
- package/dist/router.js +830 -1
- package/dist/router.mjs +801 -1
- package/dist/runtime.d.mts +97 -0
- package/dist/runtime.d.ts +97 -0
- package/dist/runtime.js +43 -0
- package/dist/runtime.mjs +15 -0
- package/dist/server.d.mts +5 -1
- package/dist/server.d.ts +5 -1
- package/dist/server.js +3267 -1
- package/dist/server.mjs +3241 -1
- package/dist/state.d.mts +3 -1
- package/dist/state.d.ts +3 -1
- package/dist/state.js +1036 -1
- package/dist/state.mjs +992 -1
- package/dist/style.d.mts +47 -1
- package/dist/style.d.ts +47 -1
- package/dist/style.js +551 -1
- package/dist/style.mjs +483 -1
- package/dist/{types-DOAdFFJB.d.ts → types-C0nGi6MX.d.mts} +29 -13
- package/dist/{types-DOAdFFJB.d.mts → types-Du6kfwTm.d.ts} +29 -13
- package/dist/types.d.mts +452 -3
- package/dist/types.d.ts +452 -3
- package/dist/types.js +18 -1
- package/dist/ws.d.mts +195 -0
- package/dist/ws.d.ts +195 -0
- package/dist/ws.js +380 -0
- package/dist/ws.mjs +358 -0
- package/dist/wss.d.mts +108 -0
- package/dist/wss.d.ts +108 -0
- package/dist/wss.js +1306 -0
- package/dist/wss.mjs +1300 -0
- package/package.json +53 -6
- package/dist/client.d.mts +0 -9
- package/dist/client.d.ts +0 -9
- package/dist/client.js +0 -1
- package/dist/client.mjs +0 -1
package/dist/fs.js
ADDED
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/fs.ts
|
|
21
|
+
var fs_exports = {};
|
|
22
|
+
__export(fs_exports, {
|
|
23
|
+
appendFile: () => appendFile,
|
|
24
|
+
appendFileSync: () => appendFileSync,
|
|
25
|
+
copyFile: () => copyFile,
|
|
26
|
+
copyFileSync: () => copyFileSync,
|
|
27
|
+
default: () => fs_default,
|
|
28
|
+
exists: () => exists,
|
|
29
|
+
existsSync: () => existsSync,
|
|
30
|
+
getRuntime: () => getRuntime,
|
|
31
|
+
mkdir: () => mkdir,
|
|
32
|
+
mkdirSync: () => mkdirSync,
|
|
33
|
+
promises: () => promises,
|
|
34
|
+
readFile: () => readFile,
|
|
35
|
+
readFileSync: () => readFileSync,
|
|
36
|
+
readdir: () => readdir,
|
|
37
|
+
readdirSync: () => readdirSync,
|
|
38
|
+
realpath: () => realpath,
|
|
39
|
+
realpathSync: () => realpathSync,
|
|
40
|
+
rename: () => rename,
|
|
41
|
+
renameSync: () => renameSync,
|
|
42
|
+
rmdir: () => rmdir,
|
|
43
|
+
rmdirSync: () => rmdirSync,
|
|
44
|
+
stat: () => stat,
|
|
45
|
+
statSync: () => statSync,
|
|
46
|
+
unlink: () => unlink,
|
|
47
|
+
unlinkSync: () => unlinkSync,
|
|
48
|
+
writeFile: () => writeFile,
|
|
49
|
+
writeFileSync: () => writeFileSync
|
|
50
|
+
});
|
|
51
|
+
module.exports = __toCommonJS(fs_exports);
|
|
52
|
+
|
|
53
|
+
// src/runtime.ts
|
|
54
|
+
var runtime = (() => {
|
|
55
|
+
if (typeof Deno !== "undefined") return "deno";
|
|
56
|
+
if (typeof Bun !== "undefined") return "bun";
|
|
57
|
+
return "node";
|
|
58
|
+
})();
|
|
59
|
+
var isNode = runtime === "node";
|
|
60
|
+
var isBun = runtime === "bun";
|
|
61
|
+
var isDeno = runtime === "deno";
|
|
62
|
+
|
|
63
|
+
// src/fs.ts
|
|
64
|
+
var isBunOrDeno = isBun || isDeno;
|
|
65
|
+
function parseOptions(options, defaultValue) {
|
|
66
|
+
return typeof options === "string" ? { encoding: options } : options || defaultValue;
|
|
67
|
+
}
|
|
68
|
+
function decodeContent(content, encoding) {
|
|
69
|
+
if (encoding) {
|
|
70
|
+
return new TextDecoder(encoding).decode(content);
|
|
71
|
+
}
|
|
72
|
+
return Buffer.from(content instanceof ArrayBuffer ? new Uint8Array(content) : content);
|
|
73
|
+
}
|
|
74
|
+
function dataToUint8Array(data) {
|
|
75
|
+
if (typeof data === "string") {
|
|
76
|
+
return new TextEncoder().encode(data);
|
|
77
|
+
}
|
|
78
|
+
if (data instanceof Buffer) {
|
|
79
|
+
return new Uint8Array(data);
|
|
80
|
+
}
|
|
81
|
+
return data;
|
|
82
|
+
}
|
|
83
|
+
function processDenoEntries(iterator, withFileTypes) {
|
|
84
|
+
const entries = [];
|
|
85
|
+
for (const entry of iterator) {
|
|
86
|
+
if (withFileTypes) {
|
|
87
|
+
entries.push(createDirentFromDenoEntry(entry));
|
|
88
|
+
} else {
|
|
89
|
+
entries.push(entry.name);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return entries;
|
|
93
|
+
}
|
|
94
|
+
async function processDenoEntriesAsync(iterator, withFileTypes) {
|
|
95
|
+
const entries = [];
|
|
96
|
+
for await (const entry of iterator) {
|
|
97
|
+
if (withFileTypes) {
|
|
98
|
+
entries.push(createDirentFromDenoEntry(entry));
|
|
99
|
+
} else {
|
|
100
|
+
entries.push(entry.name);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return entries;
|
|
104
|
+
}
|
|
105
|
+
var fs;
|
|
106
|
+
var fsPromises;
|
|
107
|
+
if (isNode) {
|
|
108
|
+
fs = require("fs");
|
|
109
|
+
fsPromises = require("fs/promises");
|
|
110
|
+
}
|
|
111
|
+
async function readFile(path, options) {
|
|
112
|
+
const opts = parseOptions(options, {});
|
|
113
|
+
if (isNode) {
|
|
114
|
+
return fsPromises.readFile(path, opts);
|
|
115
|
+
} else if (isBun) {
|
|
116
|
+
const file = Bun.file(path);
|
|
117
|
+
const content = await file.arrayBuffer();
|
|
118
|
+
return decodeContent(content, opts.encoding);
|
|
119
|
+
} else if (isDeno) {
|
|
120
|
+
const content = await Deno.readFile(path);
|
|
121
|
+
return decodeContent(content, opts.encoding);
|
|
122
|
+
}
|
|
123
|
+
throw new Error("Unsupported runtime");
|
|
124
|
+
}
|
|
125
|
+
function readFileSync(path, options) {
|
|
126
|
+
const opts = parseOptions(options, {});
|
|
127
|
+
if (isNode) {
|
|
128
|
+
return fs.readFileSync(path, opts);
|
|
129
|
+
} else if (isBun) {
|
|
130
|
+
const file = Bun.file(path);
|
|
131
|
+
const content = file.arrayBuffer();
|
|
132
|
+
return decodeContent(content, opts.encoding);
|
|
133
|
+
} else if (isDeno) {
|
|
134
|
+
const content = Deno.readFileSync(path);
|
|
135
|
+
return decodeContent(content, opts.encoding);
|
|
136
|
+
}
|
|
137
|
+
throw new Error("Unsupported runtime");
|
|
138
|
+
}
|
|
139
|
+
async function writeFile(path, data, options) {
|
|
140
|
+
const opts = parseOptions(options, {});
|
|
141
|
+
if (isNode) {
|
|
142
|
+
return fsPromises.writeFile(path, data, opts);
|
|
143
|
+
} else if (isBun) {
|
|
144
|
+
await Bun.write(path, data);
|
|
145
|
+
} else if (isDeno) {
|
|
146
|
+
await Deno.writeFile(path, dataToUint8Array(data));
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function writeFileSync(path, data, options) {
|
|
150
|
+
const opts = parseOptions(options, {});
|
|
151
|
+
if (isNode) {
|
|
152
|
+
fs.writeFileSync(path, data, opts);
|
|
153
|
+
} else if (isBun) {
|
|
154
|
+
Bun.write(path, data);
|
|
155
|
+
} else if (isDeno) {
|
|
156
|
+
Deno.writeFileSync(path, dataToUint8Array(data));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
async function appendFile(path, data, options) {
|
|
160
|
+
const opts = parseOptions(options, {});
|
|
161
|
+
if (isNode) {
|
|
162
|
+
return fsPromises.appendFile(path, data, opts);
|
|
163
|
+
} else {
|
|
164
|
+
if (await exists(path)) {
|
|
165
|
+
const existing = await readFile(path);
|
|
166
|
+
const combined = Buffer.isBuffer(existing) ? Buffer.concat([existing, Buffer.isBuffer(data) ? data : Buffer.from(data)]) : existing + (Buffer.isBuffer(data) ? data.toString() : data);
|
|
167
|
+
await writeFile(path, combined, opts);
|
|
168
|
+
} else {
|
|
169
|
+
await writeFile(path, data, opts);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
function appendFileSync(path, data, options) {
|
|
174
|
+
const opts = parseOptions(options, {});
|
|
175
|
+
if (isNode) {
|
|
176
|
+
fs.appendFileSync(path, data, opts);
|
|
177
|
+
} else {
|
|
178
|
+
if (existsSync(path)) {
|
|
179
|
+
const existing = readFileSync(path);
|
|
180
|
+
const combined = Buffer.isBuffer(existing) ? Buffer.concat([existing, Buffer.isBuffer(data) ? data : Buffer.from(data)]) : existing + (Buffer.isBuffer(data) ? data.toString() : data);
|
|
181
|
+
writeFileSync(path, combined, opts);
|
|
182
|
+
} else {
|
|
183
|
+
writeFileSync(path, data, opts);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
async function exists(path) {
|
|
188
|
+
try {
|
|
189
|
+
await stat(path);
|
|
190
|
+
return true;
|
|
191
|
+
} catch {
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
function existsSync(path) {
|
|
196
|
+
try {
|
|
197
|
+
statSync(path);
|
|
198
|
+
return true;
|
|
199
|
+
} catch {
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
async function stat(path) {
|
|
204
|
+
if (isNode) {
|
|
205
|
+
return fsPromises.stat(path);
|
|
206
|
+
} else if (isBun) {
|
|
207
|
+
const file = Bun.file(path);
|
|
208
|
+
const size = file.size;
|
|
209
|
+
const exists2 = await file.exists();
|
|
210
|
+
if (!exists2) {
|
|
211
|
+
throw new Error(`ENOENT: no such file or directory, stat '${path}'`);
|
|
212
|
+
}
|
|
213
|
+
return createStatsObject(path, size, false);
|
|
214
|
+
} else if (isDeno) {
|
|
215
|
+
const info = await Deno.stat(path);
|
|
216
|
+
return createStatsFromDenoFileInfo(info);
|
|
217
|
+
}
|
|
218
|
+
throw new Error("Unsupported runtime");
|
|
219
|
+
}
|
|
220
|
+
function statSync(path) {
|
|
221
|
+
if (isNode) {
|
|
222
|
+
return fs.statSync(path);
|
|
223
|
+
} else if (isBun) {
|
|
224
|
+
const file = Bun.file(path);
|
|
225
|
+
const size = file.size;
|
|
226
|
+
try {
|
|
227
|
+
file.arrayBuffer();
|
|
228
|
+
} catch {
|
|
229
|
+
throw new Error(`ENOENT: no such file or directory, stat '${path}'`);
|
|
230
|
+
}
|
|
231
|
+
return createStatsObject(path, size, false);
|
|
232
|
+
} else if (isDeno) {
|
|
233
|
+
const info = Deno.statSync(path);
|
|
234
|
+
return createStatsFromDenoFileInfo(info);
|
|
235
|
+
}
|
|
236
|
+
throw new Error("Unsupported runtime");
|
|
237
|
+
}
|
|
238
|
+
async function mkdir(path, options) {
|
|
239
|
+
const opts = typeof options === "number" ? { mode: options } : options || {};
|
|
240
|
+
if (isNode) {
|
|
241
|
+
await fsPromises.mkdir(path, opts);
|
|
242
|
+
} else if (isBun) {
|
|
243
|
+
await Deno.mkdir(path, { recursive: opts.recursive });
|
|
244
|
+
} else if (isDeno) {
|
|
245
|
+
await Deno.mkdir(path, { recursive: opts.recursive });
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
function mkdirSync(path, options) {
|
|
249
|
+
const opts = typeof options === "number" ? { mode: options } : options || {};
|
|
250
|
+
if (isNode) {
|
|
251
|
+
fs.mkdirSync(path, opts);
|
|
252
|
+
} else if (isBun) {
|
|
253
|
+
Deno.mkdirSync(path, { recursive: opts.recursive });
|
|
254
|
+
} else if (isDeno) {
|
|
255
|
+
Deno.mkdirSync(path, { recursive: opts.recursive });
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
async function readdir(path, options) {
|
|
259
|
+
const opts = parseOptions(options, {});
|
|
260
|
+
if (isNode) {
|
|
261
|
+
return fsPromises.readdir(path, opts);
|
|
262
|
+
} else if (isBunOrDeno) {
|
|
263
|
+
return processDenoEntriesAsync(Deno.readDir(path), opts.withFileTypes);
|
|
264
|
+
}
|
|
265
|
+
throw new Error("Unsupported runtime");
|
|
266
|
+
}
|
|
267
|
+
function readdirSync(path, options) {
|
|
268
|
+
const opts = parseOptions(options, {});
|
|
269
|
+
if (isNode) {
|
|
270
|
+
return fs.readdirSync(path, opts);
|
|
271
|
+
} else if (isBunOrDeno) {
|
|
272
|
+
return processDenoEntries(Deno.readDirSync(path), opts.withFileTypes);
|
|
273
|
+
}
|
|
274
|
+
throw new Error("Unsupported runtime");
|
|
275
|
+
}
|
|
276
|
+
async function unlink(path) {
|
|
277
|
+
if (isNode) {
|
|
278
|
+
return fsPromises.unlink(path);
|
|
279
|
+
} else if (isBun) {
|
|
280
|
+
await Deno.remove(path);
|
|
281
|
+
} else if (isDeno) {
|
|
282
|
+
await Deno.remove(path);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
function unlinkSync(path) {
|
|
286
|
+
if (isNode) {
|
|
287
|
+
fs.unlinkSync(path);
|
|
288
|
+
} else if (isBun) {
|
|
289
|
+
Deno.removeSync(path);
|
|
290
|
+
} else if (isDeno) {
|
|
291
|
+
Deno.removeSync(path);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
async function rmdir(path, options) {
|
|
295
|
+
if (isNode) {
|
|
296
|
+
return fsPromises.rmdir(path, options);
|
|
297
|
+
} else if (isBun) {
|
|
298
|
+
await Deno.remove(path, { recursive: options?.recursive });
|
|
299
|
+
} else if (isDeno) {
|
|
300
|
+
await Deno.remove(path, { recursive: options?.recursive });
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
function rmdirSync(path, options) {
|
|
304
|
+
if (isNode) {
|
|
305
|
+
fs.rmdirSync(path, options);
|
|
306
|
+
} else if (isBun) {
|
|
307
|
+
Deno.removeSync(path, { recursive: options?.recursive });
|
|
308
|
+
} else if (isDeno) {
|
|
309
|
+
Deno.removeSync(path, { recursive: options?.recursive });
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
async function rename(oldPath, newPath) {
|
|
313
|
+
if (isNode) {
|
|
314
|
+
return fsPromises.rename(oldPath, newPath);
|
|
315
|
+
} else if (isBun) {
|
|
316
|
+
await Deno.rename(oldPath, newPath);
|
|
317
|
+
} else if (isDeno) {
|
|
318
|
+
await Deno.rename(oldPath, newPath);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
function renameSync(oldPath, newPath) {
|
|
322
|
+
if (isNode) {
|
|
323
|
+
fs.renameSync(oldPath, newPath);
|
|
324
|
+
} else if (isBun) {
|
|
325
|
+
Deno.renameSync(oldPath, newPath);
|
|
326
|
+
} else if (isDeno) {
|
|
327
|
+
Deno.renameSync(oldPath, newPath);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
async function copyFile(src, dest, flags) {
|
|
331
|
+
if (isNode) {
|
|
332
|
+
return fsPromises.copyFile(src, dest, flags);
|
|
333
|
+
} else if (isBun) {
|
|
334
|
+
await Deno.copyFile(src, dest);
|
|
335
|
+
} else if (isDeno) {
|
|
336
|
+
await Deno.copyFile(src, dest);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
function copyFileSync(src, dest, flags) {
|
|
340
|
+
if (isNode) {
|
|
341
|
+
fs.copyFileSync(src, dest, flags);
|
|
342
|
+
} else if (isBun) {
|
|
343
|
+
Deno.copyFileSync(src, dest);
|
|
344
|
+
} else if (isDeno) {
|
|
345
|
+
Deno.copyFileSync(src, dest);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
async function realpath(path, options) {
|
|
349
|
+
if (isNode) {
|
|
350
|
+
return fsPromises.realpath(path, options);
|
|
351
|
+
} else if (isBun) {
|
|
352
|
+
const fs2 = require("fs/promises");
|
|
353
|
+
return fs2.realpath(path, options);
|
|
354
|
+
} else if (isDeno) {
|
|
355
|
+
return await Deno.realPath(path);
|
|
356
|
+
}
|
|
357
|
+
return path;
|
|
358
|
+
}
|
|
359
|
+
function realpathSync(path, options) {
|
|
360
|
+
if (isNode) {
|
|
361
|
+
return fs.realpathSync(path, options);
|
|
362
|
+
} else if (isBun) {
|
|
363
|
+
const fs2 = require("fs");
|
|
364
|
+
return fs2.realpathSync(path, options);
|
|
365
|
+
} else if (isDeno) {
|
|
366
|
+
return Deno.realPathSync(path);
|
|
367
|
+
}
|
|
368
|
+
return path;
|
|
369
|
+
}
|
|
370
|
+
function createStatsObject(_path, size, isDir) {
|
|
371
|
+
const now = Date.now();
|
|
372
|
+
return {
|
|
373
|
+
isFile: () => !isDir,
|
|
374
|
+
isDirectory: () => isDir,
|
|
375
|
+
isBlockDevice: () => false,
|
|
376
|
+
isCharacterDevice: () => false,
|
|
377
|
+
isSymbolicLink: () => false,
|
|
378
|
+
isFIFO: () => false,
|
|
379
|
+
isSocket: () => false,
|
|
380
|
+
dev: 0,
|
|
381
|
+
ino: 0,
|
|
382
|
+
mode: isDir ? 16877 : 33188,
|
|
383
|
+
nlink: 1,
|
|
384
|
+
uid: 0,
|
|
385
|
+
gid: 0,
|
|
386
|
+
rdev: 0,
|
|
387
|
+
size,
|
|
388
|
+
blksize: 4096,
|
|
389
|
+
blocks: Math.ceil(size / 512),
|
|
390
|
+
atimeMs: now,
|
|
391
|
+
mtimeMs: now,
|
|
392
|
+
ctimeMs: now,
|
|
393
|
+
birthtimeMs: now,
|
|
394
|
+
atime: new Date(now),
|
|
395
|
+
mtime: new Date(now),
|
|
396
|
+
ctime: new Date(now),
|
|
397
|
+
birthtime: new Date(now)
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
function createStatsFromDenoFileInfo(info) {
|
|
401
|
+
return {
|
|
402
|
+
isFile: () => info.isFile,
|
|
403
|
+
isDirectory: () => info.isDirectory,
|
|
404
|
+
isBlockDevice: () => false,
|
|
405
|
+
isCharacterDevice: () => false,
|
|
406
|
+
isSymbolicLink: () => info.isSymlink || false,
|
|
407
|
+
isFIFO: () => false,
|
|
408
|
+
isSocket: () => false,
|
|
409
|
+
dev: info.dev || 0,
|
|
410
|
+
ino: info.ino || 0,
|
|
411
|
+
mode: info.mode || 0,
|
|
412
|
+
nlink: info.nlink || 1,
|
|
413
|
+
uid: info.uid || 0,
|
|
414
|
+
gid: info.gid || 0,
|
|
415
|
+
rdev: 0,
|
|
416
|
+
size: info.size,
|
|
417
|
+
blksize: info.blksize || 4096,
|
|
418
|
+
blocks: info.blocks || Math.ceil(info.size / 512),
|
|
419
|
+
atimeMs: info.atime?.getTime() || Date.now(),
|
|
420
|
+
mtimeMs: info.mtime?.getTime() || Date.now(),
|
|
421
|
+
ctimeMs: info.birthtime?.getTime() || Date.now(),
|
|
422
|
+
birthtimeMs: info.birthtime?.getTime() || Date.now(),
|
|
423
|
+
atime: info.atime || /* @__PURE__ */ new Date(),
|
|
424
|
+
mtime: info.mtime || /* @__PURE__ */ new Date(),
|
|
425
|
+
ctime: info.birthtime || /* @__PURE__ */ new Date(),
|
|
426
|
+
birthtime: info.birthtime || /* @__PURE__ */ new Date()
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
function createDirentFromDenoEntry(entry) {
|
|
430
|
+
return {
|
|
431
|
+
name: entry.name,
|
|
432
|
+
isFile: () => entry.isFile,
|
|
433
|
+
isDirectory: () => entry.isDirectory,
|
|
434
|
+
isBlockDevice: () => false,
|
|
435
|
+
isCharacterDevice: () => false,
|
|
436
|
+
isSymbolicLink: () => entry.isSymlink || false,
|
|
437
|
+
isFIFO: () => false,
|
|
438
|
+
isSocket: () => false
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
function getRuntime() {
|
|
442
|
+
return runtime;
|
|
443
|
+
}
|
|
444
|
+
var promises = {
|
|
445
|
+
readFile,
|
|
446
|
+
writeFile,
|
|
447
|
+
appendFile,
|
|
448
|
+
stat,
|
|
449
|
+
mkdir,
|
|
450
|
+
readdir,
|
|
451
|
+
unlink,
|
|
452
|
+
rmdir,
|
|
453
|
+
rename,
|
|
454
|
+
copyFile,
|
|
455
|
+
realpath
|
|
456
|
+
};
|
|
457
|
+
var fs_default = {
|
|
458
|
+
readFile,
|
|
459
|
+
readFileSync,
|
|
460
|
+
writeFile,
|
|
461
|
+
writeFileSync,
|
|
462
|
+
appendFile,
|
|
463
|
+
appendFileSync,
|
|
464
|
+
exists,
|
|
465
|
+
existsSync,
|
|
466
|
+
stat,
|
|
467
|
+
statSync,
|
|
468
|
+
mkdir,
|
|
469
|
+
mkdirSync,
|
|
470
|
+
readdir,
|
|
471
|
+
readdirSync,
|
|
472
|
+
unlink,
|
|
473
|
+
unlinkSync,
|
|
474
|
+
rmdir,
|
|
475
|
+
rmdirSync,
|
|
476
|
+
rename,
|
|
477
|
+
renameSync,
|
|
478
|
+
copyFile,
|
|
479
|
+
copyFileSync,
|
|
480
|
+
realpath,
|
|
481
|
+
realpathSync,
|
|
482
|
+
promises,
|
|
483
|
+
getRuntime
|
|
484
|
+
};
|
|
485
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
486
|
+
0 && (module.exports = {
|
|
487
|
+
appendFile,
|
|
488
|
+
appendFileSync,
|
|
489
|
+
copyFile,
|
|
490
|
+
copyFileSync,
|
|
491
|
+
exists,
|
|
492
|
+
existsSync,
|
|
493
|
+
getRuntime,
|
|
494
|
+
mkdir,
|
|
495
|
+
mkdirSync,
|
|
496
|
+
promises,
|
|
497
|
+
readFile,
|
|
498
|
+
readFileSync,
|
|
499
|
+
readdir,
|
|
500
|
+
readdirSync,
|
|
501
|
+
realpath,
|
|
502
|
+
realpathSync,
|
|
503
|
+
rename,
|
|
504
|
+
renameSync,
|
|
505
|
+
rmdir,
|
|
506
|
+
rmdirSync,
|
|
507
|
+
stat,
|
|
508
|
+
statSync,
|
|
509
|
+
unlink,
|
|
510
|
+
unlinkSync,
|
|
511
|
+
writeFile,
|
|
512
|
+
writeFileSync
|
|
513
|
+
});
|