JSPM

expose-hidden

0.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q46895F

expose everything from an object to itself

Package Exports

  • expose-hidden

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (expose-hidden) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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 */)