@alanscodelog/utils
    Preparing search index...

    Variable keysConst

    keys: <
        TKey extends string
        | number
        | symbol = any,
        T extends Record<TKey, any> = Record<TKey, any>,
    >(
        o: T,
    ) => Keys<T, TKey> = ...

    Because 99.999999999999% of the time we don't want the default typescript behavior of typing the keys as string[].

    #awaiting Exact Types to save us from this pain.

    This is not meant to work with arrays, but it does, returning number[] instead.

    See Keys

    Type declaration

      • <
            TKey extends string
            | number
            | symbol = any,
            T extends Record<TKey, any> = Record<TKey, any>,
        >(
            o: T,
        ): Keys<T, TKey>
      • Type Parameters

        • TKey extends string | number | symbol = any
        • T extends Record<TKey, any> = Record<TKey, any>

        Parameters

        Returns Keys<T, TKey>

    Keys [[Keys]] for more details (note the order of the type parameters are inverted for this function for convenience, e.g., you'll rarely need to pass the type of the object, it's more likely you'll want to narrow the keys).