@polkadot/util
Version:
A collection of useful utilities for @polkadot
17 lines (16 loc) • 448 B
TypeScript
import type { BufferObject } from '../types.js';
/**
* @name isBuffer
* @summary Tests for a `Buffer` object instance.
* @description
* Checks to see if the input object is an instance of `Buffer`.
* @example
* <BR>
*
* ```javascript
* import { isBuffer } from '@polkadot/util';
*
* console.log('isBuffer', isBuffer(Buffer.from([]))); // => true
* ```
*/
export declare function isBuffer<T = BufferObject>(value: unknown): value is T;