(variables: IVariable[])
| 1011 | * @param {IVariable[]} variables |
| 1012 | */ |
| 1013 | export const prepareSandboxVars = (variables: IVariable[]) => { |
| 1014 | let vars = {} |
| 1015 | if (variables) { |
| 1016 | for (const item of variables) { |
| 1017 | let value = item.value |
| 1018 | |
| 1019 | // read from .env file |
| 1020 | if (item.type === 'runtime') { |
| 1021 | value = process.env[item.name] ?? '' |
| 1022 | } |
| 1023 | |
| 1024 | Object.defineProperty(vars, item.name, { |
| 1025 | enumerable: true, |
| 1026 | configurable: true, |
| 1027 | writable: true, |
| 1028 | value: value |
| 1029 | }) |
| 1030 | } |
| 1031 | } |
| 1032 | return vars |
| 1033 | } |
| 1034 | |
| 1035 | let version: string |
| 1036 | export const getVersion: () => Promise<{ version: string }> = async () => { |
no outgoing calls
no test coverage detected