Comparing version 10.0.1 to 10.1.0
@@ -15,3 +15,3 @@ import {PackageJson} from 'type-fest'; | ||
export interface Flag<Type extends FlagType, Default> { | ||
export interface Flag<Type extends FlagType, Default, IsMultiple = false> { | ||
readonly type?: Type; | ||
@@ -21,8 +21,8 @@ readonly alias?: string; | ||
readonly isRequired?: boolean | IsRequiredPredicate; | ||
readonly isMultiple?: boolean; | ||
readonly isMultiple?: IsMultiple; | ||
} | ||
type StringFlag = Flag<'string', string>; | ||
type BooleanFlag = Flag<'boolean', boolean>; | ||
type NumberFlag = Flag<'number', number>; | ||
type StringFlag = Flag<'string', string> | Flag<'string', string[], true>; | ||
type BooleanFlag = Flag<'boolean', boolean> | Flag<'boolean', boolean[], true>; | ||
type NumberFlag = Flag<'number', number> | Flag<'number', number[], true>; | ||
type AnyFlag = StringFlag | BooleanFlag | NumberFlag; | ||
@@ -318,3 +318,2 @@ type AnyFlags = Record<string, AnyFlag>; | ||
export default function meow<Flags extends AnyFlags>(helpMessage: string, options?: Options<Flags>): Result<Flags>; | ||
// eslint-disable-next-line no-redeclare | ||
export default function meow<Flags extends AnyFlags>(options?: Options<Flags>): Result<Flags>; |
18
index.js
@@ -64,3 +64,3 @@ import {dirname} from 'node:path'; | ||
`Unknown flag${unknownFlags.length > 1 ? 's' : ''}`, | ||
...unknownFlags | ||
...unknownFlags, | ||
].join('\n')); | ||
@@ -76,5 +76,5 @@ }; | ||
if ( | ||
typeof booleanDefault !== 'undefined' && | ||
flag.type === 'boolean' && | ||
!Object.prototype.hasOwnProperty.call(flag, 'default') | ||
typeof booleanDefault !== 'undefined' | ||
&& flag.type === 'boolean' | ||
&& !Object.prototype.hasOwnProperty.call(flag, 'default') | ||
) { | ||
@@ -116,3 +116,3 @@ flag.default = flag.isMultiple ? [booleanDefault] : booleanDefault; | ||
cwd: dirname(fileURLToPath(options.importMeta.url)), | ||
normalize: false | ||
normalize: false, | ||
}); | ||
@@ -132,3 +132,3 @@ | ||
allowUnknownFlags: true, | ||
...options | ||
...options, | ||
}; | ||
@@ -143,3 +143,3 @@ | ||
arguments: options.input, | ||
...buildParserFlags(options) | ||
...buildParserFlags(options), | ||
}; | ||
@@ -157,3 +157,3 @@ | ||
...parserOptions.configuration, | ||
'greedy-arrays': false | ||
'greedy-arrays': false, | ||
}; | ||
@@ -236,3 +236,3 @@ | ||
showHelp, | ||
showVersion | ||
showVersion, | ||
}; | ||
@@ -239,0 +239,0 @@ }; |
{ | ||
"name": "meow", | ||
"version": "10.0.1", | ||
"version": "10.1.0", | ||
"description": "CLI app helper", | ||
@@ -45,4 +45,4 @@ "license": "MIT", | ||
"dependencies": { | ||
"@types/minimist": "^1.2.1", | ||
"camelcase-keys": "^6.2.2", | ||
"@types/minimist": "^1.2.2", | ||
"camelcase-keys": "^7.0.0", | ||
"decamelize": "^5.0.0", | ||
@@ -55,13 +55,13 @@ "decamelize-keys": "^1.1.0", | ||
"redent": "^4.0.0", | ||
"trim-newlines": "^4.0.1", | ||
"type-fest": "^1.0.2", | ||
"yargs-parser": "^20.2.7" | ||
"trim-newlines": "^4.0.2", | ||
"type-fest": "^1.2.2", | ||
"yargs-parser": "^20.2.9" | ||
}, | ||
"devDependencies": { | ||
"ava": "^3.15.0", | ||
"execa": "^5.0.0", | ||
"execa": "^5.1.1", | ||
"indent-string": "^5.0.0", | ||
"read-pkg": "^6.0.0", | ||
"tsd": "^0.14.0", | ||
"xo": "^0.39.1" | ||
"tsd": "^0.17.0", | ||
"xo": "^0.41.0" | ||
}, | ||
@@ -68,0 +68,0 @@ "xo": { |
@@ -224,3 +224,3 @@ # meow | ||
```js | ||
const meow from 'meow'; | ||
import meow from 'meow'; | ||
@@ -227,0 +227,0 @@ const cli = meow(` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24760
443
+ Addedcamelcase@6.3.0(transitive)
+ Addedcamelcase-keys@7.0.2(transitive)
+ Addedquick-lru@5.1.1(transitive)
- Removedcamelcase@5.3.1(transitive)
- Removedcamelcase-keys@6.2.2(transitive)
- Removedquick-lru@4.0.1(transitive)
Updated@types/minimist@^1.2.2
Updatedcamelcase-keys@^7.0.0
Updatedtrim-newlines@^4.0.2
Updatedtype-fest@^1.2.2
Updatedyargs-parser@^20.2.9