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

Function getBinaryData

static/word2md/mammoth.browser.js:12698–12712  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

12696 * @return {String|ArrayBuffer|Uint8Array|Buffer} the data.
12697 */
12698var getBinaryData = function(file) {
12699 var result = getRawData(file),
12700 type = utils.getTypeOf(result);
12701 if (type === "string") {
12702 if (!file.options.binary) {
12703 // unicode text !
12704 // unicode string => binary string is a painful process, check if we can avoid it.
12705 if (support.nodebuffer) {
12706 return nodeBuffer(result, "utf-8");
12707 }
12708 }
12709 return file.asBinary();
12710 }
12711 return result;
12712};
12713
12714/**
12715 * Transform this._data into a string.

Callers 2

mammoth.browser.jsFile · 0.70

Calls 1

getRawDataFunction · 0.70

Tested by

no test coverage detected