(opts: Options = {})
| 7 | }; |
| 8 | |
| 9 | export default function transform(opts: Options = {}) { |
| 10 | const transforms = Array.isArray(opts.transforms) |
| 11 | ? opts.transforms.filter(Boolean) |
| 12 | : defaultTransforms; |
| 13 | |
| 14 | return (code: string) => |
| 15 | _transform(code, { |
| 16 | transforms, |
| 17 | // Suppresses React's `__self`/`__source` debug props. They describe a |
| 18 | // source file, and there is no file here -- this is code typed into a |
| 19 | // live editor, so sucrase emits an empty filename. React ignores both |
| 20 | // props, and React 19 treats `__self` as the signature of an outdated |
| 21 | // JSX transform and warns about it, so there is nothing to lose. |
| 22 | production: true, |
| 23 | }).code; |
| 24 | } |
no outgoing calls
no test coverage detected