@segment/analytics-core
Version:
This package represents core 'shared' functionality that is shared by analytics packages. This is not designed to be used directly, but internal to analytics-node and analytics-browser.
18 lines • 626 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.bindAll = void 0;
function bindAll(obj) {
var proto = obj.constructor.prototype;
for (var _i = 0, _a = Object.getOwnPropertyNames(proto); _i < _a.length; _i++) {
var key = _a[_i];
if (key !== 'constructor') {
var desc = Object.getOwnPropertyDescriptor(obj.constructor.prototype, key);
if (!!desc && typeof desc.value === 'function') {
obj[key] = obj[key].bind(obj);
}
}
}
return obj;
}
exports.bindAll = bindAll;
//# sourceMappingURL=bind-all.js.map