JS数据校验

JS数据校验

module.exports = {
    error:'',
    isJSON : function (str){
        if (typeof str == 'string') {
            try {          `              ·            ·                      

if(typeof obj == 'object' && obj ){ return true; }else{ return false; } } catch(e) { console.log('error:'+str+'!!!'+e); return false; } } }, isNumber : function (checkVal){ var reg = /^-?[1-9][0-9]?.?[0-9]*$/; return reg.test(checkVal); } }
未完,待续......
原文地址:https://www.cnblogs.com/zhishiyv/p/14662498.html