mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-05 08:02:18 +00:00
use array methods only on arrays
This commit is contained in:
@@ -74,6 +74,9 @@
|
||||
}
|
||||
|
||||
function findOptionsByValue(values: any[]) {
|
||||
if (!Array.isArray(values)) {
|
||||
return []
|
||||
}
|
||||
return options?.filter((item) => {
|
||||
let itemValue = item.value
|
||||
try {
|
||||
@@ -95,7 +98,7 @@
|
||||
}
|
||||
|
||||
function toValues(options: ObjectOption[] | undefined) {
|
||||
if (!options) {
|
||||
if (!options || !Array.isArray(options)) {
|
||||
return []
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user