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

fix(node/util): add missing debug alias of debuglog (#24944)

Add the missing `node:util.debug` export which is an alias of
`node:util.debuglog`, see
https://nodejs.org/api/util.html#utildebugsection
This commit is contained in:
Marvin Hagemeister 2024-08-08 13:52:14 +02:00 committed by GitHub
parent 65224786d2
commit f50d38869d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View file

@ -47,6 +47,7 @@ import { parseArgs } from "ext:deno_node/internal/util/parse_args/parse_args.js"
export {
callbackify,
debuglog,
debuglog as debug,
format,
formatWithOptions,
inspect,
@ -321,5 +322,6 @@ export default {
toUSVString,
log,
debuglog,
debug: debuglog,
isDeepStrictEqual,
};

View file

@ -8,6 +8,7 @@ import {
} from "@std/assert";
import { stripAnsiCode } from "@std/fmt/colors";
import * as util from "node:util";
import utilDefault from "node:util";
import { Buffer } from "node:buffer";
Deno.test({
@ -322,3 +323,10 @@ Deno.test({
util.parseArgs({});
},
});
Deno.test("[util] debuglog() and debug()", () => {
assert(typeof util.debug === "function");
assert(typeof util.debuglog === "function");
assertEquals(util.debuglog, util.debug);
assertEquals(utilDefault.debuglog, utilDefault.debug);
});