wonder.js
Version:
64 lines (56 loc) • 1.6 kB
JavaScript
;
var Caml_obj = require("bs-platform/lib/js/caml_obj.js");
var Log$WonderLog = require("wonder-log/lib/js/src/Log.js");
var Contract$WonderLog = require("wonder-log/lib/js/src/Contract.js");
var StateDataMain$Wonderjs = require("../state/main/data/StateDataMain.js");
var IsDebugMainService$Wonderjs = require("../state/main/state/IsDebugMainService.js");
var hexFloat_of_string = (
function(str) {
return parseInt(str, 16);
}
);
var convertStringToInt = (
function(str) {
return parseInt(str, 10);
}
);
function leastFloat(min, num) {
var match = num < 0;
if (match) {
return 0;
} else {
return num;
}
}
function bigThan(num, below) {
var match = Caml_obj.caml_lessthan(num, below);
if (match) {
return below;
} else {
return num;
}
}
function clamp(num, below, up) {
Contract$WonderLog.requireCheck((function (param) {
return Contract$WonderLog.test(Log$WonderLog.buildAssertMessage("below <= up", "not"), (function (param) {
return Contract$WonderLog.Operators[/* <=. */12](below, up);
}));
}), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData));
var match = num < below;
if (match) {
return below;
} else {
var match$1 = num > up;
if (match$1) {
return up;
} else {
return num;
}
}
}
exports.hexFloat_of_string = hexFloat_of_string;
exports.convertStringToInt = convertStringToInt;
exports.leastFloat = leastFloat;
exports.bigThan = bigThan;
exports.clamp = clamp;
/* hexFloat_of_string Not a pure module */