Commit 7e38821 1 parent 8c32b4a commit 7e38821 Copy full SHA for 7e38821
File tree 1 file changed +5
-7
lines changed
1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -119,11 +119,9 @@ it is marked as deprecated.
119
119
``` js
120
120
const util = require (' util' );
121
121
122
- exports .puts = util .deprecate (function () {
123
- for (let i = 0 , len = arguments .length ; i < len; ++ i) {
124
- process .stdout .write (arguments [i] + ' \n ' );
125
- }
126
- }, ' util.puts: Use console.log instead' );
122
+ exports .obsoleteFunction = util .deprecate (() => {
123
+ // Do something here.
124
+ }, ' obsoleteFunction() is deprecated. Use newShinyFunction() instead.' );
127
125
```
128
126
129
127
When called, ` util.deprecate() ` will return a function that will emit a
@@ -1023,7 +1021,7 @@ util.isObject(null);
1023
1021
// Returns: false
1024
1022
util .isObject ({});
1025
1023
// Returns: true
1026
- util .isObject (function () {});
1024
+ util .isObject (() => {});
1027
1025
// Returns: false
1028
1026
```
1029
1027
@@ -1055,7 +1053,7 @@ util.isPrimitive(undefined);
1055
1053
// Returns: true
1056
1054
util .isPrimitive ({});
1057
1055
// Returns: false
1058
- util .isPrimitive (function () {});
1056
+ util .isPrimitive (() => {});
1059
1057
// Returns: false
1060
1058
util .isPrimitive (/ ^$ / );
1061
1059
// Returns: false
You can’t perform that action at this time.
0 commit comments