Better HN
topnewbestaskshowjobs
Log inSign up

mpoc

3 karma · joined Nov 29, 2022 (4y ago) · 1 submissions

Submissions

comment 3y ago · link · parent

"objectKeys" wrapper from https://github.com/sindresorhus/ts-extras also does this.

It would be nice if the behaviour with "as const" was different:

  const person = { name: 'John Doe', age: 35 } as const
  const result = Object.keys(person) // return type is not 'name' | 'age'