JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q22751F
  • License MIT

Rename a given function. Tries to be cross-platform and guaranteed. Useful when you want to preserve name of bound function.

Package Exports

  • rename-function

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 (rename-function) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

rename-function npmjs.com The MIT License

Rename a given function. Tries to be cross-platform and guaranteed. Useful when you want to preserve name of bound function.

code climate standard code style travis build status coverage status dependency status

Install

npm i rename-function --save

Usage

For more use-cases see the tests

const renameFunction = require('rename-function')

renameFunction

Rename given fn with name. If given name is same as old, then the fn is just returned earlier, nothing more is done.

Params

  • fn {Function}
  • name {String}
  • returns {Function}

Example

var rename = require('rename-function')
ver getName = require('get-fn-name')

var fn = rename(fixture () {}, 'abc')

console.log(getName(fn)) // => 'abc'
console.log(fn.name) // => 'abc'

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckoCore.tk keybase tunnckoCore tunnckoCore npm tunnckoCore twitter tunnckoCore github