mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
lib: reduce util.is*() usage
Many of the util.is*() methods used to check data types simply compare against a single value or the result of typeof. This commit replaces calls to these methods with equivalent checks. This commit does not touch calls to the more complex methods (isRegExp(), isDate(), etc.). Fixes: https://github.com/iojs/io.js/issues/607 PR-URL: https://github.com/iojs/io.js/pull/647 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
1 parent
bce7a2608e
commit
6ac8bdc0ab
37 files changed
+451
-445
No files matched your search
+1
-1
@@ -6,7 +6,7 @@ function Console(stdout, stderr) {
|
||||
if (!(this instanceof Console)) {
|
||||
return new Console(stdout, stderr);
|
||||
}
|
||||
if (!stdout || !util.isFunction(stdout.write)) {
|
||||
if (!stdout || typeof stdout.write !== 'function') {
|
||||
throw new TypeError('Console expects a writable stream instance');
|
||||
}
|
||||
if (!stderr) {
|
||||
|
||||
Reference in new issue
Block a user