• Return keys on a type as an array of strings

    Type Parameters

    • T extends object

    Returns (keyof T)[]

    Available keys

    type Person = {
    firstName: string;
    lastName: string;
    age: number;
    }

    const keys = typeKeys<Person>();
    console.log(keys); // Output: ["firstName", "lastName", "age"]