Canonicalizes an array or single locale input into a list of valid BCP 47 locale strings.
Gracefully ignores malformed locales and strips invalid/falsy values without throwing.
Type Declaration
(locales?:unknown):readonlystring[]
Parameters
Optionallocales: unknown
Single or multiple locale identifiers or Intl.Locale instances
Canonicalizes an array or single locale input into a list of valid BCP 47 locale strings. Gracefully ignores malformed locales and strips invalid/falsy values without throwing.