taraskevizer 7.1.2 → 8.0.0
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/README.md +1 -93
- package/dist/bin.js +5 -12
- package/dist/index.cjs +194 -142
- package/dist/index.d.ts +295 -109
- package/dist/index.js +193 -139
- package/package.json +4 -2
package/dist/index.js
CHANGED
|
@@ -32,6 +32,9 @@ var dictFrom = {
|
|
|
32
32
|
);
|
|
33
33
|
return dict;
|
|
34
34
|
},
|
|
35
|
+
/**
|
|
36
|
+
* Adds the global flag to all patterns in the dictionary.
|
|
37
|
+
*/
|
|
35
38
|
nonGlobal: (dict) => {
|
|
36
39
|
for (const item of dict)
|
|
37
40
|
item[0] = RegExp(item[0], "g" + item[0].flags);
|
|
@@ -2018,6 +2021,18 @@ var arabic = {
|
|
|
2018
2021
|
)
|
|
2019
2022
|
};
|
|
2020
2023
|
|
|
2024
|
+
// src/constants.ts
|
|
2025
|
+
var REPLACE_J = {
|
|
2026
|
+
NEVER: 0,
|
|
2027
|
+
RANDOM: 1,
|
|
2028
|
+
ALWAYS: 2
|
|
2029
|
+
};
|
|
2030
|
+
var VARIATION = {
|
|
2031
|
+
NO: 0,
|
|
2032
|
+
FIRST: 1,
|
|
2033
|
+
ALL: 2
|
|
2034
|
+
};
|
|
2035
|
+
|
|
2021
2036
|
// src/config.ts
|
|
2022
2037
|
var TaraskConfig = class {
|
|
2023
2038
|
constructor(options) {
|
|
@@ -2035,59 +2050,58 @@ var TaraskConfig = class {
|
|
|
2035
2050
|
}
|
|
2036
2051
|
}
|
|
2037
2052
|
}
|
|
2053
|
+
/** @see {@link TaraskOptions} */
|
|
2038
2054
|
general = {
|
|
2039
2055
|
abc: alphabets_exports.cyrillic,
|
|
2040
2056
|
j: REPLACE_J.NEVER,
|
|
2041
2057
|
doEscapeCapitalized: true
|
|
2042
2058
|
};
|
|
2059
|
+
/** @see {@link HtmlOptions} */
|
|
2043
2060
|
html = {
|
|
2044
2061
|
g: false
|
|
2045
2062
|
};
|
|
2063
|
+
/** @see {@link NonHtmlOptions} */
|
|
2046
2064
|
nonHtml = {
|
|
2047
2065
|
h: false,
|
|
2048
2066
|
ansiColors: false,
|
|
2049
2067
|
variations: VARIATION.ALL
|
|
2050
2068
|
};
|
|
2051
2069
|
};
|
|
2052
|
-
var REPLACE_J = {
|
|
2053
|
-
NEVER: 0,
|
|
2054
|
-
RANDOM: 1,
|
|
2055
|
-
ALWAYS: 2
|
|
2056
|
-
};
|
|
2057
|
-
var VARIATION = {
|
|
2058
|
-
NO: 0,
|
|
2059
|
-
FIRST: 1,
|
|
2060
|
-
ALL: 2
|
|
2061
|
-
};
|
|
2062
2070
|
|
|
2063
2071
|
// src/tarask.ts
|
|
2064
2072
|
var tarask = (text, pipeline, cfg = new TaraskConfig()) => {
|
|
2065
|
-
const options = { cfg, storage: {} };
|
|
2066
|
-
|
|
2073
|
+
const options = { text, cfg, storage: {} };
|
|
2074
|
+
for (const step of pipeline)
|
|
2075
|
+
step(options);
|
|
2076
|
+
return options.text;
|
|
2067
2077
|
};
|
|
2068
2078
|
|
|
2069
2079
|
// src/steps/index.ts
|
|
2070
2080
|
var steps_exports = {};
|
|
2071
2081
|
__export(steps_exports, {
|
|
2072
|
-
|
|
2073
|
-
|
|
2082
|
+
afterJoin: () => afterJoin,
|
|
2083
|
+
applyGHtml: () => applyGHtml,
|
|
2084
|
+
applyGNonHtml: () => applyGNonHtml,
|
|
2074
2085
|
applyNoFix: () => applyNoFix,
|
|
2075
|
-
applyNonHtmlG: () => applyNonHtmlG,
|
|
2076
|
-
applyNonHtmlVariations: () => applyNonHtmlVariations,
|
|
2077
2086
|
applyVariableParts: () => applyVariableParts,
|
|
2087
|
+
applyVariationsHtml: () => applyVariationsHtml,
|
|
2088
|
+
applyVariationsNonHtml: () => applyVariationsNonHtml,
|
|
2078
2089
|
convertAlphabet: () => convertAlphabet,
|
|
2079
2090
|
convertAlphabetLowerCase: () => convertAlphabetLowerCase,
|
|
2080
|
-
|
|
2091
|
+
finalize: () => finalize,
|
|
2081
2092
|
highlightDiffStep: () => highlightDiffStep,
|
|
2093
|
+
highlightDiffStepNonHtml: () => highlightDiffStepNonHtml,
|
|
2082
2094
|
joinSplittedText: () => joinSplittedText,
|
|
2083
2095
|
prepare: () => prepare,
|
|
2084
2096
|
replaceIbyJ: () => replaceIbyJ,
|
|
2085
2097
|
resolveSpecialSyntax: () => resolveSpecialSyntax,
|
|
2086
2098
|
restoreCaseStep: () => restoreCaseStep,
|
|
2099
|
+
restoreParentheses: () => restoreParentheses,
|
|
2087
2100
|
restoreWhitespaces: () => restoreWhitespaces,
|
|
2088
2101
|
storeSplittedAbcConvertedOrig: () => storeSplittedAbcConvertedOrig,
|
|
2089
2102
|
storeSplittedText: () => storeSplittedText,
|
|
2090
2103
|
taraskevize: () => taraskevize,
|
|
2104
|
+
toLowerCase: () => toLowerCase,
|
|
2091
2105
|
trim: () => trim,
|
|
2092
2106
|
whitespacesToSpaces: () => whitespacesToSpaces
|
|
2093
2107
|
});
|
|
@@ -2243,55 +2257,118 @@ var ansiColorWrappers = {
|
|
|
2243
2257
|
};
|
|
2244
2258
|
|
|
2245
2259
|
// src/steps/convert-alphabet.ts
|
|
2246
|
-
var convertAlphabet = (
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
general: { abc }
|
|
2254
|
-
}
|
|
2255
|
-
}) => replaceWithDict(text, abc.lower);
|
|
2260
|
+
var convertAlphabet = (options) => {
|
|
2261
|
+
const { lower, upper } = options.cfg.general.abc;
|
|
2262
|
+
options.text = replaceWithDict(replaceWithDict(options.text, lower), upper);
|
|
2263
|
+
};
|
|
2264
|
+
var convertAlphabetLowerCase = (options) => {
|
|
2265
|
+
options.text = replaceWithDict(options.text, options.cfg.general.abc.lower);
|
|
2266
|
+
};
|
|
2256
2267
|
|
|
2257
2268
|
// src/steps/highlight-diff.ts
|
|
2258
|
-
var highlightDiffStep = (highlight) => (
|
|
2269
|
+
var highlightDiffStep = (highlight) => ({
|
|
2259
2270
|
cfg: {
|
|
2260
2271
|
general: { abc }
|
|
2261
2272
|
},
|
|
2262
|
-
storage: {
|
|
2273
|
+
storage: { textArr, origArr }
|
|
2263
2274
|
}) => {
|
|
2264
|
-
highlightDiff(
|
|
2265
|
-
return _;
|
|
2275
|
+
highlightDiff(textArr, origArr, abc === alphabets_exports.cyrillic, highlight);
|
|
2266
2276
|
};
|
|
2267
|
-
var
|
|
2277
|
+
var highlightDiffStepNonHtml = ({
|
|
2268
2278
|
cfg: {
|
|
2269
2279
|
general: { abc },
|
|
2270
2280
|
nonHtml: { ansiColors }
|
|
2271
2281
|
},
|
|
2272
|
-
storage: {
|
|
2282
|
+
storage: { textArr, origArr }
|
|
2273
2283
|
}) => {
|
|
2274
2284
|
if (ansiColors)
|
|
2275
2285
|
highlightDiff(
|
|
2276
|
-
|
|
2277
|
-
|
|
2286
|
+
textArr,
|
|
2287
|
+
origArr,
|
|
2278
2288
|
abc === alphabets_exports.cyrillic,
|
|
2279
2289
|
ansiColorWrappers.fix
|
|
2280
2290
|
);
|
|
2281
|
-
|
|
2291
|
+
};
|
|
2292
|
+
|
|
2293
|
+
// src/steps/i-to-j.ts
|
|
2294
|
+
var toJ = (shortU) => "й " + (shortU ? "у" : "");
|
|
2295
|
+
var replaceIbyJ = (options) => {
|
|
2296
|
+
const { abc, j } = options.cfg.general;
|
|
2297
|
+
if (j && abc !== alphabets_exports.latinJi)
|
|
2298
|
+
options.text = options.text.replace(
|
|
2299
|
+
/(?<=[аеёіоуыэюя] )і (ў?)/g,
|
|
2300
|
+
j === REPLACE_J.ALWAYS ? ($0, $1) => toJ($1) : ($0, $1) => Math.random() >= 0.5 ? toJ($1) : $0
|
|
2301
|
+
);
|
|
2302
|
+
};
|
|
2303
|
+
|
|
2304
|
+
// src/steps/join-splitted.ts
|
|
2305
|
+
var joinSplittedText = (options) => {
|
|
2306
|
+
options.text = options.storage.textArr.join(" ");
|
|
2307
|
+
};
|
|
2308
|
+
|
|
2309
|
+
// src/steps/apply-g.ts
|
|
2310
|
+
var applyGHtml = (options) => {
|
|
2311
|
+
const colorize = htmlWrappers.letterH;
|
|
2312
|
+
if (options.cfg.general.abc === alphabets_exports.cyrillic)
|
|
2313
|
+
options.text = replaceG(
|
|
2314
|
+
options.cfg.html.g ? colorize("$&") : ($0) => colorize(gobj[$0])
|
|
2315
|
+
)(options.text);
|
|
2316
|
+
};
|
|
2317
|
+
var applyGNonHtml = (options) => {
|
|
2318
|
+
const colorize = ansiColorWrappers.variable;
|
|
2319
|
+
const {
|
|
2320
|
+
cfg: {
|
|
2321
|
+
general: { abc },
|
|
2322
|
+
nonHtml: { h, ansiColors }
|
|
2323
|
+
}
|
|
2324
|
+
} = options;
|
|
2325
|
+
if (abc === alphabets_exports.cyrillic && (h || ansiColors))
|
|
2326
|
+
options.text = replaceG(
|
|
2327
|
+
ansiColors ? h ? ($0) => colorize(gobj[$0]) : colorize("$&") : ($0) => gobj[$0]
|
|
2328
|
+
)(options.text);
|
|
2329
|
+
};
|
|
2330
|
+
|
|
2331
|
+
// src/steps/apply-variations.ts
|
|
2332
|
+
var applyVariableParts = (callback) => (options) => {
|
|
2333
|
+
options.text = options.text.replace(
|
|
2334
|
+
/\([^)]*?\)/g,
|
|
2335
|
+
($0) => callback($0.slice(1, -1).split("|"))
|
|
2336
|
+
);
|
|
2337
|
+
};
|
|
2338
|
+
var applyVariationsHtml = applyVariableParts((parts) => {
|
|
2339
|
+
const main = parts.shift();
|
|
2340
|
+
return `<tarL data-l='${parts}'>${main}</tarL>`;
|
|
2341
|
+
});
|
|
2342
|
+
var applyVariationsNonHtml = (options) => {
|
|
2343
|
+
const partIndex = options.cfg.nonHtml.variations;
|
|
2344
|
+
const colorize = ansiColorWrappers.variable;
|
|
2345
|
+
if (partIndex !== VARIATION.ALL)
|
|
2346
|
+
applyVariableParts(
|
|
2347
|
+
options.cfg.nonHtml.ansiColors ? (parts) => colorize(parts[partIndex]) : (parts) => parts[partIndex]
|
|
2348
|
+
)(options);
|
|
2349
|
+
};
|
|
2350
|
+
|
|
2351
|
+
// src/steps/prepare.ts
|
|
2352
|
+
var prepare = (options) => {
|
|
2353
|
+
options.text = options.text.replace(/г'(?![еёіюя])/g, "ґ").replace(/ - /g, " — ").replace(new RegExp("(\\p{P}|\\p{S}|\\d+)", "gu"), " $1 ").replace(/ ['`’] (?=\S)/g, "ʼ").replace(/\(/g, "(");
|
|
2282
2354
|
};
|
|
2283
2355
|
|
|
2284
2356
|
// src/steps/resolve-syntax.ts
|
|
2285
2357
|
var NOFIX_CHAR = " ";
|
|
2286
2358
|
var NOFIX_REGEX = new RegExp(NOFIX_CHAR, "g");
|
|
2287
|
-
var applyNoFix = (
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2359
|
+
var applyNoFix = (options) => {
|
|
2360
|
+
const { noFixArr } = options.storage;
|
|
2361
|
+
if (noFixArr.length)
|
|
2362
|
+
options.text = options.text.replace(NOFIX_REGEX, () => noFixArr.shift());
|
|
2363
|
+
};
|
|
2364
|
+
var resolveSpecialSyntax = (leftAngleBracket) => (options) => {
|
|
2365
|
+
const {
|
|
2366
|
+
text,
|
|
2367
|
+
storage,
|
|
2368
|
+
cfg: {
|
|
2369
|
+
general: { doEscapeCapitalized, abc }
|
|
2370
|
+
}
|
|
2371
|
+
} = options;
|
|
2295
2372
|
const noFixArr = storage.noFixArr = [];
|
|
2296
2373
|
const convertAlphavet = (abcOnlyText, abc2) => restoreCase(
|
|
2297
2374
|
replaceWithDict(abcOnlyText.toLowerCase(), abc2.lower).split(" "),
|
|
@@ -2305,8 +2382,10 @@ var resolveSpecialSyntax = (leftAngleBracket) => (text, {
|
|
|
2305
2382
|
}
|
|
2306
2383
|
) : text2;
|
|
2307
2384
|
const parts = text.split(/(?=[<>])/g);
|
|
2308
|
-
if (parts.length === 1)
|
|
2309
|
-
|
|
2385
|
+
if (parts.length === 1) {
|
|
2386
|
+
options.text = escapeCapsIfNeeded(text);
|
|
2387
|
+
return;
|
|
2388
|
+
}
|
|
2310
2389
|
let result = text.startsWith("<") ? "" : escapeCapsIfNeeded(parts.shift());
|
|
2311
2390
|
let depth = 0;
|
|
2312
2391
|
let currentPart = "";
|
|
@@ -2351,94 +2430,53 @@ var resolveSpecialSyntax = (leftAngleBracket) => (text, {
|
|
|
2351
2430
|
result += escapeCapsIfNeeded(part);
|
|
2352
2431
|
}
|
|
2353
2432
|
}
|
|
2354
|
-
|
|
2355
|
-
};
|
|
2356
|
-
|
|
2357
|
-
// src/steps/html-steps.ts
|
|
2358
|
-
var applyHtmlVariations = applyVariableParts((parts) => {
|
|
2359
|
-
const main = parts.shift();
|
|
2360
|
-
return `<tarL data-l='${parts}'>${main}</tarL>`;
|
|
2361
|
-
});
|
|
2362
|
-
var applyHtmlG = (text, {
|
|
2363
|
-
cfg: {
|
|
2364
|
-
general: { abc },
|
|
2365
|
-
html: { g }
|
|
2366
|
-
}
|
|
2367
|
-
}) => {
|
|
2368
|
-
const colorize = htmlWrappers.letterH;
|
|
2369
|
-
return abc === alphabets_exports.cyrillic ? replaceG(g ? colorize("$&") : ($0) => colorize(gobj[$0]))(text) : text;
|
|
2370
|
-
};
|
|
2371
|
-
|
|
2372
|
-
// src/steps/i-to-j.ts
|
|
2373
|
-
var toJ = (shortU) => "й " + (shortU ? "у" : "");
|
|
2374
|
-
var replaceIbyJ = (text, {
|
|
2375
|
-
cfg: {
|
|
2376
|
-
general: { j, abc }
|
|
2377
|
-
}
|
|
2378
|
-
}) => j && abc !== alphabets_exports.latinJi ? text.replace(
|
|
2379
|
-
/(?<=[аеёіоуыэюя] )і (ў?)/g,
|
|
2380
|
-
j === REPLACE_J.ALWAYS ? ($0, $1) => toJ($1) : ($0, $1) => Math.random() >= 0.5 ? toJ($1) : $0
|
|
2381
|
-
) : text;
|
|
2382
|
-
|
|
2383
|
-
// src/steps/join-splitted.ts
|
|
2384
|
-
var joinSplittedText = (_, { storage: { text } }) => text.join(" ");
|
|
2385
|
-
|
|
2386
|
-
// src/steps/non-html-steps.ts
|
|
2387
|
-
var applyNonHtmlVariations = (text, options) => {
|
|
2388
|
-
const partIndex = options.cfg.nonHtml.variations;
|
|
2389
|
-
const colorize = ansiColorWrappers.variable;
|
|
2390
|
-
return partIndex === VARIATION.ALL ? text : applyVariableParts(
|
|
2391
|
-
options.cfg.nonHtml.ansiColors ? (parts) => colorize(parts[partIndex]) : (parts) => parts[partIndex]
|
|
2392
|
-
)(text, options);
|
|
2393
|
-
};
|
|
2394
|
-
var applyNonHtmlG = (text, {
|
|
2395
|
-
cfg: {
|
|
2396
|
-
general: { abc },
|
|
2397
|
-
nonHtml: { h, ansiColors }
|
|
2398
|
-
}
|
|
2399
|
-
}) => {
|
|
2400
|
-
const colorize = ansiColorWrappers.variable;
|
|
2401
|
-
return abc === alphabets_exports.cyrillic && (h || ansiColors) ? replaceG(
|
|
2402
|
-
ansiColors ? h ? ($0) => colorize(gobj[$0]) : colorize("$&") : ($0) => gobj[$0]
|
|
2403
|
-
)(text) : text;
|
|
2433
|
+
options.text = result + escapeCapsIfNeeded(currentPart);
|
|
2404
2434
|
};
|
|
2405
2435
|
|
|
2406
|
-
// src/steps/prepare.ts
|
|
2407
|
-
var prepare = (text) => text.replace(/г'(?![еёіюя])/g, "ґ").replace(/ - /g, " — ").replace(new RegExp("(\\p{P}|\\p{S}|\\d+)", "gu"), " $1 ").replace(/ ['`’] (?=\S)/g, "ʼ").replace(/\(/g, "(");
|
|
2408
|
-
|
|
2409
2436
|
// src/steps/restore-case.ts
|
|
2410
|
-
var restoreCaseStep = (
|
|
2437
|
+
var restoreCaseStep = ({
|
|
2411
2438
|
cfg: {
|
|
2412
2439
|
general: { abc }
|
|
2413
2440
|
},
|
|
2414
|
-
storage: {
|
|
2441
|
+
storage: { textArr, origArr }
|
|
2415
2442
|
}) => {
|
|
2416
2443
|
if (abc.upper) {
|
|
2417
|
-
restoreCase(
|
|
2444
|
+
restoreCase(textArr, origArr);
|
|
2418
2445
|
} else {
|
|
2419
|
-
for (let i = 0; i <
|
|
2420
|
-
if (
|
|
2421
|
-
|
|
2446
|
+
for (let i = 0; i < textArr.length; i++) {
|
|
2447
|
+
if (origArr[i] !== origArr[i].toLowerCase())
|
|
2448
|
+
textArr[i] = origArr[i];
|
|
2422
2449
|
}
|
|
2423
2450
|
}
|
|
2424
|
-
return _;
|
|
2425
2451
|
};
|
|
2426
2452
|
|
|
2427
2453
|
// src/steps/store-splitted-abc-converted-orig.ts
|
|
2428
|
-
var storeSplittedAbcConvertedOrig = (
|
|
2429
|
-
|
|
2430
|
-
|
|
2454
|
+
var storeSplittedAbcConvertedOrig = ({
|
|
2455
|
+
cfg: {
|
|
2456
|
+
general: {
|
|
2457
|
+
abc: { lower, upper }
|
|
2458
|
+
}
|
|
2459
|
+
},
|
|
2460
|
+
text,
|
|
2461
|
+
storage
|
|
2462
|
+
}) => {
|
|
2463
|
+
storage.origArr = replaceWithDict(replaceWithDict(text, lower), upper).split(
|
|
2464
|
+
" "
|
|
2465
|
+
);
|
|
2431
2466
|
};
|
|
2432
2467
|
|
|
2433
2468
|
// src/steps/store-splitted-text.ts
|
|
2434
|
-
var storeSplittedText = (
|
|
2435
|
-
|
|
2436
|
-
|
|
2469
|
+
var storeSplittedText = ({
|
|
2470
|
+
text,
|
|
2471
|
+
storage
|
|
2472
|
+
}) => {
|
|
2473
|
+
storage.textArr = text.split(" ");
|
|
2437
2474
|
};
|
|
2438
2475
|
|
|
2439
2476
|
// src/steps/taraskevize.ts
|
|
2440
2477
|
var wordlistPlusNoSoften = wordlist.concat(noSoften);
|
|
2441
|
-
var taraskevize = (
|
|
2478
|
+
var taraskevize = (options) => {
|
|
2479
|
+
let { text } = options;
|
|
2442
2480
|
text = replaceWithDict(text, wordlistPlusNoSoften);
|
|
2443
2481
|
softening:
|
|
2444
2482
|
do {
|
|
@@ -2448,37 +2486,56 @@ var taraskevize = (text) => {
|
|
|
2448
2486
|
continue softening;
|
|
2449
2487
|
break;
|
|
2450
2488
|
} while (true);
|
|
2451
|
-
|
|
2489
|
+
options.text = replaceWithDict(text.replace(//g, ""), afterTarask);
|
|
2452
2490
|
};
|
|
2453
2491
|
|
|
2454
2492
|
// src/steps/whitespaces.ts
|
|
2455
|
-
var whitespacesToSpaces = (
|
|
2493
|
+
var whitespacesToSpaces = (options) => {
|
|
2494
|
+
const { storage } = options;
|
|
2456
2495
|
storage.spaces = [];
|
|
2457
|
-
|
|
2496
|
+
options.text = options.text.replace(/\s+/g, (match) => {
|
|
2458
2497
|
storage.spaces.push(match);
|
|
2459
2498
|
return " ";
|
|
2460
2499
|
});
|
|
2461
2500
|
};
|
|
2462
|
-
var restoreWhitespaces = (
|
|
2463
|
-
|
|
2464
|
-
|
|
2501
|
+
var restoreWhitespaces = (options) => {
|
|
2502
|
+
const { spaces } = options.storage;
|
|
2503
|
+
spaces.reverse();
|
|
2504
|
+
options.text = options.text.replace(/ /g, () => spaces.pop());
|
|
2465
2505
|
};
|
|
2466
2506
|
|
|
2467
2507
|
// src/steps/trim.ts
|
|
2468
|
-
var trim = (
|
|
2508
|
+
var trim = (options) => {
|
|
2509
|
+
options.text = ` ${options.text.trim()} `;
|
|
2510
|
+
};
|
|
2511
|
+
|
|
2512
|
+
// src/steps/other.ts
|
|
2513
|
+
var restoreParentheses = (options) => {
|
|
2514
|
+
options.text = options.text.replace(/(/g, "(");
|
|
2515
|
+
};
|
|
2516
|
+
var afterJoin = (options) => {
|
|
2517
|
+
options.text = options.text.replace(/ /g, " ").replace(new RegExp(" (\\p{P}|\\p{S}|\\d+|() ", "gu"), "$1");
|
|
2518
|
+
};
|
|
2519
|
+
var finalize = (newLine) => (options) => {
|
|
2520
|
+
options.text = options.text.replace(/\n/g, newLine).trim();
|
|
2521
|
+
};
|
|
2522
|
+
var toLowerCase = (options) => {
|
|
2523
|
+
options.text = options.text.toLowerCase();
|
|
2524
|
+
};
|
|
2469
2525
|
|
|
2470
2526
|
// src/pipelines.ts
|
|
2471
|
-
var
|
|
2472
|
-
|
|
2473
|
-
|
|
2527
|
+
var pipelines_exports = {};
|
|
2528
|
+
__export(pipelines_exports, {
|
|
2529
|
+
abcOnly: () => abcOnly,
|
|
2530
|
+
html: () => html,
|
|
2531
|
+
plainText: () => plainText
|
|
2532
|
+
});
|
|
2474
2533
|
var resolveSpecialSyntaxWithLAB = resolveSpecialSyntax("<");
|
|
2475
|
-
var toLowerCase = (text) => text.toLowerCase();
|
|
2476
2534
|
var finalizeWithNewLine = finalize("\n");
|
|
2477
|
-
var
|
|
2478
|
-
(
|
|
2535
|
+
var abcOnly = [
|
|
2536
|
+
({ storage, cfg: { general } }) => {
|
|
2479
2537
|
storage.doEscapeCapitalized = general.doEscapeCapitalized;
|
|
2480
2538
|
general.doEscapeCapitalized = false;
|
|
2481
|
-
return _;
|
|
2482
2539
|
},
|
|
2483
2540
|
trim,
|
|
2484
2541
|
resolveSpecialSyntaxWithLAB,
|
|
@@ -2490,9 +2547,8 @@ var abcOnlyPipeline = [
|
|
|
2490
2547
|
restoreParentheses,
|
|
2491
2548
|
afterJoin,
|
|
2492
2549
|
finalizeWithNewLine,
|
|
2493
|
-
(
|
|
2550
|
+
({ storage, cfg: { general } }) => {
|
|
2494
2551
|
general.doEscapeCapitalized = storage.doEscapeCapitalized;
|
|
2495
|
-
return _;
|
|
2496
2552
|
}
|
|
2497
2553
|
];
|
|
2498
2554
|
var createPipeline = (resolveSpecialSyntax2, applyG, applyVariations, finalize2, highlightDiffStep2) => [
|
|
@@ -2517,17 +2573,17 @@ var createPipeline = (resolveSpecialSyntax2, applyG, applyVariations, finalize2,
|
|
|
2517
2573
|
applyNoFix,
|
|
2518
2574
|
finalize2
|
|
2519
2575
|
];
|
|
2520
|
-
var
|
|
2576
|
+
var plainText = createPipeline(
|
|
2521
2577
|
resolveSpecialSyntaxWithLAB,
|
|
2522
|
-
|
|
2523
|
-
|
|
2578
|
+
applyGNonHtml,
|
|
2579
|
+
applyVariationsNonHtml,
|
|
2524
2580
|
finalizeWithNewLine,
|
|
2525
|
-
|
|
2581
|
+
highlightDiffStepNonHtml
|
|
2526
2582
|
);
|
|
2527
|
-
var
|
|
2583
|
+
var html = createPipeline(
|
|
2528
2584
|
resolveSpecialSyntax("<"),
|
|
2529
|
-
|
|
2530
|
-
|
|
2585
|
+
applyGHtml,
|
|
2586
|
+
applyVariationsHtml,
|
|
2531
2587
|
finalize("<br>"),
|
|
2532
2588
|
highlightDiffStep(htmlWrappers.fix)
|
|
2533
2589
|
);
|
|
@@ -2535,11 +2591,9 @@ export {
|
|
|
2535
2591
|
REPLACE_J,
|
|
2536
2592
|
TaraskConfig,
|
|
2537
2593
|
VARIATION,
|
|
2538
|
-
abcOnlyPipeline,
|
|
2539
2594
|
dict_exports as dicts,
|
|
2540
|
-
htmlPipeline,
|
|
2541
2595
|
lib_exports as lib,
|
|
2542
|
-
|
|
2596
|
+
pipelines_exports as pipelines,
|
|
2543
2597
|
steps_exports as steps,
|
|
2544
2598
|
tarask
|
|
2545
2599
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "taraskevizer",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"author": "GooseOb",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"husky": "^9.0.11",
|
|
17
17
|
"prettier": "^3.2.5",
|
|
18
18
|
"tsup": "^8.0.2",
|
|
19
|
+
"typedoc": "^0.25.13",
|
|
19
20
|
"typescript": "^5.4.5"
|
|
20
21
|
},
|
|
21
22
|
"bin": {
|
|
@@ -48,7 +49,8 @@
|
|
|
48
49
|
"test": "esrun --send-code-mode=temporaryFile test",
|
|
49
50
|
"test-cli": "bun run build && esrun --send-code-mode=temporaryFile test",
|
|
50
51
|
"prepare": "husky",
|
|
51
|
-
"typecheck": "tsc --project src/tsconfig.json"
|
|
52
|
+
"typecheck": "tsc --project src/tsconfig.json",
|
|
53
|
+
"docs": "typedoc --out docs src/index.ts --skipErrorChecking"
|
|
52
54
|
},
|
|
53
55
|
"sideEffects": false,
|
|
54
56
|
"type": "module",
|