@ocap/indexdb-memory 1.31.9 → 1.32.0
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.
|
@@ -4,6 +4,7 @@ import { TIndexedTransaction } from "@ocap/types";
|
|
|
4
4
|
//#region src/table/transaction.d.ts
|
|
5
5
|
declare class Transaction extends MemoryIndex<TIndexedTransaction> {
|
|
6
6
|
_insert(row: Record<string, unknown>): TIndexedTransaction & Record<string, unknown>;
|
|
7
|
+
_update(key: string | Record<string, unknown>, updates: Record<string, unknown>): (TIndexedTransaction & Record<string, unknown>) | null;
|
|
7
8
|
}
|
|
8
9
|
//#endregion
|
|
9
10
|
export { Transaction as default };
|
|
@@ -6,6 +6,10 @@ var Transaction = class extends base_default {
|
|
|
6
6
|
_insert(row) {
|
|
7
7
|
return super._insert(formatTxBeforeInsert(row));
|
|
8
8
|
}
|
|
9
|
+
_update(key, updates) {
|
|
10
|
+
const normalized = updates?.tx?.itxJson ? formatTxBeforeInsert(updates) : updates;
|
|
11
|
+
return super._update(key, normalized);
|
|
12
|
+
}
|
|
9
13
|
};
|
|
10
14
|
var transaction_default = Transaction;
|
|
11
15
|
|
|
@@ -8,6 +8,10 @@ var Transaction = class extends require_table_base.default {
|
|
|
8
8
|
_insert(row) {
|
|
9
9
|
return super._insert((0, _ocap_indexdb.formatTxBeforeInsert)(row));
|
|
10
10
|
}
|
|
11
|
+
_update(key, updates) {
|
|
12
|
+
const normalized = updates?.tx?.itxJson ? (0, _ocap_indexdb.formatTxBeforeInsert)(updates) : updates;
|
|
13
|
+
return super._update(key, normalized);
|
|
14
|
+
}
|
|
11
15
|
};
|
|
12
16
|
var transaction_default = Transaction;
|
|
13
17
|
|
|
@@ -4,6 +4,7 @@ import { TIndexedTransaction } from "@ocap/types";
|
|
|
4
4
|
//#region src/table/transaction.d.ts
|
|
5
5
|
declare class Transaction extends MemoryIndex<TIndexedTransaction> {
|
|
6
6
|
_insert(row: Record<string, unknown>): TIndexedTransaction & Record<string, unknown>;
|
|
7
|
+
_update(key: string | Record<string, unknown>, updates: Record<string, unknown>): (TIndexedTransaction & Record<string, unknown>) | null;
|
|
7
8
|
}
|
|
8
9
|
//#endregion
|
|
9
10
|
export { Transaction as default };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ocap/indexdb-memory",
|
|
3
3
|
"description": "OCAP indexdb adapter that uses memory as backend, just for test purpose",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.32.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "wangshijun <shijun@arcblock.io> (https://www.arcblock.io)",
|
|
7
7
|
"bugs": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"wangshijun <shijun@arcblock.io> (https://www.arcblock.io)"
|
|
16
16
|
],
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@ocap/indexdb-test": "1.
|
|
18
|
+
"@ocap/indexdb-test": "1.32.0",
|
|
19
19
|
"@types/debug": "^4.1.12",
|
|
20
20
|
"@types/lodash": "^4.17.10",
|
|
21
21
|
"@types/lokijs": "^1.5.14",
|
|
@@ -79,10 +79,10 @@
|
|
|
79
79
|
},
|
|
80
80
|
"gitHead": "87990c8b5e215107fc587c1ced0d6b3e2cd2483e",
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@arcblock/did": "1.
|
|
83
|
-
"@ocap/indexdb": "1.
|
|
84
|
-
"@ocap/types": "1.
|
|
85
|
-
"@ocap/util": "1.
|
|
82
|
+
"@arcblock/did": "1.32.0",
|
|
83
|
+
"@ocap/indexdb": "1.32.0",
|
|
84
|
+
"@ocap/types": "1.32.0",
|
|
85
|
+
"@ocap/util": "1.32.0",
|
|
86
86
|
"debug": "^4.4.3",
|
|
87
87
|
"lodash": "^4.17.23",
|
|
88
88
|
"lokijs": "^1.5.12"
|