| 1 |
"use strict"; |
| 2 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 3 |
exports.operate = exports.hasLift = void 0; |
| 4 |
var isFunction_1 = require("./isFunction"); |
| 5 |
function hasLift(source) { |
| 6 |
return isFunction_1.isFunction(source === null || source === void 0 ? void 0 : source.lift); |
| 7 |
} |
| 8 |
exports.hasLift = hasLift; |
| 9 |
function operate(init) { |
| 10 |
return function (source) { |
| 11 |
if (hasLift(source)) { |
| 12 |
return source.lift(function (liftedSource) { |
| 13 |
try { |
| 14 |
return init(liftedSource, this); |
| 15 |
} |
| 16 |
catch (err) { |
| 17 |
this.error(err); |
| 18 |
} |
| 19 |
}); |
| 20 |
} |
| 21 |
throw new TypeError('Unable to lift unknown Observable type'); |
| 22 |
}; |
| 23 |
} |
| 24 |
exports.operate = operate; |
| 25 |
//# sourceMappingURL=lift.js.map |