diff --git a/package.json b/package.json index c622716..b6284e5 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "read-pkg-up": "^9.1.0", "redent": "^4.0.0", "trim-newlines": "^5.0.0", - "type-fest": "^3.7.1", + "type-fest": "^3.9.0", "yargs-parser": "^21.1.1" }, "devDependencies": { @@ -63,13 +63,14 @@ "common-tags": "^1.8.2", "execa": "^7.1.1", "indent-string": "^5.0.0", - "read-pkg": "^7.1.0", - "tsd": "^0.28.0", - "xo": "^0.53.1" + "read-pkg": "^8.0.0", + "tsd": "^0.28.1", + "xo": "^0.54.2" }, "xo": { "rules": { - "unicorn/no-process-exit": "off" + "unicorn/no-process-exit": "off", + "unicorn/error-message": "off" } }, "ava": { diff --git a/readme.md b/readme.md index d82246f..f20b6d1 100644 --- a/readme.md +++ b/readme.md @@ -18,14 +18,14 @@ ## Install -``` -$ npm install meow +```sh +npm install meow ``` ## Usage -``` -$ ./foo-app.js unicorns --rainbow +```sh +./foo-app.js unicorns --rainbow ``` ```js @@ -310,18 +310,4 @@ See [`get-stdin`](https://github.com/sindresorhus/get-stdin) if you want to acce See [`conf`](https://github.com/sindresorhus/conf) if you need to persist some data. -See [`update-notifier`](https://github.com/yeoman/update-notifier) if you want update notifications. - [More useful CLI utilities…](https://github.com/sindresorhus/awesome-nodejs#command-line-utilities) - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
diff --git a/source/parser.js b/source/parser.js index 8daa714..c025581 100644 --- a/source/parser.js +++ b/source/parser.js @@ -14,7 +14,7 @@ const buildParserFlags = ({flags, booleanDefault}) => { } if ( - typeof booleanDefault !== 'undefined' + booleanDefault !== undefined && flag.type === 'boolean' && !Object.hasOwn(flag, 'default') ) { diff --git a/source/validate.js b/source/validate.js index 5089316..effba37 100644 --- a/source/validate.js +++ b/source/validate.js @@ -87,7 +87,7 @@ const isFlagMissing = (flagName, definedFlags, receivedFlags, input) => { } } - if (typeof receivedFlags[flagName] === 'undefined') { + if (receivedFlags[flagName] === undefined) { return isFlagRequired; } @@ -103,7 +103,7 @@ const reportMissingRequiredFlags = missingRequiredFlags => { export const checkMissingRequiredFlags = (flags, receivedFlags, input) => { const missingRequiredFlags = []; - if (typeof flags === 'undefined') { + if (flags === undefined) { return []; }