taraskevizer 1.6.1 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -4
- package/dist/index.js +2 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2105,10 +2105,8 @@ for (const [raw, obj] of arr)
|
|
|
2105
2105
|
for (const [pattern, result] of raw)
|
|
2106
2106
|
obj.push([RegExp(pattern, "g"), result]);
|
|
2107
2107
|
for (const obj of [latinLetters, latinLettersUpperCase, greekLetters, greekLettersUpperCase, thWords])
|
|
2108
|
-
for (
|
|
2109
|
-
const item = obj[i];
|
|
2108
|
+
for (const item of obj)
|
|
2110
2109
|
item[0] = RegExp(item[0], "g" + item[0].flags);
|
|
2111
|
-
}
|
|
2112
2110
|
for (const word of gwords)
|
|
2113
2111
|
wordlist.push([RegExp(word.replace(/ґ/g, "г"), "g"), word]);
|
|
2114
2112
|
|
|
@@ -2339,7 +2337,7 @@ var finalizer = {
|
|
|
2339
2337
|
return `<tarL data-l='${options}'>${main}</tarL>`;
|
|
2340
2338
|
}).replace(/ \n /g, "<br>"),
|
|
2341
2339
|
nonHtml(text, options) {
|
|
2342
|
-
if (isObject(options) &&
|
|
2340
|
+
if (isObject(options) && "variations" in options && options.variations !== VARIATION.ALL) {
|
|
2343
2341
|
const WORD_INDEX = options.variations;
|
|
2344
2342
|
const replacer = ($0) => $0.slice(1, -1).split("|")[WORD_INDEX];
|
|
2345
2343
|
text = text.replace(
|
package/dist/index.js
CHANGED
|
@@ -2075,10 +2075,8 @@ for (const [raw, obj] of arr)
|
|
|
2075
2075
|
for (const [pattern, result] of raw)
|
|
2076
2076
|
obj.push([RegExp(pattern, "g"), result]);
|
|
2077
2077
|
for (const obj of [latinLetters, latinLettersUpperCase, greekLetters, greekLettersUpperCase, thWords])
|
|
2078
|
-
for (
|
|
2079
|
-
const item = obj[i];
|
|
2078
|
+
for (const item of obj)
|
|
2080
2079
|
item[0] = RegExp(item[0], "g" + item[0].flags);
|
|
2081
|
-
}
|
|
2082
2080
|
for (const word of gwords)
|
|
2083
2081
|
wordlist.push([RegExp(word.replace(/ґ/g, "г"), "g"), word]);
|
|
2084
2082
|
|
|
@@ -2309,7 +2307,7 @@ var finalizer = {
|
|
|
2309
2307
|
return `<tarL data-l='${options}'>${main}</tarL>`;
|
|
2310
2308
|
}).replace(/ \n /g, "<br>"),
|
|
2311
2309
|
nonHtml(text, options) {
|
|
2312
|
-
if (isObject(options) &&
|
|
2310
|
+
if (isObject(options) && "variations" in options && options.variations !== VARIATION.ALL) {
|
|
2313
2311
|
const WORD_INDEX = options.variations;
|
|
2314
2312
|
const replacer = ($0) => $0.slice(1, -1).split("|")[WORD_INDEX];
|
|
2315
2313
|
text = text.replace(
|