wallet-core/node_modules/auto-bind/index.js
2017-05-28 00:40:43 +02:00

13 lines
260 B
JavaScript

'use strict';
module.exports = self => {
for (const key of Object.getOwnPropertyNames(self.constructor.prototype)) {
const val = self[key];
if (key !== 'constructor' && typeof val === 'function') {
self[key] = val.bind(self);
}
}
return self;
};