Add zip
@ramongr is already working on this.
Since May 6, 2026.
Assessment
This issue has not been assessed yet.
Description
Operation
zip
Category
transformations
Proposed signature
export function zip<T extends readonly (readonly unknown[])[]>(
...arrays: T
): { [K in keyof T]: T[K] extends readonly (infer U)[] ? U : never }[]
Why this isn't covered by native ES/TS
No native equivalent.
Empty / edge-case behaviour
- No arguments →
[]. - Result length = length of the shortest input array (document this; an alternative
zipLongestcould be a follow-up). - Variadic arity preserved in the tuple type.
Examples
zip([1, 2, 3], ['a', 'b', 'c']); // [[1, 'a'], [2, 'b'], [3, 'c']]
zip([1, 2, 3], ['a', 'b'], [true]); // [[1, 'a', true]]
Acceptance criteria
- Implementation in
src/transformations/zip.ts - Re-exported from
src/transformations/index.ts - Tests in
tests/transformations/zip.test.ts(incl. unequal lengths, no args) - Docs added in
docs/transformations.md - README API table updated
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ramongr/op-array
-
additive v3-accepted
-
additive v3-accepted
-
additive v3-accepted
-
chore(v3.0): roadmap Openbreaking-change v3-accepted
All issues in ramongr/op-array
Similar issues
-
comp/dashboard P3 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
NousResearch/hermes-agent#117722 ·
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·