@scaleforge/joser
Advanced tools
Comparing version 0.6.0 to 0.6.1
@@ -74,11 +74,12 @@ "use strict"; | ||
const serializer = this.serializers[type]; | ||
if (Array.isArray(item)) { | ||
const { array } = this.deserialize({ | ||
array: item, | ||
if (Array.isArray(item) || | ||
(typeof item === 'object' && item !== null && !serializer)) { | ||
const { deserialize } = this.deserialize({ | ||
deserialize: item, | ||
__t: { | ||
t: __t.t, | ||
i: { array: typeIndices.at(1) }, | ||
i: { deserialize: typeIndices.at(1) }, | ||
}, | ||
}); | ||
return array; | ||
return deserialize; | ||
} | ||
@@ -131,3 +132,11 @@ if (!serializer) { | ||
if (typeof item === 'object' && item !== null && !serializer) { | ||
return this.serialize(item); | ||
const serialized = this.serialize(item); | ||
for (const name of serialized['__t']['t']) { | ||
if (!t.includes(name)) { | ||
t.push(name); | ||
} | ||
} | ||
_i.push([index, serialized['__t']['i']]); | ||
delete serialized['__t']; | ||
return serialized; | ||
} | ||
@@ -134,0 +143,0 @@ if (!serializer) { |
{ | ||
"name": "@scaleforge/joser", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Javascript object serializer", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26290
296