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
31 additions
and
1 deletion.
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,6 @@ | ||
## 1.0.2 | ||
+ Update docs and license | ||
|
||
## 0.6.2 | ||
+ Add changelog | ||
+ Convert utils build with babel |
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
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 @@ | ||
import not from '../not'; | ||
|
||
describe('utils/is/not', () => { | ||
it('returns the logical inverse of passed arg', () => { | ||
expect(not(1)).toBe(false); | ||
expect(not(0)).toBe(true); | ||
expect(not(false)).toBe(true); | ||
expect(not('2323')).toBe(false); | ||
expect(not({})).toBe(false); | ||
}); | ||
}); |
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 @@ | ||
/** | ||
* A function that returns the `!` of its argument. It will return `true` when | ||
* passed false-y value, and `false` when passed a truth-y one. | ||
* | ||
* @param {*} a any value | ||
* @return {Boolean} the logical inverse of passed argument. | ||
* @example | ||
* | ||
* not(true); //=> false | ||
* not(false); //=> true | ||
* not(0); //=> true | ||
* not(1); //=> false | ||
*/ | ||
export default function not(a) { | ||
return !a; | ||
} |