Function isBuffer

  • Returns true if the given object is a Buffer. Otherwise, returns false.

    const util = require('util');

    util.isBuffer({ length: 0 });
    // Returns: false
    util.isBuffer([]);
    // Returns: false
    util.isBuffer(Buffer.from('hello world'));
    // Returns: true

    Deprecated

    Since v4.0.0 - Use isBuffer instead.

    Parameters

    • object: unknown

    Returns object is "buffer".Buffer

  • Returns true if the given object is a Buffer. Otherwise, returns false.

    const util = require('util');

    util.isBuffer({ length: 0 });
    // Returns: false
    util.isBuffer([]);
    // Returns: false
    util.isBuffer(Buffer.from('hello world'));
    // Returns: true

    Deprecated

    Since v4.0.0 - Use isBuffer instead.

    Parameters

    • object: unknown

    Returns object is "buffer".Buffer

Generated using TypeDoc