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

Function from

static/word2md/mammoth.browser.js:9814–9828  ·  view source on GitHub ↗
(that, value, encodingOrOffset, length)

Source from the content-addressed store, hash-verified

9812}
9813
9814function from (that, value, encodingOrOffset, length) {
9815 if (typeof value === 'number') {
9816 throw new TypeError('"value" argument must not be a number')
9817 }
9818
9819 if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
9820 return fromArrayBuffer(that, value, encodingOrOffset, length)
9821 }
9822
9823 if (typeof value === 'string') {
9824 return fromString(that, value, encodingOrOffset)
9825 }
9826
9827 return fromObject(that, value)
9828}
9829
9830/**
9831 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError

Callers 2

BufferFunction · 0.70
mammoth.browser.jsFile · 0.70

Calls 3

fromArrayBufferFunction · 0.70
fromStringFunction · 0.70
fromObjectFunction · 0.70

Tested by

no test coverage detected