@fireproof/core 0.7.0-alpha.0 → 0.7.0-alpha.2
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/dist/fireproof.js +2 -13
- package/dist/src/fireproof.d.ts +2 -2
- package/dist/src/fireproof.js +10 -18
- package/dist/src/fireproof.js.map +1 -1
- package/dist/src/fireproof.mjs +8 -16
- package/dist/src/fireproof.mjs.map +1 -1
- package/dist/storage/filesystem.js +5 -2
- package/package.json +4 -2
- package/src/fireproof.js +2 -14
- package/src/storage/filesystem.js +6 -2
package/dist/src/fireproof.mjs
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
import { mkdir, writeFile } from 'node:fs/promises';
|
1
|
+
import { mkdir, writeFile } from 'fs/promises';
|
3
2
|
import http from 'node:http';
|
4
3
|
import https from 'node:https';
|
5
4
|
import zlib from 'node:zlib';
|
@@ -8,6 +7,7 @@ import { Buffer as Buffer$H } from 'node:buffer';
|
|
8
7
|
import { types, promisify as promisify$1, deprecate as deprecate$2 } from 'node:util';
|
9
8
|
import { format as format$2 } from 'node:url';
|
10
9
|
import { isIP } from 'node:net';
|
10
|
+
import 'node:fs';
|
11
11
|
import 'node:path';
|
12
12
|
|
13
13
|
var encode_1$2 = encode$9;
|
@@ -39184,6 +39184,10 @@ function homedir(){
|
|
39184
39184
|
return '$HOME'
|
39185
39185
|
}
|
39186
39186
|
|
39187
|
+
var fs = {};
|
39188
|
+
|
39189
|
+
const readFileSync = fs.readFileSync;
|
39190
|
+
|
39187
39191
|
const defaultConfig$1 = {
|
39188
39192
|
dataDir: join(homedir(), '.fireproof')
|
39189
39193
|
};
|
@@ -50346,22 +50350,10 @@ class Fireproof {
|
|
50346
50350
|
* Creates a new Fireproof instance with default storage settings
|
50347
50351
|
* Most apps should use this and not worry about the details.
|
50348
50352
|
* @static
|
50349
|
-
* @returns {Database
|
50353
|
+
* @returns {Database} - a new Fireproof instance
|
50350
50354
|
*/
|
50351
50355
|
static storage = (name = null, opts = {}) => {
|
50352
|
-
|
50353
|
-
return new Database(null, opts)
|
50354
|
-
} else {
|
50355
|
-
// const primaryLoader = Loader.appropriate(name, opts.primary, { key: null })
|
50356
|
-
// const secondaryLoader = opts.secondary ? Loader.appropriate(name, opts.secondary, { key: null }) : null
|
50357
|
-
const db = new Database(name, opts);
|
50358
|
-
return db
|
50359
|
-
// const loaders = [pr]
|
50360
|
-
|
50361
|
-
// todo we need branch names here
|
50362
|
-
|
50363
|
-
// console.log('storage', name, opts, primaryLoader, secondaryLoader)
|
50364
|
-
}
|
50356
|
+
return new Database(name, opts)
|
50365
50357
|
}
|
50366
50358
|
|
50367
50359
|
// static fromConfig (name, primary, secondary, opts = {}) {
|