(i18n?: string)
| 680 | } |
| 681 | |
| 682 | function _parseMessageMeta(i18n?: string): {meaning: string; description: string; id: string} { |
| 683 | if (!i18n) return {meaning: '', description: '', id: ''}; |
| 684 | |
| 685 | const idIndex = i18n.indexOf(ID_SEPARATOR); |
| 686 | const descIndex = i18n.indexOf(MEANING_SEPARATOR); |
| 687 | const [meaningAndDesc, id] = |
| 688 | idIndex > -1 ? [i18n.slice(0, idIndex), i18n.slice(idIndex + 2)] : [i18n, '']; |
| 689 | const [meaning, description] = |
| 690 | descIndex > -1 |
| 691 | ? [meaningAndDesc.slice(0, descIndex), meaningAndDesc.slice(descIndex + 1)] |
| 692 | : ['', meaningAndDesc]; |
| 693 | |
| 694 | return {meaning, description, id: id.trim()}; |
| 695 | } |
| 696 | |
| 697 | function isTextNode(ast: html.Node[]): ast is [html.Text] { |
| 698 | return ast.length === 1 && ast[0] instanceof html.Text; |
no test coverage detected