@rescript/std
Version:
The motiviation of this repo is that when ReScript users want to share their library with JS users, the JS users don't need have ReScript toolchain installed, this makes sharing code with JS users easier (more details on that topic can be found in our [Ex
30 lines (23 loc) • 601 B
JavaScript
;
var Caml_option = require("./caml_option.js");
var Caml_exceptions = require("./caml_exceptions.js");
var $$Error = "JsError";
function internalToOCamlException(e) {
if (Caml_exceptions.is_extension(e)) {
return e;
} else {
return {
RE_EXN_ID: "JsError",
_1: e
};
}
}
function as_js_exn(exn) {
if (exn.RE_EXN_ID === $$Error) {
return Caml_option.some(exn._1);
}
}
exports.$$Error = $$Error;
exports.internalToOCamlException = internalToOCamlException;
exports.as_js_exn = as_js_exn;
/* Caml_exceptions Not a pure module */