autobind-decorator
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -0,1 +1,6 @@ | ||
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
/** | ||
@@ -15,7 +20,2 @@ * @copyright 2015, Andrey Popp <8mayday@gmail.com> | ||
*/ | ||
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
exports['default'] = autobind; | ||
@@ -40,4 +40,15 @@ | ||
// (Using reflect to get all keys including symbols) | ||
console.log(Object.getOwnPropertyNames(), Object.getOwnProperySymbols()); | ||
Reflect.ownKeys(target.prototype).forEach(function (key) { | ||
var keys = undefined; | ||
// Use Reflect if exists | ||
if (typeof Reflect !== 'undefined') { | ||
keys = Reflect.ownKeys(target.prototype); | ||
} else { | ||
keys = Object.getOwnPropertyNames(target.prototype); | ||
// use symbols if support is provided | ||
if (typeof Object.getOwnPropertySymbols === 'function') { | ||
keys = keys.concat(Object.getOwnPropertySymbols(target.prototype)); | ||
} | ||
} | ||
keys.forEach(function (key) { | ||
// Ignore special case target method | ||
@@ -73,2 +84,6 @@ if (key === 'constructor') { | ||
get: function get() { | ||
if (this === target.prototype) { | ||
return fn; | ||
} | ||
var boundFn = fn.bind(this); | ||
@@ -75,0 +90,0 @@ Object.defineProperty(this, key, { |
{ | ||
"name": "autobind-decorator", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "Decorator for binding method to an object", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
17206
85
0