* Check if value is an Intl.Locale object by checking for [[InitializedLocale]] internal slot * We detect this by checking if it's an Intl.Locale instance * * Per ECMA-402 #sec-canonicalizelocalelist step 7.c: * "If Type(kValue) is Object and kValue has an [[InitializedLocale]] internal slot, th
(value: any)
| 13 | * https://tc39.es/ecma402/#sec-canonicalizelocalelist |
| 14 | */ |
| 15 | function isLocaleObject(value: any): value is Intl.Locale { |
| 16 | return ( |
| 17 | typeof value === 'object' && |
| 18 | value !== null && |
| 19 | typeof value.toString === 'function' && |
| 20 | typeof value.baseName === 'string' && |
| 21 | typeof value.language === 'string' |
| 22 | ) |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * https://tc39.es/ecma402/#sec-canonicalizelocalelist |
no outgoing calls
no test coverage detected