UNPKG
tytalk-builder
Version:
latest (0.0.5)
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
一个帮助开发者快速构建属于自己的聊天机器人的开源SDK。
github.com/xfanwu/TyTalkBuilder
xfanwu/TyTalkBuilder
tytalk-builder
/
tytalk-builder
/
lib
/
recognizer
/
isNumber.js
16 lines
(10 loc)
•
253 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const
chinese2num =
require
(
'chinese2num'
);
/** * 判断一个string是否为全数字 *
@param
string
*
@returns
{
boolean
} */
function
isNumber
(
string
) {
return
(!(
isNaN
(
string
))) || (!
isNaN
(
chinese2num
(
string
))) }
module
.
exports
= isNumber