MCPcopy Create free account
hub / github.com/TruthHun/BookStack / typedArraySupport

Function typedArraySupport

static/word2md/mammoth.browser.js:9742–9752  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9740exports.kMaxLength = kMaxLength()
9741
9742function typedArraySupport () {
9743 try {
9744 var arr = new Uint8Array(1)
9745 arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
9746 return arr.foo() === 42 && // typed array instances can be augmented
9747 typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
9748 arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
9749 } catch (e) {
9750 return false
9751 }
9752}
9753
9754function kMaxLength () {
9755 return Buffer.TYPED_ARRAY_SUPPORT

Callers 1

mammoth.browser.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected