diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2020-08-25 09:43:54 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-24 19:43:54 -0400 |
commit | c4d5b01acfe0cac31f94743a57e8e619178ba563 (patch) | |
tree | 1987fe2e23c4db59a44159f4c7d21ecc61be4ad3 /std/node/buffer.ts | |
parent | 9b0f9c876529696c8008dda8b3606e34d3fe98dc (diff) |
feat: update to TypeScript 4.0 (#6514)
Diffstat (limited to 'std/node/buffer.ts')
-rw-r--r-- | std/node/buffer.ts | 8 |
1 files changed, 5 insertions, 3 deletions
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<string, unknown> { return { type: "Buffer", data: Array.from(this) }; } |