fix(value-parser): option type is string
This commit is contained in:
parent
5540a582f0
commit
f87cf982f1
@ -22,10 +22,15 @@ export class StringValueParser extends BaseValueParser {
|
|||||||
const map = new Map();
|
const map = new Map();
|
||||||
const set = new Set();
|
const set = new Set();
|
||||||
for (const option of options) {
|
for (const option of options) {
|
||||||
|
if (typeof option === 'string') {
|
||||||
|
set.add(option);
|
||||||
|
map.set(option, option);
|
||||||
|
} else {
|
||||||
set.add(option.value);
|
set.add(option.value);
|
||||||
set.add(option.label);
|
set.add(option.label);
|
||||||
map.set(option.label, option.value);
|
map.set(option.label, option.value);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return { map, set };
|
return { map, set };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user