@aria-framework/db-worker 0.4.1 → 0.4.2
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/README.md +6 -0
- package/package.json +1 -1
- package/worker.js +2 -1
package/README.md
CHANGED
|
@@ -112,6 +112,12 @@ Model methods may be sync or async (thenables are awaited). BigInts in results
|
|
|
112
112
|
|
|
113
113
|
## Changelog
|
|
114
114
|
|
|
115
|
+
- **0.4.2** — sanitizeForTransfer passes `Map`/`Set` through untouched (like
|
|
116
|
+
Date/Buffer/typed arrays — structured clone handles them natively; the
|
|
117
|
+
generic object branch would silently mangle them to `{}`). Latent-bug guard
|
|
118
|
+
from an Acc101 review: no current consumer returns one across the boundary,
|
|
119
|
+
but the first future model method that does now works instead of delivering
|
|
120
|
+
empty data with no error signal.
|
|
115
121
|
- **0.4.1** — third-review fixes (all in the 0.4.0 additions). (1) Boot-crash
|
|
116
122
|
suppression latched: a hard boot crash emits 'error' AND 'exit'; the exit
|
|
117
123
|
handler no longer fires the death policy after the error handler consumed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aria-framework/db-worker",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Aria App Framework — db-worker module. Async RPC bridge over synchronous better-sqlite3: a worker-thread dispatcher (runWorker), a main-thread client with per-call timeouts and crash handling (DbClient), and a SQLite layer with WAL pragmas + a numbered-migration runner (database).",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"private": false,
|
package/worker.js
CHANGED
|
@@ -88,7 +88,8 @@ function sanitizeForTransfer(obj, ctx) {
|
|
|
88
88
|
if (obj === null || obj === undefined) return obj;
|
|
89
89
|
if (typeof obj === 'bigint') return Number(obj);
|
|
90
90
|
if (typeof obj !== 'object') return obj;
|
|
91
|
-
if (obj instanceof Date || Buffer.isBuffer(obj) || ArrayBuffer.isView(obj)
|
|
91
|
+
if (obj instanceof Date || Buffer.isBuffer(obj) || ArrayBuffer.isView(obj)
|
|
92
|
+
|| obj instanceof Map || obj instanceof Set) return obj;
|
|
92
93
|
// Two structures: `path` (ancestor set) detects TRUE cycles — an object
|
|
93
94
|
// containing itself must throw; `memo` (obj → sanitized copy) makes shared/
|
|
94
95
|
// diamond references legal AND linear-time: the same source object always
|