mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
lib: macro-ify type checks
Increases the grep factor. Makes it easier to harmonize type checks across the code base.
This commit is contained in:
12
lib/https.js
12
lib/https.js
@@ -60,21 +60,21 @@ exports.createServer = function(opts, requestListener) {
|
||||
// HTTPS agents.
|
||||
|
||||
function createConnection(port, host, options) {
|
||||
if (typeof port === 'object') {
|
||||
if (IS_OBJECT(port)) {
|
||||
options = port;
|
||||
} else if (typeof host === 'object') {
|
||||
} else if (IS_OBJECT(host)) {
|
||||
options = host;
|
||||
} else if (typeof options === 'object') {
|
||||
} else if (IS_OBJECT(options)) {
|
||||
options = options;
|
||||
} else {
|
||||
options = {};
|
||||
}
|
||||
|
||||
if (typeof port === 'number') {
|
||||
if (IS_NUMBER(port)) {
|
||||
options.port = port;
|
||||
}
|
||||
|
||||
if (typeof host === 'string') {
|
||||
if (IS_STRING(host)) {
|
||||
options.host = host;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ Agent.prototype.getName = function(options) {
|
||||
name += options.pfx;
|
||||
|
||||
name += ':';
|
||||
if (options.rejectUnauthorized !== undefined)
|
||||
if (!IS_UNDEFINED(options.rejectUnauthorized))
|
||||
name += options.rejectUnauthorized;
|
||||
|
||||
return name;
|
||||
|
||||
Reference in New Issue
Block a user