Commit ba15e368 authored by Guilherme Gazzo's avatar Guilherme Gazzo
Browse files

Fix conditional

parent 4c049ef7
......@@ -180,7 +180,6 @@ const conditionsMatch = (conditions: Conditions = undefined, filters: Conditiona
if (!conditions) {
return false;
}
if (Array.isArray(filters.engine) && !filters.engine.includes(conditions.engine)) {
return false;
}
......@@ -188,9 +187,9 @@ const conditionsMatch = (conditions: Conditions = undefined, filters: Conditiona
return true;
};
const createSurfaceRenderer = <T>(allowedBlockTypes?: ElementType[]) =>
const createSurfaceRenderer = <T>(allowedBlockTypes?: ElementType[], conditions?: Conditions) =>
(parser: IParser<T>) =>
(blocks: unknown, conditions?: Conditions): any => {
(blocks: unknown): any => {
if (!Array.isArray(blocks)) {
return [];
}
......@@ -338,3 +337,5 @@ export {
};
export * from './blocks';
console.log(`ui-kit version: ${ process.env.VERSION }`);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment