-
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
4 changed files
with
37 additions
and
0 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './core' | ||
export * from './lang' | ||
export * from './array' | ||
export * from './math' |
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,16 @@ | ||
import add from 'lodash/add' | ||
|
||
import update from '../core/update' | ||
|
||
/** | ||
* Replaces by the addition of the former number and the given number. | ||
* @function add | ||
* @memberof math | ||
* @param {Object} object The object to modify. | ||
* @param {Array|string} path The path of the property to set. | ||
* @param {number} addend The number to add. | ||
* @return {Object} Returns the updated object. | ||
* @see {@link https://lodash.com/docs#add|Lodash} for more information | ||
* @since 0.1.7 | ||
*/ | ||
export default update(add) |
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,11 @@ | ||
/* eslint-env node, mocha */ | ||
import { expect } from 'chai' | ||
|
||
import add from './add' | ||
|
||
describe('Add', () => { | ||
|
||
it('should add two numbers', () => { | ||
expect(add({ nested: { prop: 2 } }, 'nested.prop', 4)).to.be.deep.equal({ nested: { prop: 6 } }) | ||
}) | ||
}) |
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,9 @@ | ||
import add from './add' | ||
|
||
/** | ||
* Math functions. | ||
* @namespace math | ||
*/ | ||
export { | ||
add, | ||
} |