UNPKG

wonder.js

Version:
42 lines (35 loc) 1.66 kB
'use strict'; var Js_option = require("bs-platform/lib/js/js_option.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"); function unsafeGet(optionData) { Contract$WonderLog.requireCheck((function (param) { return Contract$WonderLog.test(Log$WonderLog.buildAssertMessage("data exist(get by getExn)", "not"), (function (param) { return Contract$WonderLog.assertExist(optionData); })); }), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData)); return Js_option.getExn(optionData); } function unsafeGetWithMessage(msg, optionData) { Contract$WonderLog.requireCheck((function (param) { return Contract$WonderLog.test(msg, (function (param) { return Contract$WonderLog.assertExist(optionData); })); }), IsDebugMainService$Wonderjs.getIsDebug(StateDataMain$Wonderjs.stateData)); return Js_option.getExn(optionData); } function isJsonSerializedValueNone(value) { if (value === null) { return true; } else { return value === undefined; } } var unsafeGetJsonSerializedValue = unsafeGet; exports.unsafeGet = unsafeGet; exports.unsafeGetWithMessage = unsafeGetWithMessage; exports.unsafeGetJsonSerializedValue = unsafeGetJsonSerializedValue; exports.isJsonSerializedValueNone = isJsonSerializedValueNone; /* Log-WonderLog Not a pure module */