taraskevizer 8.0.10 → 8.0.11

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/config.js CHANGED
@@ -1,5 +1,5 @@
1
- import { alphabets } from './dict';
2
- import { REPLACE_J, VARIATION } from './constants';
1
+ import { alphabets } from './dict/index.js';
2
+ import { REPLACE_J, VARIATION } from './constants.js';
3
3
  export class TaraskConfig {
4
4
  constructor(options) {
5
5
  if (!options)
@@ -1,4 +1,4 @@
1
- import { dictFrom } from '../lib';
1
+ import { dictFrom } from '../lib.js';
2
2
  const soft = '\u0652(?=[еёіюяь])';
3
3
  const presoft = '([تزكثࢮбвгджзйклмнпрстфхцчшў])\u0652?(\u0651?)';
4
4
 
@@ -1,3 +1,3 @@
1
- export * from './cyrillic';
2
- export * from './latin';
3
- export * from './arabic';
1
+ export * from './cyrillic.js';
2
+ export * from './latin.js';
3
+ export * from './arabic.js';
@@ -1,5 +1,5 @@
1
- import { iwords } from '../iwords';
2
- import { dictFrom } from '../lib';
1
+ import { iwords } from '../iwords.js';
2
+ import { dictFrom } from '../lib.js';
3
3
  const common = {
4
4
  lower: ([
5
5
  [
@@ -1,5 +1,5 @@
1
1
  export * from './gobj';
2
2
  export * from './wordlist';
3
3
  export * from './softening';
4
- export * as alphabets from './alphabets';
4
+ export * as alphabets from './alphabets/index';
5
5
  export type * from './types';
@@ -1,4 +1,4 @@
1
- export * from './gobj';
2
- export * from './wordlist';
3
- export * from './softening';
4
- export * as alphabets from './alphabets';
1
+ export * from './gobj.js';
2
+ export * from './wordlist.js';
3
+ export * from './softening.js';
4
+ export * as alphabets from './alphabets/index.js';
@@ -1,4 +1,4 @@
1
- import { toOneLine } from './lib';
1
+ import { toOneLine } from './lib.js';
2
2
 
3
3
  export const iwords = toOneLine(`біс
4
4
  бсэн
@@ -1,5 +1,5 @@
1
- import { dictFrom } from './lib';
2
- import { iwords } from './iwords';
1
+ import { dictFrom } from './lib.js';
2
+ import { iwords } from './iwords.js';
3
3
  export const noSoften = dictFrom.nonGlobal([
4
4
  [/масфільм/, 'мас\ue0ffфільм'],
5
5
  [/пэндзлік/, 'пэндз\ue0ffлік'],
@@ -1,5 +1,5 @@
1
- import { iwords } from './iwords';
2
- import { dictFrom, toOneLine } from './lib';
1
+ import { iwords } from './iwords.js';
2
+ import { dictFrom, toOneLine } from './lib.js';
3
3
  const chemicalElements1 = [
4
4
  'сканд|ванад|рубід|род|ірыд|рэзэрфорд',
5
5
  'стронц|бар|цэр|лютэц|самар| тор|амэрыц|кальц|кюр|дармштат|лівэрмор|натр'
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  export type { HtmlOptions, NonHtmlOptions, TaraskOptions } from './types';
2
- export * as dicts from './dict';
2
+ export * as dicts from './dict/index';
3
3
  export * from './tarask';
4
4
  export * from './config';
5
- export * as steps from './steps';
5
+ export * as steps from './steps/index';
6
6
  export * as pipelines from './pipelines';
7
- export * as lib from './lib';
7
+ export * as lib from './lib/index';
8
8
  export { REPLACE_J, VARIATION } from './constants';
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- export * as dicts from './dict';
2
- export * from './tarask';
3
- export * from './config';
4
- export * as steps from './steps';
5
- export * as pipelines from './pipelines';
6
- export * as lib from './lib';
7
- export { REPLACE_J, VARIATION } from './constants';
1
+ export * as dicts from './dict/index.js';
2
+ export * from './tarask.js';
3
+ export * from './config.js';
4
+ export * as steps from './steps/index.js';
5
+ export * as pipelines from './pipelines.js';
6
+ export * as lib from './lib/index.js';
7
+ export { REPLACE_J, VARIATION } from './constants.js';
@@ -1,5 +1,5 @@
1
- import { replaceG } from './replace-g';
2
- import { gobj } from '../dict';
1
+ import { replaceG } from './replace-g.js';
2
+ import { gobj } from '../dict/index.js';
3
3
  export const highlightDiff = (text, orig, isCyrillic, highlight) => {
4
4
  const replaceGByOpposite = replaceG(($0) => gobj[$0]);
5
5
  for (let i = 0; i < text.length; i++) {
package/dist/lib/index.js CHANGED
@@ -1,8 +1,8 @@
1
- export * from './after-tarask';
2
- export * from './highlight-diff';
3
- export * from './replace-g';
4
- export * from './replace-with-dict';
5
- export * from './restore-case';
6
- export * from './wrappers';
7
- export * from './mutating-step';
8
- export { dictFrom } from './../dict/lib';
1
+ export * from './after-tarask.js';
2
+ export * from './highlight-diff.js';
3
+ export * from './replace-g.js';
4
+ export * from './replace-with-dict.js';
5
+ export * from './restore-case.js';
6
+ export * from './wrappers.js';
7
+ export * from './mutating-step.js';
8
+ export { dictFrom } from './../dict/lib.js';
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * @module
16
16
  */
17
- import { type TaraskStep } from './steps';
17
+ import { type TaraskStep } from './steps/index';
18
18
  /**
19
19
  * Storage for the pipeline {@link abcOnly}.
20
20
  */
@@ -28,7 +28,7 @@ type AbcOnlyStorage = {
28
28
  *
29
29
  * To see the full list of steps, check the source code.
30
30
  */
31
- export declare const abcOnly: (TaraskStep<import("./steps").SpecialSyntaxStorage> | TaraskStep<import("./steps").WhiteSpaceStorage> | (({ storage, cfg: { general } }: {
31
+ export declare const abcOnly: (TaraskStep<import("./steps/resolve-syntax").SpecialSyntaxStorage> | TaraskStep<import("./steps/whitespaces").WhiteSpaceStorage> | (({ storage, cfg: { general } }: {
32
32
  text: string;
33
33
  storage: AbcOnlyStorage;
34
34
  cfg: import("./config").TaraskConfig;
@@ -36,13 +36,13 @@ export declare const abcOnly: (TaraskStep<import("./steps").SpecialSyntaxStorage
36
36
  /**
37
37
  * Pipeline for taraskevizing into plain text.
38
38
  */
39
- export declare const plainText: (TaraskStep<import("./steps").SplittedTextStorage> | TaraskStep<import("./steps").SpecialSyntaxStorage> | TaraskStep<import("./steps").WhiteSpaceStorage>)[];
39
+ export declare const plainText: (TaraskStep<import("./steps/types").SplittedTextStorage> | TaraskStep<import("./steps/resolve-syntax").SpecialSyntaxStorage> | TaraskStep<import("./steps/whitespaces").WhiteSpaceStorage>)[];
40
40
  /**
41
41
  * Pipeline for taraskevizing into HTML.
42
42
  */
43
- export declare const html: (TaraskStep<import("./steps").SplittedTextStorage> | TaraskStep<import("./steps").SpecialSyntaxStorage> | TaraskStep<import("./steps").WhiteSpaceStorage>)[];
43
+ export declare const html: (TaraskStep<import("./steps/types").SplittedTextStorage> | TaraskStep<import("./steps/resolve-syntax").SpecialSyntaxStorage> | TaraskStep<import("./steps/whitespaces").WhiteSpaceStorage>)[];
44
44
  /**
45
45
  * Pipeline for phonetizing.
46
46
  */
47
- export declare const phonetic: (TaraskStep<import("./steps").SpecialSyntaxStorage> | TaraskStep<import("./steps").WhiteSpaceStorage>)[];
47
+ export declare const phonetic: (TaraskStep<import("./steps/resolve-syntax").SpecialSyntaxStorage> | TaraskStep<import("./steps/whitespaces").WhiteSpaceStorage>)[];
48
48
  export {};
package/dist/pipelines.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
- import { applyVariationsHtml, applyVariationsNonHtml, applyGHtml, applyGNonHtml, highlightDiffStep, highlightDiffStepNonHtml, applyNoFix, convertAlphabet, convertAlphabetLowerCase, joinSplittedText, prepare, replaceIbyJ, resolveSpecialSyntax, restoreCaseStep, restoreWhitespaces, storeSplittedAbcConvertedOrig, storeSplittedText, taraskevize, whitespacesToSpaces, trim, finalize, toLowerCase, } from './steps';
3
- import { htmlWrappers } from './lib/wrappers';
2
+ import { applyVariationsHtml, applyVariationsNonHtml, applyGHtml, applyGNonHtml, highlightDiffStep, highlightDiffStepNonHtml, applyNoFix, convertAlphabet, convertAlphabetLowerCase, joinSplittedText, prepare, replaceIbyJ, resolveSpecialSyntax, restoreCaseStep, restoreWhitespaces, storeSplittedAbcConvertedOrig, storeSplittedText, taraskevize, whitespacesToSpaces, trim, finalize, toLowerCase, } from './steps/index.js';
3
+ import { htmlWrappers } from './lib/wrappers.js';
4
4
  const resolveSpecialSyntaxWithLAB = resolveSpecialSyntax('<');
5
5
  const finalizeWithNewLine = finalize('\n');
6
6
 
@@ -1,6 +1,5 @@
1
- import { replaceG, ansiColorWrappers, htmlWrappers } from '../lib';
2
- import { alphabets } from '../dict';
3
- import { gobj } from '../dict';
1
+ import { replaceG, ansiColorWrappers, htmlWrappers } from '../lib/index.js';
2
+ import { alphabets, gobj } from '../dict/index.js';
4
3
  export const applyGHtml = (options) => {
5
4
  const colorize = htmlWrappers.letterH;
6
5
  if (options.cfg.general.abc === alphabets.cyrillic)
@@ -1,5 +1,5 @@
1
- import { ansiColorWrappers, mutatingStep } from '../lib';
2
- import { VARIATION } from '../constants';
1
+ import { ansiColorWrappers, mutatingStep } from '../lib/index.js';
2
+ import { VARIATION } from '../constants.js';
3
3
 
4
4
  export const applyVariableParts = (callback) => mutatingStep(({ text }) => text.replace(/\([^)]*?\)/g, ($0) => callback($0.slice(1, -1).split('|'))));
5
5
 
@@ -1,3 +1,3 @@
1
- import { mutatingStep, replaceWithDict } from '../lib';
1
+ import { mutatingStep, replaceWithDict } from '../lib/index.js';
2
2
  export const convertAlphabet = mutatingStep(({ text, cfg: { general: { abc: { upper, lower }, }, }, }) => replaceWithDict(replaceWithDict(text, lower), upper));
3
3
  export const convertAlphabetLowerCase = mutatingStep(({ text, cfg: { general: { abc: { lower }, }, }, }) => replaceWithDict(text, lower));
@@ -1,4 +1,4 @@
1
- import { mutatingStep } from '../lib';
1
+ import { mutatingStep } from '../lib/index.js';
2
2
 
3
3
  export const finalize = (newLine) => mutatingStep(({ text }) => text
4
4
  .replace(/&#40/g, '(')
@@ -1,5 +1,5 @@
1
- import { highlightDiff, ansiColorWrappers } from '../lib';
2
- import { alphabets } from '../dict';
1
+ import { highlightDiff, ansiColorWrappers } from '../lib/index.js';
2
+ import { alphabets } from '../dict/index.js';
3
3
 
4
4
  export const highlightDiffStep = (highlight) => ({ cfg: { general: { abc }, }, storage: { textArr, origArr }, }) => {
5
5
  highlightDiff(textArr, origArr, abc === alphabets.cyrillic, highlight);
@@ -1,5 +1,5 @@
1
- import { alphabets } from '../dict';
2
- import { REPLACE_J } from '../constants';
1
+ import { alphabets } from '../dict/index.js';
2
+ import { REPLACE_J } from '../constants.js';
3
3
  const toJ = (shortU) => 'й ' + (shortU ? 'у' : '');
4
4
  export const replaceIbyJ = (options) => {
5
5
  const { abc, j } = options.cfg.general;
@@ -1,17 +1,17 @@
1
1
 
2
- export * from './convert-alphabet';
3
- export * from './highlight-diff';
4
- export * from './i-to-j';
5
- export * from './join-splitted';
6
- export * from './apply-g';
7
- export * from './apply-variations';
8
- export * from './prepare';
9
- export * from './resolve-syntax';
10
- export * from './restore-case';
11
- export * from './store-splitted-abc-converted-orig';
12
- export * from './store-splitted-text';
13
- export * from './taraskevize';
14
- export * from './whitespaces';
15
- export * from './trim';
16
- export * from './finalize';
17
- export * from './to-lower-case';
2
+ export * from './convert-alphabet.js';
3
+ export * from './highlight-diff.js';
4
+ export * from './i-to-j.js';
5
+ export * from './join-splitted.js';
6
+ export * from './apply-g.js';
7
+ export * from './apply-variations.js';
8
+ export * from './prepare.js';
9
+ export * from './resolve-syntax.js';
10
+ export * from './restore-case.js';
11
+ export * from './store-splitted-abc-converted-orig.js';
12
+ export * from './store-splitted-text.js';
13
+ export * from './taraskevize.js';
14
+ export * from './whitespaces.js';
15
+ export * from './trim.js';
16
+ export * from './finalize.js';
17
+ export * from './to-lower-case.js';
@@ -1,2 +1,2 @@
1
- import { mutatingStep } from '../lib';
1
+ import { mutatingStep } from '../lib/index.js';
2
2
  export const joinSplittedText = mutatingStep(({ storage: { textArr } }) => textArr.join(' '));
@@ -1,4 +1,4 @@
1
- import { mutatingStep } from '../lib';
1
+ import { mutatingStep } from '../lib/index.js';
2
2
 
3
3
  export const prepare = mutatingStep(({ text }) => text
4
4
  .replace(/г'(?![еёіюя])/g, 'ґ')
@@ -1,4 +1,4 @@
1
- import { restoreCase, replaceWithDict, mutatingStep } from '../lib';
1
+ import { restoreCase, replaceWithDict, mutatingStep } from '../lib/index.js';
2
2
  const NOFIX_CHAR = ' \ue0fe ';
3
3
  const NOFIX_REGEX = new RegExp(NOFIX_CHAR, 'g');
4
4
 
@@ -1,4 +1,4 @@
1
- import { restoreCase } from '../lib';
1
+ import { restoreCase } from '../lib/index.js';
2
2
  export const restoreCaseStep = ({ cfg: { general: { abc }, }, storage: { textArr, origArr }, }) => {
3
3
  if (abc.upper) {
4
4
  restoreCase(textArr, origArr);
@@ -1,4 +1,4 @@
1
- import { replaceWithDict } from '../lib';
1
+ import { replaceWithDict } from '../lib/index.js';
2
2
  export const storeSplittedAbcConvertedOrig = ({ cfg: { general: { abc: { lower, upper }, }, }, text, storage, }) => {
3
3
  storage.origArr = replaceWithDict(replaceWithDict(text, lower), upper).split(' ');
4
4
  };
@@ -1,5 +1,5 @@
1
- import { noSoften, softeners, wordlist } from '../dict';
2
- import { afterTarask, mutatingStep, replaceWithDict } from '../lib';
1
+ import { noSoften, softeners, wordlist } from '../dict/index.js';
2
+ import { afterTarask, mutatingStep, replaceWithDict } from '../lib/index.js';
3
3
  const wordlistPlusNoSoften = wordlist.concat(noSoften);
4
4
  export const taraskevize = mutatingStep(({ text }) => {
5
5
  text = replaceWithDict(text, wordlistPlusNoSoften);
@@ -1,2 +1,2 @@
1
- import { mutatingStep } from '../lib';
1
+ import { mutatingStep } from '../lib/index.js';
2
2
  export const toLowerCase = mutatingStep(({ text }) => text.toLowerCase());
@@ -1,2 +1,2 @@
1
- import { mutatingStep } from '../lib';
1
+ import { mutatingStep } from '../lib/index.js';
2
2
  export const trim = mutatingStep(({ text }) => ` ${text.trim()} `);
@@ -1,4 +1,4 @@
1
- import { mutatingStep } from '../lib';
1
+ import { mutatingStep } from '../lib/index.js';
2
2
 
3
3
  export const whitespacesToSpaces = mutatingStep(({ text, storage }) => {
4
4
  storage.spaces = [];
package/dist/tarask.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { TaraskConfig } from './config';
2
- import type { TaraskStep } from './steps';
2
+ import type { TaraskStep } from './steps/index';
3
3
  /**
4
4
  * @returns converted text
5
5
  *
package/dist/tarask.js CHANGED
@@ -1,4 +1,4 @@
1
- import { TaraskConfig } from './config';
1
+ import { TaraskConfig } from './config.js';
2
2
 
3
3
  export const tarask = (text, pipeline, cfg = new TaraskConfig()) => {
4
4
  const options = { text, cfg, storage: {} };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taraskevizer",
3
- "version": "8.0.10",
3
+ "version": "8.0.11",
4
4
  "author": "GooseOb",
5
5
  "repository": {
6
6
  "type": "git",