From 8898ca54a856165c0cd36dc24dc1688f46f48e9a Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 30 Jan 2015 04:52:11 -0500 Subject: [PATCH] feature(util) type: regexp speed up --- lib/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util.js b/lib/util.js index b9927e8f..3916177c 100644 --- a/lib/util.js +++ b/lib/util.js @@ -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();