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

Function validateRow

docs/pseudo.esm.sh/tinybase@9.0.0/index.js:1130–1141  ·  view source on GitHub ↗
(tableId, rowId, row, skipDefaults)

Source from the content-addressed store, hash-verified

1128 () => cellInvalid(tableId)
1129 );
1130 const validateRow = (tableId, rowId, row, skipDefaults) => objValidate(
1131 skipDefaults ? row : addDefaultsToRow(row, tableId, rowId),
1132 (cell, cellId) => ifNotUndefined(
1133 getValidatedCell(tableId, rowId, cellId, cell),
1134 (validCell) => {
1135 row[cellId] = validCell;
1136 return true;
1137 },
1138 () => false
1139 ),
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(

Callers 4

validateTableFunction · 0.70
setRowFunction · 0.70
addRowFunction · 0.70
setPartialRowFunction · 0.70

Calls 4

objValidateFunction · 0.70
addDefaultsToRowFunction · 0.70
getValidatedCellFunction · 0.70
cellInvalidFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…