From c4d5b01acfe0cac31f94743a57e8e619178ba563 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Tue, 25 Aug 2020 09:43:54 +1000 Subject: feat: update to TypeScript 4.0 (#6514) --- std/node/buffer.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'std/node/buffer.ts') diff --git a/std/node/buffer.ts b/std/node/buffer.ts index 7656803d9..c88d7f8b7 100644 --- a/std/node/buffer.ts +++ b/std/node/buffer.ts @@ -94,7 +94,9 @@ export default class Buffer extends Uint8Array { if (typeof fill === "string") { encoding = checkEncoding(encoding); if ( - typeof fill === "string" && fill.length === 1 && encoding === "utf8" + typeof fill === "string" && + fill.length === 1 && + encoding === "utf8" ) { buf.fill(fill.charCodeAt(0)); } else bufFill = Buffer.from(fill, encoding); @@ -221,7 +223,7 @@ export default class Buffer extends Uint8Array { /** * Returns true if obj is a Buffer, false otherwise. */ - static isBuffer(obj: object): obj is Buffer { + static isBuffer(obj: unknown): obj is Buffer { return obj instanceof Buffer; } @@ -408,7 +410,7 @@ export default class Buffer extends Uint8Array { * Returns a JSON representation of buf. JSON.stringify() implicitly calls * this function when stringifying a Buffer instance. */ - toJSON(): object { + toJSON(): Record { return { type: "Buffer", data: Array.from(this) }; } -- cgit v1.2.3