From a804a580d09fc29b63c03bbf625b7d5bb38f2fd9 Mon Sep 17 00:00:00 2001 From: Nikolay Borzov Date: Fri, 29 Mar 2019 22:25:56 +0400 Subject: [PATCH] [btoa] Accept Buffer (#34271) --- types/btoa/btoa-tests.ts | 2 ++ types/btoa/index.d.ts | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/types/btoa/btoa-tests.ts b/types/btoa/btoa-tests.ts index 7ce230fcf7..d159bd5b7e 100644 --- a/types/btoa/btoa-tests.ts +++ b/types/btoa/btoa-tests.ts @@ -1,3 +1,5 @@ import btoa = require('btoa'); btoa('foo'); + +btoa(Buffer.from('foo')); diff --git a/types/btoa/index.d.ts b/types/btoa/index.d.ts index 4f16b77328..b4c06cf328 100644 --- a/types/btoa/index.d.ts +++ b/types/btoa/index.d.ts @@ -5,6 +5,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -declare function btoa(str: string): string; +/// + +declare function btoa(str: string | Buffer): string; export = btoa;