template-saas/apps/backend/node_modules/iterare/lib/flatten.js
rckrdmrd 26f0e52ca7 feat: Initial commit - template-saas
Template base para proyectos SaaS multi-tenant.

Estructura inicial:
- apps/backend (NestJS API)
- apps/frontend (React/Vite)
- apps/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:24 -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