Detect Capital

EasyString

Solution

export function detectCapitalUse(word: string): boolean {
  return /^[A-Z]+$|^[A-Z]?[a-z]+$/.test(word);
}