minimistjs / minimist

parse argument options
MIT License
515 stars 30 forks source link

defaults option doesn't respect undefined #60

Closed johndeighan closed 4 months ago

johndeighan commented 5 months ago

If I want a particular option to have the default value undefined, and I don't supply that option on the command line, it isn't returned as undefined.

ljharb commented 5 months ago

Can you provide your code, and an example invocation and the results?

shadowspawn commented 5 months ago

I was not able to reproduce this problem from your description.

const parser = require('minimist');
const result = parser(process.argv.slice(2), {
    default: {foo: 'bar', example: undefined}
});
console.log(result);
% node index.js
{ _: [], foo: 'bar', example: undefined }
shadowspawn commented 4 months ago

There isn't enough information to help with this issue, and no activity in a month. Closing this issue as can't reproduce.

Feel free to open a new issue if it comes up again, with new information and renewed interest.