aboutsummaryrefslogtreecommitdiff
path: root/node_modules/auto-bind/index.js
blob: 2cca81f6c0d023d7649115aff1776900552b3dcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
'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;
};