npm.io
0.1.5 • Published 4 months ago

object-info

Licence
MIT
Version
0.1.5
Deps
2
Size
9 kB
Vulns
0
Weekly
0
Install scriptsThis package runs scripts during installation (preinstall/install/postinstall)

object-ext

Usage

const {
  getInfo,
  setLazyProperty
} = require("object-ext");

const object1 = ... // something

console.log(getInfo(object1));

setLazyProperty(
  object1,         // target
  "lasyProperty",  // property name
  () => Date.now() // initializer
);

Example output (getInfo)

{
  constructorName: "WeakSet",
  entries: null,
  hasIndexedLookupInterceptor: false,
  hasNamedLookupInterceptor: false,
  identityHash: 961779,
  internalFields: [],
  isCallable: false,
  isConstructor: false,
  isApiWrapper: false,
  isUndetectable: false,
  values: [ {} ]
}

Keywords