MCPcopy Create free account
hub / github.com/EvoMap/evolver / numberField

Function numberField

src/gep/cliContracts.js:1164–1169  ·  view source on GitHub ↗
(value, key)

Source from the content-addressed store, hash-verified

1162}
1163
1164function numberField(value, key) {
1165 const obj = record(value);
1166 const raw = obj && obj[key];
1167 const n = typeof raw === 'number' ? raw : (typeof raw === 'string' && raw.trim() ? Number(raw) : NaN);
1168 return Number.isSafeInteger(n) ? n : undefined;
1169}
1170
1171function sameJson(left, right) {
1172 return JSON.stringify(left) === JSON.stringify(right);

Callers 2

creditsFromPayloadFunction · 0.70
firstNumberFieldFunction · 0.70

Calls 1

recordFunction · 0.85

Tested by

no test coverage detected