Skip to content

Commit

Permalink
Avoid long lines
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Feb 23, 2018
1 parent 9a6c55b commit 2f8cc52
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions blocks/api/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ import { createBlock } from './factory';
* @return {boolean} Whether the list of blocks matches a templates
*/
export function doesBlocksMatchTemplate( blocks = [], template = [] ) {
return blocks.length === template.length && every( template, ( [ name,, innerBlocksTemplate ], index ) => {
const block = blocks[ index ];
return name === block.name && doesBlocksMatchTemplate( block.innerBlocks, innerBlocksTemplate );
} );
return (
blocks.length === template.length &&
every( template, ( [ name, , innerBlocksTemplate ], index ) => {
const block = blocks[ index ];
return (
name === block.name &&
doesBlocksMatchTemplate( block.innerBlocks, innerBlocksTemplate )
);
} )
);
}

/**
Expand Down

0 comments on commit 2f8cc52

Please sign in to comment.