Skip to content

Commit

Permalink
refactor: use object object spread rather than Object.assign
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdlg committed Jul 17, 2018
1 parent 5491e3b commit 683cf3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/glob-assets.js
Expand Up @@ -27,12 +27,12 @@ module.exports = async assets =>
// - `path` of the matched file
// - `name` based on the actual file name (to avoid assets with duplicate `name`)
// - other properties of the original asset definition
return globbed.map(file => Object.assign({}, asset, {path: file, name: basename(file)}));
return globbed.map(file => ({...asset, path: file, name: basename(file)}));
}
// If asset is an Object, output an Object definition with:
// - `path` of the matched file if there is one, or the original `path` definition (will be considered as a missing file)
// - other properties of the original asset definition
return Object.assign({}, asset, {path: globbed[0] || asset.path});
return {...asset, path: globbed[0] || asset.path};
}
if (globbed.length > 0) {
// If asset is a String definition, output each files matched
Expand Down

0 comments on commit 683cf3d

Please sign in to comment.