Skip to content

Commit

Permalink
fix: export deepMerge
Browse files Browse the repository at this point in the history
  • Loading branch information
julrich committed Sep 11, 2024
1 parent f00d737 commit 62506b9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@kickstartds/jsonschema-utils",
"comment": "export deepMerge",
"type": "patch"
}
],
"packageName": "@kickstartds/jsonschema-utils"
}
6 changes: 5 additions & 1 deletion tools/jsonschema-utils/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,11 @@ export function reduceSchemaAllOfs(
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
function deepMerge<T extends Record<string, any>>(obj1: T, obj2: T, replaceExamples: boolean = false): T {
export function deepMerge<T extends Record<string, any>>(
obj1: T,
obj2: T,
replaceExamples: boolean = false
): T {
const keys = Array.from(new Set([...Object.keys(obj1), ...Object.keys(obj2)]));

return keys.reduce((acc, key) => {
Expand Down

0 comments on commit 62506b9

Please sign in to comment.