Comparing version 8.1.1 to 8.1.2
@@ -35,3 +35,3 @@ import {PackageJson} from 'type-fest'; | ||
The key is the flag name in camel-case and the value is an object with any of: | ||
The key is the flag name and the value is an object with any of: | ||
@@ -46,4 +46,2 @@ - `type`: Type of value. (Possible values: `string` `boolean` `number`) | ||
Note that flags are always defined using a camel-case key (`myKey`), but will match arguments in kebab-case (`--my-key`). | ||
@example | ||
@@ -50,0 +48,0 @@ ``` |
11
index.js
@@ -6,3 +6,2 @@ 'use strict'; | ||
const camelCaseKeys = require('camelcase-keys'); | ||
const decamelize = require('decamelize'); | ||
const decamelizeKeys = require('decamelize-keys'); | ||
@@ -55,13 +54,6 @@ const trimNewlines = require('trim-newlines'); | ||
for (const flag of missingRequiredFlags) { | ||
console.error(`\t--${decamelize(flag.key, '-')}${flag.alias ? `, -${flag.alias}` : ''}`); | ||
console.error(`\t--${flag.key}${flag.alias ? `, -${flag.alias}` : ''}`); | ||
} | ||
}; | ||
const validateOptions = ({flags}) => { | ||
const invalidFlags = Object.keys(flags).filter(flagKey => flagKey.includes('-') && flagKey !== '--'); | ||
if (invalidFlags.length > 0) { | ||
throw new Error(`Flag keys may not contain '-': ${invalidFlags.join(', ')}`); | ||
} | ||
}; | ||
const reportUnknownFlags = unknownFlags => { | ||
@@ -138,3 +130,2 @@ console.error([ | ||
validateOptions(options); | ||
let parserOptions = { | ||
@@ -141,0 +132,0 @@ arguments: options.input, |
{ | ||
"name": "meow", | ||
"version": "8.1.1", | ||
"version": "8.1.2", | ||
"description": "CLI app helper", | ||
@@ -45,3 +45,2 @@ "license": "MIT", | ||
"camelcase-keys": "^6.2.2", | ||
"decamelize": "^1.2.0", | ||
"decamelize-keys": "^1.1.0", | ||
@@ -48,0 +47,0 @@ "hard-rejection": "^2.1.0", |
@@ -135,3 +135,3 @@ # meow | ||
The key is the flag name in camel-case and the value is an object with any of: | ||
The key is the flag name and the value is an object with any of: | ||
@@ -149,4 +149,2 @@ - `type`: Type of value. (Possible values: `string` `boolean` `number`) | ||
Note that flags are always defined using a camel-case key (`myKey`), but will match arguments in kebab-case (`--my-key`). | ||
Example: | ||
@@ -153,0 +151,0 @@ |
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
11
24124
433
351
- Removeddecamelize@^1.2.0