asynciterator-promiseproxy
Advanced tools
Comparing version 1.0.2 to 1.0.3
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
var tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./lib/PromiseProxyIterator"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const asynciterator_1 = require("asynciterator"); | ||
var tslib_1 = require("tslib"); | ||
var asynciterator_1 = require("asynciterator"); | ||
/** | ||
@@ -10,15 +11,19 @@ * A {@link TransformIterator} that allows the source to be set through a lazy Promise. | ||
*/ | ||
class PromiseProxyIterator extends asynciterator_1.TransformIterator { | ||
constructor(sourceGetter) { | ||
super(); | ||
this.sourceGetter = sourceGetter; | ||
var PromiseProxyIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(PromiseProxyIterator, _super); | ||
function PromiseProxyIterator(sourceGetter) { | ||
var _this = _super.call(this) || this; | ||
_this.sourceGetter = sourceGetter; | ||
return _this; | ||
} | ||
_begin(done) { | ||
this.sourceGetter().then((source) => { | ||
this.source = source; | ||
PromiseProxyIterator.prototype._begin = function (done) { | ||
var _this = this; | ||
this.sourceGetter().then(function (source) { | ||
_this.source = source; | ||
done(); | ||
}).catch((error) => this.emit('error', error)); | ||
} | ||
} | ||
}).catch(function (error) { return _this.emit('error', error); }); | ||
}; | ||
return PromiseProxyIterator; | ||
}(asynciterator_1.TransformIterator)); | ||
exports.PromiseProxyIterator = PromiseProxyIterator; | ||
//# sourceMappingURL=PromiseProxyIterator.js.map |
{ | ||
"name": "asynciterator-promiseproxy", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "An AsyncIterator proxy that allows its source to be set via a promise.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6067
44