While lodash union works perfectly fine
Extendify with union strategy makes array of strings a complete mess
describe('extendify', function() {
var chai = require('chai');
var expect = chai.expect;
describe('lodash', function() {
var _ = require('lodash');
it('lodash union', function() {
expect(_.union(['mocha', 'chai', 'closure'], ['closure']))
.deep.equal(['mocha', 'chai', 'closure']); // OK
});
});
describe('extendify', function() {
it('union array of strings', function() {
var extend = require('extendify')({
arrays: 'union',
inPlace: false
});
expect(extend(['mocha', 'chai', 'closure'], ['closure']))
.deep.equal(['mocha', 'chai', 'closure'] // WTF ['closure', 'chai', 'closure']
);
});
});
});
While lodash union works perfectly fine
Extendify with union strategy makes array of strings a complete mess