Untitled
unknown
javascript
2 years ago
587 B
11
Indexable
function myFunction() {
const folder = DriveApp.getFolderById('1IdcFDiRy0Ykznx6gLjAQSAZe8rrjkLHj');
const files = folder.getFiles();
const type = 'IOQ';
const dic = {
'IOPQ': ['tutorial', 'an toàn', 'service', 'iopq'],
'IOQ': ['tutorial', 'an toàn', 'service'],
};
const fileNames = [];
while (files.hasNext()) {
const file = files.next();
const fileName = file.getName();
fileNames.push(fileName);
}
const passed = dic[type].every(x => fileNames.join('|').toLowerCase().includes(x.toLowerCase()));
console.log(passed);
}
Editor is loading...