expose-hidden

expose everything from an object to itself

2 个版本
安装
npm install expose-hidden
yarn add expose-hidden
pnpm add expose-hidden
bun add expose-hidden
README

When extending objects in nodejs, Object.keys and Object.getOwnPropertyNames may not give you all of the methods on the object. Use expose hidden to re-expose the hidden methods.

const exposeHidden = require('expose-hidden')
class Eh {
  hidden1() {}
  hidden2() {}
}
const eh = new Eh()

// @returns eh, it mutates so it does not need to return, but for convenience
exposeHidden(eh, /* optional second arg is `thisArg` to rebind as needed */)
版本列表
0.0.2 2017-03-31
0.0.1 2017-03-29