feature(util) type: regexp speed up

This commit is contained in:
coderaiser 2015-01-30 04:52:11 -05:00
parent 1150aa7133
commit 8898ca54a8

View file

@ -283,7 +283,7 @@
* @param variable
*/
function type(variable) {
var regExp = new RegExp('\\s([a-zA-Z]+)'),
var regExp = /\s([a-zA-Z]+)/,
str = {}.toString.call(variable),
typeBig = str.match(regExp)[1],
result = typeBig.toLowerCase();