1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

fix(node/util): export styleText from node:util (#26194)

Fixes #26184.

It was added but not publicly exported.
This commit is contained in:
Nathan Whitaker 2024-10-12 12:36:23 -07:00 committed by GitHub
parent 7a990d9d42
commit 4f89225f76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View file

@ -39,6 +39,7 @@ import {
formatWithOptions,
inspect,
stripVTControlCharacters,
styleText,
} from "ext:deno_node/internal/util/inspect.mjs";
import { codes } from "ext:deno_node/internal/error_codes.ts";
import types from "node:util/types";
@ -63,6 +64,7 @@ export {
parseArgs,
promisify,
stripVTControlCharacters,
styleText,
types,
};
@ -354,4 +356,5 @@ export default {
debuglog,
debug: debuglog,
isDeepStrictEqual,
styleText,
};

View file

@ -348,3 +348,8 @@ Deno.test("[util] aborted()", async () => {
await promise;
assertEquals(done, true);
});
Deno.test("[util] styleText()", () => {
const redText = util.styleText("red", "error");
assertEquals(redText, "\x1B[31merror\x1B[39m");
});