Skip to main content

@terascope/utils / buffers

buffers

Functions

ensureBuffer()

ensureBuffer(input, encoding): Buffer

Convert an input to a Buffer if possible

Parameters

ParameterTypeDefault value
inputstring | Buffer<ArrayBufferLike>undefined
encodingBufferEncoding'utf8'

Returns

Buffer

Source

packages/utils/src/buffers.ts:6


isBuffer()

isBuffer(input): input is Buffer<ArrayBufferLike>

Check if an input is an nodejs Buffer

Parameters

ParameterType
inputunknown

Returns

input is Buffer<ArrayBufferLike>

Source

packages/utils/src/buffers.ts:19