mirror of
https://github.com/tiennm99/is-a-good-dev.git
synced 2026-07-31 06:25:50 +00:00
17 lines
491 B
JavaScript
17 lines
491 B
JavaScript
const { stripExt } = require('./utils.js');
|
|
|
|
async function getFileName(file, data) {
|
|
// Extract the file name without extension
|
|
const fileNameWithoutExt = stripExt(file);
|
|
|
|
// Validate if the file name matches any of the target.RECORD_TYPE values
|
|
const recordTypes = Object.keys(data.target);
|
|
if (!recordTypes.includes(fileNameWithoutExt.toUpperCase())) {
|
|
return false;
|
|
} else {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
module.exports = getFileName;
|