| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bd559e3 commit b5cae4f
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1050,6 +1050,9 @@ The `util.isBuffer()` API has been removed. Please use | |||
| 1050 | 1050 | ||
| 1051 | 1051 | <!-- YAML | |
| 1052 | 1052 | changes: | |
| 1053 | + - version: REPLACEME | ||
| 1054 | + pr-url: https://github.com/nodejs/node/pull/52744 | ||
| 1055 | + description: End-of-Life deprecation. | ||
| 1053 | 1056 | - version: v22.0.0 | |
| 1054 | 1057 | pr-url: https://github.com/nodejs/node/pull/50488 | |
| 1055 | 1058 | description: Runtime deprecation. | |
@@ -1065,9 +1068,9 @@ changes: | |||
| 1065 | 1068 | description: Documentation-only deprecation. | |
| 1066 | 1069 | --> | |
| 1067 | 1070 | ||
| 1068 | - Type: Runtime | ||
| 1071 | + Type: End-of-Life | ||
| 1069 | 1072 | ||
| 1070 | - The [`util.isDate()`][] API is deprecated. Please use | ||
| 1073 | + The `util.isDate()` API has been removed. Please use | ||
| 1071 | 1074 | `arg instanceof Date` instead. | |
| 1072 | 1075 | ||
| 1073 | 1076 | ### DEP0048: `util.isError()` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2950,31 +2950,6 @@ util.isArray({}); | |||
| 2950 | 2950 | // Returns: false | |
| 2951 | 2951 | ``` | |
| 2952 | 2952 | ||
| 2953 | - ### `util.isDate(object)` | ||
| 2954 | - | ||
| 2955 | - <!-- YAML | ||
| 2956 | - added: v0.6.0 | ||
| 2957 | - deprecated: v4.0.0 | ||
| 2958 | - --> | ||
| 2959 | - | ||
| 2960 | - > Stability: 0 - Deprecated: Use [`util.types.isDate()`][] instead. | ||
| 2961 | - | ||
| 2962 | - * `object` {any} | ||
| 2963 | - * Returns: {boolean} | ||
| 2964 | - | ||
| 2965 | - Returns `true` if the given `object` is a `Date`. Otherwise, returns `false`. | ||
| 2966 | - | ||
| 2967 | - ```js | ||
| 2968 | - const util = require('node:util'); | ||
| 2969 | - | ||
| 2970 | - util.isDate(new Date()); | ||
| 2971 | - // Returns: true | ||
| 2972 | - util.isDate(Date()); | ||
| 2973 | - // false (without 'new' returns a String) | ||
| 2974 | - util.isDate({}); | ||
| 2975 | - // Returns: false | ||
| 2976 | - ``` | ||
| 2977 | - | ||
| 2978 | 2953 | ### `util.isError(object)` | |
| 2979 | 2954 | ||
| 2980 | 2955 | <!-- YAML | |
@@ -3152,7 +3127,6 @@ util.log('Timestamped message.'); | |||
| 3152 | 3127 | [`util.promisify()`]: #utilpromisifyoriginal | |
| 3153 | 3128 | [`util.types.isAnyArrayBuffer()`]: #utiltypesisanyarraybuffervalue | |
| 3154 | 3129 | [`util.types.isArrayBuffer()`]: #utiltypesisarraybuffervalue | |
| 3155 | - [`util.types.isDate()`]: #utiltypesisdatevalue | ||
| 3156 | 3130 | [`util.types.isNativeError()`]: #utiltypesisnativeerrorvalue | |
| 3157 | 3131 | [`util.types.isSharedArrayBuffer()`]: #utiltypesissharedarraybuffervalue | |
| 3158 | 3132 | [async function]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -354,9 +354,6 @@ module.exports = { | |||
| 354 | 354 | } | |
| 355 | 355 | return internalDeepEqual(a, b); | |
| 356 | 356 | }, | |
| 357 | - isDate: deprecate(types.isDate, | ||
| 358 | - 'The `util.isDate` API is deprecated. Please use `arg instanceof Date` instead.', | ||
| 359 | - 'DEP0047'), | ||
| 360 | 357 | isError: deprecate(isError, | |
| 361 | 358 | 'The `util.isError` API is deprecated. ' + | |
| 362 | 359 | 'Please use `ObjectPrototypeToString(e) === "[object Error]" ' + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,16 +40,6 @@ assert.strictEqual(util.isArray(/regexp/), false); | |||
| 40 | 40 | assert.strictEqual(util.isArray(new Error()), false); | |
| 41 | 41 | assert.strictEqual(util.isArray({ __proto__: Array.prototype }), false); | |
| 42 | 42 | ||
| 43 | - // isDate | ||
| 44 | - assert.strictEqual(util.isDate(new Date()), true); | ||
| 45 | - assert.strictEqual(util.isDate(new Date(0), 'foo'), true); | ||
| 46 | - assert.strictEqual(util.isDate(new (context('Date'))()), true); | ||
| 47 | - assert.strictEqual(util.isDate(Date()), false); | ||
| 48 | - assert.strictEqual(util.isDate({}), false); | ||
| 49 | - assert.strictEqual(util.isDate([]), false); | ||
| 50 | - assert.strictEqual(util.isDate(new Error()), false); | ||
| 51 | - assert.strictEqual(util.isDate({ __proto__: Date.prototype }), false); | ||
| 52 | - | ||
| 53 | 43 | // isError | |
| 54 | 44 | assert.strictEqual(util.isError(new Error()), true); | |
| 55 | 45 | assert.strictEqual(util.isError(new TypeError()), true); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments