MCPcopy Create free account
hub / github.com/tinyplex/tinybase / validateValues

Function validateValues

docs/pseudo.esm.sh/tinybase@9.0.0/index.js:1153–1164  ·  view source on GitHub ↗
(values, skipDefaults)

Source from the content-addressed store, hash-verified

1151 () => cellInvalid(tableId, rowId, cellId, cell)
1152 ) : isUndefined(getCellOrValueType(cell)) ? cellInvalid(tableId, rowId, cellId, cell) : encodeIfJson(cell);
1153 const validateValues = (values, skipDefaults) => objValidate(
1154 skipDefaults ? values : addDefaultsToValues(values),
1155 (value, valueId) => ifNotUndefined(
1156 getValidatedValue(valueId, value),
1157 (validValue) => {
1158 values[valueId] = validValue;
1159 return true;
1160 },
1161 () => false
1162 ),
1163 () => valueInvalid()
1164 );
1165 const getValidatedValue = (valueId, value) => hasValuesSchema ? ifNotUndefined(
1166 mapGet(valuesSchemaMap, valueId),
1167 (valueSchema) => isNull(value) ? valueSchema[ALLOW_NULL] ? value : valueInvalid(valueId, value, valueSchema[DEFAULT]) : getCellOrValueType(value) === valueSchema[TYPE] ? encodeIfJson(value) : isJsonType(valueSchema[TYPE]) && isEncodedJson(value) ? value : valueInvalid(valueId, value, valueSchema[DEFAULT]),

Callers 2

setValuesFunction · 0.70
setPartialValuesFunction · 0.70

Calls 4

objValidateFunction · 0.70
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…