Returns an array of string keys from an object, trying to preserve the type of the keys.
const a = keys({ a: 1, b: 2, c: 3 }); // => ['a', 'b', 'c']a.push('d'); // Error => '"d"' is not assignable to '"a" | "b" | "c"'. Copy
const a = keys({ a: 1, b: 2, c: 3 }); // => ['a', 'b', 'c']a.push('d'); // Error => '"d"' is not assignable to '"a" | "b" | "c"'.
The object type.
The object to extract keys from.
An array of string keys.
Returns an array of string keys from an object, trying to preserve the type of the keys.
Example