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

Function validateValues

src/store/index.ts:460–473  ·  view source on GitHub ↗
(values: Values, skipDefaults?: 1)

Source from the content-addressed store, hash-verified

458 : encodeIfJson(cell);
459
460 const validateValues = (values: Values, skipDefaults?: 1): boolean =>
461 objValidate(
462 skipDefaults ? values : addDefaultsToValues(values),
463 (value: Value, valueId: Id): boolean =>
464 ifNotUndefined(
465 getValidatedValue(valueId, value),
466 (validValue) => {
467 values[valueId] = validValue;
468 return true;
469 },
470 () => false,
471 ) as boolean,
472 () => valueInvalid(),
473 );
474
475 const getValidatedValue = (valueId: Id, value: Value): ValueOrUndefined =>
476 hasValuesSchema

Callers 2

setValuesFunction · 0.70
setPartialValuesFunction · 0.70

Calls 4

objValidateFunction · 0.90
addDefaultsToValuesFunction · 0.70
getValidatedValueFunction · 0.70
valueInvalidFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…