From 01d560407c2b78bb2dc1b434c7127397cfbebacb Mon Sep 17 00:00:00 2001 From: Govert de Gans Date: Sun, 23 Jun 2024 04:31:54 +0200 Subject: [PATCH] fix-fix: actually check the type of the right variable in $remove --- src/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index 9e7e039..dd33c4c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -432,15 +432,15 @@ export function handleActions( const value = findNamedChild(input.$remove[1], context, false) - if (!Array.isArray(value)) { - break - } - // clone the thing let array: unknown[] = deepClone( findNamedChild(reference, context, true) ) + if (!Array.isArray(array)) { + break + } + array = array.filter((item) => item !== value) set(context, reference, array)