UNPKG

rjweb-server

Version:

Easy and Robust Way to create a Web Server with Many Easy-to-use Features in NodeJS

14 lines (13 loc) 357 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const decoder = new TextDecoder(); /** * Convert Buffers to ArrayBuffers to strings * @since 9.0.0 */ function toString(input) { if (input instanceof Buffer) return input.toString('utf8'); else return decoder.decode(input); } exports.default = toString;