npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

namefn

1.0.0

@timoxley

npmHomeRepoSnykSocket
Downloads:80
$ npm install namefn
DailyWeeklyMonthlyYearly

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

  • timoxley/beforefn
  • timoxley/afterfn
  • timoxley/guardfn

License

MIT