Skip to content

Commit 5eab203

Browse files
author
Yury Shapkarin
committed
fix required prop with predefined type
1 parent 8de0d44 commit 5eab203

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bin/initialize.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,9 @@ program
229229

230230
let result = {};
231231
for (prop of propsWithTypes) {
232-
result[prop.match(/^[a-z0-9]+/ig)[0]] = prop.match(/:[a-z0-9]+/ig)[0].substring(1);
232+
const match = prop.match(/^[a-z0-9]+|\*/ig);
233+
const key = match[0] + (match[1] ? '*' : '');
234+
result[key] = prop.match(/:[a-z0-9]+/ig)[0].substring(1);
233235
};
234236

235237
propNames = propsWithoutTypes;

0 commit comments

Comments
 (0)