Skip to content

Commit 683cf3d

Browse files
committed
refactor: use object object spread rather than Object.assign
1 parent 5491e3b commit 683cf3d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/glob-assets.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ module.exports = async assets =>
2727
// - `path` of the matched file
2828
// - `name` based on the actual file name (to avoid assets with duplicate `name`)
2929
// - other properties of the original asset definition
30-
return globbed.map(file => Object.assign({}, asset, {path: file, name: basename(file)}));
30+
return globbed.map(file => ({...asset, path: file, name: basename(file)}));
3131
}
3232
// If asset is an Object, output an Object definition with:
3333
// - `path` of the matched file if there is one, or the original `path` definition (will be considered as a missing file)
3434
// - other properties of the original asset definition
35-
return Object.assign({}, asset, {path: globbed[0] || asset.path});
35+
return {...asset, path: globbed[0] || asset.path};
3636
}
3737
if (globbed.length > 0) {
3838
// If asset is a String definition, output each files matched

0 commit comments

Comments
 (0)