Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/utils/src/extendDictionary.mts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ export const initExtendDictionary =
base: Base,
part: DeepPartial<ToGenericString<Translation>>,
): Translation =>
extend({}, base, part) as Translation
extend(true, {}, base, part) as Translation

export const extendDictionary = initExtendDictionary()
7 changes: 6 additions & 1 deletion packages/utils/src/extendDictionary.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const test = suite('utils')

const translation = {
simple: 'Hello',
nested: { value: 'Hello nested' },
nested: { value: 'Hello nested', otherValue: 'Hello nested again' },
}

test('does no mutation', () => {
Expand Down Expand Up @@ -37,6 +37,7 @@ test('simple extend', () => {
simple: 'Hello extended',
nested: {
value: 'Hello nested',
otherValue: 'Hello nested again',
},
})
})
Expand All @@ -47,6 +48,7 @@ test('nested extend', () => {
simple: 'Hello',
nested: {
value: 'Hello nested extended',
otherValue: 'Hello nested again',
},
})
})
Expand All @@ -60,6 +62,7 @@ test('nested extend with simple', () => {
simple: 'Hello extended',
nested: {
value: 'Hello nested extended',
otherValue: 'Hello nested again',
},
})
})
Expand All @@ -74,6 +77,7 @@ test('add prop', () => {
add: 'test',
nested: {
value: 'Hello nested',
otherValue: 'Hello nested again',
},
})
})
Expand All @@ -92,6 +96,7 @@ test('add nested prop', () => {
},
nested: {
value: 'Hello nested',
otherValue: 'Hello nested again',
},
})
})
Expand Down