Skip to content

Return an empty array when zip has no inputs - #442

Open
nk-batman21 wants to merge 1 commit into
antonmedv:masterfrom
nk-batman21:fix-zip-empty-input
Open

nk-batman21 wants to merge 1 commit into
antonmedv:masterfrom
nk-batman21:fix-zip-empty-input

Conversation

@nk-batman21

Copy link
Copy Markdown

Transposing an empty array with fx 'x => zip(...x)' never finishes. With no input arrays, Math.min() produces Infinity, so zip keeps appending empty arrays. The Go preview eventually times out; the CLI and npm version keep running.

Return an empty array before entering the loop when no arrays were passed. Apply the same fix to both runtimes. Regressions run the actual transformation in the Go engine and the npm CLI, with a timeout so the old behavior cannot hang the test suite.

Validation: both regressions fail on the unchanged base. The full Go suite and all 37 npm tests pass on Linux; the engine suite, go vet ./internal/engine, and a built CLI smoke test pass on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant