MCPcopy
hub / github.com/volcengine/OpenViking / num

Function num

examples/codex-memory-plugin/scripts/config.mjs:44–51  ·  view source on GitHub ↗
(val, fallback)

Source from the content-addressed store, hash-verified

42import { resolveOpenVikingCredentials } from "./ov-credentials.mjs";
43
44function num(val, fallback) {
45 if (typeof val === "number" && Number.isFinite(val)) return val;
46 if (typeof val === "string" && val.trim()) {
47 const n = Number(val);
48 if (Number.isFinite(n)) return n;
49 }
50 return fallback;
51}
52
53function str(val, fallback) {
54 if (typeof val === "string" && val.trim()) return val.trim();

Callers 1

loadConfigFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected