(i18n?: string)
| 635 | } |
| 636 | |
| 637 | function _parseMessageMeta(i18n?: string): {meaning: string; description: string; id: string} { |
| 638 | if (!i18n) return {meaning: '', description: '', id: ''}; |
| 639 | |
| 640 | const idIndex = i18n.indexOf(ID_SEPARATOR); |
| 641 | const descIndex = i18n.indexOf(MEANING_SEPARATOR); |
| 642 | const [meaningAndDesc, id] = |
| 643 | idIndex > -1 ? [i18n.slice(0, idIndex), i18n.slice(idIndex + 2)] : [i18n, '']; |
| 644 | const [meaning, description] = |
| 645 | descIndex > -1 |
| 646 | ? [meaningAndDesc.slice(0, descIndex), meaningAndDesc.slice(descIndex + 1)] |
| 647 | : ['', meaningAndDesc]; |
| 648 | |
| 649 | return {meaning, description, id: id.trim()}; |
| 650 | } |
| 651 | |
| 652 | function isTextNode(ast: html.Node[]): ast is [html.Text] { |
| 653 | return ast.length === 1 && ast[0] instanceof html.Text; |
no test coverage detected