From 6dd6b73c2f12672d862cd71a003987cd152130f3 Mon Sep 17 00:00:00 2001 From: Gabe Date: Wed, 3 Sep 2025 13:05:41 +0800 Subject: [PATCH] refactor: rename fn name --- src/apis/index.js | 6 +++--- src/apis/trans.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/apis/index.js b/src/apis/index.js index 240b79b..3589c8c 100644 --- a/src/apis/index.js +++ b/src/apis/index.js @@ -12,7 +12,7 @@ import { import { sha256 } from "../libs/utils"; import { msAuth } from "../libs/auth"; import { kissLog } from "../libs/log"; -import { fetchTranslate } from "./trans"; +import { handleTranslate } from "./trans"; import { getHttpCachePolyfill, putHttpCachePolyfill } from "../libs/cache"; import { getBatchQueue } from "../libs/batchQueue"; @@ -254,7 +254,7 @@ export const apiTranslate = async ({ docInfo, apiSetting, usePool, - taskFn: fetchTranslate, + taskFn: handleTranslate, }, apiSetting ); @@ -263,7 +263,7 @@ export const apiTranslate = async ({ [trText, srLang = ""] = tranlation; } } else { - const translations = await fetchTranslate({ + const translations = await handleTranslate({ translator, texts: [text], from, diff --git a/src/apis/trans.js b/src/apis/trans.js index 8730011..e7273d4 100644 --- a/src/apis/trans.js +++ b/src/apis/trans.js @@ -809,7 +809,7 @@ export const parseTransRes = ( * @param {*} param0 * @returns */ -export const fetchTranslate = async ({ +export const handleTranslate = async ({ translator, texts, from,