typedash
Version:
modern, type-safe collection of utility functions
1 lines • 943 B
Source Map (JSON)
{"version":3,"file":"objectEntries-Dx2VL-5Q.cjs","names":[],"sources":["../src/functions/objectEntries/objectEntries.ts"],"sourcesContent":["import type { 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) => [CastToString<KeysOfUnion<T>>, T[keyof T]][];\n"],"mappings":";;AAEA,MAAa,gBAA8B,OAAO"}