@mtkruto/node 0.1.706 → 0.1.707
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/esm/2_storage.d.ts +1 -1
- package/esm/2_storage.d.ts.map +1 -1
- package/esm/2_storage.js +1 -1
- package/esm/storage/{2_storage_local_storage.d.ts → 2_storage_local_storage.node.d.ts} +2 -2
- package/esm/storage/2_storage_local_storage.node.d.ts.map +1 -0
- package/esm/storage/{2_storage_local_storage.js → 2_storage_local_storage.node.js} +15 -15
- package/esm/tl/3_functions.d.ts.map +1 -1
- package/esm/tl/3_functions.js +2 -3782
- package/package.json +4 -3
- package/script/2_storage.d.ts +1 -1
- package/script/2_storage.d.ts.map +1 -1
- package/script/2_storage.js +1 -1
- package/script/storage/{2_storage_local_storage.d.ts → 2_storage_local_storage.node.d.ts} +2 -2
- package/script/storage/2_storage_local_storage.node.d.ts.map +1 -0
- package/script/storage/{2_storage_local_storage.js → 2_storage_local_storage.node.js} +15 -15
- package/script/tl/3_functions.d.ts.map +1 -1
- package/script/tl/3_functions.js +2 -3782
- package/esm/storage/2_storage_local_storage.d.ts.map +0 -1
- package/script/storage/2_storage_local_storage.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mtkruto/node",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.707",
|
|
4
4
|
"description": "MTKruto for Node.js",
|
|
5
5
|
"author": "Roj <rojvv@icloud.com>",
|
|
6
6
|
"repository": {
|
|
@@ -26,13 +26,14 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@deno/shim-deno": "~0.18.0",
|
|
28
28
|
"@deno/shim-crypto": "~0.3.1",
|
|
29
|
-
"ws": "^8.13.0"
|
|
29
|
+
"ws": "^8.13.0",
|
|
30
|
+
"node-localstorage": "^3.0.5"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
33
|
"@types/node": "^20.9.0",
|
|
33
34
|
"picocolors": "^1.0.0",
|
|
34
35
|
"@types/ws": "^8.5.4",
|
|
35
|
-
"@types/
|
|
36
|
+
"@types/node-localstorage": "^1.3.3"
|
|
36
37
|
},
|
|
37
38
|
"_generatedBy": "dnt@dev"
|
|
38
39
|
}
|
package/script/2_storage.d.ts
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
export * from "./storage/0_storage.js";
|
|
21
21
|
export * from "./storage/1_utilities.js";
|
|
22
22
|
export * from "./storage/2_storage_indexed_db.js";
|
|
23
|
-
export * from "./storage/2_storage_local_storage.js";
|
|
23
|
+
export * from "./storage/2_storage_local_storage.node.js";
|
|
24
24
|
export * from "./storage/2_storage_memory.js";
|
|
25
25
|
export * from "./storage/2_storage_session_storage.js";
|
|
26
26
|
//# sourceMappingURL=2_storage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_storage.d.ts","sourceRoot":"","sources":["../src/2_storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,
|
|
1
|
+
{"version":3,"file":"2_storage.d.ts","sourceRoot":"","sources":["../src/2_storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wCAAwC,CAAC"}
|
package/script/2_storage.js
CHANGED
|
@@ -36,6 +36,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
__exportStar(require("./storage/0_storage.js"), exports);
|
|
37
37
|
__exportStar(require("./storage/1_utilities.js"), exports);
|
|
38
38
|
__exportStar(require("./storage/2_storage_indexed_db.js"), exports);
|
|
39
|
-
__exportStar(require("./storage/2_storage_local_storage.js"), exports);
|
|
39
|
+
__exportStar(require("./storage/2_storage_local_storage.node.js"), exports);
|
|
40
40
|
__exportStar(require("./storage/2_storage_memory.js"), exports);
|
|
41
41
|
__exportStar(require("./storage/2_storage_session_storage.js"), exports);
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
import { GetManyFilter, Storage, StorageKeyPart } from "./0_storage.js";
|
|
21
21
|
export declare class StorageLocalStorage implements Storage {
|
|
22
22
|
#private;
|
|
23
|
-
constructor(
|
|
23
|
+
constructor(path: string);
|
|
24
24
|
get prefix(): string;
|
|
25
25
|
branch(id: string): Storage;
|
|
26
26
|
initialize(): void;
|
|
@@ -34,4 +34,4 @@ export declare class StorageLocalStorage implements Storage {
|
|
|
34
34
|
set(key_: readonly StorageKeyPart[], value: unknown): void;
|
|
35
35
|
incr(key: readonly StorageKeyPart[], by: number): void;
|
|
36
36
|
}
|
|
37
|
-
//# sourceMappingURL=2_storage_local_storage.d.ts.map
|
|
37
|
+
//# sourceMappingURL=2_storage_local_storage.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"2_storage_local_storage.node.d.ts","sourceRoot":"","sources":["../../src/storage/2_storage_local_storage.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGxE,qBAAa,mBAAoB,YAAW,OAAO;;gBAKrC,IAAI,EAAE,MAAM;IAKxB,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAM3B,UAAU;IAGV,IAAI,aAAa,IAAI,OAAO,CAE3B;IAED,IAAI,aAAa,IAAI,OAAO,CAE3B;IAED,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,cAAc,EAAE,GAAG,CAAC,GAAG,IAAI;IAUhD,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC,CAAC,SAAS,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC;IA+B7H,GAAG,CAAC,IAAI,EAAE,SAAS,cAAc,EAAE,EAAE,KAAK,EAAE,OAAO;IASnD,IAAI,CAAC,GAAG,EAAE,SAAS,cAAc,EAAE,EAAE,EAAE,EAAE,MAAM;CAGhD"}
|
|
@@ -29,26 +29,26 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
29
29
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
30
30
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
31
31
|
};
|
|
32
|
-
var _StorageLocalStorage_prefix;
|
|
32
|
+
var _StorageLocalStorage_prefix, _StorageLocalStorage_path, _StorageLocalStorage_storage;
|
|
33
33
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
34
|
exports.StorageLocalStorage = void 0;
|
|
35
|
+
const node_localstorage_1 = require("node-localstorage");
|
|
35
36
|
const _1_utilities_js_1 = require("./1_utilities.js");
|
|
36
37
|
class StorageLocalStorage {
|
|
37
|
-
constructor(
|
|
38
|
+
constructor(path) {
|
|
38
39
|
_StorageLocalStorage_prefix.set(this, void 0);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
throw new Error("Empty prefix");
|
|
44
|
-
}
|
|
45
|
-
__classPrivateFieldSet(this, _StorageLocalStorage_prefix, prefix, "f");
|
|
40
|
+
_StorageLocalStorage_path.set(this, void 0);
|
|
41
|
+
_StorageLocalStorage_storage.set(this, void 0);
|
|
42
|
+
__classPrivateFieldSet(this, _StorageLocalStorage_prefix, "main", "f");
|
|
43
|
+
__classPrivateFieldSet(this, _StorageLocalStorage_storage, new node_localstorage_1.LocalStorage(__classPrivateFieldSet(this, _StorageLocalStorage_path, path, "f")), "f");
|
|
46
44
|
}
|
|
47
45
|
get prefix() {
|
|
48
46
|
return __classPrivateFieldGet(this, _StorageLocalStorage_prefix, "f");
|
|
49
47
|
}
|
|
50
48
|
branch(id) {
|
|
51
|
-
|
|
49
|
+
const storage = new StorageLocalStorage(__classPrivateFieldGet(this, _StorageLocalStorage_path, "f"));
|
|
50
|
+
__classPrivateFieldSet(storage, _StorageLocalStorage_prefix, this.prefix + "S__" + id, "f");
|
|
51
|
+
return storage;
|
|
52
52
|
}
|
|
53
53
|
initialize() {
|
|
54
54
|
}
|
|
@@ -60,7 +60,7 @@ class StorageLocalStorage {
|
|
|
60
60
|
}
|
|
61
61
|
get(key_) {
|
|
62
62
|
const key = this.prefix + (0, _1_utilities_js_1.toString)(key_);
|
|
63
|
-
const value =
|
|
63
|
+
const value = __classPrivateFieldGet(this, _StorageLocalStorage_storage, "f").getItem(key);
|
|
64
64
|
if (value != null) {
|
|
65
65
|
return (0, _1_utilities_js_1.fromString)(value);
|
|
66
66
|
}
|
|
@@ -69,7 +69,7 @@ class StorageLocalStorage {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
*getMany(filter, params) {
|
|
72
|
-
let entries = Object.entries(
|
|
72
|
+
let entries = Object.entries(__classPrivateFieldGet(this, _StorageLocalStorage_storage, "f")).sort(([a], [b]) => a.localeCompare(b));
|
|
73
73
|
if (params?.reverse) {
|
|
74
74
|
entries.reverse();
|
|
75
75
|
}
|
|
@@ -101,10 +101,10 @@ class StorageLocalStorage {
|
|
|
101
101
|
set(key_, value) {
|
|
102
102
|
const key = this.prefix + (0, _1_utilities_js_1.toString)(key_);
|
|
103
103
|
if (value != null) {
|
|
104
|
-
|
|
104
|
+
__classPrivateFieldGet(this, _StorageLocalStorage_storage, "f").setItem(key, (0, _1_utilities_js_1.toString)(value));
|
|
105
105
|
}
|
|
106
106
|
else {
|
|
107
|
-
|
|
107
|
+
__classPrivateFieldGet(this, _StorageLocalStorage_storage, "f").removeItem(key);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
incr(key, by) {
|
|
@@ -112,4 +112,4 @@ class StorageLocalStorage {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
exports.StorageLocalStorage = StorageLocalStorage;
|
|
115
|
-
_StorageLocalStorage_prefix = new WeakMap();
|
|
115
|
+
_StorageLocalStorage_prefix = new WeakMap(), _StorageLocalStorage_path = new WeakMap(), _StorageLocalStorage_storage = new WeakMap();
|