@n3okill/utils
Version:
Many javascript helpers
18 lines • 521 B
JavaScript
/* global BufferEncoding */
Object.defineProperty(exports, "__esModule", { value: true });
exports.toString = toString;
const detectEncoding_1 = require("./detectEncoding");
/**
* Transforms argument into string
* @param arg the buffer to transform
* @param encoding the encoding to be used
* @returns
*/
function toString(arg, encoding) {
if (!encoding) {
encoding = (0, detectEncoding_1.detectEncoding)(arg);
}
return arg.toString(encoding);
}
//# sourceMappingURL=toString.js.map
;