MCPcopy Create free account
hub / github.com/Make-md/makemd / parseCache

Method parseCache

src/adapters/mdb/mdbAdapter.ts:57–73  ·  view source on GitHub ↗
(file: AFile, refresh: boolean)

Source from the content-addressed store, hash-verified

55 }
56
57 public async parseCache (file: AFile, refresh: boolean) {
58 await getMDB(this, file.path).then(mdb => {
59 if (!mdb) {
60 return false;
61 }
62 this.cache.set(file.path, {
63 schemas: mdb.schemas ?? [],
64 fields: mdb.fields,
65 tables: mdb.tables
66 })
67 return true;
68 }).then(f => {
69 if (f)
70 this.middleware.updateFileCache(file.path, this.cache.get(file.path), refresh);
71 })
72
73 }
74
75 public contentTypes (file: AFile) {
76 return ['schemas', 'fields', 'tables', 'field', 'table', 'schema', 'field', 'mdbTable', 'mdbTables', 'mdbFrame', 'mdbCommand', 'mdbCommands'] as Array<keyof MDBContent>;

Callers

nothing calls this directly

Calls 4

getMDBFunction · 0.90
setMethod · 0.45
updateFileCacheMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected