New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@phensley/locale-matcher

Package Overview
Dependencies
Maintainers
1
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@phensley/locale-matcher - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

15

lib-es/matcher.js

@@ -34,3 +34,3 @@ import { parseLanguageTag, LanguageTag } from '@phensley/language-tag';

if (e.tag instanceof LanguageTag) {
a.push(e.tag);
a.push(e);
}

@@ -43,2 +43,3 @@ else if (e instanceof LanguageTag) {

}
var resolve = options.resolve !== false;
var result = [];

@@ -54,9 +55,15 @@ var len = raw.length;

}
else {
else if (typeof e === 'string') {
id = e.trim();
tag = parseLanguageTag(id);
}
else {
// Have a full Locale object, so optionally substitute aliases and add it
tag = e.tag;
id = e.id;
result.push(new Entry(e.id, resolve ? LanguageResolver.substituteAliases(e.tag) : e.tag));
continue;
}
// This code preserves the 'und' undefined locale. If we resolve it, adding
// likely subtags will expand it to 'en-Latn-US'.
var resolve = options.resolve !== false;
var l = tag.hasLanguage();

@@ -164,3 +171,3 @@ var s = tag.hasScript();

var distance = getDistance(desired.tag, supported.tag, threshold);
if (bestDistance === U || distance < bestDistance) {
if (distance < bestDistance) {
bestDistance = distance;

@@ -167,0 +174,0 @@ bestMatch = supported;

@@ -36,3 +36,3 @@ "use strict";

if (e.tag instanceof language_tag_1.LanguageTag) {
a.push(e.tag);
a.push(e);
}

@@ -45,2 +45,3 @@ else if (e instanceof language_tag_1.LanguageTag) {

}
var resolve = options.resolve !== false;
var result = [];

@@ -56,9 +57,15 @@ var len = raw.length;

}
else {
else if (typeof e === 'string') {
id = e.trim();
tag = language_tag_1.parseLanguageTag(id);
}
else {
// Have a full Locale object, so optionally substitute aliases and add it
tag = e.tag;
id = e.id;
result.push(new Entry(e.id, resolve ? locale_1.LanguageResolver.substituteAliases(e.tag) : e.tag));
continue;
}
// This code preserves the 'und' undefined locale. If we resolve it, adding
// likely subtags will expand it to 'en-Latn-US'.
var resolve = options.resolve !== false;
var l = tag.hasLanguage();

@@ -166,3 +173,3 @@ var s = tag.hasScript();

var distance = distance_1.getDistance(desired.tag, supported.tag, threshold);
if (bestDistance === U || distance < bestDistance) {
if (distance < bestDistance) {
bestDistance = distance;

@@ -169,0 +176,0 @@ bestMatch = supported;

{
"name": "@phensley/locale-matcher",
"version": "1.0.4",
"version": "1.0.5",
"description": "Implements CLDR enhanced language matching",

@@ -39,4 +39,4 @@ "main": "lib/index.js",

"dependencies": {
"@phensley/language-tag": "1.0.4",
"@phensley/locale": "1.0.4",
"@phensley/language-tag": "1.0.5",
"@phensley/locale": "1.0.5",
"tslib": "1.11.1"

@@ -71,3 +71,3 @@ },

},
"gitHead": "e1fcac03aa42e09bb40d806eba5299b562addc62"
"gitHead": "0e62205779ab1c474b7336bc4217c0c3afad1cae"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc