0.3.0 • Published 2 years ago

types-object v0.3.0

Weekly downloads
-
License
CC0-1.0
Repository
-
Last release
2 years ago

Types Object

Literally just supporting JavaScript Object() in TypeScript.

This includes typing for:

  • Object()
  • new Object()
  • Object.create()
  • Object.hasOwn()
  • Object.getPrototypeOf()
  • Object.setPrototypeOf()
const love = { is: 'real' } as const
const real = Object(love)
const know = Object.hasOwn(love, 'is')

love.is /* (property) is: "real" */

real /* const real: {
  readonly is: "real";
} */

know /* const know: true */

Usage

Add types-object to the array of types in compilerOptions, in either tsconfig.json or jsconfig.json.

{
  "compilerOptions": {
    "types": ["types-object"]
  }
}

Alternatively, use types-object/constructor if you only wish to include types for Object() and new Object()

{
  "compilerOptions": {
    "types": ["types-object/constructor"]
  }
}
0.3.0

2 years ago

0.2.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago