mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
add missing optional code argument to util.deprecate (#38753)
introduced in node v8
This commit is contained in:
committed by
Andrew Branch
parent
d3a7f11d86
commit
370aadf2d8
@@ -127,8 +127,10 @@ import { readFile } from 'fs';
|
||||
const foo = () => {};
|
||||
// $ExpectType () => void
|
||||
util.deprecate(foo, 'foo() is deprecated, use bar() instead');
|
||||
// $ExpectType <T extends Function>(fn: T, message: string) => T
|
||||
// $ExpectType <T extends Function>(fn: T, message: string, code?: string | undefined) => T
|
||||
util.deprecate(util.deprecate, 'deprecate() is deprecated, use bar() instead');
|
||||
// $ExpectType <T extends Function>(fn: T, message: string, code?: string | undefined) => T
|
||||
util.deprecate(util.deprecate, 'deprecate() is deprecated, use bar() instead', 'DEP0001');
|
||||
|
||||
// util.isDeepStrictEqual
|
||||
util.isDeepStrictEqual({foo: 'bar'}, {foo: 'bar'});
|
||||
|
||||
Vendored
+1
-1
@@ -51,7 +51,7 @@ declare module "util" {
|
||||
function isSymbol(object: any): object is symbol;
|
||||
/** @deprecated since v4.0.0 - use `value === undefined` instead. */
|
||||
function isUndefined(object: any): object is undefined;
|
||||
function deprecate<T extends Function>(fn: T, message: string): T;
|
||||
function deprecate<T extends Function>(fn: T, message: string, code?: string): T;
|
||||
function isDeepStrictEqual(val1: any, val2: any): boolean;
|
||||
|
||||
interface CustomPromisify<TCustom extends Function> extends Function {
|
||||
|
||||
@@ -946,8 +946,10 @@ function bufferTests() {
|
||||
const foo = () => {};
|
||||
// $ExpectType () => void
|
||||
util.deprecate(foo, 'foo() is deprecated, use bar() instead');
|
||||
// $ExpectType <T extends Function>(fn: T, message: string) => T
|
||||
// $ExpectType <T extends Function>(fn: T, message: string, code?: string) => T
|
||||
util.deprecate(util.deprecate, 'deprecate() is deprecated, use bar() instead');
|
||||
// $ExpectType <T extends Function>(fn: T, message: string, code?: string) => T
|
||||
util.deprecate(util.deprecate, 'deprecate() is deprecated, use bar() instead', 'DEP0001');
|
||||
|
||||
// util.isDeepStrictEqual
|
||||
util.isDeepStrictEqual({foo: 'bar'}, {foo: 'bar'});
|
||||
|
||||
Vendored
+1
-1
@@ -55,7 +55,7 @@ declare module "util" {
|
||||
function isSymbol(object: any): object is symbol;
|
||||
/** @deprecated since v4.0.0 - use `value === undefined` instead. */
|
||||
function isUndefined(object: any): object is undefined;
|
||||
function deprecate<T extends Function>(fn: T, message: string): T;
|
||||
function deprecate<T extends Function>(fn: T, message: string, code?: string): T;
|
||||
function isDeepStrictEqual(val1: any, val2: any): boolean;
|
||||
|
||||
interface CustomPromisify<TCustom extends Function> extends Function {
|
||||
|
||||
Vendored
+1
-1
@@ -5658,7 +5658,7 @@ declare module "util" {
|
||||
export function isString(object: any): object is string;
|
||||
export function isSymbol(object: any): object is symbol;
|
||||
export function isUndefined(object: any): object is undefined;
|
||||
export function deprecate<T extends Function>(fn: T, message: string): T;
|
||||
export function deprecate<T extends Function>(fn: T, message: string, code?: string): T;
|
||||
|
||||
export interface CustomPromisify<TCustom extends Function> extends Function {
|
||||
__promisify__: TCustom;
|
||||
|
||||
@@ -843,8 +843,10 @@ namespace util_tests {
|
||||
const foo = () => {};
|
||||
// $ExpectType () => void
|
||||
util.deprecate(foo, 'foo() is deprecated, use bar() instead');
|
||||
// $ExpectType <T extends Function>(fn: T, message: string) => T
|
||||
// $ExpectType <T extends Function>(fn: T, message: string, code?: string) => T
|
||||
util.deprecate(util.deprecate, 'deprecate() is deprecated, use bar() instead');
|
||||
// $ExpectType <T extends Function>(fn: T, message: string, code?: string) => T
|
||||
util.deprecate(util.deprecate, 'deprecate() is deprecated, use bar() instead', 'DEP0001');
|
||||
|
||||
// util.TextDecoder()
|
||||
var td = new util.TextDecoder();
|
||||
|
||||
@@ -843,8 +843,10 @@ namespace util_tests {
|
||||
const foo = () => {};
|
||||
// $ExpectType () => void
|
||||
util.deprecate(foo, 'foo() is deprecated, use bar() instead');
|
||||
// $ExpectType <T extends Function>(fn: T, message: string) => T
|
||||
// $ExpectType <T extends Function>(fn: T, message: string, code?: string) => T
|
||||
util.deprecate(util.deprecate, 'deprecate() is deprecated, use bar() instead');
|
||||
// $ExpectType <T extends Function>(fn: T, message: string, code?: string) => T
|
||||
util.deprecate(util.deprecate, 'deprecate() is deprecated, use bar() instead', 'DEP0001');
|
||||
|
||||
// util.TextDecoder()
|
||||
var td = new util.TextDecoder();
|
||||
|
||||
Reference in New Issue
Block a user