time-to-botec/squiggle/node_modules/@rescript/std/lib/es6/js_mapperRt.js
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00

55 lines
792 B
JavaScript

function raiseWhenNotFound(x) {
if (x == null) {
throw {
RE_EXN_ID: "Not_found",
Error: new Error()
};
}
return x;
}
function fromInt(len, xs, $$enum) {
var _i = 0;
while(true) {
var i = _i;
if (i === len) {
return ;
}
var k = xs[i];
if (k === $$enum) {
return i;
}
_i = i + 1 | 0;
continue ;
};
}
function fromIntAssert(len, xs, $$enum) {
var _i = 0;
while(true) {
var i = _i;
if (i === len) {
throw {
RE_EXN_ID: "Not_found",
Error: new Error()
};
}
var k = xs[i];
if (k === $$enum) {
return i;
}
_i = i + 1 | 0;
continue ;
};
}
export {
raiseWhenNotFound ,
fromInt ,
fromIntAssert ,
}
/* No side effect */