Skip to content

Commit

Permalink
Lodash: Refactor blocks away from _.reduce() (#45457)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla authored Nov 3, 2022
1 parent 4fd9c3c commit 3459353
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/blocks/src/api/utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* External dependencies
*/
import { reduce } from 'lodash';
import { colord, extend } from 'colord';
import namesPlugin from 'colord/plugins/names';
import a11yPlugin from 'colord/plugins/a11y';
Expand Down Expand Up @@ -257,9 +256,8 @@ export function __experimentalSanitizeBlockAttributes( name, attributes ) {
throw new Error( `Block type '${ name }' is not registered.` );
}

return reduce(
blockType.attributes,
( accumulator, schema, key ) => {
return Object.entries( blockType.attributes ).reduce(
( accumulator, [ key, schema ] ) => {
const value = attributes[ key ];

if ( undefined !== value ) {
Expand Down

0 comments on commit 3459353

Please sign in to comment.