@monstermann/fn
Version:
A utility library for TypeScript.
23 lines (21 loc) • 479 B
TypeScript
import { KeysOfUnion } from "type-fest";
//#region src/object/keys.d.ts
/**
* `keys(target)`
*
* Returns an array of `target` object's enumerable property names.
*
* ```ts
* keys({ a: 1, b: 2, c: 3 }); // ["a", "b", "c"]
* ```
*
* ```ts
* pipe({ a: 1, b: 2, c: 3 }, keys()); // ["a", "b", "c"]
* ```
*/
declare const keys: {
(): <T extends object>(target: T) => KeysOfUnion<T>[];
<T extends object>(target: T): KeysOfUnion<T>[];
};
//#endregion
export { keys };