michangarrito/apps/backend/node_modules/iterare/lib/flatten.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

30 lines
959 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("./utils");
class FlattenIterator {
constructor(outer) {
this.outer = outer;
}
next() {
// Currently iterating over an inner Iterable?
if (this.inner) {
const result = this.inner.next();
// If not done, return result
if (!result.done) {
return result;
}
// Else stop iterating inner Iterable
this.inner = undefined;
}
// Continue with next outer element
const { value, done } = this.outer.next();
// If the value is iterable, start iterating over it
if (utils_1.isIterable(value)) {
this.inner = value[Symbol.iterator]();
return this.next();
}
return { value, done };
}
}
exports.FlattenIterator = FlattenIterator;
//# sourceMappingURL=flatten.js.map