msgpackr 1.11.14 → 1.12.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.
- package/dist/index-no-eval.cjs +7 -1
- package/dist/index-no-eval.cjs.map +1 -1
- package/dist/index-no-eval.min.js +1 -1
- package/dist/index-no-eval.min.js.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/node.cjs +7 -1
- package/dist/node.cjs.map +1 -1
- package/dist/test.js +76 -1
- package/dist/test.js.map +1 -1
- package/pack.js +7 -1
- package/package.json +1 -1
package/dist/index-no-eval.cjs
CHANGED
|
@@ -1296,7 +1296,13 @@
|
|
|
1296
1296
|
hasSharedUpdate = false;
|
|
1297
1297
|
let encodingError;
|
|
1298
1298
|
try {
|
|
1299
|
-
|
|
1299
|
+
// readOnlyStructures: skip the random-access struct write path so NO new struct is
|
|
1300
|
+
// minted. randomAccessStructure stays true (the struct READ path and the struct-safe
|
|
1301
|
+
// integer boundary are preserved, so existing struct data still decodes), but objects
|
|
1302
|
+
// fall through to the normal pack()->writeObject->writeRecord path and are written as
|
|
1303
|
+
// classic shared-structure records (byte range 0x40-0x7f, disjoint from struct headers
|
|
1304
|
+
// at 0x20-0x3f) — the bounded, width-agnostic encoding used before struct mode.
|
|
1305
|
+
if (packr.randomAccessStructure && !packr.readOnlyStructures && value && typeof value === 'object') {
|
|
1300
1306
|
if (value.constructor === Object) writeStruct(value); // simple object
|
|
1301
1307
|
else if (value.constructor !== Map && !Array.isArray(value) && !extensionClasses.some(extClass => value instanceof extClass)) {
|
|
1302
1308
|
// allow user classes, if they don't need special handling (but do use toJSON if available)
|