From fba96cf7c894967cfcd0b783cc961afcc67cf7db Mon Sep 17 00:00:00 2001 From: Alec Helmturner Date: Sat, 25 Nov 2023 19:28:02 -0600 Subject: [PATCH] rm unused imports in iterableUtils.ts --- src/async/iterableUtils.ts | 67 -------------------------------------- 1 file changed, 67 deletions(-) diff --git a/src/async/iterableUtils.ts b/src/async/iterableUtils.ts index 8095410..2cb1b69 100644 --- a/src/async/iterableUtils.ts +++ b/src/async/iterableUtils.ts @@ -156,88 +156,21 @@ export interface AsyncIterableEsque { [Symbol.asyncIterator](): AsyncIterator; } -export function isAsyncIterableEsque( - maybeAsyncIterable: unknown, -): maybeAsyncIterable is AsyncIterableEsque { - return ( - !!maybeAsyncIterable && - (typeof maybeAsyncIterable === "object" || - typeof maybeAsyncIterable === "function") && - Symbol.asyncIterator in maybeAsyncIterable - ); -} - export interface IterableEsque { [Symbol.iterator](): Iterator; } -export function isIterableEsque( - maybeIterable: unknown, -): maybeIterable is IterableEsque { - return ( - !!maybeIterable && - (typeof maybeIterable === "object" || - typeof maybeIterable === "function") && - Symbol.iterator in maybeIterable - ); -} type SyncOrAsyncGeneratorFnEsque = AsyncGeneratorFnEsque | GeneratorFnEsque; -export function isMaybeAsyncGeneratorFn( - maybeAsyncGeneratorFn: unknown, -): maybeAsyncGeneratorFn is SyncOrAsyncGeneratorFnEsque { - return ( - typeof maybeAsyncGeneratorFn === "function" && - ["AsyncGeneratorFunction", "GeneratorFunction"].includes( - maybeAsyncGeneratorFn.constructor.name, - ) - ); -} - export type GeneratorFnEsque = () => Generator; -export function isGeneratorFnEsque( - maybeGeneratorFn: unknown, -): maybeGeneratorFn is GeneratorFnEsque { - return ( - typeof maybeGeneratorFn === "function" && - maybeGeneratorFn.constructor.name === "GeneratorFunction" - ); -} - export type AsyncGeneratorFnEsque = () => AsyncGenerator; -export function isAsyncGeneratorFnEsque( - maybeAsyncGeneratorFn: unknown, -): maybeAsyncGeneratorFn is AsyncGeneratorFnEsque { - return ( - typeof maybeAsyncGeneratorFn === "function" && - maybeAsyncGeneratorFn.constructor.name === "AsyncGeneratorFunction" - ); -} - export type PromiseEsque = PromiseLike; -export function isPromiseEsque( - maybePromise: unknown, -): maybePromise is PromiseEsque { - return ( - !!maybePromise && - typeof maybePromise === "object" && - "then" in maybePromise && - typeof maybePromise.then === "function" - ); -} - export type ThunkEsque = () => unknown; -export function isThunkEsque(maybeThunk: unknown): maybeThunk is ThunkEsque { - return ( - !!maybeThunk && typeof maybeThunk === "function" && maybeThunk.length === 0 - ); -} - export type Thunkable = | AsyncIterableEsque | IterableEsque