{"version":3,"sources":["iterable/operators/skiplast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,MAAM,OAAO,gBAA0B,SAAQ,SAAkB;IAI/D,YAAY,MAAyB,EAAE,KAAa;QAClD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChB,MAAM,CAAC,GAAG,EAAe,CAAC;QAC1B,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE;YAC/B,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACb,IAAI,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;gBAC1B,MAAM,CAAC,CAAC,KAAK,EAAG,CAAC;aAClB;SACF;IACH,CAAC;CACF;AAED,MAAM,UAAU,QAAQ,CAAU,KAAa;IAC7C,OAAO,SAAS,wBAAwB,CAAC,MAAyB;QAChE,OAAO,IAAI,gBAAgB,CAAU,MAAM,EAAE,KAAK,CAAC,CAAC;IACtD,CAAC,CAAC;AACJ,CAAC","file":"skiplast.js","sourcesContent":["import { IterableX } from '../iterablex';\nimport { MonoTypeOperatorFunction } from '../../interfaces';\n\nexport class SkipLastIterable<TSource> extends IterableX<TSource> {\n  private _source: Iterable<TSource>;\n  private _count: number;\n\n  constructor(source: Iterable<TSource>, count: number) {\n    super();\n    this._source = source;\n    this._count = count;\n  }\n\n  *[Symbol.iterator]() {\n    const q = [] as TSource[];\n    for (const item of this._source) {\n      q.push(item);\n      if (q.length > this._count) {\n        yield q.shift()!;\n      }\n    }\n  }\n}\n\nexport function skipLast<TSource>(count: number): MonoTypeOperatorFunction<TSource> {\n  return function skipLastOperatorFunction(source: Iterable<TSource>): IterableX<TSource> {\n    return new SkipLastIterable<TSource>(source, count);\n  };\n}\n"]}