Skip to content

Commit

Permalink
fix-fix: actually check the type of the right variable in $remove
Browse files Browse the repository at this point in the history
  • Loading branch information
grappigegovert committed Jun 23, 2024
1 parent 729c89e commit 01d5604
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,15 +432,15 @@ export function handleActions<Context>(

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)
Expand Down

0 comments on commit 01d5604

Please sign in to comment.