Schnuller
[ˈʃnʊlɐ]
- Silence methods of an object
- Create silenced copies
- Create objects with noop methods
Installation
yarn add schnuller
Usage
Silence console log globally
windowconsole = windowconsole 'log' console // => undefined
Silenced copies
const foo = { return `Hello ` } { return `Bye ` }const bar = foo 'bye'bar // => 'Hello World'bar // => undefinedfoo // => 'Hello World'foo // => 'Bye World'
Empty with noops
const bar = {} 'bye'bar // => undefined
Contributing
Testing
yarn test
© 2017 by Gregor Adams
Logo via onlinewebfonts