taraskevizer 8.0.4 → 8.0.5

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.
Files changed (2) hide show
  1. package/dist/bin.js +17 -19
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -14,7 +14,7 @@ const printWithPrefix = (msg) => {
14
14
  process.argv.splice(0, 2);
15
15
  const checkForOptions = (options) => process.argv[0] && options.includes(process.argv[0].toLowerCase());
16
16
  if (checkForOptions(["-v", "--version"])) {
17
- printWithPrefix("8.0.4");
17
+ printWithPrefix("8.0.5");
18
18
  process.exit(0);
19
19
  }
20
20
  if (checkForOptions(["-h", "--help"])) {
@@ -66,12 +66,11 @@ Other:
66
66
  `);
67
67
  process.exit(0);
68
68
  }
69
- const general = {};
70
- const nonHtml = {
71
- variations: 2,
72
- ansiColors: true
73
- };
74
- const html = { g: true };
69
+ const cfg = new TaraskConfig({
70
+ general: {},
71
+ html: { g: true },
72
+ nonHtml: { variations: VARIATION.ALL, ansiColors: true }
73
+ });
75
74
  let mode = "plainText";
76
75
  const toHashTable = (dict) => {
77
76
  const result = {};
@@ -86,62 +85,62 @@ const optionDict = toHashTable([
86
85
  [
87
86
  ["--latin", "-l"],
88
87
  () => {
89
- general.abc = dicts.alphabets.latin;
88
+ cfg.general.abc = dicts.alphabets.latin;
90
89
  }
91
90
  ],
92
91
  [
93
92
  ["--latin-ji", "-lj"],
94
93
  () => {
95
- general.abc = dicts.alphabets.latinJi;
94
+ cfg.general.abc = dicts.alphabets.latinJi;
96
95
  }
97
96
  ],
98
97
  [
99
98
  ["--arabic", "-a"],
100
99
  () => {
101
- general.abc = dicts.alphabets.arabic;
100
+ cfg.general.abc = dicts.alphabets.arabic;
102
101
  }
103
102
  ],
104
103
  [
105
104
  ["--jrandom", "-jr"],
106
105
  () => {
107
- general.j = REPLACE_J.RANDOM;
106
+ cfg.general.j = REPLACE_J.RANDOM;
108
107
  }
109
108
  ],
110
109
  [
111
110
  ["--jalways", "-ja"],
112
111
  () => {
113
- general.j = REPLACE_J.ALWAYS;
112
+ cfg.general.j = REPLACE_J.ALWAYS;
114
113
  }
115
114
  ],
116
115
  [
117
116
  ["--no-escape-caps", "-nec"],
118
117
  () => {
119
- general.doEscapeCapitalized = false;
118
+ cfg.general.doEscapeCapitalized = false;
120
119
  }
121
120
  ],
122
121
  [
123
122
  ["--h"],
124
123
  () => {
125
- nonHtml.h = true;
126
- html.g = false;
124
+ cfg.nonHtml.h = true;
125
+ cfg.html.g = false;
127
126
  }
128
127
  ],
129
128
  [
130
129
  ["--no-variations", "-nv"],
131
130
  () => {
132
- nonHtml.variations = VARIATION.NO;
131
+ cfg.nonHtml.variations = VARIATION.NO;
133
132
  }
134
133
  ],
135
134
  [
136
135
  ["--first-variation-only", "-fvo"],
137
136
  () => {
138
- nonHtml.variations = VARIATION.FIRST;
137
+ cfg.nonHtml.variations = VARIATION.FIRST;
139
138
  }
140
139
  ],
141
140
  [
142
141
  ["--no-color", "-nc"],
143
142
  () => {
144
- nonHtml.ansiColors = false;
143
+ cfg.nonHtml.ansiColors = false;
145
144
  }
146
145
  ],
147
146
  [
@@ -189,7 +188,6 @@ if (process.argv.length) {
189
188
  }
190
189
  text = Buffer.concat(chunks, length).toString();
191
190
  }
192
- const cfg = new TaraskConfig({ general, html, nonHtml });
193
191
  if (process.stdout.write(tarask(text, pipelines[mode], cfg) + "\n")) {
194
192
  process.exit(0);
195
193
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taraskevizer",
3
- "version": "8.0.4",
3
+ "version": "8.0.5",
4
4
  "author": "GooseOb",
5
5
  "repository": {
6
6
  "type": "git",