Module

std/node/buffer.ts>Buffer.isBuffer

Deno standard library
Go to Latest
method Buffer.isBuffer
import { Buffer } from "https://dotland.deno.dev/std@0.177.0/node/buffer.ts";

Returns true if obj is a Buffer, false otherwise.

import { Buffer } from 'buffer';

Buffer.isBuffer(Buffer.alloc(10)); // true
Buffer.isBuffer(Buffer.from('foo')); // true
Buffer.isBuffer('a string'); // false
Buffer.isBuffer([]); // false
Buffer.isBuffer(new Uint8Array(1024)); // false

Parameters

obj: unknown