invoke-without-new
Add capability to invoke constructors without new
.
Install
npm install --save invoke-without-new
Usage
As a function
// foo.jsconst invokeWithoutNew = { thisbar = 1 } moduleexports = // index.jsconst Foo = const foo1 = // worksconst foo2 = // works
As a decorator
// foo.jsconst invokeWithoutNew = @invokeWithoutNew { thisbar = 1 } moduleexports = Foo // index.jsconst Foo = const foo1 = // worksconst foo2 = // works
caiogondim.com · GitHub @caiogondim · Twitter @caio_gondim