feat(cli): add copy argument to Buffer.bytes (#6697)

This commit is contained in:
Marcos Casagrande 2020-07-13 06:58:59 +02:00 committed by GitHub
parent 63edeb1c36
commit 1a96a96e10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 8 deletions

View file

@ -820,10 +820,12 @@ declare namespace Deno {
*
* The slice is valid for use only until the next buffer modification (that
* is, only until the next call to a method like `read()`, `write()`,
* `reset()`, or `truncate()`). The slice aliases the buffer content at
* `reset()`, or `truncate()`). If `options.copy` is false the slice aliases the buffer content at
* least until the next buffer modification, so immediate changes to the
* slice will affect the result of future reads. */
bytes(): Uint8Array;
* slice will affect the result of future reads.
* @param options Defaults to `{ copy: true }`
*/
bytes(options?: { copy?: boolean }): Uint8Array;
/** Returns whether the unread portion of the buffer is empty. */
empty(): boolean;
/** A read only number of bytes of the unread portion of the buffer. */