-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import xor from './xor' | ||
|
||
export { | ||
xor, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import xor from 'lodash/xor' | ||
|
||
import update from '../core/update' | ||
|
||
export default update(xor) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* eslint-env node, mocha */ | ||
import { expect } from 'chai' | ||
|
||
import xor from './xor' | ||
|
||
describe('Xor', () => { | ||
|
||
const withOneAndTwo = { nested: { prop: [1, 2] } } | ||
const oneAndThree = [1, 3] | ||
const withOneAndThree = { nested: { prop: oneAndThree } } | ||
const twoAndThree = [2, 3] | ||
const withTwoAndThree = { nested: { prop: twoAndThree } } | ||
|
||
it('should xor arrays', () => { | ||
expect(xor(withOneAndTwo, 'nested.prop', twoAndThree)).to.be.deep.equal(withOneAndThree) | ||
expect(xor(withOneAndTwo, 'nested.prop', oneAndThree)).to.be.deep.equal(withTwoAndThree) | ||
}) | ||
|
||
it('should xor deep undefined to array', () => { | ||
expect(xor({}, 'nested.prop', oneAndThree)).to.be.deep.equal(withOneAndThree) | ||
expect(xor(undefined, 'nested.prop', oneAndThree)).to.be.deep.equal(withOneAndThree) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './core' | ||
export * from './lang' | ||
export * from './array' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters