util: runtime deprecate util.isDate

PR-URL: https://github.com/nodejs/node/pull/50488
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This commit is contained in:
Marco Ippolito 2023-10-31 12:44:51 +02:00 committed by Node.js GitHub Bot
parent 3c670cb15d
commit a0c5b871a9
2 changed files with 36 additions and 14 deletions

View File

@ -1035,6 +1035,9 @@ The [`util.isBuffer()`][] API is deprecated. Please use
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/50488
description: Runtime deprecation.
- version:
- v6.12.0
- v4.8.6
@ -1047,7 +1050,7 @@ changes:
description: Documentation-only deprecation.
-->
Type: Documentation-only
Type: Runtime
The [`util.isDate()`][] API is deprecated.

View File

@ -404,19 +404,38 @@ module.exports = {
}
return internalDeepEqual(a, b);
},
isNull,
isNullOrUndefined,
isNumber,
isString,
isSymbol,
isUndefined,
isRegExp: types.isRegExp,
isObject,
isDate: types.isDate,
isError,
isFunction,
isPrimitive,
log,
isNull: deprecate(isNull,
'The `util.isNull` API is deprecated. Please use `arg === null` instead.',
'DEP0050'),
isNullOrUndefined: deprecate(isNullOrUndefined,
'The `util.isNullOrUndefined` API is deprecated. ' +
'Please use `arg === null || arg === undefined` instead.',
'DEP0051'),
isNumber: deprecate(isNumber,
'The `util.isNumber` API is deprecated. Please use `typeof arg === "number"` instead.',
'DEP0052'),
isString: deprecate(isString,
'The `util.isString` API is deprecated. Please use `typeof arg === "string"` instead.',
'DEP0056'),
isSymbol: deprecate(isSymbol,
'The `util.isSymbol` API is deprecated. Please use `arg === "symbol"` instead.',
'DEP0057'),
isUndefined: deprecate(isUndefined,
'The `util.isUndefined` API is deprecated. Please use `arg === undefined` instead.',
'DEP0058'),
isRegExp: deprecate(types.isRegExp,
'The `util.isRegExp` API is deprecated. Please use `arg instanceof RegExp` instead.',
'DEP0055'),
isObject: deprecate(isObject,
'The `util.isObject` API is deprecated. Please use `typeof arg === "object"` instead.',
'DEP0053'),
isDate: deprecate(types.isDate,
'The `util.isDate` API is deprecated. Please use `arg instanceof Error` instead.',
'DEP0047'),
isError: deprecate(isError, 'The `util.isError API is deprecated.', 'DEP0048'),
isFunction: deprecate(isFunction, 'The `util.isFunction API is deprecated.', 'DEP0049'),
isPrimitive: deprecate(isPrimitive, 'The `util.isPrimitive API is deprecated.', 'DEP0054'),
log: deprecate(log, 'The `util.log API is deprecated.', 'DEP0059'),
promisify,
stripVTControlCharacters,
toUSVString,