namefn

1.0.0 • Public • Published

namefn

Create an equivalent function with a new name.

var nameFn = require('namefn')

function User() {

}

console.log(new User()) // User {}

var OtherUser = nameFn('OtherUser', User)

console.log(new OtherUser()) // OtherUser {}

The original function's properties, arity and prototype are maintained with the newly named function.

See Also

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i namefn

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • timoxley