taraskevizer 10.0.0-alpha.1 → 10.0.0-alpha.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/bin.js CHANGED
@@ -6,7 +6,7 @@ const printWithPrefix = (msg) => {
6
6
  process.argv.splice(0, 2);
7
7
  const checkForOptions = (options) => process.argv[0] && options.includes(process.argv[0].toLowerCase());
8
8
  if (checkForOptions(['-v', '--version'])) {
9
- printWithPrefix("10.0.0-alpha.1");
9
+ printWithPrefix("10.0.0-alpha.2");
10
10
  process.exit(0);
11
11
  }
12
12
  if (checkForOptions(['-h', '--help'])) {
@@ -61,7 +61,7 @@ OPTIONS
61
61
  let cfg = {
62
62
  g: true,
63
63
  variations: 'all',
64
- wrapperDict: wrappers.ansiColor,
64
+ wrappers: wrappers.ansiColor,
65
65
  };
66
66
  let mode = 'tarask';
67
67
  const toHashTable = (dict) => {
@@ -131,7 +131,7 @@ const optionDict = toHashTable([
131
131
  [
132
132
  ['--no-color', '-nc'],
133
133
  () => {
134
- cfg.wrapperDict = null;
134
+ cfg.wrappers = null;
135
135
  },
136
136
  ],
137
137
  [
@@ -192,7 +192,7 @@ cfg = new TaraskConfig(isHtml
192
192
  ? {
193
193
  ...htmlConfigOptions,
194
194
  ...cfg,
195
- wrapperDict: htmlConfigOptions.wrapperDict,
195
+ wrappers: htmlConfigOptions.wrappers,
196
196
  }
197
197
  : cfg);
198
198
  if (process.stdout.write(pipelines[mode](text, cfg) + '\n')) {
package/dist/config.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { PartialReadonly } from './types';
2
2
  import type { Alphabet } from './dict/alphabets';
3
- import { type WrapperDict } from './wrappers';
3
+ import { type Wrappers } from './wrappers';
4
4
  export type Variation = 'no' | 'first' | 'all';
5
5
  export type OptionJ = 'never' | 'random' | 'always';
6
6
  export declare class TaraskConfig {
@@ -38,7 +38,7 @@ export declare class TaraskConfig {
38
38
  *
39
39
  * @default null
40
40
  */
41
- wrapperDict: null | WrapperDict;
41
+ wrappers: null | Wrappers;
42
42
  /**
43
43
  * Do replace ґ(g) by г(h) in cyrillic alphabet?
44
44
  *
@@ -88,7 +88,7 @@ export declare class TaraskConfig {
88
88
  * });
89
89
  */
90
90
  export declare const htmlConfigOptions: {
91
- readonly wrapperDict: Required<WrapperDict>;
91
+ readonly wrappers: Required<Wrappers>;
92
92
  readonly g: false;
93
93
  readonly newLine: "<br>";
94
94
  readonly leftAngleBracket: "&lt";
package/dist/config.js CHANGED
@@ -15,7 +15,7 @@ export class TaraskConfig {
15
15
 
16
16
  doEscapeCapitalized = true;
17
17
 
18
- wrapperDict = null;
18
+ wrappers = null;
19
19
 
20
20
  g = true;
21
21
 
@@ -27,7 +27,7 @@ export class TaraskConfig {
27
27
  }
28
28
 
29
29
  export const htmlConfigOptions = {
30
- wrapperDict: html,
30
+ wrappers: html,
31
31
  g: false,
32
32
  newLine: '<br>',
33
33
  leftAngleBracket: '&lt',
@@ -1,8 +1,8 @@
1
1
  import { replaceG } from '../lib/index.js';
2
2
  import { alphabets, gobj } from '../dict/index.js';
3
3
  export const applyG = (ctx) => {
4
- const { abc, g, wrapperDict } = ctx.cfg;
5
- const wrap = wrapperDict?.letterH;
4
+ const { abc, g, wrappers } = ctx.cfg;
5
+ const wrap = wrappers?.letterH;
6
6
  if (abc === alphabets.cyrillic && (wrap || !g))
7
7
  ctx.text = replaceG(wrap ? (g ? wrap('$&') : ($0) => wrap(gobj[$0])) : ($0) => gobj[$0])(ctx.text);
8
8
  };
@@ -1,3 +1,3 @@
1
1
  import { mutatingStep } from '../lib/index.js';
2
2
  import { defaultVariation } from '../wrappers.js';
3
- export const applyVariations = mutatingStep(({ text, cfg: { wrapperDict, variations } }) => text.replace(/\([^)]*?\)/g, (wrapperDict?.variable || defaultVariation)[variations]));
3
+ export const applyVariations = mutatingStep(({ text, cfg: { wrappers, variations } }) => text.replace(/\([^)]*?\)/g, (wrappers?.variable || defaultVariation)[variations]));
@@ -1,7 +1,7 @@
1
1
  import { highlightDiff } from '../lib/index.js';
2
2
  import { alphabets } from '../dict/index.js';
3
3
 
4
- export const highlightDiffStep = ({ cfg: { abc, wrapperDict }, storage: { textArr, origArr }, }) => {
5
- if (wrapperDict?.fix)
6
- highlightDiff(textArr, origArr, abc === alphabets.cyrillic, wrapperDict.fix);
4
+ export const highlightDiffStep = ({ cfg: { abc, wrappers }, storage: { textArr, origArr }, }) => {
5
+ if (wrappers?.fix)
6
+ highlightDiff(textArr, origArr, abc === alphabets.cyrillic, wrappers.fix);
7
7
  };
@@ -3,12 +3,12 @@ type TransformString = (content: string) => string;
3
3
  export type VariationWrappers = {
4
4
  [p in Variation]: TransformString;
5
5
  };
6
- export type WrapperDict = {
6
+ export type Wrappers = {
7
7
  fix?: TransformString;
8
8
  variable?: VariationWrappers;
9
9
  letterH?: TransformString;
10
10
  };
11
11
  export declare const defaultVariation: VariationWrappers;
12
- export declare const html: Required<WrapperDict>;
13
- export declare const ansiColor: Required<WrapperDict>;
12
+ export declare const html: Required<Wrappers>;
13
+ export declare const ansiColor: Required<Wrappers>;
14
14
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taraskevizer",
3
- "version": "10.0.0-alpha.1",
3
+ "version": "10.0.0-alpha.2",
4
4
  "author": "GooseOb",
5
5
  "repository": {
6
6
  "type": "git",