MCPcopy Create free account
hub / github.com/GooGee/Entity-Builder / runCodeFile

Function runCodeFile

src/Service/runCodeFile.ts:6–31  ·  view source on GitHub ↗
(name: string, entity: LB.Entity, DataMap: Record<string, any> = {})

Source from the content-addressed store, hash-verified

4import { callCode } from "./Generator/runCode"
5
6export default function runCodeFile(name: string, entity: LB.Entity, DataMap: Record<string, any> = {}) {
7 const folder = "code" + APP_VERSION_NUMBER
8 return readFilezzInFolder(getDirectoryName(folder)).then((response) =>
9 exportDB().then((db) => {
10 const fileMap = response.data.data
11 if (name in fileMap) {
12 //
13 } else {
14 throw new Error(name + " not found")
15 }
16
17 const data = {
18 db,
19 fileMap,
20 entity,
21 result: [],
22 DataMap,
23 }
24 if (HelperCodeFileName in fileMap) {
25 callCode(fileMap[HelperCodeFileName], data)
26 }
27 callCode(fileMap[name], data)
28 return data
29 }),
30 )
31}

Callers 3

FactoryFunction · 0.85
ValidationFunction · 0.85
ConstraintListFunction · 0.85

Calls 4

readFilezzInFolderFunction · 0.90
getDirectoryNameFunction · 0.90
exportDBFunction · 0.90
callCodeFunction · 0.90

Tested by

no test coverage detected