| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7224094 commit 1d817dc
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1240,6 +1240,9 @@ The `util.isObject()` API has been removed. Please use | |||
| 1240 | 1240 | ||
| 1241 | 1241 | <!-- YAML | |
| 1242 | 1242 | changes: | |
| 1243 | + - version: REPLACEME | ||
| 1244 | + pr-url: https://github.com/nodejs/node/pull/52744 | ||
| 1245 | + description: End-of-Life deprecation. | ||
| 1243 | 1246 | - version: v22.0.0 | |
| 1244 | 1247 | pr-url: https://github.com/nodejs/node/pull/50488 | |
| 1245 | 1248 | description: Runtime deprecation. | |
@@ -1255,9 +1258,9 @@ changes: | |||
| 1255 | 1258 | description: Documentation-only deprecation. | |
| 1256 | 1259 | --> | |
| 1257 | 1260 | ||
| 1258 | - Type: Runtime | ||
| 1261 | + Type: End-of-Life | ||
| 1259 | 1262 | ||
| 1260 | - The [`util.isPrimitive()`][] API is deprecated. Please use | ||
| 1263 | + The `util.isPrimitive()` API has been removed. Please use | ||
| 1261 | 1264 | `arg === null || (typeof arg !=='object' && typeof arg !== 'function')` | |
| 1262 | 1265 | instead. | |
| 1263 | 1266 | ||
@@ -3815,8 +3818,6 @@ is deprecated to better align with recommendations per [NIST SP 800-38D][]. | |||
| 3815 | 3818 | [`util.inspect()`]: util.md#utilinspectobject-options | |
| 3816 | 3819 | [`util.inspect.custom`]: util.md#utilinspectcustom | |
| 3817 | 3820 | [`util.isArray()`]: util.md#utilisarrayobject | |
| 3818 | - [`util.isPrimitive()`]: util.md#utilisprimitiveobject | ||
| 3819 | - [`util.log()`]: util.md#utillogstring | ||
| 3820 | 3821 | [`util.promisify`]: util.md#utilpromisifyoriginal | |
| 3821 | 3822 | [`util.toUSVString()`]: util.md#utiltousvstringstring | |
| 3822 | 3823 | [`util.types`]: util.md#utiltypes | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2950,46 +2950,6 @@ util.isArray({}); | |||
| 2950 | 2950 | // Returns: false | |
| 2951 | 2951 | ``` | |
| 2952 | 2952 | ||
| 2953 | - ### `util.isPrimitive(object)` | ||
| 2954 | - | ||
| 2955 | - <!-- YAML | ||
| 2956 | - added: v0.11.5 | ||
| 2957 | - deprecated: v4.0.0 | ||
| 2958 | - --> | ||
| 2959 | - | ||
| 2960 | - > Stability: 0 - Deprecated: Use | ||
| 2961 | - > `(typeof value !== 'object' && typeof value !== 'function') || value === null` | ||
| 2962 | - > instead. | ||
| 2963 | - | ||
| 2964 | - * `object` {any} | ||
| 2965 | - * Returns: {boolean} | ||
| 2966 | - | ||
| 2967 | - Returns `true` if the given `object` is a primitive type. Otherwise, returns | ||
| 2968 | - `false`. | ||
| 2969 | - | ||
| 2970 | - ```js | ||
| 2971 | - const util = require('node:util'); | ||
| 2972 | - | ||
| 2973 | - util.isPrimitive(5); | ||
| 2974 | - // Returns: true | ||
| 2975 | - util.isPrimitive('foo'); | ||
| 2976 | - // Returns: true | ||
| 2977 | - util.isPrimitive(false); | ||
| 2978 | - // Returns: true | ||
| 2979 | - util.isPrimitive(null); | ||
| 2980 | - // Returns: true | ||
| 2981 | - util.isPrimitive(undefined); | ||
| 2982 | - // Returns: true | ||
| 2983 | - util.isPrimitive({}); | ||
| 2984 | - // Returns: false | ||
| 2985 | - util.isPrimitive(() => {}); | ||
| 2986 | - // Returns: false | ||
| 2987 | - util.isPrimitive(/^$/); | ||
| 2988 | - // Returns: false | ||
| 2989 | - util.isPrimitive(new Date()); | ||
| 2990 | - // Returns: false | ||
| 2991 | - ``` | ||
| 2992 | - | ||
| 2993 | 2953 | ### `util.log(string)` | |
| 2994 | 2954 | ||
| 2995 | 2955 | <!-- YAML | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -89,16 +89,6 @@ function lazyAbortController() { | |||
| 89 | 89 | ||
| 90 | 90 | let internalDeepEqual; | |
| 91 | 91 | ||
| 92 | - /** | ||
| 93 | - * @deprecated since v4.0.0 | ||
| 94 | - * @param {any} arg | ||
| 95 | - * @returns {arg is (boolean | null | number | string | symbol | undefined)} | ||
| 96 | - */ | ||
| 97 | - function isPrimitive(arg) { | ||
| 98 | - return arg === null || | ||
| 99 | - (typeof arg !== 'object' && typeof arg !== 'function'); | ||
| 100 | - } | ||
| 101 | - | ||
| 102 | 92 | /** | |
| 103 | 93 | * @param {number} n | |
| 104 | 94 | * @returns {string} | |
@@ -335,11 +325,6 @@ module.exports = { | |||
| 335 | 325 | } | |
| 336 | 326 | return internalDeepEqual(a, b); | |
| 337 | 327 | }, | |
| 338 | - isPrimitive: deprecate(isPrimitive, | ||
| 339 | - 'The `util.isPrimitive` API is deprecated. ' + | ||
| 340 | - 'Please use `arg === null || ' + | ||
| 341 | - '(typeof arg !== "object" && typeof arg !== "function")` instead.', | ||
| 342 | - 'DEP0054'), | ||
| 343 | 328 | log: deprecate(log, | |
| 344 | 329 | 'The `util.log API is deprecated. ' + | |
| 345 | 330 | 'Please use console.log() with a custom formatter or a third-party logger instead.', | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,23 +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 | - // isPrimitive | ||
| 44 | - assert.strictEqual(util.isPrimitive({}), false); | ||
| 45 | - assert.strictEqual(util.isPrimitive(new Error()), false); | ||
| 46 | - assert.strictEqual(util.isPrimitive(new Date()), false); | ||
| 47 | - assert.strictEqual(util.isPrimitive([]), false); | ||
| 48 | - assert.strictEqual(util.isPrimitive(/regexp/), false); | ||
| 49 | - assert.strictEqual(util.isPrimitive(function() {}), false); | ||
| 50 | - assert.strictEqual(util.isPrimitive(new Number(1)), false); | ||
| 51 | - assert.strictEqual(util.isPrimitive(new String('bla')), false); | ||
| 52 | - assert.strictEqual(util.isPrimitive(new Boolean(true)), false); | ||
| 53 | - assert.strictEqual(util.isPrimitive(true), true); | ||
| 54 | - assert.strictEqual(util.isPrimitive(undefined), true); | ||
| 55 | - assert.strictEqual(util.isPrimitive(null), true); | ||
| 56 | - assert.strictEqual(util.isPrimitive(Infinity), true); | ||
| 57 | - assert.strictEqual(util.isPrimitive(NaN), true); | ||
| 58 | - assert.strictEqual(util.isPrimitive(Symbol('symbol')), true); | ||
| 59 | - | ||
| 60 | 43 | assert.strictEqual(util.toUSVString('string\ud801'), 'string\ufffd'); | |
| 61 | 44 | ||
| 62 | 45 | { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments