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;