object-unpacker
Advanced tools
Comparing version 0.0.15 to 0.0.16
@@ -248,3 +248,6 @@ "use strict"; | ||
if (isAbsoluteReferenceOrNonReference(newValueStr)) { | ||
result[returnKey] = referencesResolver.resolve(augmentedDictionary, newValue); | ||
var extendedDictionary_1 = new Map(); | ||
augmentedDictionary.forEach(function (v, k) { return extendedDictionary_1.set(k, v); }); | ||
Util_1.indexObject(prefix, postfix, postfixIsOptional, '', extendedDictionary_1, data); | ||
result[returnKey] = referencesResolver.resolve(extendedDictionary_1, newValue); | ||
} | ||
@@ -251,0 +254,0 @@ else if (newValueStr.includes('%self')) { |
@@ -91,3 +91,3 @@ "use strict"; | ||
var replacement = referenceValues.get(ref); | ||
if (replacement && typeof result === 'string') { | ||
if (replacement !== null && replacement !== undefined && typeof result === 'string') { | ||
if (result === ref) { | ||
@@ -97,3 +97,10 @@ result = replacement; | ||
else { | ||
result = result.replace(ref, "" + replacement); | ||
if (typeof replacement === 'object') { | ||
var rawRef = unref(ref); | ||
console.error(rawRef + " refers to an object or array and cannot be embedded in a string"); | ||
result = result.replace(ref, "" + rawRef); | ||
} | ||
else { | ||
result = result.replace(ref, "" + replacement); | ||
} | ||
} | ||
@@ -113,2 +120,5 @@ } | ||
}; | ||
var unref = function (ref) { | ||
return ref.replace('/index.', '').replace('/subs.', ''); | ||
}; | ||
//# sourceMappingURL=ReferencesResolver.js.map |
{ | ||
"name": "object-unpacker", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"description": "A JSON to JSON mapper in TypeScript", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
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
60058
607