Make new routing system the default
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -4,6 +4,10 @@ export type Awaitable<T> = T | Promise<T>
|
||||
/** Type alias for something that may be undefined. */
|
||||
export type Maybe<T> = T | undefined
|
||||
|
||||
export type MaybeArr<T extends [...any[]]> = {
|
||||
[Index in keyof T]: Maybe<T[Index]>
|
||||
} & {length: T['length']}
|
||||
|
||||
export type Either<T1, T2> = Left<T1> | Right<T2>
|
||||
|
||||
export type Left<T> = [T, undefined]
|
||||
@@ -26,6 +30,14 @@ export function right<T>(what: T): Right<T> {
|
||||
return [undefined, what]
|
||||
}
|
||||
|
||||
export function unleft<T>(what: Left<T>): T {
|
||||
return what[0]
|
||||
}
|
||||
|
||||
export function unright<T>(what: Right<T>): T {
|
||||
return what[1]
|
||||
}
|
||||
|
||||
/** Type alias for a callback that accepts a typed argument. */
|
||||
export type ParameterizedCallback<T> = ((arg: T) => any)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user