MCPcopy Index your code
hub / github.com/OneNoteDev/WebClipper / typedArraySupport

Function typedArraySupport

lib/sanitize-html.js:646–656  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

644exports.kMaxLength = kMaxLength()
645
646function typedArraySupport () {
647 try {
648 var arr = new Uint8Array(1)
649 arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
650 return arr.foo() === 42 && // typed array instances can be augmented
651 typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
652 arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
653 } catch (e) {
654 return false
655 }
656}
657
658function kMaxLength () {
659 return Buffer.TYPED_ARRAY_SUPPORT

Callers 1

sanitize-html.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected