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

Function toTablesSchema

src/schematizers/index.ts:51–67  ·  view source on GitHub ↗
(schemas: {[tableId: string]: any})

Source from the content-addressed store, hash-verified

49 };
50
51 const toTablesSchema = (schemas: {[tableId: string]: any}): TablesSchema => {
52 const tablesSchema: TablesSchema = objNew();
53 objForEach(schemas, (schema, tableId) => {
54 const tableSchema: {[cellId: string]: CellSchema} = objNew();
55 ifNotUndefined(getProperties(schema), (properties) =>
56 objForEach(properties, (cellSchema, cellId) =>
57 ifNotUndefined(toCellOrValueSchema(cellSchema), (cellSchema) => {
58 tableSchema[cellId] = cellSchema;
59 }),
60 ),
61 );
62 if (!objIsEmpty(tableSchema)) {
63 tablesSchema[tableId] = tableSchema;
64 }
65 });
66 return tablesSchema;
67 };
68
69 const toValuesSchema = (schemas: {[valueId: string]: any}): ValuesSchema => {
70 const valuesSchema: ValuesSchema = objNew();

Callers

nothing calls this directly

Calls 5

objNewFunction · 0.90
objForEachFunction · 0.90
objIsEmptyFunction · 0.90
toCellOrValueSchemaFunction · 0.85
getPropertiesFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…