[btoa] Accept Buffer (#34271)

This commit is contained in:
Nikolay Borzov
2019-03-29 22:25:56 +04:00
committed by Ron Buckton
parent 59ed5920c9
commit a804a580d0
2 changed files with 5 additions and 1 deletions

View File

@@ -1,3 +1,5 @@
import btoa = require('btoa');
btoa('foo');
btoa(Buffer.from('foo'));

View File

@@ -5,6 +5,8 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
declare function btoa(str: string): string;
/// <reference types="node" />
declare function btoa(str: string | Buffer): string;
export = btoa;