Skip to content

Commit e0a11a7

Browse files
committed
Added the already used @ungap/structured-clone/json to the export utilities
1 parent 4afce39 commit e0a11a7

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

docs/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,8 @@ The module is registered within the interpreter as *JS* module and it offers var
379379
| currentScript | `from polyscript import currentScript` | it's an explicit, always correct, reference to the current node running the generic script code. |
380380
| js_modules | `from polyscript import js_modules` | described in the [Extra config Features](#extra-config-features) part. |
381381
| lazy_py_modules | `from polyscript import lazy_py_modules` | allows, only in *Python* related interpreters, and without needing static config entries, to import lazily any available module.
382-
| storage | `from polyscript import storage` | a utility to instantiate a named [idb-map](https://github.com/WebReflection/idb-map/#readme) that can be consumed synchronously.
382+
| storage | `from polyscript import storage` | a utility to instantiate a named [idb-map](https://github.com/WebReflection/idb-map/#readme) that can be consumed synchronously.
383+
| JSON | `from polyscript import JSON` | a utility to stringify/parse more complex or recursive data via [@ungap/structured-clone/json](https://github.com/ungap/structured-clone/#readme).
383384
384385
385386
#### lazy_py_modules

docs/index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

esm/interpreter/_python.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as JSON from '@ungap/structured-clone/json';
12
import IDBMapSync from '@webreflection/idb-map/sync';
23
import { dedent } from '../utils.js';
34
import { io } from './_io.js';
@@ -17,6 +18,7 @@ export const registerJSModule = (interpreter, name, value) => {
1718
await storage.sync();
1819
return storage;
1920
};
21+
value.JSON = JSON;
2022
}
2123
interpreter.registerJsModule(name, value);
2224
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,6 @@
9191
"to-json-callback": "^0.1.1"
9292
},
9393
"worker": {
94-
"blob": "sha256-y/qSAmO9mTFoVI7HFnSREEX6z7iKiMeZRkWrNHB3ogg="
94+
"blob": "sha256-aKFI8LDFH/HzDVvL04EsywRyTDQpQV+n5vYBrEVA35I="
9595
}
9696
}

0 commit comments

Comments
 (0)