智能照明系统APP-本地串口
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
LightingSystemApp-serial/.svn/pristine/50/5032b45e3198d5e75ac7851aaff...

28 lines
695 B

var objToStr = require('./objToStr');
var isNaN = require('./isNaN');
var lowerCase = require('./lowerCase');
var isBuffer = require('./isBuffer');
exports = function(val) {
var lower =
arguments.length > 1 && arguments[1] !== undefined
? arguments[1]
: true;
var ret;
if (val === null) ret = 'Null';
if (val === undefined) ret = 'Undefined';
if (isNaN(val)) ret = 'NaN';
if (isBuffer(val)) ret = 'Buffer';
if (!ret) {
ret = objToStr(val).match(regObj);
if (ret) ret = ret[1];
}
if (!ret) return '';
return lower ? lowerCase(ret) : ret;
};
var regObj = /^\[object\s+(.*?)]$/;
module.exports = exports;