Skip to content

Commit

Permalink
remove double ternary op
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed Apr 16, 2024
1 parent 26844a1 commit f6e19c3
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ const searchRegex = computed(() => {
/** Wraps value prop so it can be set, and always returns an array */
const selected = computed({
get() {
return props.value === null ? [] : Array.isArray(props.value) ? props.value : [props.value];
if (props.value === null) {
return [];
} else if (Array.isArray(props.value)) {
return props.value;
} else {
return [props.value];
}
},
set(value) {
emit("input", value);
Expand Down

0 comments on commit f6e19c3

Please sign in to comment.