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

Method reset

io/buffer.ts:200–203  ·  view source on GitHub ↗

* Resets the contents * * @example Usage * ```ts * import { Buffer } from "@std/io/buffer"; * import { assertEquals } from "@std/assert/equals"; * * const buf = new Buffer(); * await buf.write(new TextEncoder().encode("Hello, world!")); * buf.reset(); * assertEquals(buf

()

Source from the content-addressed store, hash-verified

198 * ```
199 */
200 reset() {
201 this.#reslice(0);
202 this.#off = 0;
203 }
204
205 #tryGrowByReslice(n: number) {
206 const l = this.#buf.byteLength;

Callers 4

truncateMethod · 0.95
readSyncMethod · 0.95
#growMethod · 0.95
buffer_test.tsFile · 0.45

Calls 1

#resliceMethod · 0.95

Tested by

no test coverage detected