taraskevizer 10.4.14 → 10.4.15
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/index.js +5 -6
- package/package.json +1 -1
package/dist/bin/index.js
CHANGED
|
@@ -68,7 +68,7 @@ process.argv.splice(0, 2);
|
|
|
68
68
|
const firstArg = process.argv[0];
|
|
69
69
|
if (firstArg) {
|
|
70
70
|
if (firstArg === '-v' || firstArg === '--version') {
|
|
71
|
-
printLn("10.4.
|
|
71
|
+
printLn("10.4.15");
|
|
72
72
|
process.exit(0);
|
|
73
73
|
}
|
|
74
74
|
if (firstArg === '-h' || firstArg === '--help') {
|
|
@@ -101,6 +101,7 @@ const workers = {
|
|
|
101
101
|
})));
|
|
102
102
|
},
|
|
103
103
|
};
|
|
104
|
+
const convert = (text) => pipelines[mode](text, cfg);
|
|
104
105
|
const processText = async (text) => {
|
|
105
106
|
let result = '';
|
|
106
107
|
if (!doForceSingleThread && workers.size > 1 && text.length > 50_000) {
|
|
@@ -110,7 +111,7 @@ const processText = async (text) => {
|
|
|
110
111
|
result = results.join('');
|
|
111
112
|
}
|
|
112
113
|
else {
|
|
113
|
-
result =
|
|
114
|
+
result = convert(text);
|
|
114
115
|
}
|
|
115
116
|
if (!process.stdout.write(result)) {
|
|
116
117
|
process.stdout.once('drain', () => {
|
|
@@ -120,8 +121,7 @@ const processText = async (text) => {
|
|
|
120
121
|
}
|
|
121
122
|
};
|
|
122
123
|
if (process.argv.length) {
|
|
123
|
-
|
|
124
|
-
await processText(process.argv.reverse().join(' '));
|
|
124
|
+
process.stdout.write(convert(process.argv.reverse().join(' ')) + '\n');
|
|
125
125
|
}
|
|
126
126
|
else {
|
|
127
127
|
const chunks = [];
|
|
@@ -138,8 +138,7 @@ else {
|
|
|
138
138
|
if (chunk.includes('\n'))
|
|
139
139
|
break;
|
|
140
140
|
}
|
|
141
|
-
|
|
142
|
-
process.stdout.write('\n');
|
|
141
|
+
process.stdout.write(convert(getChunksString()));
|
|
143
142
|
}
|
|
144
143
|
else {
|
|
145
144
|
printErrLn('Reading from stdin...');
|