@n3okill/utils
Version:
Many javascript helpers
14 lines • 481 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.detectEncoding = detectEncoding;
/* global BufferEncoding */
/**
* Detects buffer enconding
* This is basic helper that will only detect buffer encoding between `utf8` and `utf16le`
* @param arg the buffer to detect encoding
* @returns detected encoding
*/
function detectEncoding(arg) {
return arg.lastIndexOf(0) !== -1 ? "utf16le" : "utf8";
}
//# sourceMappingURL=detectEncoding.js.map
;