This commit is contained in:
BluJ
2023-03-28 13:12:14 -06:00
parent ea8063a511
commit f9c558ec25
7 changed files with 177 additions and 57 deletions

View File

@@ -105,7 +105,8 @@ export type ListValueSpecOf<T extends ListValueSpecType> = T extends "string"
/** represents a spec for a list */
export type ValueSpecList = ValueSpecListOf<ListValueSpecType>;
export interface ValueSpecListOf<T extends ListValueSpecType> extends WithStandalone {
export interface ValueSpecListOf<T extends ListValueSpecType>
extends WithStandalone {
type: "list";
subtype: T;
spec: ListValueSpecOf<T>;
@@ -122,7 +123,10 @@ export interface ValueSpecListOf<T extends ListValueSpecType> extends WithStanda
}
// sometimes the type checker needs just a little bit of help
export function isValueSpecListOf<S extends ListValueSpecType>(t: ValueSpecList, s: S): t is ValueSpecListOf<S> {
export function isValueSpecListOf<S extends ListValueSpecType>(
t: ValueSpecList,
s: S
): t is ValueSpecListOf<S> {
return t.subtype === s;
}