Files
NapCatQQ/.pnpm-store/v3/files/1e/2fc938284a192117141785fff0cdddc3eada6c60dd5e7c74214b0bc62e51cb680bb00802d88e0aab6eca9eb934c619d9ac427f9eb0e47c87b97520a304b5e4
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

21 lines
774 B
Plaintext

import { LookupSupportedLocales } from '@formatjs/intl-localematcher';
import { ToObject } from './262';
import { GetOption } from './GetOption';
/**
* https://tc39.es/ecma402/#sec-supportedlocales
* @param availableLocales
* @param requestedLocales
* @param options
*/
export function SupportedLocales(availableLocales, requestedLocales, options) {
var matcher = 'best fit';
if (options !== undefined) {
options = ToObject(options);
matcher = GetOption(options, 'localeMatcher', 'string', ['lookup', 'best fit'], 'best fit');
}
if (matcher === 'best fit') {
return LookupSupportedLocales(Array.from(availableLocales), requestedLocales);
}
return LookupSupportedLocales(Array.from(availableLocales), requestedLocales);
}