-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Prompted by @aaronccasanova in #74 (comment), I started thinking through related pollution scenarios (#74 (comment)).
If this is something we care about, we have room for improvement. 🙊
const { parseArgs } = require('@pkgjs/parseargs');
// Somebody trampled all over prototypes...
Object.prototype.strict = false;
Object.prototype.args = ['--pollution', 'happened'];
Object.prototype.pollution = { type: 'string'};
const knownOptions = {
with: { short: 'w', type: 'string' },
bool: { short: 'b', type: 'boolean' }
};
console.log(parseArgs({ options: knownOptions }));
% node pollution.js --with VALUE -b
{ values: { pollution: 'happened' }, positionals: [] }
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request