Kargi-Sitesi/.angular/cache/16.2.16/babel-webpack/ee7f3dab77dd1a31d9d06d1ba5cc3c78e2e6e2cfd8f44500007c5705bf4a74ca.json

1 line
7.6 KiB
JSON
Raw Normal View History

2024-10-31 19:07:58 +00:00
{"ast":null,"code":"import { Subscriber } from '../Subscriber';\nexport function bufferCount(bufferSize, startBufferEvery = null) {\n return function bufferCountOperatorFunction(source) {\n return source.lift(new BufferCountOperator(bufferSize, startBufferEvery));\n };\n}\nclass BufferCountOperator {\n constructor(bufferSize, startBufferEvery) {\n this.bufferSize = bufferSize;\n this.startBufferEvery = startBufferEvery;\n if (!startBufferEvery || bufferSize === startBufferEvery) {\n this.subscriberClass = BufferCountSubscriber;\n } else {\n this.subscriberClass = BufferSkipCountSubscriber;\n }\n }\n call(subscriber, source) {\n return source.subscribe(new this.subscriberClass(subscriber, this.bufferSize, this.startBufferEvery));\n }\n}\nclass BufferCountSubscriber extends Subscriber {\n constructor(destination, bufferSize) {\n super(destination);\n this.bufferSize = bufferSize;\n this.buffer = [];\n }\n _next(value) {\n const buffer = this.buffer;\n buffer.push(value);\n if (buffer.length == this.bufferSize) {\n this.destination.next(buffer);\n this.buffer = [];\n }\n }\n _complete() {\n const buffer = this.buffer;\n if (buffer.length > 0) {\n this.destination.next(buffer);\n }\n super._complete();\n }\n}\nclass BufferSkipCountSubscriber extends Subscriber {\n constructor(destination, bufferSize, startBufferEvery) {\n super(destination);\n this.bufferSize = bufferSize;\n this.startBufferEvery = startBufferEvery;\n this.buffers = [];\n this.count = 0;\n }\n _next(value) {\n const {\n bufferSize,\n startBufferEvery,\n buffers,\n count\n } = this;\n this.count++;\n if (count % startBufferEvery === 0) {\n buffers.push([]);\n }\n for (let i = buffers.length; i--;) {\n const buffer = buffers[i];\n buffer.push(value);\n if (buffer.length === bufferSize) {\n buffers.splice(i, 1);\n this.destination.next(buffer);\n }\n }\n }\n _complete() {\n const {\n buffers,\n destination\n } = this;\n while (buffers.length > 0) {\n let buffer = buffers.shift();\n if (buffer.length > 0) {\n destination.next(buffer);\n }\n }\n super._complete();\n }\n}","map":{"version":3,"names":["Subscriber","bufferCount","bufferSize","startBufferEvery","bufferCountOperatorFunction","source","lift","BufferCountOperator","constructor","subscriberClass","BufferCountSubscriber","BufferSkipCountSubscriber","call","subscriber","subscribe","destination","buffer","_next","value","push","length","next","_complete","buffers","count","i","splice","shift"],"sources":["/home/arctichawk1/Desktop/Projects/Public/Kargi-Sitesi/node_modules/rxjs/_esm2015/internal/operators/bufferCount.js"],"sourcesContent":["import { Subscriber } from '../Subscriber';\nexport function bufferCount(bufferSize, startBufferEvery = null) {\n return function bufferCountOperatorFunction(source) {\n return source.lift(new BufferCountOperator(bufferSize, startBufferEvery));\n };\n}\nclass BufferCountOperator {\n constructor(bufferSize, startBufferEvery) {\n this.bufferSize = bufferSize;\n this.startBufferEvery = startBufferEvery;\n if (!startBufferEvery || bufferSize === startBufferEvery) {\n this.subscriberClass = BufferCountSubscriber;\n }\n else {\n this.subscriberClass = BufferSkipCountSubscriber;\n }\n }\n call(subscriber, source) {\n return source.subscribe(new this.subscriberClass(subscriber, this.bufferSize, this.startBufferEvery));\n }\n}\nclass BufferCountSubscriber extends Subscriber {\n constructor(destination, bufferSize) {\n super(destination);\n this.bufferSize = bufferSize;\n this.buffer = [];\n }\n _next(value) {\n const buffer = this.buffer;\n buffer.push(value);\n if (buffer.length == this.bufferSize) {\n this.destination.next(buffer);\n this.buffer = [];\n }\n }\n _co