• Retrieves the keys of an object as an array of the object's keys.

    This function ensures that the returned keys are typed correctly based on the input object.

    Example

    const person = { name: 'Alice', age: 25 };
    const keys = objectKeys(person); // ['name', 'age']

    Type Parameters

    • T

    Parameters

    • object: T

      The object from which the keys will be retrieved.

    Returns (keyof T)[]