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

Function buildStateWithIndexedDB

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

Source from the content-addressed store, hash-verified

51}
52
53async function buildStateWithIndexedDB(
54 sheetDefinitions: SheetDefinition[],
55 persistenceConfig: PersistenceConfig
56): Promise<ImporterState> {
57 const state = await getIndexedDBState(
58 sheetDefinitions,
59 persistenceConfig.customKey
60 );
61
62 if (state != null) {
63 return state;
64 }
65
66 const newState = buildInitialState(sheetDefinitions);
67 setIndexedDBState(newState, persistenceConfig.customKey);
68 return newState;
69}
70
71class StateBuilder {
72 private initialState: ImporterState;

Callers 1

buildStateFunction · 0.85

Calls 3

getIndexedDBStateFunction · 0.90
setIndexedDBStateFunction · 0.90
buildInitialStateFunction · 0.85

Tested by

no test coverage detected