Skip to content

Commit c179254

Browse files
starkwangevanlucas
authored andcommittedNov 13, 2017
lib: improve the usage of TypeError[INVALID_ARG_TYPE]
The initials of expected in TypeError[ERR_INVALID_ARG_TYPE] are inconsistent. This change is to unify them. PR-URL: #16401 Fixes: #16383 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
1 parent 64a0c80 commit c179254

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+96
-96
lines changed
 

‎lib/_http_client.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function ClientRequest(options, cb) {
105105
// when createConnection is provided.
106106
} else if (typeof agent.addRequest !== 'function') {
107107
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'Agent option',
108-
['Agent-like object', 'undefined', 'false']);
108+
['Agent-like Object', 'undefined', 'false']);
109109
}
110110
this.agent = agent;
111111

‎lib/_http_outgoing.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ function write_(msg, chunk, encoding, callback, fromEnd) {
652652

653653
if (!fromEnd && typeof chunk !== 'string' && !(chunk instanceof Buffer)) {
654654
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'first argument',
655-
['string', 'buffer']);
655+
['string', 'Buffer']);
656656
}
657657

658658

@@ -750,7 +750,7 @@ OutgoingMessage.prototype.end = function end(chunk, encoding, callback) {
750750
if (chunk) {
751751
if (typeof chunk !== 'string' && !(chunk instanceof Buffer)) {
752752
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'first argument',
753-
['string', 'buffer']);
753+
['string', 'Buffer']);
754754
}
755755
if (!this._header) {
756756
if (typeof chunk === 'string')

0 commit comments

Comments
 (0)