UNPKG

@n3okill/utils

Version:
14 lines 481 B
"use strict"; 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