import { Extends } from '../../commonness/Extends'; import { If } from '../../commonness/If'; /** * * Returns an array of keys and values from an object. * * 객체의 키와 값을 배열로 반환합니다. * * @param T - Object type whose entries are to be extracted / 키와 값을 추출할 객체 타입 * * @returns An array of keys and values from an object / 객체의 키와 값을 배열로 반환 * * @example * interface Model { * name: string; * age: number; * locations: string[] | null; * } * * type ModelEntries = ['name', string] | ['age', number] | ['locations', string[] | null]; * * type cases = [ * Expect, ModelEntries>>, * Expect>, ModelEntries>>, * Expect, ['key', undefined]>>, * Expect, ['key', undefined]>>, * Expect, ['key', string | undefined]>>, * ] * * @link https://www.utilscript.site/docs/usage-object/entries * */ export type Entries> = NonNullable<{ [K in keyof T]: [K, If[K], never>, T[K], Required[K]>]; }[keyof T]>;