The JavaScript that loads external files for type checking, if on.
async function loadJsFile(check_fileNm) {
var script = document.createElement('script')
return new Promise(function (resolve) {
script.addEventListener("load", () => {
resolve()
});
script.src = check_fileNm
script.async = false
document.head.appendChild(script) }); }
async function linkUp_706_type_check(type_checks,
lib_tc_file, check_fileN, check_funcs) {
if (type_checks === false) {
return check_funcs
} else {
await loadJsFile(lib_tc_file)
await loadJsFile(check_fileN)
type_czech = TypeCzech('LOG-ERRORS')
proxies=link_up_706(type_czech, check_funcs)
return proxies } }
This 706-Type-Czech-Funcs.js file and the Type-Czech library are only loaded when "type_checks = true"
function link_up_706(type_czech, [addInt2Int_706, timesIntByInt_706]) {
function PRE_add(first_int, second_int) {
return type_czech.checkParam_type([first_int, second_int], ['number', 'number'])
}
function POST_add(sum_int) {
return type_czech.checkParam_type(sum_int, 'number')
}
addInt2Int_706 = type_czech.linkUp(addInt2Int_706, PRE_add, POST_add)
function PRE_times(first_int, second_int) {
return type_czech.checkParam_type([first_int, second_int], ['number', 'number']);
}
function POST_times(sum_int) {
return type_czech.checkParam_type(sum_int, 'number')
}
timesIntByInt_706 = type_czech.linkUp(timesIntByInt_706, PRE_times, POST_times);
return [addInt2Int_706, timesIntByInt_706]
}