HEX
Server: nginx/1.18.0
System: Linux srv01 5.15.0-171-generic #181-Ubuntu SMP Fri Feb 6 22:44:50 UTC 2026 x86_64
User: RaviMohan (1026)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/GemsPile/kh.gemspile.com/web/node_modules/to-data-view/test.js
const assert = require('assert')
const toDataView = require('./')

assert(toDataView(Buffer.from('test')) instanceof DataView)
assert(toDataView(new ArrayBuffer(10)) instanceof DataView)
assert(toDataView(new Int8Array(1337)) instanceof DataView)
assert(toDataView(new Uint8Array(120)) instanceof DataView)
assert(toDataView(new Uint8ClampedArray(8)) instanceof DataView)

assert.throws(() => toDataView(), TypeError)
assert.throws(() => toDataView(undefined), TypeError)
assert.throws(() => toDataView(null), TypeError)
assert.throws(() => toDataView(true), TypeError)
assert.throws(() => toDataView(false), TypeError)
assert.throws(() => toDataView(1337), TypeError)
assert.throws(() => toDataView('string'), TypeError)
assert.throws(() => toDataView([0, 1, 2]), TypeError)
assert.throws(() => toDataView({ length: 10 }), TypeError)
assert.throws(() => toDataView(/foobar/i), TypeError)
assert.throws(() => toDataView(Symbol('foobar')), TypeError)