(name: string, entity: LB.Entity, DataMap: Record<string, any> = {})
| 4 | import { callCode } from "./Generator/runCode" |
| 5 | |
| 6 | export 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 | } |
no test coverage detected