A spec-compliant ponyfill for Intl.LocaleMatcher. Since this is only stage-1 this package is a ponyfill instead of polyfill.
Installation#
npm i @formatjs/intl-localematcher
Requirements#
Usage#
Simple#
match(['fr-XX', 'en'], ['fr', 'en'], 'en') // 'fr'
match(['zh'], ['fr', 'en'], 'en') // 'en'