1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-28 01:59:06 -05:00

added type number to 'size' parameter (denoland/deno_std#618)

Original: f3bdf1a77b
This commit is contained in:
timonson 2019-09-29 16:11:18 +02:00 committed by Ryan Dahl
parent 04e4f10087
commit aca2253305

View file

@ -45,11 +45,11 @@ export class BufReader implements Reader {
// private lastCharSize: number;
/** return new BufReader unless r is BufReader */
static create(r: Reader, size = DEFAULT_BUF_SIZE): BufReader {
static create(r: Reader, size: number = DEFAULT_BUF_SIZE): BufReader {
return r instanceof BufReader ? r : new BufReader(r, size);
}
constructor(rd: Reader, size = DEFAULT_BUF_SIZE) {
constructor(rd: Reader, size: number = DEFAULT_BUF_SIZE) {
if (size < MIN_BUF_SIZE) {
size = MIN_BUF_SIZE;
}
@ -411,11 +411,11 @@ export class BufWriter implements Writer {
err: Error | null = null;
/** return new BufWriter unless w is BufWriter */
static create(w: Writer, size = DEFAULT_BUF_SIZE): BufWriter {
static create(w: Writer, size: number = DEFAULT_BUF_SIZE): BufWriter {
return w instanceof BufWriter ? w : new BufWriter(w, size);
}
constructor(private wr: Writer, size = DEFAULT_BUF_SIZE) {
constructor(private wr: Writer, size: number = DEFAULT_BUF_SIZE) {
if (size <= 0) {
size = DEFAULT_BUF_SIZE;
}