michangarrito/apps/whatsapp-service/node_modules/iterare/lib/slice.js
rckrdmrd 48dea7a5d0 feat: Initial commit - michangarrito
Marketplace móvil para negocios locales mexicanos.

Estructura inicial:
- apps/backend (NestJS API)
- apps/frontend (React Web)
- apps/mobile (Expo/React Native)
- apps/mcp-server (Claude MCP Server)
- apps/whatsapp-service (WhatsApp Business API)
- database/ (PostgreSQL DDL)
- docs/ (Documentación)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 04:41:02 -06:00

33 lines
986 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class SliceIterator {
/**
* @param {Iterator<T>} source Source Iterator
* @param {number} start Zero-based positive start index, inclusive
* @param {number} end Zero-based positive end index, exclusive, defaults to end of iterator
*/
constructor(source, start, end = Infinity) {
this.source = source;
this.start = start;
this.end = end;
this.i = 0;
}
next() {
// Skip elements before start
while (this.i < this.start) {
const result = this.source.next();
if (result.done) {
return result;
}
this.i++;
}
// Finish when end is reached
this.i++;
if (this.i >= this.end) {
return { done: true };
}
return this.source.next();
}
}
exports.SliceIterator = SliceIterator;
//# sourceMappingURL=slice.js.map