cc-translate 0.5.7 → 0.5.8
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/index.js +1 -1
- package/package.json +2 -2
- package/src/index.ts +1 -1
- package/src/lib/utils.ts +1 -1
package/index.js
CHANGED
|
@@ -244,6 +244,7 @@ export class CwalletTranslate {
|
|
|
244
244
|
folderName: this.CACHE_ROOT_PATH,
|
|
245
245
|
});
|
|
246
246
|
});
|
|
247
|
+
checkEnvNodeVersion();
|
|
247
248
|
this.OPENAI_KEY = params.key;
|
|
248
249
|
this.CACHE_ROOT_PATH = params.cacheFileRootPath;
|
|
249
250
|
this.ENTRY_ROOT_PATH = params.fileRootPath;
|
|
@@ -252,7 +253,6 @@ export class CwalletTranslate {
|
|
|
252
253
|
this.OUTPUT_ROOT_PATH = params.outputRootPath;
|
|
253
254
|
this.fineTune = params.fineTune;
|
|
254
255
|
this.languages = (_c = params.languages) !== null && _c !== void 0 ? _c : [];
|
|
255
|
-
checkEnvNodeVersion();
|
|
256
256
|
this.createOpenAIClient();
|
|
257
257
|
}
|
|
258
258
|
get supportLanguages() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-translate",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.8",
|
|
4
4
|
"description": "A language translation tool based on OpenAI",
|
|
5
5
|
"author": "maybe",
|
|
6
6
|
"type": "module",
|
|
@@ -46,6 +46,6 @@
|
|
|
46
46
|
"typescript": "^5.6.3"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
|
49
|
-
"node": ">=
|
|
49
|
+
"node": ">=18.16.0"
|
|
50
50
|
}
|
|
51
51
|
}
|
package/src/index.ts
CHANGED
|
@@ -52,7 +52,6 @@ export class CwalletTranslate {
|
|
|
52
52
|
fineTune: string[];
|
|
53
53
|
|
|
54
54
|
constructor(params: ICwalletTranslateParams) {
|
|
55
|
-
checkEnvNodeVersion();
|
|
56
55
|
this.OPENAI_KEY = params.key;
|
|
57
56
|
this.CACHE_ROOT_PATH = params.cacheFileRootPath;
|
|
58
57
|
this.ENTRY_ROOT_PATH = params.fileRootPath;
|
|
@@ -61,6 +60,7 @@ export class CwalletTranslate {
|
|
|
61
60
|
this.OUTPUT_ROOT_PATH = params.outputRootPath;
|
|
62
61
|
this.fineTune = params.fineTune;
|
|
63
62
|
this.languages = params.languages ?? [];
|
|
63
|
+
checkEnvNodeVersion();
|
|
64
64
|
this.createOpenAIClient();
|
|
65
65
|
}
|
|
66
66
|
|
package/src/lib/utils.ts
CHANGED
|
@@ -112,7 +112,7 @@ export const dequeue = async (queue: (() => Promise<void>)[]) => {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
|
-
const REQUIRED_VERSION = ">=
|
|
115
|
+
const REQUIRED_VERSION = ">=18.16.0";
|
|
116
116
|
export const checkEnvNodeVersion = () => {
|
|
117
117
|
// 检查当前 Node.js 版本
|
|
118
118
|
if (!semver.satisfies(process.version, REQUIRED_VERSION)) {
|