(json: MitosisComponent, options: ToSolidOptions)
| 73 | .join('\n'); |
| 74 | |
| 75 | function addProviderComponents(json: MitosisComponent, options: ToSolidOptions) { |
| 76 | for (const key in json.context.set) { |
| 77 | const { name, value, ref } = json.context.set[key]; |
| 78 | |
| 79 | const bindingValue = value |
| 80 | ? createSingleBinding({ code: stringifyContextValue(value) }) |
| 81 | : ref |
| 82 | ? createSingleBinding({ code: ref }) |
| 83 | : undefined; |
| 84 | |
| 85 | json.children = [ |
| 86 | createMitosisNode({ |
| 87 | name: `${name}.Provider`, |
| 88 | children: json.children, |
| 89 | ...(bindingValue && { bindings: { value: bindingValue } }), |
| 90 | }), |
| 91 | ]; |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | const DEFAULT_OPTIONS: ToSolidOptions = { |
| 96 | state: 'signals', |
no test coverage detected