function isAssetFile(
  filePath: string,
  assetExts: $ReadOnlySet<string>,
): boolean {
  const baseName = path.basename(filePath);

  for (let i = baseName.length - 1; i >= 0; i--) {
    if (baseName[i] === '.') {
      const ext = baseName.slice(i + 1);

      if (assetExts.has(ext)) {
        return true;
      }
    }
  }

  return false;
}
Determine if a file path should be considered an asset file based on the
given `assetExts`.