Skip to content

Commit c14fc1b

Browse files
authored
Release/1.0.2 (#23)
* Revert: Remove utils/is/not in favor of utils/not. (#21) * release/1.0.2 update docs at npm
1 parent 6f66055 commit c14fc1b

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 1.0.2
2+
+ Update docs and license
3+
14
## 0.6.2
25
+ Add changelog
36
+ Convert utils build with babel

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tinkoff/utils",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"author": "Tinkoff team",
55
"scripts": {
66
"release": "node ./releaseUtils/index.js",

src/is/__tests__/not.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import not from '../not';
2+
3+
describe('utils/is/not', () => {
4+
it('returns the logical inverse of passed arg', () => {
5+
expect(not(1)).toBe(false);
6+
expect(not(0)).toBe(true);
7+
expect(not(false)).toBe(true);
8+
expect(not('2323')).toBe(false);
9+
expect(not({})).toBe(false);
10+
});
11+
});

src/is/not.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* A function that returns the `!` of its argument. It will return `true` when
3+
* passed false-y value, and `false` when passed a truth-y one.
4+
*
5+
* @param {*} a any value
6+
* @return {Boolean} the logical inverse of passed argument.
7+
* @example
8+
*
9+
* not(true); //=> false
10+
* not(false); //=> true
11+
* not(0); //=> true
12+
* not(1); //=> false
13+
*/
14+
export default function not(a) {
15+
return !a;
16+
}

0 commit comments

Comments
 (0)