i18next-conv
Advanced tools
Comparing version 2.1.1 to 2.2.0
@@ -14,3 +14,4 @@ function regexIndexOf(value, regex, startpos) { | ||
var flat = {} | ||
, separator = options.keyseparator || '##'; | ||
, separator = options.keyseparator || '##' | ||
, ctxSeparator = options.ctxSeparator || '_'; | ||
@@ -52,6 +53,6 @@ function recurse(appendTo, obj, parentKey) { | ||
ctxKey = ctxKey.substring(0, pluralIndex); | ||
if (ctxKey.indexOf('_') > -1) context = ctxKey.substring(ctxKey.lastIndexOf('_') + 1, ctxKey.length); | ||
if (ctxKey.indexOf(ctxSeparator) > -1) context = ctxKey.substring(ctxKey.lastIndexOf(ctxSeparator) + 1, ctxKey.length); | ||
} | ||
else if (key.indexOf('_') > -1) { | ||
context = ctxKey.substring(ctxKey.lastIndexOf('_') + 1, ctxKey.length); | ||
else if (key.indexOf(ctxSeparator) > -1) { | ||
context = ctxKey.substring(ctxKey.lastIndexOf(ctxSeparator) + 1, ctxKey.length); | ||
} | ||
@@ -64,3 +65,3 @@ else { | ||
if (context !== '') key = key.replace('_' + context, ''); | ||
if (context !== '') key = key.replace(ctxSeparator + context, ''); | ||
@@ -67,0 +68,0 @@ // append or recurse |
@@ -9,3 +9,3 @@ { | ||
], | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"private": false, | ||
@@ -12,0 +12,0 @@ "preferGlobal": "true", |
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
112939
2731
0