Skip to content

Commit

Permalink
Simplify slimImageObjects method
Browse files Browse the repository at this point in the history
  • Loading branch information
mkaz committed Jun 30, 2017
1 parent da19f15 commit 5c535e2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions blocks/library/gallery/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ const editMediaLibrary = ( attributes, setAttributes ) => {
// we only need this set to display the image in the library
const slimImageObjects = ( imgs ) => {
const attrSet = [ 'sizes', 'mime', 'type', 'subtype', 'id', 'url', 'alt' ];
const newImgs = [];
imgs.forEach( ( img ) => {
newImgs.push( pick( img, attrSet ) );
} );
return newImgs;
return imgs.map( ( img ) => pick( img, attrSet ) );
};

function defaultColumnsNumber( attributes ) {
Expand Down

0 comments on commit 5c535e2

Please sign in to comment.