mirror of
https://github.com/lissy93/networking-toolbox.git
synced 2026-11-22 14:01:44 +03:00
Resolve TSC lint and check warns
This commit is contained in:
1 parent
b2ba871421
commit
ef727fc383
4 files changed
+5
-8
No files matched your search
@@ -11,7 +11,7 @@
|
||||
let { text, position = 'top', delay = 500, children }: Props = $props();
|
||||
|
||||
let showTooltip = $state(false);
|
||||
let tooltipTimeout: number;
|
||||
let tooltipTimeout: ReturnType<typeof setTimeout>;
|
||||
|
||||
/**
|
||||
* Show tooltip after delay
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import { json, error } from '@sveltejs/kit';
|
||||
import type { RequestHandler } from './$types';
|
||||
// @ts-expect-error - Node.js core modules work at runtime
|
||||
import { exec } from 'child_process';
|
||||
// @ts-expect-error - Node.js core modules work at runtime
|
||||
import { promisify } from 'util';
|
||||
// @ts-expect-error - Node.js core modules work at runtime
|
||||
import { promises as dns } from 'dns';
|
||||
|
||||
export const config = { runtime: 'nodejs22.x' };
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { json, error } from '@sveltejs/kit';
|
||||
import type { RequestHandler } from './$types';
|
||||
import { promises as dns } from 'node:dns';
|
||||
import type { MxRecord, SoaRecord } from 'node:dns';
|
||||
|
||||
interface DNSPerformanceRequest {
|
||||
domain: string;
|
||||
@@ -106,8 +107,8 @@ async function queryResolver(
|
||||
records = await withTimeout(resolver.resolve6(domain), timeoutMs);
|
||||
break;
|
||||
case 'MX': {
|
||||
const mxRecords = (await withTimeout(resolver.resolveMx(domain), timeoutMs)) as dns.MxRecord[];
|
||||
records = mxRecords.map((r: dns.MxRecord) => `${r.priority} ${r.exchange}`);
|
||||
const mxRecords = (await withTimeout(resolver.resolveMx(domain), timeoutMs)) as MxRecord[];
|
||||
records = mxRecords.map((r: MxRecord) => `${r.priority} ${r.exchange}`);
|
||||
break;
|
||||
}
|
||||
case 'TXT': {
|
||||
@@ -122,7 +123,7 @@ async function queryResolver(
|
||||
records = await withTimeout(resolver.resolveCname(domain), timeoutMs);
|
||||
break;
|
||||
case 'SOA': {
|
||||
const soaRecord = (await withTimeout(resolver.resolveSoa(domain), timeoutMs)) as dns.SoaRecord;
|
||||
const soaRecord = (await withTimeout(resolver.resolveSoa(domain), timeoutMs)) as SoaRecord;
|
||||
records = [
|
||||
`${soaRecord.nsname} ${soaRecord.hostmaster} ${soaRecord.serial} ${soaRecord.refresh} ${soaRecord.retry} ${soaRecord.expire} ${soaRecord.minttl}`,
|
||||
];
|
||||
|
||||
@@ -2,7 +2,6 @@ import { json } from '@sveltejs/kit';
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
// @ts-expect-error - fs is available in Node.js server context
|
||||
const { readFileSync } = await import('fs');
|
||||
const pkg = JSON.parse(readFileSync('package.json', 'utf8'));
|
||||
return json({
|
||||
|
||||
Reference in new issue
Block a user