We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 98405b7 commit 724e3ccCopy full SHA for 724e3cc
lib/internal/util/inspect.js
@@ -140,6 +140,7 @@ const assert = require('internal/assert');
140
const { NativeModule } = require('internal/bootstrap/loaders');
141
const {
142
validateObject,
143
+ validateString,
144
} = require('internal/validators');
145
146
let hexSlice;
@@ -2114,9 +2115,7 @@ if (internalBinding('config').hasIntl) {
2114
2115
* Remove all VT control characters. Use to estimate displayed string width.
2116
*/
2117
function stripVTControlCharacters(str) {
- if (typeof str !== 'string') {
2118
- throw new ERR_INVALID_ARG_TYPE('str', 'string', str);
2119
- }
+ validateString(str, 'str');
2120
2121
return str.replace(ansi, '');
2122
}
0 commit comments