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

Rename a given function. Tries to be cross-platform and guaranteed. Useful when you want to preserve name of bound function.
Install
npm i rename-function --saveUsage
For more use-cases see the tests
const renameFunction = require('rename-function')renameFunction
Rename given
fnwithname. If givennameis same as old, then thefnis 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'Related
- bind-context: Bind context to a function and preserves her name. Can be used… more | homepage
- function-arguments: Get arguments of a function, useful for and used in dependency injectors.… more | homepage
- is-async-function: Is function really asynchronous function? Trying to guess that based on check… more | homepage
- is-bound-function: Check if given function is bound or not. | homepage
- is-callback-function: Returns true if function is a callback. Checks its name is one… more | homepage
- parse-function: Parse a function, arrow function or string to object with name, args,… more | homepage
- smart-bind: Smarter binding of function with some context. It uses .apply instead of… more | homepage
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.