From 385f45ffb74bea4e9f321d638b716a2f93048513 Mon Sep 17 00:00:00 2001 From: YouFaceJaraxxus Date: Tue, 2 Jun 2026 13:07:05 +0200 Subject: [PATCH] introduced a fix which would allow us to add fields that are empty objects into the masks despite being leaves: this means that specifically NULLs are to be handled for clearing --- src/utils.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 7526e343..9365480a 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -81,9 +81,13 @@ export function recursiveFieldMaskSearch(data: Record): string[] { const fieldKey = toSnakeCase(key); const value = data[key]; if (typeof value === "object" && !Array.isArray(value) && value !== null) { - const children = recursiveFieldMaskSearch(value); - for (const child of children) { - paths.push(`${fieldKey}.${child}`); + if (Object.keys(value).length === 0) { + paths.push(fieldKey); + } else { + const children = recursiveFieldMaskSearch(value); + for (const child of children) { + paths.push(`${fieldKey}.${child}`); + } } continue; }