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

Function buildState

src/importer/state.tsx:22–34  ·  view source on GitHub ↗
(
  sheetDefinitions: SheetDefinition[],
  persistenceConfig: PersistenceConfig
)

Source from the content-addressed store, hash-verified

20import { getMappedData } from '@/mapper';
21
22export async function buildState(
23 sheetDefinitions: SheetDefinition[],
24 persistenceConfig: PersistenceConfig
25): Promise<ImporterState> {
26 const defaultState = buildInitialState(sheetDefinitions);
27 try {
28 if (!persistenceConfig.enabled) return defaultState;
29
30 return await buildStateWithIndexedDB(sheetDefinitions, persistenceConfig);
31 } catch (_error) {
32 return defaultState;
33 }
34}
35
36export function buildInitialState(
37 sheetDefinitions: SheetDefinition[]

Callers 1

fetchStateFunction · 0.90

Calls 2

buildInitialStateFunction · 0.85
buildStateWithIndexedDBFunction · 0.85

Tested by

no test coverage detected