taraskevizer 8.0.3 → 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.
- package/dist/bin.js +21 -22
- package/dist/index.cjs +4 -2
- package/dist/index.js +4 -2
- package/package.json +1 -2
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.
|
|
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
|
|
70
|
-
|
|
71
|
-
|
|
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
|
[
|
|
@@ -158,17 +157,18 @@ const optionDict = toHashTable([
|
|
|
158
157
|
]
|
|
159
158
|
]);
|
|
160
159
|
let currOption;
|
|
161
|
-
|
|
160
|
+
process.argv.reverse();
|
|
161
|
+
while (currOption = process.argv.pop()) {
|
|
162
162
|
if (currOption in optionDict) {
|
|
163
163
|
optionDict[currOption]();
|
|
164
164
|
} else {
|
|
165
|
-
process.argv.
|
|
165
|
+
process.argv.push(currOption);
|
|
166
166
|
break;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
let text = "";
|
|
170
170
|
if (process.argv.length) {
|
|
171
|
-
text = process.argv.join(" ");
|
|
171
|
+
text = process.argv.reverse().join(" ");
|
|
172
172
|
} else {
|
|
173
173
|
const chunks = [];
|
|
174
174
|
let length = 0;
|
|
@@ -188,7 +188,6 @@ if (process.argv.length) {
|
|
|
188
188
|
}
|
|
189
189
|
text = Buffer.concat(chunks, length).toString();
|
|
190
190
|
}
|
|
191
|
-
const cfg = new TaraskConfig({ general, html, nonHtml });
|
|
192
191
|
if (process.stdout.write(tarask(text, pipelines[mode], cfg) + "\n")) {
|
|
193
192
|
process.exit(0);
|
|
194
193
|
} else {
|
package/dist/index.cjs
CHANGED
|
@@ -2399,8 +2399,10 @@ var NOFIX_CHAR = " ";
|
|
|
2399
2399
|
var NOFIX_REGEX = new RegExp(NOFIX_CHAR, "g");
|
|
2400
2400
|
var applyNoFix = (options) => {
|
|
2401
2401
|
const { noFixArr } = options.storage;
|
|
2402
|
-
if (noFixArr.length)
|
|
2403
|
-
|
|
2402
|
+
if (noFixArr.length) {
|
|
2403
|
+
noFixArr.reverse();
|
|
2404
|
+
options.text = options.text.replace(NOFIX_REGEX, () => noFixArr.pop());
|
|
2405
|
+
}
|
|
2404
2406
|
};
|
|
2405
2407
|
var resolveSpecialSyntax = (leftAngleBracket) => mutatingStep(
|
|
2406
2408
|
({
|
package/dist/index.js
CHANGED
|
@@ -2372,8 +2372,10 @@ var NOFIX_CHAR = " ";
|
|
|
2372
2372
|
var NOFIX_REGEX = new RegExp(NOFIX_CHAR, "g");
|
|
2373
2373
|
var applyNoFix = (options) => {
|
|
2374
2374
|
const { noFixArr } = options.storage;
|
|
2375
|
-
if (noFixArr.length)
|
|
2376
|
-
|
|
2375
|
+
if (noFixArr.length) {
|
|
2376
|
+
noFixArr.reverse();
|
|
2377
|
+
options.text = options.text.replace(NOFIX_REGEX, () => noFixArr.pop());
|
|
2378
|
+
}
|
|
2377
2379
|
};
|
|
2378
2380
|
var resolveSpecialSyntax = (leftAngleBracket) => mutatingStep(
|
|
2379
2381
|
({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "taraskevizer",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.5",
|
|
4
4
|
"author": "GooseOb",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
"test": "esrun --send-code-mode=temporaryFile test",
|
|
50
50
|
"test-cli": "bun run build && esrun --send-code-mode=temporaryFile test",
|
|
51
51
|
"postinstall": "husky",
|
|
52
|
-
"typecheck": "tsc --project src/tsconfig.json",
|
|
53
52
|
"docs": "typedoc --out docs src/index.ts --skipErrorChecking"
|
|
54
53
|
},
|
|
55
54
|
"sideEffects": false,
|