UNPKG

@tetcoin/util

Version:
32 lines (27 loc) 851 B
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = isBuffer; var _instanceOf = _interopRequireDefault(require("./instanceOf")); // Copyright 2017-2019 @polkadot/util authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. /** * @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 '@tetcoin/util'; * * console.log('isBuffer', isBuffer(Buffer.from([]))); // => true * ``` */ function isBuffer(value) { return (0, _instanceOf.default)(value, Buffer); }