question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for `Object.hasOwn` (`lib.d.ts` and narrowing)

See original GitHub issue

Object.hasOwn(obj, key) has just moved to stage 3.

https://github.com/tc39/proposal-accessible-object-hasownproperty

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:49
  • Comments:27 (8 by maintainers)

github_iconTop GitHub Comments

18reactions
pubmikebcommented, Oct 11, 2021

Any update? Both, Node.js v.16.11+ and V8 v.95+ support Object.hasOwn out-of-box.

P.S. On 17th October Node.js 17.0 will be released.

17reactions
pubmikebcommented, Sep 7, 2021

Object.hasOwn has reached stage 4 and is finally in GA of V8/Chromium-based browsers/Node.js. It’s a time to update lib.es5.d.ts.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Object.hasOwn() - JavaScript - MDN Web Docs
The Object.hasOwn() static method returns true if the specified object has the indicated property as its own property.
Read more >
TS: type guard for ES Map, `if (map.has(key)) map.get(key)` is ...
After many experiments I finally figured it out, and I'm very happy with the result! The answer is to augment Map interface like...
Read more >
TSConfig Reference - Docs on every TSConfig option
From allowJs to useDefineForClassFields the TSConfig reference includes information about all of the active compiler flags setting up a TypeScript project.
Read more >
Eslint-config-lostfictions NPM | npm.io
(EDIT: Object.hasOwn doesn't have support yet in TypeScript's lib.d.ts , so we're waiting for that. See the tracking issue.).
Read more >
Overview - TypeScript
TypeScript 3.6 supports transforming import.meta to context.meta when your ... lib.d.ts type Readonly<T> = { readonly [K in keyof T]: T[K] } //...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found