import { IParallelEnumerable , ParallelGeneratorType , TypedData } from "../../types" ; import { BasicParallelEnumerable } from "../BasicParallelEnumerable" ; param source param count returns export const skip = < TSource > ( source , count ) : IParallelEnumerable < TSource > => { const dataFunc = source . dataFunc ; switch ( dataFunc . type ) { case ParallelGeneratorType . PromiseToArray : { const generator = async ( ) => ( await dataFunc . generator ( ) ) . slice ( count ) ; return new BasicParallelEnumerable ( { generator , type : ParallelGeneratorType . PromiseToArray , } ) ; } case ParallelGeneratorType . ArrayOfPromises : { const generator = ( ) => dataFunc . generator ( ) . slice ( count ) ; return new BasicParallelEnumerable ( { generator , type : ParallelGeneratorType . ArrayOfPromises , } ) ; } case ParallelGeneratorType . PromiseOfPromises : { const generator = async ( ) => { const dataInner = await dataFunc . generator ( ) ; return dataInner . slice ( count ) ; } ; const dataFuncNew = { generator , type : ParallelGeneratorType . PromiseOfPromises , } ; return new BasicParallelEnumerable < TSource > ( dataFuncNew ) ; } } } ;