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

Function getValidatedCell

docs/pseudo.esm.sh/tinybase@9.0.0/index.js:1142–1152  ·  view source on GitHub ↗
(tableId, rowId, cellId, cell)

Source from the content-addressed store, hash-verified

1140 () => cellInvalid(tableId, rowId)
1141 );
1142 const getValidatedCell = (tableId, rowId, cellId, cell) => hasTablesSchema ? ifNotUndefined(
1143 mapGet(mapGet(tablesSchemaMap, tableId), cellId),
1144 (cellSchema) => isNull(cell) ? cellSchema[ALLOW_NULL] ? cell : cellInvalid(tableId, rowId, cellId, cell, cellSchema[DEFAULT]) : getCellOrValueType(cell) === cellSchema[TYPE] ? encodeIfJson(cell) : isJsonType(cellSchema[TYPE]) && isEncodedJson(cell) ? cell : cellInvalid(
1145 tableId,
1146 rowId,
1147 cellId,
1148 cell,
1149 cellSchema[DEFAULT]
1150 ),
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(

Callers 3

validateRowFunction · 0.70
applyRowDirectlyFunction · 0.70
setCellFunction · 0.70

Calls 8

mapGetFunction · 0.70
isNullFunction · 0.70
cellInvalidFunction · 0.70
getCellOrValueTypeFunction · 0.70
encodeIfJsonFunction · 0.70
isJsonTypeFunction · 0.70
isEncodedJsonFunction · 0.70
isUndefinedFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…