@segment/analytics-next
Version:
Analytics Next (aka Analytics 2.0) is the latest version of Segment’s JavaScript SDK - enabling you to send your data to any tool without having to learn, test, or use a new API every time.
17 lines • 600 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
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.default = bindAll;
//# sourceMappingURL=bind-all.js.map