@calcit/procs
Advanced tools
Comparing version 0.2.60 to 0.2.61
@@ -452,28 +452,2 @@ var _a; | ||
}; | ||
export let wrapTailCall = (f) => { | ||
return (...args) => { | ||
if (typeof f !== "function") { | ||
debugger; | ||
throw new Error("Expected function to be called"); | ||
} | ||
var result = f.apply(null, args); | ||
var times = 0; | ||
while (result instanceof CrDataRecur) { | ||
if (f === recur) { | ||
// do not recur on itself | ||
break; | ||
} | ||
if (times > 10000) { | ||
debugger; | ||
throw new Error("Expected tail recursion to exist quickly"); | ||
} | ||
result = f.apply(null, result.args); | ||
times = times + 1; | ||
} | ||
if (result instanceof CrDataRecur) { | ||
throw new Error("Expected actual value to be returned"); | ||
} | ||
return result; | ||
}; | ||
}; | ||
export let first = (xs) => { | ||
@@ -480,0 +454,0 @@ if (xs == null) { |
@@ -507,30 +507,2 @@ import { overwriteComparator, initTernaryTreeMap } from "@calcit/ternary-tree"; | ||
export let wrapTailCall = (f: CrDataFn): CrDataFn => { | ||
return (...args: CrDataValue[]): CrDataValue => { | ||
if (typeof f !== "function") { | ||
debugger; | ||
throw new Error("Expected function to be called"); | ||
} | ||
var result = f.apply(null, args); | ||
var times = 0; | ||
while (result instanceof CrDataRecur) { | ||
if (f === recur) { | ||
// do not recur on itself | ||
break; | ||
} | ||
if (times > 10000) { | ||
debugger; | ||
throw new Error("Expected tail recursion to exist quickly"); | ||
} | ||
result = f.apply(null, result.args); | ||
times = times + 1; | ||
} | ||
if (result instanceof CrDataRecur) { | ||
throw new Error("Expected actual value to be returned"); | ||
} | ||
return result; | ||
}; | ||
}; | ||
export let first = (xs: CrDataValue): CrDataValue => { | ||
@@ -537,0 +509,0 @@ if (xs == null) { |
{ | ||
"name": "@calcit/procs", | ||
"version": "0.2.60", | ||
"version": "0.2.61", | ||
"main": "./lib/calcit.procs.js", | ||
@@ -5,0 +5,0 @@ "devDependencies": { |
98806
3680