File tree 3 files changed +17
-14
lines changed
3 files changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ declare namespace meow {
26
26
type NumberFlag = Flag < 'number' , number > ;
27
27
28
28
type AnyFlag = StringFlag | BooleanFlag | NumberFlag ;
29
- type AnyFlags = { [ key : string ] : AnyFlag } ;
29
+ type AnyFlags = Record < string , AnyFlag > ;
30
30
31
31
interface Options < Flags extends AnyFlags > {
32
32
/**
@@ -107,7 +107,7 @@ declare namespace meow {
107
107
108
108
_You most likely don't need this option._
109
109
*/
110
- readonly pkg ?: { [ key : string ] : unknown } ;
110
+ readonly pkg ?: Record < string , unknown > ;
111
111
112
112
/**
113
113
Custom arguments object.
@@ -232,12 +232,12 @@ declare namespace meow {
232
232
/**
233
233
Flags converted to camelCase excluding aliases.
234
234
*/
235
- flags : TypedFlags < Flags > & { [ name : string ] : unknown } ;
235
+ flags : TypedFlags < Flags > & Record < string , unknown > ;
236
236
237
237
/**
238
238
Flags converted camelCase including aliases.
239
239
*/
240
- unnormalizedFlags : TypedFlags < Flags > & { [ name : string ] : unknown } ;
240
+ unnormalizedFlags : TypedFlags < Flags > & Record < string , unknown > ;
241
241
242
242
/**
243
243
The `package.json` object.
Original file line number Diff line number Diff line change @@ -54,8 +54,10 @@ const reportMissingRequiredFlags = missingRequiredFlags => {
54
54
}
55
55
} ;
56
56
57
- const buildParserFlags = ( { flags, booleanDefault} ) =>
58
- Object . entries ( flags ) . reduce ( ( parserFlags , [ flagKey , flagValue ] ) => {
57
+ const buildParserFlags = ( { flags, booleanDefault} ) => {
58
+ const parserFlags = { } ;
59
+
60
+ for ( const [ flagKey , flagValue ] of Object . entries ( flags ) ) {
59
61
const flag = { ...flagValue } ;
60
62
61
63
if (
@@ -73,9 +75,10 @@ const buildParserFlags = ({flags, booleanDefault}) =>
73
75
}
74
76
75
77
parserFlags [ flagKey ] = flag ;
78
+ }
76
79
77
- return parserFlags ;
78
- } , { } ) ;
80
+ return parserFlags ;
81
+ } ;
79
82
80
83
const validateFlags = ( flags , options ) => {
81
84
for ( const [ flagKey , flagValue ] of Object . entries ( options . flags ) ) {
Original file line number Diff line number Diff line change 45
45
"decamelize-keys" : " ^1.1.0" ,
46
46
"hard-rejection" : " ^2.1.0" ,
47
47
"minimist-options" : " 4.1.0" ,
48
- "normalize-package-data" : " ^2.5 .0" ,
48
+ "normalize-package-data" : " ^3.0 .0" ,
49
49
"read-pkg-up" : " ^7.0.1" ,
50
50
"redent" : " ^3.0.0" ,
51
51
"trim-newlines" : " ^3.0.0" ,
52
- "type-fest" : " ^0.13.1 " ,
53
- "yargs-parser" : " ^18.1 .3"
52
+ "type-fest" : " ^0.18.0 " ,
53
+ "yargs-parser" : " ^20.2 .3"
54
54
},
55
55
"devDependencies" : {
56
56
"ava" : " ^2.4.0" ,
57
- "execa" : " ^4.0 .0" ,
57
+ "execa" : " ^4.1 .0" ,
58
58
"indent-string" : " ^4.0.0" ,
59
- "tsd" : " ^0.11.0 " ,
60
- "xo" : " ^0.30.0 "
59
+ "tsd" : " ^0.13.1 " ,
60
+ "xo" : " ^0.34.1 "
61
61
},
62
62
"xo" : {
63
63
"rules" : {
You can’t perform that action at this time.
0 commit comments