@punks/backend-core 0.0.35 → 0.0.36
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/index.js +16 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/utils/{objects.d.ts → objects/index.d.ts} +1 -0
- package/dist/esm/index.js +16 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/utils/{objects.d.ts → objects/index.d.ts} +1 -0
- package/dist/esm/types/utils/objects/mergeDeep.spec.d.ts +1 -0
- package/dist/esm/types/utils/objects/removeUndefinedProps.spec.d.ts +1 -0
- package/dist/index.d.ts +2 -1
- package/package.json +1 -1
- /package/dist/cjs/types/utils/{objects.test.d.ts → objects/mergeDeep.spec.d.ts} +0 -0
- /package/dist/{esm/types/utils/objects.test.d.ts → cjs/types/utils/objects/removeUndefinedProps.spec.d.ts} +0 -0
package/dist/esm/index.js
CHANGED
|
@@ -272,6 +272,21 @@ const buildObject = (...props) => {
|
|
|
272
272
|
}
|
|
273
273
|
return out;
|
|
274
274
|
};
|
|
275
|
+
const mergeDeep = (a, b) => {
|
|
276
|
+
const c = { ...(a ?? {}) };
|
|
277
|
+
for (const key in b ?? {}) {
|
|
278
|
+
if (b.hasOwnProperty(key)) {
|
|
279
|
+
const value = b[key];
|
|
280
|
+
if (typeof value === "object" && !Array.isArray(value)) {
|
|
281
|
+
c[key] = mergeDeep(c[key] ?? {}, value);
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
c[key] = value;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return c;
|
|
289
|
+
};
|
|
275
290
|
|
|
276
291
|
const pluralize = (word) => {
|
|
277
292
|
return word.endsWith("s") ? `${word}es` : `${word}s`;
|
|
@@ -28490,5 +28505,5 @@ Log.enabled = true;
|
|
|
28490
28505
|
Log.level = LogLevel.Debug;
|
|
28491
28506
|
Log.metaSerialization = MetaSerializationType.None;
|
|
28492
28507
|
|
|
28493
|
-
export { ExcelKeyTransform, Log, LogLevel, MetaSerializationType, addTime, buildObject, buildTree, byField, byFieldDesc, camelToKebabCase, camelToSnakeCase, csvBuild, csvParse, distinct, distinctElements, ensureDirectory, ensureStartSlash, ensureTailingSlash, excelBuild, excelParse, first, flatten, getDirectoryFilePaths, getDirectoryPath, groupBy, indexes, isNullOrUndefined, iterate, joinPath, jsonDistinct, last, mapOrThrow, newUuid, notNull, notUndefined, pluralize, processArrayDifferences, range, removeUndefinedProps, selectMany, sleep, sort, splitPath, subArrays, subtractTime, toCamelCase, toDict, toItemsDict, toItemsMap, toMap, toTitleCase, trim$1 as trim, trimEnd, trimStart };
|
|
28508
|
+
export { ExcelKeyTransform, Log, LogLevel, MetaSerializationType, addTime, buildObject, buildTree, byField, byFieldDesc, camelToKebabCase, camelToSnakeCase, csvBuild, csvParse, distinct, distinctElements, ensureDirectory, ensureStartSlash, ensureTailingSlash, excelBuild, excelParse, first, flatten, getDirectoryFilePaths, getDirectoryPath, groupBy, indexes, isNullOrUndefined, iterate, joinPath, jsonDistinct, last, mapOrThrow, mergeDeep, newUuid, notNull, notUndefined, pluralize, processArrayDifferences, range, removeUndefinedProps, selectMany, sleep, sort, splitPath, subArrays, subtractTime, toCamelCase, toDict, toItemsDict, toItemsMap, toMap, toTitleCase, trim$1 as trim, trimEnd, trimStart };
|
|
28494
28509
|
//# sourceMappingURL=index.js.map
|