From 1631115a6a9846c50473fe60ea5bdb7ce9d04084 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Mon, 11 Dec 2023 19:42:59 +0100 Subject: infra(tsconfig): noImplicitAny (#2562) --- src/internal/keys.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/internal/keys.ts (limited to 'src') diff --git a/src/internal/keys.ts b/src/internal/keys.ts new file mode 100644 index 00000000..d67d32e7 --- /dev/null +++ b/src/internal/keys.ts @@ -0,0 +1,13 @@ +/** + * Specialized version of `Object.keys()` which preserves the type information of the keys. + * + * Please note that the type information might be inaccurate for subtypes of the argument type + * and thus should only be used to cover the property access of the object. + * + * @internal + * + * @param obj The object to get the keys of. + */ +export function keys(obj: T): Array { + return Object.keys(obj) as Array; +} -- cgit v1.2.3