(text: string, bom: boolean)
| 10 | } |
| 11 | |
| 12 | export function join(text: string, bom: boolean) { |
| 13 | const stripped = split(text).text |
| 14 | if (!bom) return stripped |
| 15 | return BOM + stripped |
| 16 | } |
| 17 | |
| 18 | export const readFile = Effect.fn("Bom.readFile")(function* (fs: FSUtil.Interface, filePath: string) { |
| 19 | return split(new TextDecoder("utf-8", { ignoreBOM: true }).decode(yield* fs.readFile(filePath))) |