Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Commit

Permalink
feat(isNumber): Add module isNumber
Browse files Browse the repository at this point in the history
Checks if a value is a number
  • Loading branch information
adambrgmn committed Jan 16, 2018
1 parent 14c6544 commit 72dfa4a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/__tests__/isNumber.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import isNumber from '../isNumber';

test('Core.isNumber', () => {
expect(isNumber(1)).toBeTruthy();
expect(isNumber({})).toBeFalsy();
expect(isNumber({ foo: 'bar' })).toBeFalsy();
expect(isNumber(() => null)).toBeFalsy();
expect(isNumber([])).toBeFalsy();
expect(isNumber('a')).toBeFalsy();
expect(isNumber(null)).toBeFalsy();
expect(isNumber(undefined)).toBeFalsy();
});
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import is from './is';
import isArray from './isArray';
import isFunction from './isFunction';
import isNil from './isNil';
import isNumber from './isNumber';
import isObject from './isObject';
import last from './last';
import map from './map';
Expand All @@ -38,6 +39,7 @@ export {
isArray,
isFunction,
isNil,
isNumber,
isObject,
last,
map,
Expand Down
3 changes: 3 additions & 0 deletions src/isNumber.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import is from './is';

export default x => is('number', x);

0 comments on commit 72dfa4a

Please sign in to comment.