(
input: string,
variables: IVariable[],
flow: ICommonObject,
additionalSandbox: ICommonObject = {}
)
| 1817 | * @returns {ICommonObject} - The sandbox object |
| 1818 | */ |
| 1819 | export const createCodeExecutionSandbox = ( |
| 1820 | input: string, |
| 1821 | variables: IVariable[], |
| 1822 | flow: ICommonObject, |
| 1823 | additionalSandbox: ICommonObject = {} |
| 1824 | ): ICommonObject => { |
| 1825 | const sandbox: ICommonObject = { |
| 1826 | $input: input, |
| 1827 | util: undefined, |
| 1828 | Symbol: undefined, |
| 1829 | child_process: undefined, |
| 1830 | fs: undefined, |
| 1831 | process: undefined, |
| 1832 | ...additionalSandbox |
| 1833 | } |
| 1834 | |
| 1835 | sandbox['$vars'] = prepareSandboxVars(variables) |
| 1836 | sandbox['$flow'] = flow |
| 1837 | |
| 1838 | return sandbox |
| 1839 | } |
| 1840 | |
| 1841 | /** |
| 1842 | * Process template variables in state object, replacing {{ output }} and {{ output.property }} patterns |
no test coverage detected