MCPcopy Create free account
hub / github.com/denoland/std / readDocuments

Method readDocuments

yaml/_loader_state.ts:1844–1858  ·  view source on GitHub ↗
(
    options: { singleDocument?: boolean } = {},
  )

Source from the content-addressed store, hash-verified

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}

Callers 4

parseFunction · 0.95
parseAllFunction · 0.95
parseFunction · 0.95
parseAllFunction · 0.95

Calls 3

#createErrorMethod · 0.95
readDocumentMethod · 0.95
eofMethod · 0.45

Tested by

no test coverage detected