Skip to content

Commit

Permalink
fix(useArrayDifference): error with falsey (#2869)
Browse files Browse the repository at this point in the history
Co-authored-by: lix <lixin@hiekn.com>
  • Loading branch information
simpleoo0o and simpleoo0o4work committed Mar 22, 2023
1 parent 7b27148 commit 418585d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/shared/useArrayDifference/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ export function useArrayDifference<T>(...args: any[]): ComputedRef<T[]> {
const key = compareFn as keyof T
compareFn = (value: T, othVal: T) => value[key] === othVal[key]
}
return computed(() => resolveUnref(list).filter(x => !resolveUnref(values).find(y => compareFn(x, y))))
return computed(() => resolveUnref(list).filter(x => resolveUnref(values).findIndex(y => compareFn(x, y)) === -1))
}

0 comments on commit 418585d

Please sign in to comment.