@taqueria/protocol
Version:
A TypeScript package which contains types that are to be shared between @taqueria/node-sdk and @taqueria/taqueria.
56 lines (55 loc) • 2.04 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// TaqError.ts
var TaqError_exports = {};
__export(TaqError_exports, {
E_TaqError: () => E_TaqError,
create: () => create,
toFutureParseErr: () => toFutureParseErr,
toFutureParseUnknownErr: () => toFutureParseUnknownErr,
toParseErr: () => toParseErr,
toParseUnknownErr: () => toParseUnknownErr
});
module.exports = __toCommonJS(TaqError_exports);
var import_fluture = require("fluture");
var E_TaqError = class extends Error {
constructor(taqErr) {
super(taqErr.msg);
this.context = taqErr.context;
this.kind = taqErr.kind;
this.name = this.kind;
this.previous = taqErr.previous;
}
};
var toFutureParseErr = (previous, msg, context) => (0, import_fluture.reject)(toParseErr(previous, msg, context)).pipe((0, import_fluture.map)((val) => val));
var toParseErr = (previous, msg, context) => create({
kind: "E_PARSE",
msg,
context,
previous
});
var toParseUnknownErr = (previous, msg, context) => create({
kind: "E_PARSE_UNKNOWN",
msg,
context,
previous
});
var toFutureParseUnknownErr = (previous, msg, context) => (0, import_fluture.reject)(toParseUnknownErr(previous, msg, context)).pipe((0, import_fluture.map)((val) => val));
var create = (err) => err;
//# sourceMappingURL=TaqError.js.map