( theme: string )
| 613 | } |
| 614 | |
| 615 | export function extractThemeData( |
| 616 | theme: string |
| 617 | ): [string, string, string] | never { |
| 618 | const checksumStart = theme.indexOf('@checksum -') |
| 619 | const variablesStart = theme.indexOf('@variables -') |
| 620 | const themeStart = theme.indexOf('@theme -') |
| 621 | if (checksumStart === -1 || variablesStart === -1 || themeStart === -1) { |
| 622 | throw new Error('Unable to find checksum in theme file.') |
| 623 | } |
| 624 | const checksum = theme.substring( |
| 625 | checksumStart + 12, |
| 626 | theme.indexOf('\n', checksumStart) |
| 627 | ) as string |
| 628 | const variables = theme.substring( |
| 629 | variablesStart + 13, |
| 630 | theme.indexOf('\n', variablesStart) |
| 631 | ) as string |
| 632 | const themeName = theme.substring( |
| 633 | themeStart + 9, |
| 634 | theme.indexOf('\n', themeStart) |
| 635 | ) as string |
| 636 | return [checksum, variables, themeName] |
| 637 | } |
| 638 | |
| 639 | async function apiTheme( |
| 640 | themeName: string, |
no outgoing calls
no test coverage detected