Blame view

utils/string-process.js 240 Bytes
1 2 3 4 5 6 7 8 9 10 11
/**
 * 字符串处理
 */

'use strict';

/**
 * [判断数字]
 * @param  {[string]} str [验证参数]
 * @return {[Boolean]}
 */
12
const isNumeric = (str) => {
陈峰 authored
13
    return /^\d+(\.\d+)?$/.test(str);
14 15 16
};

module.exports = {
17
    isNumeric
18
};