export function validateValueAsBlob()

in lib/eventstream_rpc_utils.ts [373:382]


export function validateValueAsBlob(value : any, propertyName?: string, type?: string) {
    if (value === undefined) {
        throwMissingPropertyError(propertyName, type);
    }

    /* there doesn't seem to be a good way of checking if something is an ArrayBuffer */
    if ((typeof value !== 'string') && !ArrayBuffer.isView(value) && (!value.byteLength || !value.maxByteLength)) {
        throwInvalidPropertyValueError('a value convertible to a binary payload', propertyName, type);
    }
}