Type-safe Object.keys() with overload for NonEmptyArray (To be removed)
The object shape
The object shape to get the values from
Array of object keys
To be removed
Use RecordCore.keys instead
const result1: NonEmptyReadonlyArray<'key'> = objectKeys({key: 'value'} as const);const result2: Array<'key'> = objectKeys({key: 'value'});const result3: Array<string> = objectKeys<Record<string, string>>({key: 'value'});const result4: [] = objectKeys({}); Copy
const result1: NonEmptyReadonlyArray<'key'> = objectKeys({key: 'value'} as const);const result2: Array<'key'> = objectKeys({key: 'value'});const result3: Array<string> = objectKeys<Record<string, string>>({key: 'value'});const result4: [] = objectKeys({});
v0.2.0
Type-safe Object.keys() with overload for NonEmptyArray (To be removed)