UNPKG

@n3okill/utils

Version:
11 lines 370 B
/* 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 */ export function detectEncoding(arg) { return arg.lastIndexOf(0) !== -1 ? "utf16le" : "utf8"; } //# sourceMappingURL=detectEncoding.js.map