Socket
Socket
Sign inDemoInstall

rename-function

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rename-function - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

5

CHANGELOG.md
## 1.0.2 - 2016-04-14
- Release v1.0.2 / npm@v1.0.2
- fix to work correctly for anonymous function
- allow passing context to anonymous function (kinda strange, lol)
## 1.0.1 - 2016-04-14

@@ -4,0 +9,0 @@ - Release v1.0.1 / npm@v1.0.1

4

index.js

@@ -40,6 +40,6 @@ /*!

}
if (typeof name !== 'string') return fn
name = typeof name === 'string' ? utils.namify(name) : false
if (name === utils.getFnName(fn)) return fn
name = name || ''
name = utils.namify(name)
var str = format('return function %s() { return fn.apply(ctx || this, arguments) }', name)

@@ -46,0 +46,0 @@ var func = (new Function('fn', 'ctx', str))(fn, ctx || this) // eslint-disable-line no-new-func

{
"name": "rename-function",
"version": "1.0.1",
"version": "1.0.2",
"description": "Rename a given function. Tries to be cross-platform and guaranteed. Useful when you want to preserve name of bound function. In bonus, allows passing context to the renamed function.",

@@ -5,0 +5,0 @@ "repository": "tunnckoCore/rename-function",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc