mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-26 18:04:45 +10:00
consistent imports
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import * as dns from "dns";
|
import dns from "node:dns/promises";
|
||||||
import { isIP } from "net";
|
import { isIP } from "node:net";
|
||||||
import { ORPCError } from "@orpc/server";
|
import { ORPCError } from "@orpc/server";
|
||||||
import type { InferSelectModel } from "drizzle-orm";
|
import type { InferSelectModel } from "drizzle-orm";
|
||||||
import puppeteer, { type Browser, type ConnectOptions, type Page } from "puppeteer-core";
|
import puppeteer, { type Browser, type ConnectOptions, type Page } from "puppeteer-core";
|
||||||
@@ -17,11 +17,11 @@ let browserInstance: Browser | null = null;
|
|||||||
|
|
||||||
async function normalizePrinterEndpoint(printerEndpoint: string): Promise<URL> {
|
async function normalizePrinterEndpoint(printerEndpoint: string): Promise<URL> {
|
||||||
// Convert endpoint hostname to IP when using chromedp
|
// Convert endpoint hostname to IP when using chromedp
|
||||||
// SEE ISSUE: https://github.com/amruthpillai/reactive-resume/issues/2681
|
// https://github.com/amruthpillai/reactive-resume/issues/2681
|
||||||
const endpoint = new URL(printerEndpoint);
|
const endpoint = new URL(printerEndpoint);
|
||||||
|
|
||||||
if (!isIP(endpoint.hostname) && !endpoint.protocol.startsWith("ws")) {
|
if (!isIP(endpoint.hostname) && !endpoint.protocol.startsWith("ws")) {
|
||||||
const { address } = await dns.promises.lookup(endpoint.hostname);
|
const { address } = await dns.lookup(endpoint.hostname);
|
||||||
endpoint.hostname = address;
|
endpoint.hostname = address;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user