Skip to content

Commit

Permalink
Fix 'removeAllBut'
Browse files Browse the repository at this point in the history
  • Loading branch information
JabX committed Jan 24, 2025
1 parent 2c2a0f1 commit 5ed86a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/stores/src/entity/form/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export class FormNodeBuilder<E, E0 = E> {
*/
removeAllBut<F extends FieldsOf<E> | ListsOf<E> | ObjectsOf<E>>(...fields: F[]): FormNodeBuilder<Pick<E, F>, E0> {
for (const key in this.node) {
if (!fields.includes(key as F) && !["clear", "replace", "set"].includes(key)) {
if (!fields.includes(key as F) && !["clear", "replace", "set", "sourceNode"].includes(key)) {
delete this.node[key as F];
}
}
Expand Down

0 comments on commit 5ed86a9

Please sign in to comment.