mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Remove other usages of : any
This commit is contained in:
parent
4eb7ea2461
commit
da82462fa2
3 changed files with 4 additions and 6 deletions
|
|
@ -38,7 +38,7 @@ function findInvalid(arr: string[], predicate = (v: string) => !/[a-f0-9]{64}/.t
|
||||||
return arr.find(predicate);
|
return arr.find(predicate);
|
||||||
}
|
}
|
||||||
|
|
||||||
function die(code: number, ...args: any[]) {
|
function die(code: number, ...args: unknown[]) {
|
||||||
console.error(...args);
|
console.error(...args);
|
||||||
Deno.exit(code);
|
Deno.exit(code);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { Conf } from '@/config.ts';
|
||||||
import pngToIco from 'png-to-ico';
|
import pngToIco from 'png-to-ico';
|
||||||
import { Storages } from '@/storages.ts';
|
import { Storages } from '@/storages.ts';
|
||||||
|
|
||||||
function die(code: number, ...args: any[]) {
|
function die(code: number, ...args: unknown[]) {
|
||||||
console.error(...args);
|
console.error(...args);
|
||||||
Deno.exit(code);
|
Deno.exit(code);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,15 +47,13 @@ export class DeepLTranslator implements DittoTranslator {
|
||||||
targetLanguage: LanguageCode,
|
targetLanguage: LanguageCode,
|
||||||
opts?: { signal?: AbortSignal },
|
opts?: { signal?: AbortSignal },
|
||||||
) {
|
) {
|
||||||
const body: any = {
|
const body = {
|
||||||
text: texts,
|
text: texts,
|
||||||
target_lang: targetLanguage.toUpperCase(),
|
target_lang: targetLanguage.toUpperCase(),
|
||||||
tag_handling: 'html',
|
tag_handling: 'html',
|
||||||
split_sentences: '1',
|
split_sentences: '1',
|
||||||
|
source_lang: source?.toUpperCase(),
|
||||||
};
|
};
|
||||||
if (source) {
|
|
||||||
body.source_lang = source.toUpperCase();
|
|
||||||
}
|
|
||||||
|
|
||||||
const url = new URL('/v2/translate', this.baseUrl);
|
const url = new URL('/v2/translate', this.baseUrl);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue