UNPKG

@nolawnchairs/chromecast

Version:
21 lines (20 loc) 690 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function Bind(target, propertyKey, descriptor) { if (!descriptor || (typeof descriptor.value !== 'function')) { throw new TypeError("Only methods can be decorated with @Bind. <" + propertyKey + "> is not a method!"); } return { configurable: true, get: function () { var bound = descriptor.value.bind(this); Object.defineProperty(this, propertyKey, { value: bound, configurable: true, writable: true }); return bound; } }; } exports.default = Bind;