Last change
on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
411 bytes
|
Line | |
---|
1 | /*!
|
---|
2 | * is-number <https://github.com/jonschlinkert/is-number>
|
---|
3 | *
|
---|
4 | * Copyright (c) 2014-present, Jon Schlinkert.
|
---|
5 | * Released under the MIT License.
|
---|
6 | */
|
---|
7 |
|
---|
8 | 'use strict';
|
---|
9 |
|
---|
10 | module.exports = function(num) {
|
---|
11 | if (typeof num === 'number') {
|
---|
12 | return num - num === 0;
|
---|
13 | }
|
---|
14 | if (typeof num === 'string' && num.trim() !== '') {
|
---|
15 | return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
|
---|
16 | }
|
---|
17 | return false;
|
---|
18 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.