oberknecht-utils
Advanced tools
Comparing version 1.6.8 to 1.6.9
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.concatJSON = void 0; | ||
const _1 = require("."); | ||
function concatJSON(arr) { | ||
let arr_ = (0, _1.convertToArray)(arr); | ||
let r = {}; | ||
arr.forEach((a) => { | ||
Object.keys(a).forEach((b) => { | ||
r[b] = a[b]; | ||
}); | ||
arr_.forEach((a) => { | ||
function appendObj(obj, obj2) { | ||
Object.keys(obj2).forEach((b) => { | ||
if (obj[b] && | ||
(0, _1.extendedTypeof)(obj[b]) === "json" && | ||
(0, _1.extendedTypeof)(obj2[b]) === "json") | ||
return appendObj(obj[b], obj2[b]); | ||
obj[b] = obj2[b]; | ||
}); | ||
} | ||
appendObj(r, a); | ||
}); | ||
@@ -11,0 +20,0 @@ return r; |
@@ -0,7 +1,20 @@ | ||
import { addKeysToObject, convertToArray, extendedTypeof } from "."; | ||
export function concatJSON(arr: Record<string, any>[]) { | ||
let arr_ = convertToArray(arr); | ||
let r = {}; | ||
arr.forEach((a) => { | ||
Object.keys(a).forEach((b) => { | ||
r[b] = a[b]; | ||
}); | ||
arr_.forEach((a) => { | ||
function appendObj(obj, obj2) { | ||
Object.keys(obj2).forEach((b) => { | ||
if ( | ||
obj[b] && | ||
extendedTypeof(obj[b]) === "json" && | ||
extendedTypeof(obj2[b]) === "json" | ||
) | ||
return appendObj(obj[b], obj2[b]); | ||
obj[b] = obj2[b]; | ||
}); | ||
} | ||
appendObj(r, a); | ||
}); | ||
@@ -8,0 +21,0 @@ |
{ | ||
"name": "oberknecht-utils", | ||
"version": "1.6.8", | ||
"version": "1.6.9", | ||
"description": "Utils for oberknecht packages", | ||
@@ -5,0 +5,0 @@ "main": "./lib-ts/utils/index", |
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
150009
4127