Convert back to old common js

This commit is contained in:
J H
2024-02-08 13:35:56 -07:00
parent dc7a86a8e8
commit 17ec714277
7 changed files with 16 additions and 16 deletions

View File

@@ -165,10 +165,10 @@ export type ListValueSpecType = "text" | "number" | "object"
export type ListValueSpecOf<T extends ListValueSpecType> = T extends "text" export type ListValueSpecOf<T extends ListValueSpecType> = T extends "text"
? ListValueSpecText ? ListValueSpecText
: T extends "number" : T extends "number"
? ListValueSpecNumber ? ListValueSpecNumber
: T extends "object" : T extends "object"
? ListValueSpecObject ? ListValueSpecObject
: never : never
/** represents a spec for a list */ /** represents a spec for a list */
export type ValueSpecList = ValueSpecListOf<ListValueSpecType> export type ValueSpecList = ValueSpecListOf<ListValueSpecType>
export interface ValueSpecListOf<T extends ListValueSpecType> export interface ValueSpecListOf<T extends ListValueSpecType>

View File

@@ -2,7 +2,10 @@ import { Address } from "../types"
import { Host, PortOptions } from "./Host" import { Host, PortOptions } from "./Host"
export class Origin<T extends Host> { export class Origin<T extends Host> {
constructor(readonly host: T, readonly options: PortOptions) {} constructor(
readonly host: T,
readonly options: PortOptions,
) {}
build({ username, path, search }: BuildOptions): Address { build({ username, path, search }: BuildOptions): Address {
const qpEntries = Object.entries(search) const qpEntries = Object.entries(search)

View File

@@ -123,7 +123,7 @@ export class Daemons<Manifest extends SDKManifest, Ids extends string> {
({ ({
status: "failing", status: "failing",
message: "message" in err ? err.message : String(err), message: "message" in err ? err.message : String(err),
} as CheckResult), }) as CheckResult,
) )
currentInput.lastResult = response.status || null currentInput.lastResult = response.status || null
if (!currentInput.hadSuccess && response.status === "passing") { if (!currentInput.hadSuccess && response.status === "passing") {

View File

@@ -9,11 +9,8 @@ import * as _I from "../index"
import { camelCase } from "../../scripts/oldSpecToBuilder" import { camelCase } from "../../scripts/oldSpecToBuilder"
import { deepMerge } from "../util/deepMerge" import { deepMerge } from "../util/deepMerge"
export type IfEquals<T, U, Y = unknown, N = never> = (<G>() => G extends T export type IfEquals<T, U, Y = unknown, N = never> =
? 1 (<G>() => G extends T ? 1 : 2) extends <G>() => G extends U ? 1 : 2 ? Y : N
: 2) extends <G>() => G extends U ? 1 : 2
? Y
: N
export function testOutput<A, B>(): (c: IfEquals<A, B>) => null { export function testOutput<A, B>(): (c: IfEquals<A, B>) => null {
return () => null return () => null
} }

View File

@@ -114,8 +114,8 @@ export type ValidIfNoStupidEscape<A> = A extends
| `${string}\\"${string}` | `${string}\\"${string}`
? never ? never
: "" extends A & "" : "" extends A & ""
? never ? never
: A : A
export type ConfigRes = { export type ConfigRes = {
/** This should be the previous config, that way during set config we start with the previous */ /** This should be the previous config, that way during set config we start with the previous */

View File

@@ -69,8 +69,8 @@ const addressHostToUrl = (
const scheme = host.endsWith(".onion") const scheme = host.endsWith(".onion")
? options.scheme ? options.scheme
: options.addSsl : options.addSsl
? options.addSsl.scheme ? options.addSsl.scheme
: options.scheme // TODO: encode whether hostname transport is "secure"? : options.scheme // TODO: encode whether hostname transport is "secure"?
return `${scheme ? `${scheme}//` : ""}${ return `${scheme ? `${scheme}//` : ""}${
username ? `${username}@` : "" username ? `${username}@` : ""
}${host}${suffix}` }${host}${suffix}`

View File

@@ -6,7 +6,7 @@
"types": "./lib/index.d.ts", "types": "./lib/index.d.ts",
"scripts": { "scripts": {
"test": "jest -c ./jest.config.js --coverage", "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" "check": "tsc --noEmit"
}, },
"repository": { "repository": {