{"version":3,"file":"entries.cjs","names":["purry"],"sources":["../src/entries.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-object-type --\n * We want to match the typing of the built-in Object.entries as much as\n * possible!\n */\nimport type { Simplify, ValueOf } from \"type-fest\";\nimport { purry } from \"./purry\";\nimport type { ToString } from \"./internal/types/ToString\";\n\ntype Entry<T> = Simplify<\n  ValueOf<{\n    // `Object.entries` only returns enumerable keys, skipping symbols.\n    [P in Exclude<keyof T, symbol>]-?: [\n      // and all keys are converted to strings.\n      key: ToString<P>,\n      // Optionality doesn't play a factor in the result of entries because its\n      // a typing thing, not a runtime thing. We need to remove any `undefined`\n      // added just because the prop is optional.\n      value: Required<T>[P],\n    ];\n  }>\n>;\n\n/**\n * Returns an array of key/values of the enumerable properties of an object.\n *\n * @param data - Object to return keys and values of.\n * @signature\n *    entries(object)\n * @example\n *    entries({ a: 1, b: 2, c: 3 }); // => [['a', 1], ['b', 2], ['c', 3]]\n * @dataFirst\n * @category Object\n */\nexport function entries<T extends {}>(data: T): Entry<T>[];\n\n/**\n * Returns an array of key/values of the enumerable properties of an object.\n *\n * @signature\n *    entries()(object)\n * @example\n *    pipe({ a: 1, b: 2, c: 3 }, entries()); // => [['a', 1], ['b', 2], ['c', 3]]\n * @dataLast\n * @category Object\n */\nexport function entries(): <T extends {}>(data: T) => Entry<T>[];\n\nexport function entries(...args: readonly unknown[]): unknown {\n  return purry(Object.entries, args);\n}\n"],"mappings":"kGA+CA,SAAgB,EAAQ,GAAG,EAAmC,CAC5D,OAAOA,EAAAA,MAAM,OAAO,QAAS,EAAK"}