@fireproof/core 0.19.112-dev-web → 0.19.112-dev-iife
Sign up to get free protection for your applications and to get access to all the features.
- package/{chunk-GZANCVTS.js → chunk-D4E6UX6S.js} +1 -8
- package/{chunk-GZANCVTS.js.map → chunk-D4E6UX6S.js.map} +1 -1
- package/{web/chunk-S4HRSKEO.js → chunk-OKACCIGZ.js} +15 -29
- package/chunk-OKACCIGZ.js.map +1 -0
- package/chunk-PZ5AY32C.js +10 -0
- package/gateway-3YJXDXD3.js +59 -0
- package/gateway-3YJXDXD3.js.map +1 -0
- package/{gateway@skip-iife-OZ2V32XH.js → gateway-HUSQCAA7.js} +5 -4
- package/gateway-HUSQCAA7.js.map +1 -0
- package/index.cjs +73 -285
- package/index.cjs.map +1 -1
- package/index.d.cts +1 -3
- package/index.d.ts +1 -3
- package/index.global.js +195 -171
- package/index.global.js.map +1 -1
- package/index.js +17 -17
- package/index.js.map +1 -1
- package/{key-bag-file-4TYN2H7F.js → key-bag-file-QCOF7UFH.js} +4 -3
- package/{key-bag-file-4TYN2H7F.js.map → key-bag-file-QCOF7UFH.js.map} +1 -1
- package/{key-bag-indexdb-JEOAS4WM.js → key-bag-indexdb-VHX3MZ66.js} +4 -3
- package/{key-bag-indexdb-JEOAS4WM.js.map → key-bag-indexdb-VHX3MZ66.js.map} +1 -1
- package/metafile-cjs.json +1 -1
- package/metafile-esm.json +1 -1
- package/metafile-iife.json +1 -1
- package/node/chunk-4A4RAVNS.js +17 -0
- package/node/chunk-4A4RAVNS.js.map +1 -0
- package/node/mem-filesystem.cjs +72 -0
- package/node/mem-filesystem.cjs.map +1 -0
- package/node/mem-filesystem.d.cts +25 -0
- package/node/mem-filesystem.d.ts +25 -0
- package/{mem-filesystem@skip-iife-CJI7IIKV.js → node/mem-filesystem.js} +3 -4
- package/node/mem-filesystem.js.map +1 -0
- package/node/metafile-cjs.json +1 -0
- package/node/metafile-esm.json +1 -0
- package/node/node-filesystem.cjs +86 -0
- package/node/node-filesystem.cjs.map +1 -0
- package/node/node-filesystem.d.cts +36 -0
- package/node/node-filesystem.d.ts +36 -0
- package/{node-filesystem@skip-iife-O74VAABQ.js → node/node-filesystem.js} +3 -4
- package/node/node-filesystem.js.map +1 -0
- package/node/types-DARSfXlb.d.cts +23 -0
- package/node/types-DARSfXlb.d.ts +23 -0
- package/package.json +1 -1
- package/utils-GYG2FMCZ.js +13 -0
- package/web/gateway-impl.cjs +319 -0
- package/web/gateway-impl.cjs.map +1 -0
- package/web/gateway-impl.d.cts +86 -0
- package/web/gateway-impl.d.ts +86 -0
- package/{gateway@skip-esm-O655UEIP.js → web/gateway-impl.js} +165 -20
- package/web/gateway-impl.js.map +1 -0
- package/web/metafile-cjs.json +1 -1
- package/web/metafile-esm.json +1 -1
- package/chunk-LNFBDD6E.js +0 -75
- package/chunk-LNFBDD6E.js.map +0 -1
- package/chunk-PB4BKL4O.js +0 -7
- package/chunk-PB4BKL4O.js.map +0 -1
- package/gateway@skip-esm-O655UEIP.js.map +0 -1
- package/gateway@skip-iife-OZ2V32XH.js.map +0 -1
- package/mem-filesystem@skip-iife-CJI7IIKV.js.map +0 -1
- package/node-filesystem@skip-iife-O74VAABQ.js.map +0 -1
- package/utils-L7MUZUJX.js +0 -14
- package/web/bundle-not-impl-UH74NK5L.js +0 -5
- package/web/bundle-not-impl-UH74NK5L.js.map +0 -1
- package/web/chunk-2DC5ZIR4.js +0 -7
- package/web/chunk-2DC5ZIR4.js.map +0 -1
- package/web/chunk-Q5W7UNMP.js +0 -292
- package/web/chunk-Q5W7UNMP.js.map +0 -1
- package/web/chunk-S4HRSKEO.js.map +0 -1
- package/web/gateway@skip-esm-GI5PRACF.js +0 -165
- package/web/gateway@skip-esm-GI5PRACF.js.map +0 -1
- package/web/index.cjs +0 -4138
- package/web/index.cjs.map +0 -1
- package/web/index.d.cts +0 -1139
- package/web/index.d.ts +0 -1139
- package/web/index.js +0 -3478
- package/web/index.js.map +0 -1
- package/web/key-bag-file-4SJQGORQ.js +0 -54
- package/web/key-bag-file-4SJQGORQ.js.map +0 -1
- package/web/key-bag-indexdb-GSQOUUVQ.js +0 -50
- package/web/key-bag-indexdb-GSQOUUVQ.js.map +0 -1
- package/web/utils-EFZJNXH5.js +0 -14
- /package/{utils-L7MUZUJX.js.map → chunk-PZ5AY32C.js.map} +0 -0
- /package/{web/utils-EFZJNXH5.js.map → utils-GYG2FMCZ.js.map} +0 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
// src/runtime/gateways/file/node/to-array-buffer.ts
|
2
|
+
function toArrayBuffer(buffer) {
|
3
|
+
if (typeof buffer === "string") {
|
4
|
+
buffer = Buffer.from(buffer);
|
5
|
+
}
|
6
|
+
const ab = new ArrayBuffer(buffer.length);
|
7
|
+
const view = new Uint8Array(ab);
|
8
|
+
for (let i = 0; i < buffer.length; ++i) {
|
9
|
+
view[i] = buffer[i];
|
10
|
+
}
|
11
|
+
return view;
|
12
|
+
}
|
13
|
+
|
14
|
+
export {
|
15
|
+
toArrayBuffer
|
16
|
+
};
|
17
|
+
//# sourceMappingURL=chunk-4A4RAVNS.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/runtime/gateways/file/node/to-array-buffer.ts"],"sourcesContent":["export function toArrayBuffer(buffer: Buffer | string): Uint8Array {\n if (typeof buffer === \"string\") {\n buffer = Buffer.from(buffer);\n }\n const ab = new ArrayBuffer(buffer.length);\n const view = new Uint8Array(ab);\n for (let i = 0; i < buffer.length; ++i) {\n view[i] = buffer[i];\n }\n return view;\n}\n"],"mappings":";AAAO,SAAS,cAAc,QAAqC;AACjE,MAAI,OAAO,WAAW,UAAU;AAC9B,aAAS,OAAO,KAAK,MAAM;AAAA,EAC7B;AACA,QAAM,KAAK,IAAI,YAAY,OAAO,MAAM;AACxC,QAAM,OAAO,IAAI,WAAW,EAAE;AAC9B,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,EAAE,GAAG;AACtC,SAAK,CAAC,IAAI,OAAO,CAAC;AAAA,EACpB;AACA,SAAO;AACT;","names":[]}
|
@@ -0,0 +1,72 @@
|
|
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/runtime/gateways/file/node/mem-filesystem.ts
|
21
|
+
var mem_filesystem_exports = {};
|
22
|
+
__export(mem_filesystem_exports, {
|
23
|
+
MemFileSystem: () => MemFileSystem
|
24
|
+
});
|
25
|
+
module.exports = __toCommonJS(mem_filesystem_exports);
|
26
|
+
var import_memfs = require("memfs");
|
27
|
+
|
28
|
+
// src/runtime/gateways/file/node/to-array-buffer.ts
|
29
|
+
function toArrayBuffer(buffer) {
|
30
|
+
if (typeof buffer === "string") {
|
31
|
+
buffer = Buffer.from(buffer);
|
32
|
+
}
|
33
|
+
const ab = new ArrayBuffer(buffer.length);
|
34
|
+
const view = new Uint8Array(ab);
|
35
|
+
for (let i = 0; i < buffer.length; ++i) {
|
36
|
+
view[i] = buffer[i];
|
37
|
+
}
|
38
|
+
return view;
|
39
|
+
}
|
40
|
+
|
41
|
+
// src/runtime/gateways/file/node/mem-filesystem.ts
|
42
|
+
var MemFileSystem = class {
|
43
|
+
async start() {
|
44
|
+
return this;
|
45
|
+
}
|
46
|
+
mkdir(path, options) {
|
47
|
+
return import_memfs.fs.promises.mkdir(path, options);
|
48
|
+
}
|
49
|
+
readdir(path, options) {
|
50
|
+
return import_memfs.fs.promises.readdir(path, options);
|
51
|
+
}
|
52
|
+
rm(path, options) {
|
53
|
+
return import_memfs.fs.promises.rm(path, options);
|
54
|
+
}
|
55
|
+
copyFile(source, destination) {
|
56
|
+
return import_memfs.fs.promises.copyFile(source, destination);
|
57
|
+
}
|
58
|
+
async readfile(path, options) {
|
59
|
+
const ret = await import_memfs.fs.promises.readFile(path, options);
|
60
|
+
return toArrayBuffer(ret);
|
61
|
+
}
|
62
|
+
stat(path) {
|
63
|
+
return import_memfs.fs.promises.stat(path);
|
64
|
+
}
|
65
|
+
unlink(path) {
|
66
|
+
return import_memfs.fs.promises.unlink(path);
|
67
|
+
}
|
68
|
+
writefile(path, data) {
|
69
|
+
return import_memfs.fs.promises.writeFile(path, Buffer.from(data));
|
70
|
+
}
|
71
|
+
};
|
72
|
+
//# sourceMappingURL=mem-filesystem.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/runtime/gateways/file/node/mem-filesystem.ts","../../../src/runtime/gateways/file/node/to-array-buffer.ts"],"sourcesContent":["import type { PathLike, MakeDirectoryOptions, Stats } from \"fs\";\nimport { fs } from \"memfs\";\nimport { IReaddirOptions } from \"memfs/lib/node/types/options.js\";\nimport { toArrayBuffer } from \"./to-array-buffer.js\";\nimport type { SysFileSystem } from \"../../../../types.js\";\n\nexport class MemFileSystem implements SysFileSystem {\n async start(): Promise<SysFileSystem> {\n return this;\n }\n mkdir(path: PathLike, options?: { recursive: boolean }): Promise<string | undefined> {\n return fs.promises.mkdir(path, options);\n }\n readdir(path: PathLike, options?: IReaddirOptions): Promise<string[]> {\n return fs.promises.readdir(path, options) as Promise<string[]>;\n }\n rm(path: PathLike, options?: MakeDirectoryOptions & { recursive: boolean }): Promise<void> {\n return fs.promises.rm(path, options);\n }\n copyFile(source: PathLike, destination: PathLike): Promise<void> {\n return fs.promises.copyFile(source, destination);\n }\n async readfile(path: PathLike, options?: { encoding: BufferEncoding; flag?: string }): Promise<Uint8Array> {\n const ret = await fs.promises.readFile(path, options);\n return toArrayBuffer(ret);\n }\n stat(path: PathLike): Promise<Stats> {\n return fs.promises.stat(path) as Promise<Stats>;\n }\n unlink(path: PathLike): Promise<void> {\n return fs.promises.unlink(path);\n }\n writefile(path: PathLike, data: Uint8Array | string): Promise<void> {\n return fs.promises.writeFile(path, Buffer.from(data));\n }\n}\n","export function toArrayBuffer(buffer: Buffer | string): Uint8Array {\n if (typeof buffer === \"string\") {\n buffer = Buffer.from(buffer);\n }\n const ab = new ArrayBuffer(buffer.length);\n const view = new Uint8Array(ab);\n for (let i = 0; i < buffer.length; ++i) {\n view[i] = buffer[i];\n }\n return view;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAmB;;;ACDZ,SAAS,cAAc,QAAqC;AACjE,MAAI,OAAO,WAAW,UAAU;AAC9B,aAAS,OAAO,KAAK,MAAM;AAAA,EAC7B;AACA,QAAM,KAAK,IAAI,YAAY,OAAO,MAAM;AACxC,QAAM,OAAO,IAAI,WAAW,EAAE;AAC9B,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,EAAE,GAAG;AACtC,SAAK,CAAC,IAAI,OAAO,CAAC;AAAA,EACpB;AACA,SAAO;AACT;;;ADJO,IAAM,gBAAN,MAA6C;AAAA,EAClD,MAAM,QAAgC;AACpC,WAAO;AAAA,EACT;AAAA,EACA,MAAM,MAAgB,SAA+D;AACnF,WAAO,gBAAG,SAAS,MAAM,MAAM,OAAO;AAAA,EACxC;AAAA,EACA,QAAQ,MAAgB,SAA8C;AACpE,WAAO,gBAAG,SAAS,QAAQ,MAAM,OAAO;AAAA,EAC1C;AAAA,EACA,GAAG,MAAgB,SAAwE;AACzF,WAAO,gBAAG,SAAS,GAAG,MAAM,OAAO;AAAA,EACrC;AAAA,EACA,SAAS,QAAkB,aAAsC;AAC/D,WAAO,gBAAG,SAAS,SAAS,QAAQ,WAAW;AAAA,EACjD;AAAA,EACA,MAAM,SAAS,MAAgB,SAA4E;AACzG,UAAM,MAAM,MAAM,gBAAG,SAAS,SAAS,MAAM,OAAO;AACpD,WAAO,cAAc,GAAG;AAAA,EAC1B;AAAA,EACA,KAAK,MAAgC;AACnC,WAAO,gBAAG,SAAS,KAAK,IAAI;AAAA,EAC9B;AAAA,EACA,OAAO,MAA+B;AACpC,WAAO,gBAAG,SAAS,OAAO,IAAI;AAAA,EAChC;AAAA,EACA,UAAU,MAAgB,MAA0C;AAClE,WAAO,gBAAG,SAAS,UAAU,MAAM,OAAO,KAAK,IAAI,CAAC;AAAA,EACtD;AACF;","names":[]}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { PathLike, MakeDirectoryOptions, Stats } from 'fs';
|
2
|
+
import { IReaddirOptions } from 'memfs/lib/node/types/options.js';
|
3
|
+
import { S as SysFileSystem } from './types-DARSfXlb.cjs';
|
4
|
+
|
5
|
+
declare class MemFileSystem implements SysFileSystem {
|
6
|
+
start(): Promise<SysFileSystem>;
|
7
|
+
mkdir(path: PathLike, options?: {
|
8
|
+
recursive: boolean;
|
9
|
+
}): Promise<string | undefined>;
|
10
|
+
readdir(path: PathLike, options?: IReaddirOptions): Promise<string[]>;
|
11
|
+
rm(path: PathLike, options?: MakeDirectoryOptions & {
|
12
|
+
recursive: boolean;
|
13
|
+
}): Promise<void>;
|
14
|
+
copyFile(source: PathLike, destination: PathLike): Promise<void>;
|
15
|
+
readfile(path: PathLike, options?: {
|
16
|
+
encoding: BufferEncoding;
|
17
|
+
flag?: string;
|
18
|
+
}): Promise<Uint8Array>;
|
19
|
+
stat(path: PathLike): Promise<Stats>;
|
20
|
+
unlink(path: PathLike): Promise<void>;
|
21
|
+
writefile(path: PathLike, data: Uint8Array | string): Promise<void>;
|
22
|
+
}
|
23
|
+
|
24
|
+
export { MemFileSystem };
|
25
|
+
declare module '@fireproof/core/node'
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { PathLike, MakeDirectoryOptions, Stats } from 'fs';
|
2
|
+
import { IReaddirOptions } from 'memfs/lib/node/types/options.js';
|
3
|
+
import { S as SysFileSystem } from './types-DARSfXlb.js';
|
4
|
+
|
5
|
+
declare class MemFileSystem implements SysFileSystem {
|
6
|
+
start(): Promise<SysFileSystem>;
|
7
|
+
mkdir(path: PathLike, options?: {
|
8
|
+
recursive: boolean;
|
9
|
+
}): Promise<string | undefined>;
|
10
|
+
readdir(path: PathLike, options?: IReaddirOptions): Promise<string[]>;
|
11
|
+
rm(path: PathLike, options?: MakeDirectoryOptions & {
|
12
|
+
recursive: boolean;
|
13
|
+
}): Promise<void>;
|
14
|
+
copyFile(source: PathLike, destination: PathLike): Promise<void>;
|
15
|
+
readfile(path: PathLike, options?: {
|
16
|
+
encoding: BufferEncoding;
|
17
|
+
flag?: string;
|
18
|
+
}): Promise<Uint8Array>;
|
19
|
+
stat(path: PathLike): Promise<Stats>;
|
20
|
+
unlink(path: PathLike): Promise<void>;
|
21
|
+
writefile(path: PathLike, data: Uint8Array | string): Promise<void>;
|
22
|
+
}
|
23
|
+
|
24
|
+
export { MemFileSystem };
|
25
|
+
declare module '@fireproof/core/node'
|
@@ -1,9 +1,8 @@
|
|
1
1
|
import {
|
2
2
|
toArrayBuffer
|
3
|
-
} from "./chunk-
|
4
|
-
import "./chunk-GZANCVTS.js";
|
3
|
+
} from "./chunk-4A4RAVNS.js";
|
5
4
|
|
6
|
-
// src/runtime/gateways/file/mem-filesystem
|
5
|
+
// src/runtime/gateways/file/node/mem-filesystem.ts
|
7
6
|
import { fs } from "memfs";
|
8
7
|
var MemFileSystem = class {
|
9
8
|
async start() {
|
@@ -38,4 +37,4 @@ var MemFileSystem = class {
|
|
38
37
|
export {
|
39
38
|
MemFileSystem
|
40
39
|
};
|
41
|
-
//# sourceMappingURL=mem-filesystem
|
40
|
+
//# sourceMappingURL=mem-filesystem.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/runtime/gateways/file/node/mem-filesystem.ts"],"sourcesContent":["import type { PathLike, MakeDirectoryOptions, Stats } from \"fs\";\nimport { fs } from \"memfs\";\nimport { IReaddirOptions } from \"memfs/lib/node/types/options.js\";\nimport { toArrayBuffer } from \"./to-array-buffer.js\";\nimport type { SysFileSystem } from \"../../../../types.js\";\n\nexport class MemFileSystem implements SysFileSystem {\n async start(): Promise<SysFileSystem> {\n return this;\n }\n mkdir(path: PathLike, options?: { recursive: boolean }): Promise<string | undefined> {\n return fs.promises.mkdir(path, options);\n }\n readdir(path: PathLike, options?: IReaddirOptions): Promise<string[]> {\n return fs.promises.readdir(path, options) as Promise<string[]>;\n }\n rm(path: PathLike, options?: MakeDirectoryOptions & { recursive: boolean }): Promise<void> {\n return fs.promises.rm(path, options);\n }\n copyFile(source: PathLike, destination: PathLike): Promise<void> {\n return fs.promises.copyFile(source, destination);\n }\n async readfile(path: PathLike, options?: { encoding: BufferEncoding; flag?: string }): Promise<Uint8Array> {\n const ret = await fs.promises.readFile(path, options);\n return toArrayBuffer(ret);\n }\n stat(path: PathLike): Promise<Stats> {\n return fs.promises.stat(path) as Promise<Stats>;\n }\n unlink(path: PathLike): Promise<void> {\n return fs.promises.unlink(path);\n }\n writefile(path: PathLike, data: Uint8Array | string): Promise<void> {\n return fs.promises.writeFile(path, Buffer.from(data));\n }\n}\n"],"mappings":";;;;;AACA,SAAS,UAAU;AAKZ,IAAM,gBAAN,MAA6C;AAAA,EAClD,MAAM,QAAgC;AACpC,WAAO;AAAA,EACT;AAAA,EACA,MAAM,MAAgB,SAA+D;AACnF,WAAO,GAAG,SAAS,MAAM,MAAM,OAAO;AAAA,EACxC;AAAA,EACA,QAAQ,MAAgB,SAA8C;AACpE,WAAO,GAAG,SAAS,QAAQ,MAAM,OAAO;AAAA,EAC1C;AAAA,EACA,GAAG,MAAgB,SAAwE;AACzF,WAAO,GAAG,SAAS,GAAG,MAAM,OAAO;AAAA,EACrC;AAAA,EACA,SAAS,QAAkB,aAAsC;AAC/D,WAAO,GAAG,SAAS,SAAS,QAAQ,WAAW;AAAA,EACjD;AAAA,EACA,MAAM,SAAS,MAAgB,SAA4E;AACzG,UAAM,MAAM,MAAM,GAAG,SAAS,SAAS,MAAM,OAAO;AACpD,WAAO,cAAc,GAAG;AAAA,EAC1B;AAAA,EACA,KAAK,MAAgC;AACnC,WAAO,GAAG,SAAS,KAAK,IAAI;AAAA,EAC9B;AAAA,EACA,OAAO,MAA+B;AACpC,WAAO,GAAG,SAAS,OAAO,IAAI;AAAA,EAChC;AAAA,EACA,UAAU,MAAgB,MAA0C;AAClE,WAAO,GAAG,SAAS,UAAU,MAAM,OAAO,KAAK,IAAI,CAAC;AAAA,EACtD;AACF;","names":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"inputs":{"src/runtime/gateways/file/node/to-array-buffer.ts":{"bytes":313,"imports":[],"format":"esm"},"src/runtime/gateways/file/node/mem-filesystem.ts":{"bytes":1466,"imports":[{"path":"memfs","kind":"import-statement","external":true},{"path":"memfs/lib/node/types/options.js","kind":"import-statement","external":true},{"path":"src/runtime/gateways/file/node/to-array-buffer.ts","kind":"import-statement","original":"./to-array-buffer.js"}],"format":"esm"},"src/runtime/gateways/file/node/node-filesystem.ts":{"bytes":3143,"imports":[{"path":"src/runtime/gateways/file/node/to-array-buffer.ts","kind":"import-statement","original":"./to-array-buffer.js"},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"fs/promises","kind":"dynamic-import","external":true}],"format":"esm"}},"outputs":{"dist/fireproof-core/node/mem-filesystem.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3071},"dist/fireproof-core/node/mem-filesystem.cjs":{"imports":[{"path":"memfs","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/runtime/gateways/file/node/mem-filesystem.ts","inputs":{"src/runtime/gateways/file/node/mem-filesystem.ts":{"bytesInOutput":1016},"src/runtime/gateways/file/node/to-array-buffer.ts":{"bytesInOutput":277}},"bytes":2252},"dist/fireproof-core/node/node-filesystem.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4979},"dist/fireproof-core/node/node-filesystem.cjs":{"imports":[{"path":"@adviser/cement","kind":"require-call","external":true},{"path":"fs/promises","kind":"dynamic-import","external":true}],"exports":[],"entryPoint":"src/runtime/gateways/file/node/node-filesystem.ts","inputs":{"src/runtime/gateways/file/node/node-filesystem.ts":{"bytesInOutput":1084},"src/runtime/gateways/file/node/to-array-buffer.ts":{"bytesInOutput":277}},"bytes":2919}}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"inputs":{"src/runtime/gateways/file/node/to-array-buffer.ts":{"bytes":313,"imports":[],"format":"esm"},"src/runtime/gateways/file/node/mem-filesystem.ts":{"bytes":1466,"imports":[{"path":"memfs","kind":"import-statement","external":true},{"path":"memfs/lib/node/types/options.js","kind":"import-statement","external":true},{"path":"src/runtime/gateways/file/node/to-array-buffer.ts","kind":"import-statement","original":"./to-array-buffer.js"}],"format":"esm"},"src/runtime/gateways/file/node/node-filesystem.ts":{"bytes":3143,"imports":[{"path":"src/runtime/gateways/file/node/to-array-buffer.ts","kind":"import-statement","original":"./to-array-buffer.js"},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"dynamic-import","external":true}],"format":"esm"}},"outputs":{"dist/fireproof-core/node/mem-filesystem.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":2377},"dist/fireproof-core/node/mem-filesystem.js":{"imports":[{"path":"dist/fireproof-core/node/chunk-4A4RAVNS.js","kind":"import-statement"},{"path":"memfs","kind":"import-statement","external":true}],"exports":["MemFileSystem"],"entryPoint":"src/runtime/gateways/file/node/mem-filesystem.ts","inputs":{"src/runtime/gateways/file/node/mem-filesystem.ts":{"bytesInOutput":739}},"bytes":875},"dist/fireproof-core/node/node-filesystem.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":4285},"dist/fireproof-core/node/node-filesystem.js":{"imports":[{"path":"dist/fireproof-core/node/chunk-4A4RAVNS.js","kind":"import-statement"},{"path":"@adviser/cement","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"dynamic-import","external":true}],"exports":["NodeFileSystem"],"entryPoint":"src/runtime/gateways/file/node/node-filesystem.ts","inputs":{"src/runtime/gateways/file/node/node-filesystem.ts":{"bytesInOutput":898}},"bytes":1036},"dist/fireproof-core/node/chunk-4A4RAVNS.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":735},"dist/fireproof-core/node/chunk-4A4RAVNS.js":{"imports":[],"exports":["toArrayBuffer"],"inputs":{"src/runtime/gateways/file/node/to-array-buffer.ts":{"bytesInOutput":277}},"bytes":359}}}
|
@@ -0,0 +1,86 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __create = Object.create;
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
+
var __export = (target, all) => {
|
9
|
+
for (var name in all)
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
+
};
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
+
for (let key of __getOwnPropNames(from))
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
+
}
|
18
|
+
return to;
|
19
|
+
};
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
+
mod
|
27
|
+
));
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
+
|
30
|
+
// src/runtime/gateways/file/node/node-filesystem.ts
|
31
|
+
var node_filesystem_exports = {};
|
32
|
+
__export(node_filesystem_exports, {
|
33
|
+
NodeFileSystem: () => NodeFileSystem
|
34
|
+
});
|
35
|
+
module.exports = __toCommonJS(node_filesystem_exports);
|
36
|
+
|
37
|
+
// src/runtime/gateways/file/node/to-array-buffer.ts
|
38
|
+
function toArrayBuffer(buffer) {
|
39
|
+
if (typeof buffer === "string") {
|
40
|
+
buffer = Buffer.from(buffer);
|
41
|
+
}
|
42
|
+
const ab = new ArrayBuffer(buffer.length);
|
43
|
+
const view = new Uint8Array(ab);
|
44
|
+
for (let i = 0; i < buffer.length; ++i) {
|
45
|
+
view[i] = buffer[i];
|
46
|
+
}
|
47
|
+
return view;
|
48
|
+
}
|
49
|
+
|
50
|
+
// src/runtime/gateways/file/node/node-filesystem.ts
|
51
|
+
var import_cement = require("@adviser/cement");
|
52
|
+
var NodeFileSystem = class {
|
53
|
+
async start() {
|
54
|
+
this.fs = await import("fs/promises");
|
55
|
+
return this;
|
56
|
+
}
|
57
|
+
async mkdir(path, options) {
|
58
|
+
return this.fs?.mkdir(path, options);
|
59
|
+
}
|
60
|
+
async readdir(path, options) {
|
61
|
+
return this.fs?.readdir(path, options);
|
62
|
+
}
|
63
|
+
async rm(path, options) {
|
64
|
+
return this.fs?.rm(path, options);
|
65
|
+
}
|
66
|
+
async copyFile(source, destination) {
|
67
|
+
return this.fs?.copyFile(source, destination);
|
68
|
+
}
|
69
|
+
async readfile(path, options) {
|
70
|
+
const ret = await this.fs?.readFile(path, options);
|
71
|
+
return toArrayBuffer(ret);
|
72
|
+
}
|
73
|
+
stat(path) {
|
74
|
+
return this.fs?.stat(path);
|
75
|
+
}
|
76
|
+
async unlink(path) {
|
77
|
+
return this.fs?.unlink(path);
|
78
|
+
}
|
79
|
+
async writefile(path, data) {
|
80
|
+
if ((0, import_cement.runtimeFn)().isDeno) {
|
81
|
+
return this.fs?.writeFile(path, data);
|
82
|
+
}
|
83
|
+
return this.fs?.writeFile(path, Buffer.from(data));
|
84
|
+
}
|
85
|
+
};
|
86
|
+
//# sourceMappingURL=node-filesystem.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/runtime/gateways/file/node/node-filesystem.ts","../../../src/runtime/gateways/file/node/to-array-buffer.ts"],"sourcesContent":["import type { PathLike, MakeDirectoryOptions, Stats, ObjectEncodingOptions } from \"node:fs\";\nimport type { mkdir, readdir, rm, copyFile, readFile, stat, unlink, writeFile } from \"node:fs/promises\";\nimport { toArrayBuffer } from \"./to-array-buffer.js\";\nimport type { SysFileSystem } from \"../../../../types.js\";\nimport { runtimeFn } from \"@adviser/cement\";\n\nexport class NodeFileSystem implements SysFileSystem {\n fs?: {\n mkdir: typeof mkdir;\n readdir: typeof readdir;\n rm: typeof rm;\n copyFile: typeof copyFile;\n readFile: typeof readFile;\n stat: typeof stat;\n unlink: typeof unlink;\n writeFile: typeof writeFile;\n };\n\n async start(): Promise<SysFileSystem> {\n this.fs = await import(\"node:fs/promises\");\n return this;\n }\n async mkdir(path: PathLike, options?: { recursive: boolean }): Promise<string | undefined> {\n return this.fs?.mkdir(path, options);\n }\n async readdir(path: PathLike, options?: ObjectEncodingOptions): Promise<string[]> {\n return this.fs?.readdir(path, options) as Promise<string[]>;\n }\n async rm(path: PathLike, options?: MakeDirectoryOptions & { recursive: boolean }): Promise<void> {\n return this.fs?.rm(path, options);\n }\n async copyFile(source: PathLike, destination: PathLike): Promise<void> {\n return this.fs?.copyFile(source, destination);\n }\n async readfile(path: PathLike, options?: { encoding: BufferEncoding; flag?: string }): Promise<Uint8Array> {\n const ret = (await this.fs?.readFile(path, options)) as Buffer;\n return toArrayBuffer(ret);\n }\n stat(path: PathLike): Promise<Stats> {\n return this.fs?.stat(path) as Promise<Stats>;\n }\n async unlink(path: PathLike): Promise<void> {\n return this.fs?.unlink(path);\n }\n async writefile(path: PathLike, data: Uint8Array | string): Promise<void> {\n if (runtimeFn().isDeno) {\n return this.fs?.writeFile(path, data);\n }\n return this.fs?.writeFile(path, Buffer.from(data));\n }\n}\n\n// import { type NodeMap, join } from \"../../sys-container.js\";\n// import type { ObjectEncodingOptions, PathLike } from \"fs\";\n// import * as fs from \"fs/promises\";\n// import * as path from \"path\";\n// import * as os from \"os\";\n// import * as url from \"url\";\n// import { toArrayBuffer } from \"./utils.js\";\n\n// export async function createNodeSysContainer(): Promise<NodeMap> {\n// // const nodePath = \"node:path\";\n// // const nodeOS = \"node:os\";\n// // const nodeURL = \"node:url\";\n// // const nodeFS = \"node:fs\";\n// // const fs = (await import(\"node:fs\")).promises;\n// // const assert = \"assert\";\n// // const path = await import(\"node:path\");\n// return {\n// state: \"node\",\n// ...path,\n// // ...(await import(\"node:os\")),\n// // ...(await import(\"node:url\")),\n// ...os,\n// ...url,\n// ...fs,\n// join,\n// stat: fs.stat as NodeMap[\"stat\"],\n// readdir: fs.readdir as NodeMap[\"readdir\"],\n// readfile: async (path: PathLike, options?: ObjectEncodingOptions): Promise<Uint8Array> => {\n// const rs = await fs.readFile(path, options);\n// return toArrayBuffer(rs);\n// },\n// writefile: fs.writeFile as NodeMap[\"writefile\"],\n// };\n// }\n","export function toArrayBuffer(buffer: Buffer | string): Uint8Array {\n if (typeof buffer === \"string\") {\n buffer = Buffer.from(buffer);\n }\n const ab = new ArrayBuffer(buffer.length);\n const view = new Uint8Array(ab);\n for (let i = 0; i < buffer.length; ++i) {\n view[i] = buffer[i];\n }\n return view;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,SAAS,cAAc,QAAqC;AACjE,MAAI,OAAO,WAAW,UAAU;AAC9B,aAAS,OAAO,KAAK,MAAM;AAAA,EAC7B;AACA,QAAM,KAAK,IAAI,YAAY,OAAO,MAAM;AACxC,QAAM,OAAO,IAAI,WAAW,EAAE;AAC9B,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,EAAE,GAAG;AACtC,SAAK,CAAC,IAAI,OAAO,CAAC;AAAA,EACpB;AACA,SAAO;AACT;;;ADNA,oBAA0B;AAEnB,IAAM,iBAAN,MAA8C;AAAA,EAYnD,MAAM,QAAgC;AACpC,SAAK,KAAK,MAAM,OAAO,aAAkB;AACzC,WAAO;AAAA,EACT;AAAA,EACA,MAAM,MAAM,MAAgB,SAA+D;AACzF,WAAO,KAAK,IAAI,MAAM,MAAM,OAAO;AAAA,EACrC;AAAA,EACA,MAAM,QAAQ,MAAgB,SAAoD;AAChF,WAAO,KAAK,IAAI,QAAQ,MAAM,OAAO;AAAA,EACvC;AAAA,EACA,MAAM,GAAG,MAAgB,SAAwE;AAC/F,WAAO,KAAK,IAAI,GAAG,MAAM,OAAO;AAAA,EAClC;AAAA,EACA,MAAM,SAAS,QAAkB,aAAsC;AACrE,WAAO,KAAK,IAAI,SAAS,QAAQ,WAAW;AAAA,EAC9C;AAAA,EACA,MAAM,SAAS,MAAgB,SAA4E;AACzG,UAAM,MAAO,MAAM,KAAK,IAAI,SAAS,MAAM,OAAO;AAClD,WAAO,cAAc,GAAG;AAAA,EAC1B;AAAA,EACA,KAAK,MAAgC;AACnC,WAAO,KAAK,IAAI,KAAK,IAAI;AAAA,EAC3B;AAAA,EACA,MAAM,OAAO,MAA+B;AAC1C,WAAO,KAAK,IAAI,OAAO,IAAI;AAAA,EAC7B;AAAA,EACA,MAAM,UAAU,MAAgB,MAA0C;AACxE,YAAI,yBAAU,EAAE,QAAQ;AACtB,aAAO,KAAK,IAAI,UAAU,MAAM,IAAI;AAAA,IACtC;AACA,WAAO,KAAK,IAAI,UAAU,MAAM,OAAO,KAAK,IAAI,CAAC;AAAA,EACnD;AACF;","names":[]}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { PathLike, ObjectEncodingOptions, MakeDirectoryOptions, Stats } from 'node:fs';
|
2
|
+
import { mkdir, readdir, rm, copyFile, readFile, stat, unlink, writeFile } from 'node:fs/promises';
|
3
|
+
import { S as SysFileSystem } from './types-DARSfXlb.cjs';
|
4
|
+
import 'fs';
|
5
|
+
|
6
|
+
declare class NodeFileSystem implements SysFileSystem {
|
7
|
+
fs?: {
|
8
|
+
mkdir: typeof mkdir;
|
9
|
+
readdir: typeof readdir;
|
10
|
+
rm: typeof rm;
|
11
|
+
copyFile: typeof copyFile;
|
12
|
+
readFile: typeof readFile;
|
13
|
+
stat: typeof stat;
|
14
|
+
unlink: typeof unlink;
|
15
|
+
writeFile: typeof writeFile;
|
16
|
+
};
|
17
|
+
start(): Promise<SysFileSystem>;
|
18
|
+
mkdir(path: PathLike, options?: {
|
19
|
+
recursive: boolean;
|
20
|
+
}): Promise<string | undefined>;
|
21
|
+
readdir(path: PathLike, options?: ObjectEncodingOptions): Promise<string[]>;
|
22
|
+
rm(path: PathLike, options?: MakeDirectoryOptions & {
|
23
|
+
recursive: boolean;
|
24
|
+
}): Promise<void>;
|
25
|
+
copyFile(source: PathLike, destination: PathLike): Promise<void>;
|
26
|
+
readfile(path: PathLike, options?: {
|
27
|
+
encoding: BufferEncoding;
|
28
|
+
flag?: string;
|
29
|
+
}): Promise<Uint8Array>;
|
30
|
+
stat(path: PathLike): Promise<Stats>;
|
31
|
+
unlink(path: PathLike): Promise<void>;
|
32
|
+
writefile(path: PathLike, data: Uint8Array | string): Promise<void>;
|
33
|
+
}
|
34
|
+
|
35
|
+
export { NodeFileSystem };
|
36
|
+
declare module '@fireproof/core/node'
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { PathLike, ObjectEncodingOptions, MakeDirectoryOptions, Stats } from 'node:fs';
|
2
|
+
import { mkdir, readdir, rm, copyFile, readFile, stat, unlink, writeFile } from 'node:fs/promises';
|
3
|
+
import { S as SysFileSystem } from './types-DARSfXlb.js';
|
4
|
+
import 'fs';
|
5
|
+
|
6
|
+
declare class NodeFileSystem implements SysFileSystem {
|
7
|
+
fs?: {
|
8
|
+
mkdir: typeof mkdir;
|
9
|
+
readdir: typeof readdir;
|
10
|
+
rm: typeof rm;
|
11
|
+
copyFile: typeof copyFile;
|
12
|
+
readFile: typeof readFile;
|
13
|
+
stat: typeof stat;
|
14
|
+
unlink: typeof unlink;
|
15
|
+
writeFile: typeof writeFile;
|
16
|
+
};
|
17
|
+
start(): Promise<SysFileSystem>;
|
18
|
+
mkdir(path: PathLike, options?: {
|
19
|
+
recursive: boolean;
|
20
|
+
}): Promise<string | undefined>;
|
21
|
+
readdir(path: PathLike, options?: ObjectEncodingOptions): Promise<string[]>;
|
22
|
+
rm(path: PathLike, options?: MakeDirectoryOptions & {
|
23
|
+
recursive: boolean;
|
24
|
+
}): Promise<void>;
|
25
|
+
copyFile(source: PathLike, destination: PathLike): Promise<void>;
|
26
|
+
readfile(path: PathLike, options?: {
|
27
|
+
encoding: BufferEncoding;
|
28
|
+
flag?: string;
|
29
|
+
}): Promise<Uint8Array>;
|
30
|
+
stat(path: PathLike): Promise<Stats>;
|
31
|
+
unlink(path: PathLike): Promise<void>;
|
32
|
+
writefile(path: PathLike, data: Uint8Array | string): Promise<void>;
|
33
|
+
}
|
34
|
+
|
35
|
+
export { NodeFileSystem };
|
36
|
+
declare module '@fireproof/core/node'
|
@@ -1,9 +1,8 @@
|
|
1
1
|
import {
|
2
2
|
toArrayBuffer
|
3
|
-
} from "./chunk-
|
4
|
-
import "./chunk-GZANCVTS.js";
|
3
|
+
} from "./chunk-4A4RAVNS.js";
|
5
4
|
|
6
|
-
// src/runtime/gateways/file/node-filesystem
|
5
|
+
// src/runtime/gateways/file/node/node-filesystem.ts
|
7
6
|
import { runtimeFn } from "@adviser/cement";
|
8
7
|
var NodeFileSystem = class {
|
9
8
|
async start() {
|
@@ -42,4 +41,4 @@ var NodeFileSystem = class {
|
|
42
41
|
export {
|
43
42
|
NodeFileSystem
|
44
43
|
};
|
45
|
-
//# sourceMappingURL=node-filesystem
|
44
|
+
//# sourceMappingURL=node-filesystem.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/runtime/gateways/file/node/node-filesystem.ts"],"sourcesContent":["import type { PathLike, MakeDirectoryOptions, Stats, ObjectEncodingOptions } from \"node:fs\";\nimport type { mkdir, readdir, rm, copyFile, readFile, stat, unlink, writeFile } from \"node:fs/promises\";\nimport { toArrayBuffer } from \"./to-array-buffer.js\";\nimport type { SysFileSystem } from \"../../../../types.js\";\nimport { runtimeFn } from \"@adviser/cement\";\n\nexport class NodeFileSystem implements SysFileSystem {\n fs?: {\n mkdir: typeof mkdir;\n readdir: typeof readdir;\n rm: typeof rm;\n copyFile: typeof copyFile;\n readFile: typeof readFile;\n stat: typeof stat;\n unlink: typeof unlink;\n writeFile: typeof writeFile;\n };\n\n async start(): Promise<SysFileSystem> {\n this.fs = await import(\"node:fs/promises\");\n return this;\n }\n async mkdir(path: PathLike, options?: { recursive: boolean }): Promise<string | undefined> {\n return this.fs?.mkdir(path, options);\n }\n async readdir(path: PathLike, options?: ObjectEncodingOptions): Promise<string[]> {\n return this.fs?.readdir(path, options) as Promise<string[]>;\n }\n async rm(path: PathLike, options?: MakeDirectoryOptions & { recursive: boolean }): Promise<void> {\n return this.fs?.rm(path, options);\n }\n async copyFile(source: PathLike, destination: PathLike): Promise<void> {\n return this.fs?.copyFile(source, destination);\n }\n async readfile(path: PathLike, options?: { encoding: BufferEncoding; flag?: string }): Promise<Uint8Array> {\n const ret = (await this.fs?.readFile(path, options)) as Buffer;\n return toArrayBuffer(ret);\n }\n stat(path: PathLike): Promise<Stats> {\n return this.fs?.stat(path) as Promise<Stats>;\n }\n async unlink(path: PathLike): Promise<void> {\n return this.fs?.unlink(path);\n }\n async writefile(path: PathLike, data: Uint8Array | string): Promise<void> {\n if (runtimeFn().isDeno) {\n return this.fs?.writeFile(path, data);\n }\n return this.fs?.writeFile(path, Buffer.from(data));\n }\n}\n\n// import { type NodeMap, join } from \"../../sys-container.js\";\n// import type { ObjectEncodingOptions, PathLike } from \"fs\";\n// import * as fs from \"fs/promises\";\n// import * as path from \"path\";\n// import * as os from \"os\";\n// import * as url from \"url\";\n// import { toArrayBuffer } from \"./utils.js\";\n\n// export async function createNodeSysContainer(): Promise<NodeMap> {\n// // const nodePath = \"node:path\";\n// // const nodeOS = \"node:os\";\n// // const nodeURL = \"node:url\";\n// // const nodeFS = \"node:fs\";\n// // const fs = (await import(\"node:fs\")).promises;\n// // const assert = \"assert\";\n// // const path = await import(\"node:path\");\n// return {\n// state: \"node\",\n// ...path,\n// // ...(await import(\"node:os\")),\n// // ...(await import(\"node:url\")),\n// ...os,\n// ...url,\n// ...fs,\n// join,\n// stat: fs.stat as NodeMap[\"stat\"],\n// readdir: fs.readdir as NodeMap[\"readdir\"],\n// readfile: async (path: PathLike, options?: ObjectEncodingOptions): Promise<Uint8Array> => {\n// const rs = await fs.readFile(path, options);\n// return toArrayBuffer(rs);\n// },\n// writefile: fs.writeFile as NodeMap[\"writefile\"],\n// };\n// }\n"],"mappings":";;;;;AAIA,SAAS,iBAAiB;AAEnB,IAAM,iBAAN,MAA8C;AAAA,EAYnD,MAAM,QAAgC;AACpC,SAAK,KAAK,MAAM,OAAO,kBAAkB;AACzC,WAAO;AAAA,EACT;AAAA,EACA,MAAM,MAAM,MAAgB,SAA+D;AACzF,WAAO,KAAK,IAAI,MAAM,MAAM,OAAO;AAAA,EACrC;AAAA,EACA,MAAM,QAAQ,MAAgB,SAAoD;AAChF,WAAO,KAAK,IAAI,QAAQ,MAAM,OAAO;AAAA,EACvC;AAAA,EACA,MAAM,GAAG,MAAgB,SAAwE;AAC/F,WAAO,KAAK,IAAI,GAAG,MAAM,OAAO;AAAA,EAClC;AAAA,EACA,MAAM,SAAS,QAAkB,aAAsC;AACrE,WAAO,KAAK,IAAI,SAAS,QAAQ,WAAW;AAAA,EAC9C;AAAA,EACA,MAAM,SAAS,MAAgB,SAA4E;AACzG,UAAM,MAAO,MAAM,KAAK,IAAI,SAAS,MAAM,OAAO;AAClD,WAAO,cAAc,GAAG;AAAA,EAC1B;AAAA,EACA,KAAK,MAAgC;AACnC,WAAO,KAAK,IAAI,KAAK,IAAI;AAAA,EAC3B;AAAA,EACA,MAAM,OAAO,MAA+B;AAC1C,WAAO,KAAK,IAAI,OAAO,IAAI;AAAA,EAC7B;AAAA,EACA,MAAM,UAAU,MAAgB,MAA0C;AACxE,QAAI,UAAU,EAAE,QAAQ;AACtB,aAAO,KAAK,IAAI,UAAU,MAAM,IAAI;AAAA,IACtC;AACA,WAAO,KAAK,IAAI,UAAU,MAAM,OAAO,KAAK,IAAI,CAAC;AAAA,EACnD;AACF;","names":[]}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { PathLike, MakeDirectoryOptions, Stats } from 'fs';
|
2
|
+
|
3
|
+
interface SysFileSystem {
|
4
|
+
start(): Promise<SysFileSystem>;
|
5
|
+
mkdir(path: PathLike, options?: {
|
6
|
+
recursive: boolean;
|
7
|
+
}): Promise<string | undefined>;
|
8
|
+
readdir(path: PathLike, options?: unknown): Promise<string[]>;
|
9
|
+
rm(path: PathLike, options?: MakeDirectoryOptions & {
|
10
|
+
recursive: boolean;
|
11
|
+
}): Promise<void>;
|
12
|
+
copyFile(source: PathLike, destination: PathLike): Promise<void>;
|
13
|
+
readfile(path: PathLike, options?: {
|
14
|
+
encoding: BufferEncoding;
|
15
|
+
flag?: string;
|
16
|
+
}): Promise<Uint8Array>;
|
17
|
+
stat(path: PathLike): Promise<Stats>;
|
18
|
+
unlink(path: PathLike): Promise<void>;
|
19
|
+
writefile(path: PathLike, data: Uint8Array | string): Promise<void>;
|
20
|
+
}
|
21
|
+
|
22
|
+
export type { SysFileSystem as S };
|
23
|
+
declare module '@fireproof/core/node'
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { PathLike, MakeDirectoryOptions, Stats } from 'fs';
|
2
|
+
|
3
|
+
interface SysFileSystem {
|
4
|
+
start(): Promise<SysFileSystem>;
|
5
|
+
mkdir(path: PathLike, options?: {
|
6
|
+
recursive: boolean;
|
7
|
+
}): Promise<string | undefined>;
|
8
|
+
readdir(path: PathLike, options?: unknown): Promise<string[]>;
|
9
|
+
rm(path: PathLike, options?: MakeDirectoryOptions & {
|
10
|
+
recursive: boolean;
|
11
|
+
}): Promise<void>;
|
12
|
+
copyFile(source: PathLike, destination: PathLike): Promise<void>;
|
13
|
+
readfile(path: PathLike, options?: {
|
14
|
+
encoding: BufferEncoding;
|
15
|
+
flag?: string;
|
16
|
+
}): Promise<Uint8Array>;
|
17
|
+
stat(path: PathLike): Promise<Stats>;
|
18
|
+
unlink(path: PathLike): Promise<void>;
|
19
|
+
writefile(path: PathLike, data: Uint8Array | string): Promise<void>;
|
20
|
+
}
|
21
|
+
|
22
|
+
export type { SysFileSystem as S };
|
23
|
+
declare module '@fireproof/core/node'
|
package/package.json
CHANGED