Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
toUtf8String(buffer){
if(isUtf8(buffer)){
return buffer.toString();
}
return iconvLite.decode(buffer, 'GB18030');
}
};
const checkEncoding = (file, data, cb) => {
if (isJSONFile(file)) cb({ isUtf8: checkIfUtf8(data) })
}