Skip to content

Commit

Permalink
fixup! util: expose stripVTControlCharacters()
Browse files Browse the repository at this point in the history
  • Loading branch information
cjihrig committed Oct 2, 2021
1 parent 98405b7 commit 724e3cc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/internal/util/inspect.js
Expand Up @@ -140,6 +140,7 @@ const assert = require('internal/assert');
const { NativeModule } = require('internal/bootstrap/loaders');
const {
validateObject,
validateString,
} = require('internal/validators');

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

return str.replace(ansi, '');
}
Expand Down

0 comments on commit 724e3cc

Please sign in to comment.