entries
Gets the strongly-typed entries of the wrapped object.
This is identical to Object.entries()
, but with entries typed more narrowly than
[string, any][]
import { obj } from "@tsly/obj";
const person = {
firstName: "Jane",
lastName: "Doe",
age: 21,
};
const entries = obj(person).entries;
// ^? (["firstName", readonly "Jane"] | ["lastName", readonly "Doe"] | ["age", number])[]
console.log(entries); // [["firstName", "Jane"], ["lastName", "Doe"], ["age", 21]]