Skip to content

Commit 98c8681

Browse files
committed
refactor: use object spread rather intead Object.assign
1 parent cbf0ea1 commit 98c8681

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/index.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ async function processResult(ctx, result) {
2525
if (typeof projectConfig === 'function') {
2626
projectConfig = projectConfig(ctx)
2727
} else {
28-
projectConfig = Object.assign({}, projectConfig, ctx)
28+
projectConfig = { ...projectConfig, ...ctx }
2929
}
3030

3131
if (!projectConfig.plugins) {
@@ -55,13 +55,11 @@ function createContext(ctx) {
5555
* @prop {String} cwd=process.cwd() Config search start location
5656
* @prop {String} env=process.env.NODE_ENV Config Enviroment, will be set to `development` by `postcss-load-config` if `process.env.NODE_ENV` is `undefined`
5757
*/
58-
ctx = Object.assign(
59-
{
60-
cwd: process.cwd(),
61-
env: process.env.NODE_ENV
62-
},
63-
ctx
64-
)
58+
ctx = {
59+
cwd: process.cwd(),
60+
env: process.env.NODE_ENV,
61+
...ctx
62+
}
6563

6664
if (!ctx.env) {
6765
process.env.NODE_ENV = 'development'

0 commit comments

Comments
 (0)