MCPcopy
hub / github.com/webpack/webpack / asString

Function asString

lib/NormalModule.js:686–691  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

684 * @returns {string} the converted string
685 */
686const asString = (input) => {
687 if (Buffer.isBuffer(input)) {
688 return input.toString("utf8");
689 }
690 return input;
691};
692
693/**
694 * @param {string | Buffer} input the input

Callers 1

processResultMethod · 0.85

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected