mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 18:25:24 +00:00
Changed filterValid to use getValidated instead of isValid and to reduce the valid values
This commit is contained in:
@@ -254,5 +254,13 @@ export function filterValid<T extends Object>(
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
return source.filter((current) => isValid(current, schema));
|
return source.reduce((acc, current) => {
|
||||||
|
const validation = getValidated(current, schema);
|
||||||
|
|
||||||
|
if (!validation) {
|
||||||
|
return acc;
|
||||||
|
}
|
||||||
|
|
||||||
|
return [...acc, validation];
|
||||||
|
}, []);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user