@luolapeikko/ts-common
    Preparing search index...

    Type Alias ObjectMappedArrayTuples<R>

    ObjectMappedArrayTuples: R extends EmptyObject
        ? []
        : RecordHaveWritableKeys<R> extends never
            ? NonEmptyReadonlyArray<
                { [K in keyof R]-?: [K, Exclude<R[K], undefined>] }[keyof R],
            >
            : { [K in keyof R]-?: [K, Exclude<R[K], undefined>] }[keyof R][]

    Type mapping for Object.entries as an array of tuples

    1. if R is an empty object, return type []
    2. if R has no writable keys, return type NonEmptyReadonlyArray<[K1, V1] | [K2, V2] | ...>
    3. otherwise, return type Array<[K1, V1] | [K2, V2] | ...>

    Type Parameters

    • R extends Record<string | number | symbol, unknown>

      The object shape

    The type of the values

    v0.2.5