Skip to content

Commit 5c35373

Browse files
authored
Merge pull request #16 from blackflux/dev
[Gally]: master <- dev
2 parents e908b98 + 7c406c0 commit 5c35373

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ The paths are defined using [object-scan](https://github.com/blackflux/object-sc
7070
_Example:_
7171
<!-- eslint-disable import/no-unresolved -->
7272
```js
73-
const { Merge } = require('object-lig');
73+
const { Merge } = require('object-lib');
7474

7575
Merge()(
7676
{ children: [{ id: 1 }, { id: 2 }] },

src/core/merge.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ module.exports = (logic_ = {}) => {
5959
}
6060
});
6161
return (...args) => {
62-
const result = mkChild(args[0]);
62+
const result = mkChild(last(args));
6363
const groups = {};
6464
args.forEach((arg) => scanner(arg, { stack: [result], groups, path: [] }));
6565
return result;

test/core/merge.spec.js

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ describe('Testing Merge', () => {
1313
expect(merge(json1, json2)).to.deep.equal(fixture('result'));
1414
});
1515

16+
it('Testing string merge', () => {
17+
const d1 = 'A';
18+
const d2 = 'B';
19+
expect(Merge()(d1, d2)).to.deep.equal('B');
20+
});
21+
1622
it('Testing array concat', () => {
1723
const d1 = [{ a: 1 }];
1824
const d2 = [{ a: 2 }];

0 commit comments

Comments
 (0)