(text: string)
| 5 | const BOM = String.fromCharCode(BOM_CODE) |
| 6 | |
| 7 | export function split(text: string) { |
| 8 | if (text.charCodeAt(0) !== BOM_CODE) return { bom: false, text } |
| 9 | return { bom: true, text: text.slice(1) } |
| 10 | } |
| 11 | |
| 12 | export function join(text: string, bom: boolean) { |
| 13 | const stripped = split(text).text |