File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ import {
3939 formatWithOptions ,
4040 inspect ,
4141 stripVTControlCharacters ,
42+ styleText ,
4243} from "ext:deno_node/internal/util/inspect.mjs" ;
4344import { codes } from "ext:deno_node/internal/error_codes.ts" ;
4445import types from "node:util/types" ;
@@ -63,6 +64,7 @@ export {
6364 parseArgs ,
6465 promisify ,
6566 stripVTControlCharacters ,
67+ styleText ,
6668 types ,
6769} ;
6870
@@ -354,4 +356,5 @@ export default {
354356 debuglog,
355357 debug : debuglog ,
356358 isDeepStrictEqual,
359+ styleText,
357360} ;
Original file line number Diff line number Diff line change @@ -348,3 +348,8 @@ Deno.test("[util] aborted()", async () => {
348348 await promise ;
349349 assertEquals ( done , true ) ;
350350} ) ;
351+
352+ Deno . test ( "[util] styleText()" , ( ) => {
353+ const redText = util . styleText ( "red" , "error" ) ;
354+ assertEquals ( redText , "\x1B[31merror\x1B[39m" ) ;
355+ } ) ;
You can’t perform that action at this time.
0 commit comments