1 types
ztimson edited this page 2024-09-22 03:11:09 -04:00

@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