Skip to content

Preserve zero input in Node API#2591

Open
vetrovk wants to merge 1 commit into
gchq:masterfrom
vetrovk:fix/node-api-zero-input
Open

Preserve zero input in Node API#2591
vetrovk wants to merge 1 commit into
gchq:masterfrom
vetrovk:fix/node-api-zero-input

Conversation

@vetrovk

@vetrovk vetrovk commented Jun 22, 2026

Copy link
Copy Markdown

Fixes #2590.

This change preserves numeric 0 as valid input in the Node API instead of treating it as missing input.

Changes:

  • preserve 0 in Node API input normalization
  • preserve 0 in Dish construction
  • add regression coverage for chef.toHex(0), chef.bake(0, ...), chef.ADD(0, ...), and new Dish(0)
  • keep existing behavior for empty string and false

Validation:

  • env PATH="/opt/homebrew/opt/node@24/bin:$PATH" npm ci
  • env PATH="/opt/homebrew/opt/node@24/bin:$PATH" node --no-warnings --no-deprecation --openssl-legacy-provider tests/node/index.mjs
  • env PATH="/opt/homebrew/opt/node@24/bin:$PATH" npm run testnodeconsumer
  • env PATH="/opt/homebrew/opt/node@24/bin:$PATH" npm run lint
  • git diff --check

Notes:

  • Validation ran with Node v24.17.0 and npm 11.13.0.

@CLAassistant

CLAassistant commented Jun 22, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

Node API treats numeric 0 input as an empty dish

2 participants