# Data flow — remeda/remeda

> Canonical page: https://codevetter.com/unpack/remeda/data-flow

# Data flow — remeda/remeda

Scanned commit 9955bb0eca98cc5d1bbb17dc4314dd38a10a28d5 (2026-10-01). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

Library input crosses an overload boundary into either immediate execution or a curried function carrying optional lazy metadata. Pipeline transformations keep their working state within the invocation and produce arrays or single values without a persistence service. Documentation follows a separate path from TypeScript reflections through validated Astro records into rendered HTML. Browser theme preferences form the concrete persistent user-state path inspected here.
- purry computes fn.length minus args.length: zero invokes fn immediately, one creates a data-last wrapper, and any other difference throws Wrong number of arguments. — [packages/remeda/src/purry.ts#L46-L65](https://github.com/remeda/remeda/blob/9955bb0eca98cc5d1bbb17dc4314dd38a10a28d5/packages/remeda/src/purry.ts#L46-L65) [packages/remeda/src/internal/lazyDataLastImpl.ts#L13-L27](https://github.com/remeda/remeda/blob/9955bb0eca98cc5d1bbb17dc4314dd38a10a28d5/packages/remeda/src/internal/lazyDataLastImpl.ts#L13-L27)
- Direct map and filter calls delegate to native array methods with the original input array available to callbacks; their data-last functions additionally carry lazy and lazyArgs metadata when constructed through purry. — [packages/remeda/src/map.ts#L53-L70](https://github.com/remeda/remeda/blob/9955bb0eca98cc5d1bbb17dc4314dd38a10a28d5/packages/remeda/src/map.ts#L53-L70) [packages/remeda/src/filter.ts#L79-L95](https://github.com/remeda/remeda/blob/9955bb0eca98cc5d1bbb17dc4314dd38a10a28d5/packages/remeda/src/filter.ts#L79-L95) [packages/remeda/src/internal/lazyDataLastImpl.ts#L23-L27](https://github.com/remeda/remeda/blob/9955bb0eca98cc5d1bbb17dc4314dd38a10a28d5/packages/remeda/src/internal/lazyDataLastImpl.ts#L23-L27)
- pipe instantiates evaluators once per invocation, groups adjacent lazy steps for iterable outputs, accumulates their results, and unwraps the first accumulated item when the terminal evaluator is marked single. — [packages/remeda/src/pipe.ts#L285-L319](https://github.com/remeda/remeda/blob/9955bb0eca98cc5d1bbb17dc4314dd38a10a28d5/packages/remeda/src/pipe.ts#L285-L319) [packages/remeda/src/pipe.ts#L322-L342](https://github.com/remeda/remeda/blob/9955bb0eca98cc5d1bbb17dc4314dd38a10a28d5/packages/remeda/src/pipe.ts#L322-L342)
- Each lazy step records its incoming values before calling its evaluator; hasNext controls forwarding, hasMany recursively processes expanded values, and done propagates early termination to the outer iterable loop. — [packages/remeda/src/pipe.ts#L344-L358](https://github.com/remeda/remeda/blob/9955bb0eca98cc5d1bbb17dc4314dd38a10a28d5/packages/remeda/src/pipe.ts#L344-L358) [packages/remeda/src/pipe.ts#L373-L412](https://github.com/remeda/remeda/blob/9955bb0eca98cc5d1bbb17dc4314dd38a10a28d5/packages/remeda/src/pipe.ts#L373-L412)
- groupBy invokes its callback with item, index, and full input, skips undefined keys, accumulates nonempty arrays in a null-prototype object, then restores Object.prototype before returning. — [packages/remeda/src/groupBy.ts#L77-L110](https://github.com/remeda/remeda/blob/9955bb0eca98cc5d1bbb17dc4314dd38a10a28d5/packages/remeda/src/groupBy.ts#L77-L110)
- The functions collection resolves the installed workspace package to a real path and passes its tsconfig and src/index.ts to TypeDoc; function reflections are parsed into named, digested Astro store entries. — [packages/docs/src/lib/typedoc/internal-package-dir.ts#L6-L18](https://github.com/remeda/remeda/blob/9955bb0eca98cc5d1bbb17dc4314dd38a10a28d5/packages/docs/src/lib/typedoc/internal-package-dir.ts#L6-L18) [packages/docs/src/content/functions/content.config.ts#L8-L32](https://github.com/remeda/remeda/blob/9955bb0eca98cc5d1bbb17dc4314dd38a10a28d5/packages/docs/src/content/functions/content.config.ts#L8-L32) [packages/docs/src/lib/typedoc/loader.ts#L55-L63](https://github.com/remeda/remeda/blob/9955bb0eca98cc5d1bbb17dc4314dd38a10a28d5/packages/docs/src/lib/typedoc/loader.ts#L55-L63) [packages/docs/src/lib/typedoc/loader.ts#L96-L110](https://github.com/remeda/remeda/blob/9955bb0eca98cc5d1bbb17dc4314dd38a10a28d5/packages/docs/src/lib/typedoc/loader.ts#L96-L110)
- getFunctions groups stored functions by the first signature's category tag; cards deduplicate signatures by @signature and place data-last variants last, while description Markdown passes through marked and DOMPurify before HTML insertion. — [packages/docs/src/lib/functions/entries.ts#L9-L19](https://github.com/remeda/remeda/blob/9955bb0eca98cc5d1bbb17dc4314dd38a10a28d5/packages/docs/src/lib/functions/entries.ts#L9-L19) [packages/docs/src/components/function-card.astro#L35-L43](https://github.com/remeda/remeda/blob/9955bb0eca98cc5d1bbb17dc4314dd38a10a28d5/packages/docs/src/components/function-card.astro#L35-L43) [packages/docs/src/lib/as-html.ts#L15-L18](https://github.com/remeda/remeda/blob/9955bb0eca98cc5d1bbb17dc4314dd38a10a28d5/packages/docs/src/lib/as-html.ts#L15-L18) [packages/docs/src/components/markdown.astro#L8-L12](https://github.com/remeda/remeda/blob/9955bb0eca98cc5d1bbb17dc4314dd38a10a28d5/packages/docs/src/components/markdown.astro#L8-L12)
- Theme selection changes the document's dark class and DocSearch data-theme attribute; explicit light/dark choices persist under localStorage key theme, while system selection removes that entry and consults matchMedia. — [packages/docs/src/lib/theme.ts#L1-L8](https://github.com/remeda/remeda/blob/9955bb0eca98cc5d1bbb17dc4314dd38a10a28d5/packages/docs/src/lib/theme.ts#L1-L8) [packages/docs/src/lib/theme.ts#L28-L65](https://github.com/remeda/remeda/blob/9955bb0eca98cc5d1bbb17dc4314dd38a10a28d5/packages/docs/src/lib/theme.ts#L28-L65)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
