bugzilla
Version:
A NodeJS module to access Bugzilla instances through the REST API.
38 lines • 987 B
JavaScript
class Executable {
constructor() {
this.promise = null;
}
isExecuting() {
return !!this.promise;
}
then(onfulfilled, onrejected) {
if (!this.promise) {
this.promise = this.execute();
}
return this.promise.then(onfulfilled, onrejected);
}
catch(onrejected) {
return this.then(undefined, onrejected);
}
finally(onfinally) {
return this.then().finally(onfinally);
}
}
export class FilteredQuery extends Executable {
constructor(exec) {
super();
this.exec = exec;
}
execute() {
return this.exec(this.includes, this.excludes);
}
include(includes) {
this.includes = includes !== null && includes !== void 0 ? includes : undefined;
return this;
}
exclude(excludes) {
this.excludes = excludes !== null && excludes !== void 0 ? excludes : undefined;
return this;
}
}
//# sourceMappingURL=query.js.map