From 71bec727c8dbfd6a036d043743759c5df932639c Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 30 May 2025 21:27:52 +0200 Subject: [PATCH] cli: fix dealing with enum types with object value lists Convert to array before calling filter() Signed-off-by: Felix Fietkau --- package/utils/cli/files/usr/share/ucode/cli/types.uc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/utils/cli/files/usr/share/ucode/cli/types.uc b/package/utils/cli/files/usr/share/ucode/cli/types.uc index 46c563dfb34..def3b12d919 100644 --- a/package/utils/cli/files/usr/share/ucode/cli/types.uc +++ b/package/utils/cli/files/usr/share/ucode/cli/types.uc @@ -64,6 +64,8 @@ const types = { return val; let list = this.value; + if (type(list) == "object") + list = keys(list); if (this.ignore_case) { val = lc(val); val = filter(list, (v) => val == lc(v))[0];