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 | Bufferundefined
encodingBufferEncoding'utf8'

Returns

Buffer

Source

packages/utils/src/buffers.ts:6


isBuffer()

isBuffer(input): input is Buffer

Check if an input is an nodejs Buffer

Parameters

ParameterType
inputunknown

Returns

input is Buffer

Source

packages/utils/src/buffers.ts:19