@lucid-softworks/object-has-own
v0.1.0
Published
An own-property check that narrows object keys.
Maintainers
Readme
@lucid-softworks/object-has-own
Check string or symbol ownership without consulting the prototype chain, and narrow an otherwise unknown object to contain the checked key.
import { hasOwn } from "@lucid-softworks/object-has-own";
if (hasOwn(value, "id")) {
value.id; // unknown
}