From e99ae80f7adc0f0e677381c3cc1549235d3877ab Mon Sep 17 00:00:00 2001 From: lonkaars Date: Tue, 11 Jul 2023 13:01:41 +0200 Subject: small cleanup --- util/object.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 util/object.ts (limited to 'util') diff --git a/util/object.ts b/util/object.ts new file mode 100644 index 0000000..fc25f50 --- /dev/null +++ b/util/object.ts @@ -0,0 +1,12 @@ +export function recursiveValues(obj: { [k: string]: any }): any[] { + let values = []; + for (let key in obj) { + let val = obj[key]; + if (typeof val === "object") { + values.push(...recursiveValues(val)); + } else { + values.push(val); + } + } + return values; +} -- cgit v1.2.3