File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1085,6 +1085,10 @@ Type: End-of-Life
1085
1085
The ` util.isDate() ` API has been removed. Please use
1086
1086
` arg instanceof Date ` instead.
1087
1087
1088
+ Also for stronger approaches, consider using:
1089
+ ` Date.prototype.toString.call(arg) === '[object Date]' && !isNaN(arg) ` .
1090
+ This can also be used in a ` try/catch ` block to handle invalid date objects.
1091
+
1088
1092
### DEP0048: ` util.isError() `
1089
1093
1090
1094
<!-- YAML
@@ -1109,9 +1113,7 @@ changes:
1109
1113
1110
1114
Type: End-of-Life
1111
1115
1112
- The ` util.isError() ` API has been removed. Please use
1113
- ` Object.prototype.toString(arg) === '[object Error]' || arg instanceof Error `
1114
- instead.
1116
+ The ` util.isError() ` API has been removed. Please use ` Error.isError(arg) ` .
1115
1117
1116
1118
### DEP0049: ` util.isFunction() `
1117
1119
@@ -1272,9 +1274,7 @@ changes:
1272
1274
1273
1275
Type: End-of-Life
1274
1276
1275
- The ` util.isPrimitive() ` API has been removed. Please use
1276
- ` arg === null || (typeof arg !=='object' && typeof arg !== 'function') `
1277
- instead.
1277
+ The ` util.isPrimitive() ` API has been removed. Please use ` Object(arg) !== arg ` instead.
1278
1278
1279
1279
### DEP0055: ` util.isRegExp() `
1280
1280
You can’t perform that action at this time.
0 commit comments