UNPKG

typedash

Version:

modern, type-safe collection of utility functions

1 lines 909 B
{"version":3,"sources":["../../src/functions/objectEntries/objectEntries.ts"],"names":[],"mappings":";AAEO,IAAM,gBAA8B,OAAO","sourcesContent":["import { CastToString, KeysOfUnion } from '../../types';\n\nexport const objectEntries: ObjetEntries = Object.entries;\n\n/**\n * Returns an array of a given object's own enumerable string-keyed property [key, value] pairs, in the same order as that provided by a for...in loop. (The only important difference is that a for...in loop enumerates properties in the prototype chain as well.)\n * Same as `Object.entries()` but returns a typed array.\n * @param object An object whose enumerable own property [key, value] pairs are to be returned.\n * @returns An array of the given object's own enumerable string-keyed property [key, value] pairs.\n */\ntype ObjetEntries = <T extends object>(\n object: T\n) => Array<[CastToString<KeysOfUnion<T>>, T[keyof T]]>;\n"]}