i18next-fs-backend
Advanced tools
+4
-0
@@ -0,1 +1,5 @@ | ||
| ### 2.6.2 | ||
| - use own interpolation function instead of relying on i18next's interpolator | ||
| ### 2.6.1 | ||
@@ -2,0 +6,0 @@ |
+8
-0
@@ -9,2 +9,3 @@ "use strict"; | ||
| exports.getPath = getPath; | ||
| exports.interpolate = interpolate; | ||
| exports.pushPath = pushPath; | ||
@@ -78,2 +79,9 @@ exports.setPath = setPath; | ||
| return obj[k]; | ||
| } | ||
| var interpolationRegexp = /\{\{(.+?)\}\}/g; | ||
| function interpolate(str, data) { | ||
| return str.replace(interpolationRegexp, function (match, key) { | ||
| var value = data[key.trim()]; | ||
| return value != null ? value : match; | ||
| }); | ||
| } |
+7
-0
@@ -67,2 +67,9 @@ var arr = []; | ||
| return obj[k]; | ||
| } | ||
| var interpolationRegexp = /\{\{(.+?)\}\}/g; | ||
| export function interpolate(str, data) { | ||
| return str.replace(interpolationRegexp, function (match, key) { | ||
| var value = data[key.trim()]; | ||
| return value != null ? value : match; | ||
| }); | ||
| } |
+8
-0
@@ -71,1 +71,9 @@ const arr = [] | ||
| } | ||
| const interpolationRegexp = /\{\{(.+?)\}\}/g | ||
| export function interpolate (str, data) { | ||
| return str.replace(interpolationRegexp, (match, key) => { | ||
| const value = data[key.trim()] | ||
| return value != null ? value : match | ||
| }) | ||
| } |
+2
-2
| { | ||
| "name": "i18next-fs-backend", | ||
| "version": "2.6.1", | ||
| "version": "2.6.2", | ||
| "private": false, | ||
@@ -45,3 +45,3 @@ "type": "module", | ||
| "expect.js": "0.3.1", | ||
| "i18next": "24.0.0", | ||
| "i18next": "26.0.3", | ||
| "js-yaml": "4.1.1", | ||
@@ -48,0 +48,0 @@ "jsonc-parser": "3.3.1", |
Sorry, the diff of this file is not supported yet
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
664370
0.12%19114
0.12%