Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isPlainObject function is wrong #144

Closed
zozzz opened this issue Aug 18, 2020 · 3 comments
Closed

isPlainObject function is wrong #144

zozzz opened this issue Aug 18, 2020 · 3 comments

Comments

@zozzz
Copy link

zozzz commented Aug 18, 2020

Hi, this function is wrong:

function isPlainObject(a) {
return typeof a === "object";
}

because returns true when a is null so currently, isPlainObject(null) === true. Why not use is-plain-object package instead?

@bebraw
Copy link
Member

bebraw commented Aug 18, 2020

I went with the minimal amount of external dependencies.

Can you send me a test case where the current check is problematic? Simple configurations to merge would do.

@zozzz
Copy link
Author

zozzz commented Aug 18, 2020

const { merge } = require("webpack-merge")

const a = {
    devServer: { base: true }
}

const b = {
    devServer: null
}

console.log(merge(a, b))

expected result: { devServer: null }

@bebraw bebraw closed this as completed in 4eb811c Aug 18, 2020
@bebraw
Copy link
Member

bebraw commented Aug 18, 2020

Fixed in 5.1.2. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants