]> git.ardis.lu - envpass/commit
Manually narrow the return type of `parseEnv`
authorArdis Lu <ardisglu@gmail.com>
Wed, 22 Jul 2026 07:35:47 +0000 (00:35 -0700)
committerArdis Lu <ardisglu@gmail.com>
Wed, 22 Jul 2026 07:35:47 +0000 (00:35 -0700)
commit8374efadfc751aa2a5db43cff96109ffb230690b
tree5ee8e2037a55d6a8dbdfd3f21a62c522dc8109a1
parentf5b70dcb1641acc49361c84aa326f5c6262c35e9
Manually narrow the return type of `parseEnv`

`Record<string, string>` clarifies that `value` can never be `undefined`, whereas `NodeJS.Dict<string>` allows `undefined`. This change allows the deletion of an unreachable and untestable code branch without raising type errors. The new return type matches the actual type used in the Node.js codebase [0].

[0] https://github.com/nodejs/node/blob/fbab4586118ccd225d06706fe6502e063354b765/lib/util.js#L485-L493
src/command.js
This page took 0.036136 seconds and 4 git commands to generate.