Comparing version 1.2.0 to 1.3.0
@@ -30,2 +30,3 @@ function getSupportedLocale(wanted, available, fallback, redirects) { | ||
// eslint-disable-next-line prefer-named-capture-group,require-unicode-regexp | ||
const interpolationMatcher = /{{\s?([^{}\s]*)\s?}}/g; | ||
@@ -348,10 +349,9 @@ function mergeTranslations(target, source) { | ||
function translate(registry, locale, key, values) { | ||
var _a; | ||
const translation = registry.getTranslations(locale); | ||
const defaultTranslation = registry.getTranslations(registry.defaultLocale); // Leave || operator, don't use ?? because we want to use fallbacks on '' strings. | ||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | ||
const value = getStringByKey(translation, key) || getStringByKey(defaultTranslation, key) || key; //=> Interpolate | ||
return (_a = interpolate(value, values)) !== null && _a !== void 0 ? _a : key; | ||
return interpolate(value, values); | ||
} | ||
@@ -358,0 +358,0 @@ /** |
@@ -526,10 +526,9 @@ (function (global, factory) { | ||
function translate(registry, locale, key, values) { | ||
var _a; | ||
var translation = registry.getTranslations(locale); | ||
var defaultTranslation = registry.getTranslations(registry.defaultLocale); // Leave || operator, don't use ?? because we want to use fallbacks on '' strings. | ||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | ||
var value = getStringByKey(translation, key) || getStringByKey(defaultTranslation, key) || key; //=> Interpolate | ||
return (_a = interpolate(value, values)) !== null && _a !== void 0 ? _a : key; | ||
return interpolate(value, values); | ||
} | ||
@@ -536,0 +535,0 @@ /** |
{ | ||
"name": "@mitm/intl", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"dependencies": { | ||
"@types/express": "*" | ||
}, | ||
"peerDependencies": { | ||
"date-fns": "^2.25.0" | ||
}, | ||
"main": "./intl.umd.js", | ||
"module": "./intl.esm.js", | ||
"typings": "./index.d.ts", | ||
"dependencies": {}, | ||
"peerDependencies": { | ||
"date-fns": "^2.25.0" | ||
} | ||
"typings": "./index.d.ts" | ||
} |
45133
1017
2
+ Added@types/express@*
+ Added@types/body-parser@1.19.5(transitive)
+ Added@types/connect@3.4.38(transitive)
+ Added@types/express@5.0.0(transitive)
+ Added@types/express-serve-static-core@5.0.2(transitive)
+ Added@types/http-errors@2.0.4(transitive)
+ Added@types/mime@1.3.5(transitive)
+ Added@types/node@22.10.2(transitive)
+ Added@types/qs@6.9.17(transitive)
+ Added@types/range-parser@1.2.7(transitive)
+ Added@types/send@0.17.4(transitive)
+ Added@types/serve-static@1.15.7(transitive)
+ Addedundici-types@6.20.0(transitive)