Documentation
@tsly/obj
keys

keys

Gets the strongly-typed keys of the wrapped object.

This is functionally equivilant to Object.keys() as (keyof T)[]

import { obj } from '@tsly/obj';
 
const person = {
  firstName: "Jane",
  lastName: "Doe",
  favoriteColor: "Green",
};
 
const keys = obj(person).keys;
//    ^? ('firstName' | 'lastName' | 'favoriteColor')[]
 
console.log(keys); // ['firstName', 'lastName', 'favoriteColor']

Edit on CodeSandbox (opens in a new tab)