Like typedKeys, but narrows the return type to a non-empty tuple. Throws if the object has no own enumerable keys.
Object that must have at least one own enumerable key.
Same keys as typedKeys, narrowed to a non-empty tuple type.
const obj = { foo: 1, bar: "hello" };const keys = populatedKeys(obj);// ^? ["foo" | "bar", ...("foo" | "bar")[]]populatedKeys({}); // throws "Object has no keys." Copy
const obj = { foo: 1, bar: "hello" };const keys = populatedKeys(obj);// ^? ["foo" | "bar", ...("foo" | "bar")[]]populatedKeys({}); // throws "Object has no keys."
When value has no own enumerable keys.
value
Like typedKeys, but narrows the return type to a non-empty tuple. Throws if the object has no own enumerable keys.