From e2867420b6da9b606e0f8eb7988a3370f947a152 Mon Sep 17 00:00:00 2001 From: BluJ Date: Wed, 3 May 2023 10:16:00 -0600 Subject: [PATCH] chore: small update --- lib/config/builder/config.ts | 8 ++++---- lib/config/constants.ts | 2 +- lib/emverLite/mod.ts | 2 +- lib/manifest/ManifestTypes.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/config/builder/config.ts b/lib/config/builder/config.ts index 5671176..5b2d3ec 100644 --- a/lib/config/builder/config.ts +++ b/lib/config/builder/config.ts @@ -18,7 +18,7 @@ export type ExtractConfigType | Config | Config ? B : A -export type TypeAsConfigOf, WD> = { +export type TypeAsConfigOf, WD = never> = { [K in keyof A]: Value } @@ -82,7 +82,7 @@ export const addNodesSpec = Config.of({ hostname: hostname, port: port }); export class Config, WD> { private constructor( private readonly spec: { - [K in keyof Type]: Value + [K in keyof Type]: Value | Value }, public validator: Parser, ) {} @@ -91,7 +91,7 @@ export class Config, WD> { [K in keyof Type]: ValueSpec } for (const k in this.spec) { - answer[k] = await this.spec[k].build(options) + answer[k] = await this.spec[k].build(options as any) } return answer } @@ -117,7 +117,7 @@ export class Config, WD> { { [K in keyof Spec]: Spec[K] extends Value ? WD : never }[keyof Spec] - >(spec as any, validator as any) + >(spec, validator as any) } /** diff --git a/lib/config/constants.ts b/lib/config/constants.ts index f287811..b2e5601 100644 --- a/lib/config/constants.ts +++ b/lib/config/constants.ts @@ -14,7 +14,7 @@ export const smtpConfig = Value.union( system: { name: "System Credentials", spec: Config.of({}) }, custom: { name: "Custom Credentials", - spec: Config.of>({ + spec: Config.of>({ server: Value.text({ name: "SMTP Server", required: { diff --git a/lib/emverLite/mod.ts b/lib/emverLite/mod.ts index 2e6346e..f672613 100644 --- a/lib/emverLite/mod.ts +++ b/lib/emverLite/mod.ts @@ -65,7 +65,7 @@ export class EmVer { * Or an already made emver * IsUnsafe */ - static from(range: ValidEmVer | EmVer): EmVer { + static from(range: string | EmVer): EmVer { if (range instanceof EmVer) { return range } diff --git a/lib/manifest/ManifestTypes.ts b/lib/manifest/ManifestTypes.ts index 97cfb68..4ee09fc 100644 --- a/lib/manifest/ManifestTypes.ts +++ b/lib/manifest/ManifestTypes.ts @@ -1,4 +1,4 @@ -import { ValidEmVer, ValidEmVerRange } from "../emverLite/mod" +import { ValidEmVer } from "../emverLite/mod" import { ActionMetaData } from "../types" export interface Container { @@ -70,7 +70,7 @@ export interface Dependency { /** The range of versions that would satisfy the dependency * ie: >=3.4.5 && <4.0.0 */ - version: ValidEmVerRange + version: string /** * A human readable explanation on what the dependency is used for */