From 17ec7142776d833fcd8250c19f5db7c5d01ba6e6 Mon Sep 17 00:00:00 2001 From: J H Date: Thu, 8 Feb 2024 13:35:56 -0700 Subject: [PATCH] Convert back to old common js --- lib/config/configTypes.ts | 8 ++++---- lib/interfaces/Origin.ts | 5 ++++- lib/mainFn/Daemons.ts | 2 +- lib/test/output.test.ts | 7 ++----- lib/types.ts | 4 ++-- lib/util/getNetworkInterface.ts | 4 ++-- package.json | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/config/configTypes.ts b/lib/config/configTypes.ts index 64c3fb5..14e0e1d 100644 --- a/lib/config/configTypes.ts +++ b/lib/config/configTypes.ts @@ -165,10 +165,10 @@ export type ListValueSpecType = "text" | "number" | "object" export type ListValueSpecOf = T extends "text" ? ListValueSpecText : T extends "number" - ? ListValueSpecNumber - : T extends "object" - ? ListValueSpecObject - : never + ? ListValueSpecNumber + : T extends "object" + ? ListValueSpecObject + : never /** represents a spec for a list */ export type ValueSpecList = ValueSpecListOf export interface ValueSpecListOf diff --git a/lib/interfaces/Origin.ts b/lib/interfaces/Origin.ts index 08ad3f8..1bab628 100644 --- a/lib/interfaces/Origin.ts +++ b/lib/interfaces/Origin.ts @@ -2,7 +2,10 @@ import { Address } from "../types" import { Host, PortOptions } from "./Host" export class Origin { - constructor(readonly host: T, readonly options: PortOptions) {} + constructor( + readonly host: T, + readonly options: PortOptions, + ) {} build({ username, path, search }: BuildOptions): Address { const qpEntries = Object.entries(search) diff --git a/lib/mainFn/Daemons.ts b/lib/mainFn/Daemons.ts index 26b4c0e..45ff723 100644 --- a/lib/mainFn/Daemons.ts +++ b/lib/mainFn/Daemons.ts @@ -123,7 +123,7 @@ export class Daemons { ({ status: "failing", message: "message" in err ? err.message : String(err), - } as CheckResult), + }) as CheckResult, ) currentInput.lastResult = response.status || null if (!currentInput.hadSuccess && response.status === "passing") { diff --git a/lib/test/output.test.ts b/lib/test/output.test.ts index 37c0b48..2b3afb5 100644 --- a/lib/test/output.test.ts +++ b/lib/test/output.test.ts @@ -9,11 +9,8 @@ import * as _I from "../index" import { camelCase } from "../../scripts/oldSpecToBuilder" import { deepMerge } from "../util/deepMerge" -export type IfEquals = (() => G extends T - ? 1 - : 2) extends () => G extends U ? 1 : 2 - ? Y - : N +export type IfEquals = + (() => G extends T ? 1 : 2) extends () => G extends U ? 1 : 2 ? Y : N export function testOutput(): (c: IfEquals) => null { return () => null } diff --git a/lib/types.ts b/lib/types.ts index 338e7a7..657c09c 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -114,8 +114,8 @@ export type ValidIfNoStupidEscape = A extends | `${string}\\"${string}` ? never : "" extends A & "" - ? never - : A + ? never + : A export type ConfigRes = { /** This should be the previous config, that way during set config we start with the previous */ diff --git a/lib/util/getNetworkInterface.ts b/lib/util/getNetworkInterface.ts index 9f78474..91c4014 100644 --- a/lib/util/getNetworkInterface.ts +++ b/lib/util/getNetworkInterface.ts @@ -69,8 +69,8 @@ const addressHostToUrl = ( const scheme = host.endsWith(".onion") ? options.scheme : options.addSsl - ? options.addSsl.scheme - : options.scheme // TODO: encode whether hostname transport is "secure"? + ? options.addSsl.scheme + : options.scheme // TODO: encode whether hostname transport is "secure"? return `${scheme ? `${scheme}//` : ""}${ username ? `${username}@` : "" }${host}${suffix}` diff --git a/package.json b/package.json index e45edae..636b8cf 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "types": "./lib/index.d.ts", "scripts": { "test": "jest -c ./jest.config.js --coverage", - "buildOutput": "ts-node --esm ./lib/test/makeOutput.ts && npx prettier --write '**/*.ts'", + "buildOutput": "ts-node ./lib/test/makeOutput.ts && npx prettier --write '**/*.ts'", "check": "tsc --noEmit" }, "repository": {