mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-12 00:21:08 +03:30
22 lines
619 B
JavaScript
Vendored
22 lines
619 B
JavaScript
Vendored
/** PURE_IMPORTS_START _tap,_util_EmptyError PURE_IMPORTS_END */
|
|
import { tap } from './tap';
|
|
import { EmptyError } from '../util/EmptyError';
|
|
export var throwIfEmpty = function (errorFactory) {
|
|
if (errorFactory === void 0) {
|
|
errorFactory = defaultErrorFactory;
|
|
}
|
|
return tap({
|
|
hasValue: false,
|
|
next: function () { this.hasValue = true; },
|
|
complete: function () {
|
|
if (!this.hasValue) {
|
|
throw errorFactory();
|
|
}
|
|
}
|
|
});
|
|
};
|
|
function defaultErrorFactory() {
|
|
return new EmptyError();
|
|
}
|
|
//# sourceMappingURL=throwIfEmpty.js.map
|