You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importprogramfrom'commander';program.getOptions=program.opts;console.log('program.opts before',program.opts);// prints body of opts() functionprogram.option('--opts <path>','specify opts path','test/mocha.opts');program.parse(process.argv);console.log('program.opts after',program.opts);// prints test/mocha.optsconsole.log('program.opts()',program.opts());// errors, is not a functionconsole.log('program.opts().opts',program.getOptions().opts);// this is the workaround that works.
Shouldnt the function be protected from being overridden?
it's easy enough to use program.opts().opts to get any properties that would override default functions.
But in cases (like in the mocha code) where they are using the overridden property program.opts it will introduce errors.
Thus it is a breaking change. but none the less the workaround introduce more problems with reuse then anything else.
The text was updated successfully, but these errors were encountered:
Shouldnt the function be protected from being overridden?
it's easy enough to use
program.opts().opts
to get any properties that would override default functions.But in cases (like in the mocha code) where they are using the overridden property
program.opts
it will introduce errors.Thus it is a breaking change. but none the less the workaround introduce more problems with reuse then anything else.
The text was updated successfully, but these errors were encountered: