Socket
Socket
Sign inDemoInstall

autobind-decorator

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

autobind-decorator - npm Package Compare versions

Comparing version 1.3.1 to 1.3.2

29

lib/index.js

@@ -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",

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