Skip to content

Commit 724e3cc

Browse files
committed
fixup! util: expose stripVTControlCharacters()
1 parent 98405b7 commit 724e3cc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/internal/util/inspect.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ const assert = require('internal/assert');
140140
const { NativeModule } = require('internal/bootstrap/loaders');
141141
const {
142142
validateObject,
143+
validateString,
143144
} = require('internal/validators');
144145

145146
let hexSlice;
@@ -2114,9 +2115,7 @@ if (internalBinding('config').hasIntl) {
21142115
* Remove all VT control characters. Use to estimate displayed string width.
21152116
*/
21162117
function stripVTControlCharacters(str) {
2117-
if (typeof str !== 'string') {
2118-
throw new ERR_INVALID_ARG_TYPE('str', 'string', str);
2119-
}
2118+
validateString(str, 'str');
21202119

21212120
return str.replace(ansi, '');
21222121
}

0 commit comments

Comments
 (0)