aboutsummaryrefslogtreecommitdiff
path: root/src/ClientUtils.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-02-10 09:38:32 -0500
committerbobzel <zzzman@gmail.com>2025-02-10 09:38:32 -0500
commit132fb0c203f426c508eeb23dd33b508e0608d19f (patch)
treedef8d63e674286d2de2b6a48e432767253f5861f /src/ClientUtils.ts
parent5df52296c65c4eed27b06e4d3fd22e935df5427c (diff)
code cleanup in createDocumentTool. added childLayoutFitWidth to comparisonBox so flashcards can fill window.
Diffstat (limited to 'src/ClientUtils.ts')
-rw-r--r--src/ClientUtils.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ClientUtils.ts b/src/ClientUtils.ts
index e5dbb81db..8c9dd0a32 100644
--- a/src/ClientUtils.ts
+++ b/src/ClientUtils.ts
@@ -365,6 +365,15 @@ export namespace ClientUtils {
}
}
+/**
+ * Removes specified keys from an object and returns the result in the 'omit' field of the return value.
+ * The keys that were removed ared retuned in the 'extract' field of the return value.
+ * @param obj - object to remove keys from
+ * @param keys - list of key field names to remove
+ * @param pattern - optional pattern to specify keys to removed
+ * @param addKeyFunc - optional function to call with object after keys have been removed
+ * @returns a tuple object containint 'omit' (oject after keys have been removed) and 'extact' (object containing omitted fields)
+ */
export function OmitKeys(obj: object, keys: string[], pattern?: string, addKeyFunc?: (dup: object) => void): { omit: { [key: string]: unknown }; extract: { [key: string]: unknown } } {
const omit: { [key: string]: unknown } = { ...obj };
const extract: { [key: string]: unknown } = {};