MCPcopy Index your code
hub / github.com/tinyplex/tinybase / stampValidate

Function stampValidate

src/common/stamps.ts:79–88  ·  view source on GitHub ↗
(
  stamp: Stamp<any, true>,
  validateThing: (thing: any) => boolean,
)

Source from the content-addressed store, hash-verified

77): Stamp<IdObj<To>> => stampNew(mapToObj(map, mapper), hlc);
78
79export const stampValidate = (
80 stamp: Stamp<any, true>,
81 validateThing: (thing: any) => boolean,
82) =>
83 isArray(stamp) &&
84 size(stamp) == 3 &&
85 isString(stamp[1]) &&
86 isNumber(stamp[2]) &&
87 isFiniteNumber(stamp[2]) &&
88 validateThing(stamp[0]);

Callers 1

validateMergeableContentFunction · 0.90

Calls 4

isArrayFunction · 0.90
sizeFunction · 0.90
isStringFunction · 0.90
isNumberFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…