Skip to content

Commit 853c2a6

Browse files
authored
breaking(ansi) rename .toBuffer() method to .bytes() (#606)
1 parent e9ab46a commit 853c2a6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ansi/ansi.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ export interface AnsiChain extends Chain<AnsiChain> {
1111
/** Get ansi escape sequence. */
1212
(): string;
1313

14-
/** Get ansi escape sequence. */
14+
/** Get ansi escape sequences as string. */
1515
toString(): string;
1616

17-
/** Get ansi escape sequence as Uint8Array. */
18-
toBuffer(): Uint8Array;
17+
/** Get ansi escape sequences as bytes. */
18+
bytes(): Uint8Array;
1919
}
2020

2121
/** Create new `Ansi` instance. */
@@ -47,7 +47,7 @@ export type Ansi = AnsiFactory & AnsiChain;
4747
* import { ansi } from "./mod.ts";
4848
*
4949
* await Deno.stdout.write(
50-
* ansi.cursorTo(0, 0).eraseScreen.toBuffer(),
50+
* ansi.cursorTo(0, 0).eraseScreen.bytes(),
5151
* );
5252
* ```
5353
*/
@@ -89,7 +89,7 @@ function factory(): Ansi {
8989
return this.toArray().join("");
9090
};
9191

92-
ansi.toBuffer = function (): Uint8Array {
92+
ansi.bytes = function (): Uint8Array {
9393
return encoder.encode(this.toString());
9494
};
9595

ansi/ansi_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Deno.test({
3232
.text("FOO")
3333
.eraseDown
3434
.cursorHide
35-
.toBuffer(),
35+
.bytes(),
3636
),
3737
"\x1B[2;3HFOO\x1B[0J\x1B[?25l",
3838
);

0 commit comments

Comments
 (0)