Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function isFileNameBinary (filepath) {
const ext = path.extname(filepath)
if (binextensions.includes(ext)) return true
if (textextensions.includes(ext)) return false
// dont know
}
exports.isFileNameBinary = function (filepath) {
const ext = path.extname(filepath)
if (binextensions.includes(ext)) return true
if (textextensions.includes(ext)) return false
// dont know
}
function isTextFile (filePath) {
return !binaries.includes(filePath.split('.').pop());
}
function isBinaryExtension (fileName) {
var nameParts = fileName.split('.')
if (nameParts.length > 1) {
var ext = nameParts.pop()
if (ext && BINARY_EXTENSIONS.includes(ext.toLowerCase()) === true) {
return true
}
}
return false
}
function isBinaryExtension (fileName) {
var nameParts = fileName.split('.')
if (nameParts.length > 1) {
lastTriedExt = nameParts.pop()
if (lastTriedExt && BINARY_EXTENSIONS.includes(lastTriedExt.toLowerCase()) === true) {
return true
}
}
return false
}