decodeTextStream(stream: ReadableStream<string>): ReadableStream<IniSection>
Decode a text stream into INI sections.
Transforms a stream of text chunks into a stream of IniSection objects. The text is first split into lines, then parsed into INI line objects, and finally grouped into sections.
Decode a text stream
Decode a text stream
import { decodeTextStream } from "@hertzg/wg-ini"; import { assertEquals } from "@std/assert"; const text = "[section]\nkey=value\n"; const stream = ReadableStream.from([text]); const sections = await Array.fromAsync(decodeTextStream(stream)); assertEquals(sections.length, 1); assertEquals(sections[0].section?.$section, "section");
stream: ReadableStream<string>
A readable stream of text chunks.
A readable stream of INI section objects.