(hooks, branch, key, lib)
| 8 | export const worker = (name) => hooks.worker[name]; |
| 9 | |
| 10 | const code = (hooks, branch, key, lib) => { |
| 11 | hooks[key] = () => { |
| 12 | const arr = lib ? [lib] : []; |
| 13 | arr.push(...branch(key)); |
| 14 | return arr.map(dedent).join("\n"); |
| 15 | }; |
| 16 | }; |
| 17 | |
| 18 | export const codeFor = (branch, type) => { |
| 19 | const pylib = type === "mpy" ? stdlib.replace(optional, "") : stdlib; |