MCPcopy Create free account
hub / github.com/HelloCSV/HelloCSV / applyValidations

Function applyValidations

src/validators/index.ts:141–163  ·  view source on GitHub ↗
(
  sheetDefinitions: SheetDefinition[],
  sheetStates: SheetState[]
)

Source from the content-addressed store, hash-verified

139}
140
141export async function applyValidations(
142 sheetDefinitions: SheetDefinition[],
143 sheetStates: SheetState[]
144) {
145 const promises = sheetDefinitions.map(async (sheetDefinition) => {
146 const sheetData = sheetStates.find(
147 (state) => state.sheetId === sheetDefinition.id
148 );
149
150 if (sheetData) {
151 const errors = await validateSheet(
152 sheetDefinition,
153 sheetData,
154 sheetStates
155 );
156 return errors;
157 }
158 return [];
159 });
160
161 const allErrors = await Promise.all(promises);
162 return allErrors.flat();
163}

Callers 2

getStateMethod · 0.90
index.test.jsFile · 0.85

Calls 1

validateSheetFunction · 0.85

Tested by

no test coverage detected