dreambase-library
Advanced tools
Comparing version 1.0.14 to 1.0.15
@@ -26,2 +26,3 @@ const { toString: toStr } = {}; | ||
}; | ||
const DELETE = {}; | ||
export function TypesonSimplified(...typeDefsInputs) { | ||
@@ -44,2 +45,3 @@ const typeDefs = typeDefsInputs.reduce((p, c) => ({ ...p, ...c }), typeDefsInputs.reduce((p, c) => ({ ...c, ...p }), {})); | ||
let unescapeParentKeys = []; | ||
let undefinedParentKeys = []; | ||
return JSON.parse(tson, function (key, value) { | ||
@@ -58,2 +60,8 @@ // | ||
// Do what the kid told us to | ||
if (undefinedParentKeys.length > 0) { | ||
value = { ...value }; | ||
for (const k of undefinedParentKeys) { | ||
value[k] = undefined; | ||
} | ||
} | ||
if (unescapeParentKeys.length > 0) { | ||
@@ -73,3 +81,9 @@ // Unescape dollar props | ||
// | ||
if (value === undefined) { | ||
// Preserve undefined | ||
parent = this; | ||
undefinedParentKeys.push(key); | ||
} | ||
if (key[0] === "$" && key !== "$t") { | ||
// Unescape props | ||
parent = this; | ||
@@ -76,0 +90,0 @@ unescapeParentKeys.push(key); |
{ | ||
"name": "dreambase-library", | ||
"version": "1.0.14", | ||
"version": "1.0.15", | ||
"description": "Library of dreambase-related code for use in other libraries.", | ||
@@ -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
77472
1064