Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

235 B
Raw Blame
export function hasValidExtension(
  filename: string,
  allowedExtensions: string[]
): boolean {
  const ext = filename.slice(((filename.lastIndexOf(".") - 1) >>> 0) + 2)
  return allowedExtensions.includes(`.${ext.toLowerCase()}`)
}