Skip to content

Commit

Permalink
Fix bug when using array cardinalities
Browse files Browse the repository at this point in the history
Using array cardinalities would result in the blueprint using the
`Array.filter` function as the filter for the selector, causing the
filtered set to always have size 0

Change-type: patch
  • Loading branch information
pipex committed Feb 4, 2025
1 parent 7c78044 commit 5198c53
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/blueprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ export default class Blueprint extends Contract {
(accumulator: any, value, type) => {
const selector = {
cardinality: parse(value.cardinality || value) as any,
filter: value.filter,
// Array has its own `filter` function, which we need to ignore
filter: Array.isArray(value) ? undefined : value.filter,
type: value.type || type,
version: value.version,
};
Expand Down

0 comments on commit 5198c53

Please sign in to comment.