@trim21/personal-pi-extensions 0.1.659 → 0.1.660
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/package.json
CHANGED
package/src/codemode/prelude.ts
CHANGED
|
@@ -104,10 +104,15 @@ export const PRELUDE_SOURCE = String.raw`(function (bridge, toolsJson, storeJson
|
|
|
104
104
|
Object.freeze(allTools);
|
|
105
105
|
|
|
106
106
|
// key -> JSON 文本;容量按 key 与 JSON 的字符数计
|
|
107
|
-
const stored = new Map(
|
|
107
|
+
const stored = new Map();
|
|
108
108
|
const writes = new Map();
|
|
109
109
|
let storedChars = 0;
|
|
110
|
-
for (const [key,
|
|
110
|
+
for (const [key, value] of Object.entries(parse(storeJson))) {
|
|
111
|
+
const json = stringify(value);
|
|
112
|
+
if (json === undefined) continue;
|
|
113
|
+
stored.set(key, json);
|
|
114
|
+
storedChars += key.length + json.length;
|
|
115
|
+
}
|
|
111
116
|
|
|
112
117
|
function checkKey(name, key) {
|
|
113
118
|
if (typeof key !== "string") throw new TypeErrorCtor(name + "() key must be a string");
|
package/src/codemode/worker.js
CHANGED
|
@@ -89,10 +89,15 @@ var PRELUDE_SOURCE = String.raw`(function (bridge, toolsJson, storeJson) {
|
|
|
89
89
|
Object.freeze(allTools);
|
|
90
90
|
|
|
91
91
|
// key -> JSON 文本;容量按 key 与 JSON 的字符数计
|
|
92
|
-
const stored = new Map(
|
|
92
|
+
const stored = new Map();
|
|
93
93
|
const writes = new Map();
|
|
94
94
|
let storedChars = 0;
|
|
95
|
-
for (const [key,
|
|
95
|
+
for (const [key, value] of Object.entries(parse(storeJson))) {
|
|
96
|
+
const json = stringify(value);
|
|
97
|
+
if (json === undefined) continue;
|
|
98
|
+
stored.set(key, json);
|
|
99
|
+
storedChars += key.length + json.length;
|
|
100
|
+
}
|
|
96
101
|
|
|
97
102
|
function checkKey(name, key) {
|
|
98
103
|
if (typeof key !== "string") throw new TypeErrorCtor(name + "() key must be a string");
|