diff options
author | cjihrig <cjihrig@gmail.com> | 2021-09-20 00:44:33 +0300 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2021-10-02 05:56:58 +0300 |
commit | 396b14b6c642affd46b0533f5af7c31e073ad29a (patch) | |
tree | e3fd13585a19a01fcf3f3f400b8ea9a2c191661f /doc/api/util.md | |
parent | 35dc3861cd8e91087e65f125aaf0d7d5066cb155 (diff) |
util: expose stripVTControlCharacters()
This commit exposes the existing stripVTControlCharacters()
method with docs and some additional input validation.
PR-URL: https://github.com/nodejs/node/pull/40214
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api/util.md')
-rw-r--r-- | doc/api/util.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/api/util.md b/doc/api/util.md index ea8bbd5e286..576db37779f 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -1111,6 +1111,21 @@ doSomething[kCustomPromisifiedSymbol] = (foo) => { }; ``` +## `util.stripVTControlCharacters(str)` +<!-- YAML +added: REPLACEME +--> + +* `str` {string} +* Returns: {string} + +Returns `str` with any ANSI escape codes removed. + +```js +console.log(util.stripVTControlCharacters('\u001B[4mvalue\u001B[0m')); +// Prints "value" +``` + ## Class: `util.TextDecoder` <!-- YAML added: v8.3.0 |