move types around
This commit is contained in:
@@ -1,9 +1,4 @@
|
||||
import { AsyncComparer, MaybeAsyncComparer, MaybeAsyncIterator } from "./async.js";
|
||||
import { Comparer } from "./sync.js";
|
||||
|
||||
export type AsyncFunction<TFunc extends (...args: any) => any> = TFunc extends (...args: infer P) => infer R ? (...args: P) => Promise<Awaited<R>> : never;
|
||||
export type MaybePromise<T> = T | Promise<T>;
|
||||
export type MaybeAsyncFunction<TFunc extends (...args: any) => any> = TFunc extends (...args: infer P) => infer R ? (...args: P) => MaybePromise<R> : never;
|
||||
import { Comparer, MaybeAsyncComparer, AsyncComparer, MaybeAsyncIterator } from "./types.js";
|
||||
|
||||
export function isDefined<T = any>(obj: T): obj is NonNullable<T> {
|
||||
return obj !== undefined && obj !== null;
|
||||
|
||||
Reference in New Issue
Block a user