Awesome Reviewers

When security-relevant logic maps user-controlled strings (e.g., file paths, extensions, names) or security settings to behavior, apply two rules:

1) Use own-property lookups for key→value mappings.

type IconSpec = { /* ... */ };
const BY_EXTENSION: Record<string, IconSpec> = { /* ... */ };

function safeLookup<K extends string>(table: Record<K, IconSpec>, key: string, fallback: IconSpec): IconSpec {
  return Object.hasOwn(table, key) ? table[key as K] : fallback;
}

// Example usage
const ext = (path.split(/[\\/]/).pop() ?? path).toLowerCase();
const icon = safeLookup(BY_EXTENSION, ext, /* neutral icon spec */ ({/*...*/} as IconSpec));

2) Make sandbox boundaries explicit in security-related UI text.

This prevents prototype-key confusion bugs and reduces the risk of users misunderstanding the true security guarantees of the feature.