CoolFace
Apppublic

AK-21/Graphite-Industrial-Intelligence

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
isBufferList.js33 linesDownload Raw Back to test
1'use strict'2 3const tape = require('tape')4const { BufferList, BufferListStream } = require('../')5const { Buffer } = require('buffer')6 7tape('isBufferList positives', (t) => {8  t.ok(BufferList.isBufferList(new BufferList()))9  t.ok(BufferList.isBufferList(new BufferListStream()))10 11  t.end()12})13 14tape('isBufferList negatives', (t) => {15  const types = [16    null,17    undefined,18    NaN,19    true,20    false,21    {},22    [],23    Buffer.alloc(0),24    [Buffer.alloc(0)]25  ]26 27  for (const obj of types) {28    t.notOk(BufferList.isBufferList(obj))29  }30 31  t.end()32})33