Skip to content

fix(stream-transform): preserve objects with a non-callable then field - #527

Merged
wdavidw merged 1 commit into
adaltas:masterfrom
20ns:fix/transform-non-callable-then
Oct 11, 2026
Merged

wdavidw merged 1 commit into
adaltas:masterfrom
20ns:fix/transform-non-callable-then

Conversation

@20ns

@20ns 20ns commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Returning { then: "next" } from a handler currently fails with TypeError: result.then is not a function. This can happen when transforming CSV records with a column named then.

Check that then is a function before calling it. The existing object-return test now covers a string-valued then field.

The regression fails before the fix and passes afterward. Checked on Node.js 22.22.0:

  • All 81 stream-transform tests and TypeScript checks pass.
  • All 14 workspace checks pass.
  • The package build, changed-file lint and formatting checks pass.
  • Callback, stream and sync checks preserve ordinary objects. Native promises and callable thenables still work.

@wdavidw
wdavidw merged commit f5e0176 into adaltas:master Oct 11, 2026
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.

2 participants