summaryrefslogtreecommitdiff
path: root/cli/js/buffer.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/buffer.ts')
-rw-r--r--cli/js/buffer.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/cli/js/buffer.ts b/cli/js/buffer.ts
index 3308a9a0c..4f88ff625 100644
--- a/cli/js/buffer.ts
+++ b/cli/js/buffer.ts
@@ -39,7 +39,8 @@ export class Buffer implements Reader, ReaderSync, Writer, WriterSync {
this.#buf = new Uint8Array(ab);
}
- bytes(): Uint8Array {
+ bytes(options: { copy?: boolean } = { copy: true }): Uint8Array {
+ if (options.copy === false) return this.#buf.subarray(this.#off);
return this.#buf.slice(this.#off);
}