@ztimson/utils / types
types
Functions
tyoeKeys()
tyoeKeys<T
>(): keyof T
[]
Return keys on a type as an array of strings
Type Parameters
• T extends object
Returns
keyof T
[]
Available keys
Example
type Person = {
firstName: string;
lastName: string;
age: number;
}
const keys = typeKeys<Person>();
console.log(keys); // Output: ["firstName", "lastName", "age"]
Defined in
src/types.ts:18