@rljson/io 0.0.9 → 0.0.10
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/io-mem.d.ts +3 -0
- package/dist/io.d.ts +4 -1
- package/dist/io.js +10 -3
- package/package.json +2 -1
package/dist/io-mem.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { Io } from './io.ts';
|
|
|
5
5
|
* In-Memory implementation of the Rljson Io interface.
|
|
6
6
|
*/
|
|
7
7
|
export declare class IoMem implements Io {
|
|
8
|
+
constructor();
|
|
8
9
|
static example: () => IoMem;
|
|
9
10
|
isReady(): Promise<void>;
|
|
10
11
|
dump(): Promise<Rljson>;
|
|
@@ -29,7 +30,9 @@ export declare class IoMem implements Io {
|
|
|
29
30
|
type: ContentType;
|
|
30
31
|
}): Promise<void>;
|
|
31
32
|
tables(): Promise<string[]>;
|
|
33
|
+
private _isReady;
|
|
32
34
|
private _mem;
|
|
35
|
+
private _init;
|
|
33
36
|
private _createTable;
|
|
34
37
|
private _readRow;
|
|
35
38
|
private _dump;
|
package/dist/io.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { JsonValue } from '@rljson/json';
|
|
2
2
|
import { ContentType, Rljson } from '@rljson/rljson';
|
|
3
3
|
export interface Io {
|
|
4
|
-
/** A promise resolving once the Io interface is ready
|
|
4
|
+
/** A promise resolving once the Io interface is ready
|
|
5
|
+
*
|
|
6
|
+
* 💡 Use @rljson/is-ready
|
|
7
|
+
*/
|
|
5
8
|
isReady(): Promise<void>;
|
|
6
9
|
/** Returns the complete db content as Rljson */
|
|
7
10
|
dump(): Promise<Rljson>;
|
package/dist/io.js
CHANGED
|
@@ -2,19 +2,24 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import { hip, hsh } from "@rljson/hash";
|
|
5
|
+
import { IsReady } from "@rljson/is-ready";
|
|
5
6
|
import { copy, equals } from "@rljson/json";
|
|
6
7
|
// @license
|
|
7
8
|
const _IoMem = class _IoMem {
|
|
9
|
+
// ...........................................................................
|
|
10
|
+
// Constructor & example
|
|
8
11
|
constructor() {
|
|
9
12
|
// ######################
|
|
10
13
|
// Private
|
|
11
14
|
// ######################
|
|
15
|
+
__publicField(this, "_isReady", new IsReady());
|
|
12
16
|
__publicField(this, "_mem", hip({}));
|
|
17
|
+
this._init();
|
|
13
18
|
}
|
|
14
19
|
// ...........................................................................
|
|
15
20
|
// General
|
|
16
21
|
isReady() {
|
|
17
|
-
return
|
|
22
|
+
return this._isReady.promise;
|
|
18
23
|
}
|
|
19
24
|
// ...........................................................................
|
|
20
25
|
// Dump
|
|
@@ -48,6 +53,10 @@ const _IoMem = class _IoMem {
|
|
|
48
53
|
return tables;
|
|
49
54
|
}
|
|
50
55
|
// ...........................................................................
|
|
56
|
+
_init() {
|
|
57
|
+
this._isReady.resolve();
|
|
58
|
+
}
|
|
59
|
+
// ...........................................................................
|
|
51
60
|
async _createTable(request) {
|
|
52
61
|
var _a;
|
|
53
62
|
const { name, type } = request;
|
|
@@ -154,8 +163,6 @@ const _IoMem = class _IoMem {
|
|
|
154
163
|
return result;
|
|
155
164
|
}
|
|
156
165
|
};
|
|
157
|
-
// ...........................................................................
|
|
158
|
-
// Constructor & example
|
|
159
166
|
__publicField(_IoMem, "example", () => {
|
|
160
167
|
return new _IoMem();
|
|
161
168
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rljson/io",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"packageManager": "pnpm@10.6.2",
|
|
5
5
|
"description": "Low level interface for reading and writing RLJSON data",
|
|
6
6
|
"homepage": "https://github.com/rljson/io",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@rljson/hash": "^0.0.12",
|
|
60
|
+
"@rljson/is-ready": "^0.0.16",
|
|
60
61
|
"@rljson/json": "^0.0.18",
|
|
61
62
|
"@rljson/rljson": "^0.0.21",
|
|
62
63
|
"@rljson/validate": "^0.0.8"
|