summaryrefslogtreecommitdiff
path: root/std/node/_util.ts
diff options
context:
space:
mode:
Diffstat (limited to 'std/node/_util.ts')
-rw-r--r--std/node/_util.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/std/node/_util.ts b/std/node/_util.ts
index 9cf996670..b21743541 100644
--- a/std/node/_util.ts
+++ b/std/node/_util.ts
@@ -123,6 +123,22 @@ export function getSystemErrorName(code: number): string | undefined {
return errorMap.get(code)?.[0];
}
+/**
+ * https://nodejs.org/api/util.html#util_util_deprecate_fn_msg_code
+ * @param _code This implementation of deprecate won't apply the deprecation code
+ */
+export function deprecate<A extends Array<unknown>, B>(
+ this: unknown,
+ callback: (...args: A) => B,
+ msg: string,
+ _code?: string,
+) {
+ return function (this: unknown, ...args: A) {
+ console.warn(msg);
+ return callback.apply(this, args);
+ };
+}
+
import { _TextDecoder, _TextEncoder } from "./_utils.ts";
/** The global TextDecoder */