You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

static.js 481B

1234567891011121314151617
  1. if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false
  2. var B = require('../').Buffer
  3. var test = require('tape')
  4. test('Buffer.isEncoding', function (t) {
  5. t.equal(B.isEncoding('HEX'), true)
  6. t.equal(B.isEncoding('hex'), true)
  7. t.equal(B.isEncoding('bad'), false)
  8. t.end()
  9. })
  10. test('Buffer.isBuffer', function (t) {
  11. t.equal(B.isBuffer(new B('hey', 'utf8')), true)
  12. t.equal(B.isBuffer(new B([1, 2, 3], 'utf8')), true)
  13. t.equal(B.isBuffer('hey'), false)
  14. t.end()
  15. })