Handle non-array values

This commit is contained in:
Mel O'Hagan 2022-08-05 14:53:41 +01:00
parent 1a43b72dfe
commit 15ffa76d6f
1 changed files with 3 additions and 0 deletions

View File

@ -55,6 +55,9 @@
if (!values) {
return []
}
if (!Array.isArray(values)) {
values = [values]
}
return values.map(value => (typeof value === "object" ? value._id : value))
}