00001 var root = require('./_root'), 00002 toString = require('./toString'); 00003 00005 var reTrimStart = /^\s+/; 00006 00007 /* Built-in method references for those with the same name as other `lodash` methods. */ 00008 var nativeParseInt = root.parseInt; 00009 00034 function parseInt(string, radix, guard) { 00035 if (guard || radix == null) { 00036 radix = 0; 00037 } else if (radix) { 00038 radix = +radix; 00039 } 00040 return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); 00041 } 00042 00043 module.exports = parseInt;