Comparing version 0.0.38 to 0.0.39
@@ -8,3 +8,3 @@ import { Alpha2 } from "./CountryCode"; | ||
function toAlpha2(locale: Locale): Alpha2 | undefined; | ||
function toLocale(language: Language, alpha2: Alpha2): Locale | undefined; | ||
function toLocale(language: Language, alpha2?: Alpha2): Locale | undefined; | ||
} |
@@ -241,3 +241,30 @@ "use strict"; | ||
function toLocale(language, alpha2) { | ||
const result = language + "-" + alpha2; | ||
let result; | ||
if (alpha2) | ||
result = language + "-" + alpha2; | ||
else { | ||
result = { | ||
ca: "ca-ES", | ||
co: "co-FR", | ||
da: "da-DK", | ||
de: "de-DE", | ||
en: "en-GB", | ||
es: "es-ES", | ||
et: "et-EE", | ||
fi: "fi-FI", | ||
fr: "fr-FR", | ||
is: "is-IS", | ||
ja: "ja-JP", | ||
ko: "ko-KR", | ||
lb: "lb-LU", | ||
lt: "lt-LT", | ||
nb: "nb-NO", | ||
no: "nn-NO", | ||
nl: "nl-NL", | ||
pl: "pl-PL", | ||
pt: "pt-PT", | ||
ru: "ru-RU", | ||
sv: "sv-SE", | ||
}[language]; | ||
} | ||
return is(result) ? result : undefined; | ||
@@ -244,0 +271,0 @@ } |
{ | ||
"name": "isoly", | ||
"version": "0.0.38", | ||
"version": "0.0.39", | ||
"description": "Datatypes and functions specified by ISO-standards.", | ||
@@ -5,0 +5,0 @@ "author": "PayFunc", |
Sorry, the diff of this file is not supported yet
910387
19007