UNPKG

@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

53 lines (47 loc) 855 B
'use strict'; 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 ; }; } exports.raiseWhenNotFound = raiseWhenNotFound; exports.fromInt = fromInt; exports.fromIntAssert = fromIntAssert; /* No side effect */