File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -546,8 +546,7 @@ exports.isUndefined = deprecate(isUndefined,
546546
547547// note: the isRegExp function is still used here in util
548548function isRegExp ( re ) {
549- return re !== null && typeof re === 'object' &&
550- objectToString ( re ) === '[object RegExp]' ;
549+ return objectToString ( re ) === '[object RegExp]' ;
551550}
552551exports . isRegExp = deprecate ( isRegExp ,
553552 'util.isRegExp is deprecated, please use a user-land alternative.' ) ;
@@ -560,14 +559,12 @@ exports.isObject = deprecate(isObject,
560559
561560// still used in assert and fs
562561function isDate ( d ) {
563- return d !== null && typeof d === 'object' &&
564- objectToString ( d ) === '[object Date]' ;
562+ return objectToString ( d ) === '[object Date]' ;
565563}
566564exports . isDate = isDate ;
567565
568566function isError ( e ) {
569- return e !== null && typeof e === 'object' &&
570- ( objectToString ( e ) === '[object Error]' || e instanceof Error ) ;
567+ return objectToString ( e ) === '[object Error]' || e instanceof Error ;
571568}
572569exports . isError = deprecate ( isError ,
573570 'util.isError is deprecated, please use a user-land alternative.' ) ;
You can’t perform that action at this time.
0 commit comments