diff --git a/utils/getFileName.js b/utils/getFileName.js index 10a7578..c701f26 100644 --- a/utils/getFileName.js +++ b/utils/getFileName.js @@ -2,10 +2,14 @@ const { stripExt } = require('./utils.js'); async function getFileName(file, data) { // Extract the file name without extension + console.log(file); + console.log(data); + 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 {