MCPcopy
hub / github.com/exceljs/exceljs / bufferToString

Function bufferToString

lib/utils/browser-buffer-decode.js:4–12  ·  view source on GitHub ↗
(chunk)

Source from the content-addressed store, hash-verified

2const textDecoder = typeof TextDecoder === 'undefined' ? null : new TextDecoder('utf-8');
3
4function bufferToString(chunk) {
5 if (typeof chunk === 'string') {
6 return chunk;
7 }
8 if (textDecoder) {
9 return textDecoder.decode(chunk);
10 }
11 return chunk.toString();
12}
13
14exports.bufferToString = bufferToString;

Callers 2

parse-sax.jsFile · 0.85
loadMethod · 0.85

Calls 2

decodeMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…