seroval 1.5.0 → 1.5.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/dist/cjs/development/index.cjs +13 -3
- package/dist/cjs/development/index.cjs.map +2 -2
- package/dist/cjs/production/index.cjs +2 -2
- package/dist/esm/development/index.mjs +13 -3
- package/dist/esm/development/index.mjs.map +2 -2
- package/dist/esm/production/index.mjs +2 -2
- package/dist/types/core/constructors.d.ts +1 -1
- package/dist/types/core/constructors.d.ts.map +1 -1
- package/dist/types/core/context/deserializer.d.ts.map +1 -1
- package/dist/types/core/context/serializer.d.ts.map +1 -1
- package/dist/types/core/cross/index.d.ts.map +1 -1
- package/dist/types/core/function-string.d.ts.map +1 -1
- package/dist/types/core/sequence.d.ts.map +1 -1
- package/dist/types/core/symbols.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/constructors.ts +1 -1
- package/src/core/context/deserializer.ts +5 -1
- package/src/core/context/serializer.ts +28 -4
- package/src/core/cross/index.ts +2 -0
- package/src/core/function-string.ts +1 -2
- package/src/core/sequence.ts +7 -3
- package/src/core/symbols.ts +4 -2
|
@@ -2097,7 +2097,11 @@ function assignStringProperty(object, key, value) {
|
|
|
2097
2097
|
}
|
|
2098
2098
|
function assignProperty(ctx, depth, object, key, value) {
|
|
2099
2099
|
if (typeof key === "string") {
|
|
2100
|
-
assignStringProperty(
|
|
2100
|
+
assignStringProperty(
|
|
2101
|
+
object,
|
|
2102
|
+
deserializeString(key),
|
|
2103
|
+
deserialize(ctx, depth, value)
|
|
2104
|
+
);
|
|
2101
2105
|
} else {
|
|
2102
2106
|
const actual = deserialize(ctx, depth, key);
|
|
2103
2107
|
switch (typeof actual) {
|
|
@@ -2696,7 +2700,11 @@ function createObjectAssign(ctx, ref, key, value) {
|
|
|
2696
2700
|
createAssignment(ctx.base, getRefParam(ctx, ref) + "." + key, value);
|
|
2697
2701
|
}
|
|
2698
2702
|
function createSequenceAssign(ctx, ref, index, value) {
|
|
2699
|
-
createAssignment(
|
|
2703
|
+
createAssignment(
|
|
2704
|
+
ctx.base,
|
|
2705
|
+
getRefParam(ctx, ref) + ".v[" + index + "]",
|
|
2706
|
+
value
|
|
2707
|
+
);
|
|
2700
2708
|
}
|
|
2701
2709
|
function isIndexedValueInStack(ctx, node) {
|
|
2702
2710
|
return node.t === 4 /* IndexedValue */ && ctx.stack.includes(node.i);
|
|
@@ -3997,6 +4005,7 @@ function toCrossJSONStream(source, options) {
|
|
|
3997
4005
|
plugins,
|
|
3998
4006
|
refs: options.refs,
|
|
3999
4007
|
disabledFeatures: options.disabledFeatures,
|
|
4008
|
+
depthLimit: options.depthLimit,
|
|
4000
4009
|
onParse: options.onParse,
|
|
4001
4010
|
onError: options.onError,
|
|
4002
4011
|
onDone: options.onDone
|
|
@@ -4010,7 +4019,8 @@ function fromCrossJSON(source, options) {
|
|
|
4010
4019
|
plugins,
|
|
4011
4020
|
refs: options.refs,
|
|
4012
4021
|
features: options.features,
|
|
4013
|
-
disabledFeatures: options.disabledFeatures
|
|
4022
|
+
disabledFeatures: options.disabledFeatures,
|
|
4023
|
+
depthLimit: options.depthLimit
|
|
4014
4024
|
});
|
|
4015
4025
|
return deserializeTop(ctx, source);
|
|
4016
4026
|
}
|