@terascope/utils / buffers
buffers
Functions
ensureBuffer()
ensureBuffer(
input
,encoding
):Buffer
Convert an input to a Buffer if possible
Parameters
Parameter | Type | Default value |
---|---|---|
input | string | Buffer | undefined |
encoding | BufferEncoding | '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
Parameter | Type |
---|---|
input | unknown |
Returns
input is Buffer