diff --git a/package.json b/package.json index e9d761b..983ef10 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@kdwnil/translator-utils", "private": true, - "version": "0.0.2-alpha.25", + "version": "0.0.2-alpha.26", "description": "translate utils", "homepage": "https://github.com/BANKA2017/translator-utils", "bugs": { diff --git a/packages/translator-utils-axios-helper/index.js b/packages/translator-utils-axios-helper/index.js index c9c1377..9c0e866 100644 --- a/packages/translator-utils-axios-helper/index.js +++ b/packages/translator-utils-axios-helper/index.js @@ -5,7 +5,7 @@ class AxiosRequest { options.timeout = 30000 } - const validPostRequest = (options?.method ?? '').toLowerCase() === 'post' && postData + const validPostRequest = (options?.method || '').toLowerCase() === 'post' && postData if (!options.headers) { options.headers = {} } diff --git a/packages/translator-utils-axios-helper/index.node.js b/packages/translator-utils-axios-helper/index.node.js index 938168d..1f59b26 100644 --- a/packages/translator-utils-axios-helper/index.node.js +++ b/packages/translator-utils-axios-helper/index.node.js @@ -4,7 +4,7 @@ import https from 'node:https' class AxiosRequest { requestHandle(url, postData, options = {}) { - const HTTPS_PROXY = process.env.https_proxy ?? process.env.HTTPS_PROXY ?? '' + const HTTPS_PROXY = process.env.https_proxy || process.env.HTTPS_PROXY || '' if (HTTPS_PROXY && HttpsProxyAgent) { options.agent = new HttpsProxyAgent({ proxy: HTTPS_PROXY }) @@ -19,7 +19,7 @@ class AxiosRequest { options.headers['user-agent'] = defaultUA } - const validPostRequest = (options?.method ?? '').toLowerCase() === 'post' && postData + const validPostRequest = (options?.method || '').toLowerCase() === 'post' && postData if (!options.headers['content-type']) { options.headers['content-type'] = 'application/x-www-form-urlencoded' } diff --git a/src/source/deepl.ts b/src/source/deepl.ts index 86974ce..63f2917 100644 --- a/src/source/deepl.ts +++ b/src/source/deepl.ts @@ -1,4 +1,4 @@ -import { TranslatorModuleFunction } from '../types.js' +import type { TranslatorModuleFunction } from '../types.js' import { SupportedLanguage } from '../misc.js' import axiosFetch from 'translator-utils-axios-helper' import cryptoHandle from 'translator-utils-crypto' diff --git a/src/source/google.ts b/src/source/google.ts index 95d5e72..2bb3d17 100644 --- a/src/source/google.ts +++ b/src/source/google.ts @@ -1,4 +1,4 @@ -import { TTSModuleFunction, TranslatorModuleFunction } from '../types.js' +import type { TTSModuleFunction, TranslatorModuleFunction } from '../types.js' import { SupportedLanguage } from '../misc.js' import axiosFetch from 'translator-utils-axios-helper' import { GOOGLE_LANGUAGE } from '../language.js' diff --git a/src/source/sogou.ts b/src/source/sogou.ts index ff28347..2eb7f99 100644 --- a/src/source/sogou.ts +++ b/src/source/sogou.ts @@ -1,4 +1,4 @@ -import { TTSModuleFunction, TranslatorModuleFunction } from '../types.js' +import type { TTSModuleFunction, TranslatorModuleFunction } from '../types.js' import { SupportedLanguage, buffer_to_base64 } from '../misc.js' import axiosFetch from 'translator-utils-axios-helper' import cryptoHandle from 'translator-utils-crypto' diff --git a/src/source/yandex.ts b/src/source/yandex.ts index 5f02487..3abf852 100644 --- a/src/source/yandex.ts +++ b/src/source/yandex.ts @@ -1,4 +1,4 @@ -import { TranslatorModuleFunction } from '../types.js' +import type { TranslatorModuleFunction } from '../types.js' import { SupportedLanguage, generateUUID } from '../misc.js' import axiosFetch from 'translator-utils-axios-helper' import { YANDEX_LANGUAGE } from '../language.js'