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

merge RegExp literal values error #2

Open
dickeylth opened this issue Apr 7, 2015 · 0 comments
Open

merge RegExp literal values error #2

dickeylth opened this issue Apr 7, 2015 · 0 comments

Comments

@dickeylth
Copy link

Because of node's assert.deepEqual bug: nodejs/node#1362 (the bug existed both on io.js and node.js), deep-merge may wrongly merge regexp literal values:

var DeepMerge = require("deep-merge")
var deepmerge = DeepMerge(function (target, source) {
    return [].concat(target, source)
})
var a = { foo: "bar", bar: /bar/i }
var b = { bar: "foo", baz: /foo/i }
var res = deepmerge(a, b)
console.log(res)
// expect: { foo: 'bar', bar: [ /bar/i, 'foo' ], baz: /foo/i }
// result: { foo: 'bar', bar: [ /bar/i, 'foo' ], baz: {} }
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

1 participant