@formatjs/intl-localematcher
Advanced tools
Comparing version 0.5.3 to 0.5.4
@@ -152,6 +152,7 @@ "use strict"; | ||
} | ||
supportedLocales.forEach(function (supported, j) { | ||
supportedLocales.forEach(function (supported) { | ||
// Add some weight to the distance based on the order of the supported locales | ||
// Add penalty for the order of the requested locales | ||
var distance = findMatchingDistance(desired, supported) + j + i * 40; | ||
// Add penalty for the order of the requested locales, which currently is 0 since ECMA-402 | ||
// doesn't really have room for weighted locales like `en; q=0.1` | ||
var distance = findMatchingDistance(desired, supported) + 0 + i * 40; | ||
result.distances[desired][supported] = distance; | ||
@@ -158,0 +159,0 @@ if (distance < lowestDistance) { |
@@ -147,6 +147,7 @@ import { __spreadArray } from "tslib"; | ||
} | ||
supportedLocales.forEach(function (supported, j) { | ||
supportedLocales.forEach(function (supported) { | ||
// Add some weight to the distance based on the order of the supported locales | ||
// Add penalty for the order of the requested locales | ||
var distance = findMatchingDistance(desired, supported) + j + i * 40; | ||
// Add penalty for the order of the requested locales, which currently is 0 since ECMA-402 | ||
// doesn't really have room for weighted locales like `en; q=0.1` | ||
var distance = findMatchingDistance(desired, supported) + 0 + i * 40; | ||
result.distances[desired][supported] = distance; | ||
@@ -153,0 +154,0 @@ if (distance < lowestDistance) { |
{ | ||
"name": "@formatjs/intl-localematcher", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"description": "Intl.LocaleMatcher ponyfill", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
803407
24851