(code string, input map[string]any)
| 453 | } |
| 454 | |
| 455 | func (r *NodeJSRuntime) wrapCode(code string, input map[string]any) string { |
| 456 | inputJSON, _ := json.Marshal(input) |
| 457 | return fmt.Sprintf(`// Input data |
| 458 | const _input = %s; |
| 459 | |
| 460 | // User code |
| 461 | %s |
| 462 | `, string(inputJSON), code) |
| 463 | } |
| 464 | |
| 465 | // BashRuntime Bash 运行时 |
| 466 | type BashRuntime struct { |