in cloudrun-malware-scanner/config.ts [243:266]
function validateFileExtensionList(extensionList: unknown): string[] {
if (extensionList == null) {
return [];
}
if (!(extensionList instanceof Array)) {
throw new Error('value must be an array of strings');
}
const normalizedExtensionList: string[] = [];
for (let i = 0; i < extensionList.length; i++) {
const ext = extensionList[i] as unknown;
if (typeof ext !== 'string') {
throw new Error(`value [${i}] must be a string`);
}
if (ext.length > 0 && ext[0] !== '.') {
normalizedExtensionList.push('.' + ext.toLocaleLowerCase());
} else {
normalizedExtensionList.push(ext.toLocaleLowerCase());
}
}
return normalizedExtensionList;
}