@fireproof/core 0.7.0-alpha.1 → 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/src/fireproof.js
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
var
|
4
|
-
var promises = require('node:fs/promises');
|
3
|
+
var promises = require('fs/promises');
|
5
4
|
var http = require('node:http');
|
6
5
|
var https = require('node:https');
|
7
6
|
var zlib = require('node:zlib');
|
@@ -10,6 +9,7 @@ var node_buffer = require('node:buffer');
|
|
10
9
|
var node_util = require('node:util');
|
11
10
|
var node_url = require('node:url');
|
12
11
|
var node_net = require('node:net');
|
12
|
+
require('node:fs');
|
13
13
|
require('node:path');
|
14
14
|
|
15
15
|
var encode_1$2 = encode$9;
|
@@ -39186,6 +39186,10 @@ function homedir(){
|
|
39186
39186
|
return '$HOME'
|
39187
39187
|
}
|
39188
39188
|
|
39189
|
+
var fs = {};
|
39190
|
+
|
39191
|
+
const readFileSync = fs.readFileSync;
|
39192
|
+
|
39189
39193
|
const defaultConfig$1 = {
|
39190
39194
|
dataDir: join(homedir(), '.fireproof')
|
39191
39195
|
};
|
@@ -39210,7 +39214,7 @@ class Filesystem extends Base {
|
|
39210
39214
|
|
39211
39215
|
async readCar (carCid) {
|
39212
39216
|
const carFilename = join(this.config.dataDir, this.name, `${carCid.toString()}.car`);
|
39213
|
-
const got =
|
39217
|
+
const got = readFileSync(carFilename);
|
39214
39218
|
// console.log('readCar', carFilename, got.constructor.name)
|
39215
39219
|
return got
|
39216
39220
|
}
|
@@ -39238,7 +39242,7 @@ class Filesystem extends Base {
|
|
39238
39242
|
|
39239
39243
|
function loadSync (filename) {
|
39240
39244
|
try {
|
39241
|
-
return
|
39245
|
+
return readFileSync(filename, 'utf8').toString()
|
39242
39246
|
} catch (error) {
|
39243
39247
|
// console.log('error', error)
|
39244
39248
|
return null
|