(
options: { singleDocument?: boolean } = {},
)
| 1842 | } |
| 1843 | |
| 1844 | *readDocuments( |
| 1845 | options: { singleDocument?: boolean } = {}, |
| 1846 | ): Generator<unknown> { |
| 1847 | const { singleDocument = false } = options; |
| 1848 | let yielded = 0; |
| 1849 | while (!this.#scanner.eof()) { |
| 1850 | if (singleDocument && yielded > 0) { |
| 1851 | throw this.#createError( |
| 1852 | "Found more than 1 document in the stream: expected a single document", |
| 1853 | ); |
| 1854 | } |
| 1855 | yield this.readDocument(); |
| 1856 | yielded++; |
| 1857 | } |
| 1858 | } |
| 1859 | } |
no test coverage detected