Skip to content

Commit fd2fd5c

Browse files
committed
feat: add startsWith for locked keys
1 parent d8940fc commit fd2fd5c

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.changeset/mighty-books-kick.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"lingo.dev": patch
3+
---
4+
5+
add startsWith for locked keys

packages/cli/src/cli/loaders/locked-keys.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ export default function createLockedKeysLoader(
99
return createLoader({
1010
pull: async (locale, data) =>
1111
_.chain(data)
12-
.pickBy((value, key) => !lockedKeys.includes(key))
12+
.pickBy((value, key) => !lockedKeys.some((lockedKey) => key.startsWith(lockedKey)))
1313
.value(),
1414
push: async (locale, data, originalInput) => {
1515
const lockedSubObject = _.chain(originalInput)
16-
.pickBy((value, key) => lockedKeys.includes(key))
16+
.pickBy((value, key) => lockedKeys.some((lockedKey) => key.startsWith(lockedKey)))
1717
.value();
1818

1919
if (isCacheRestore) {

0 commit comments

Comments
 (0)