@@ -450,6 +450,9 @@ changes:
450
450
451
451
Write ` buffer` to the file.
452
452
453
+ If ` buffer` is a plain object, like all variations of ` writeFile` , it must have
454
+ an own (not inherited) ` toString` function property.
455
+
453
456
The promise is resolved with an object containing two properties:
454
457
455
458
* ` bytesWritten` {integer} the number of bytes written
@@ -1290,8 +1293,8 @@ changes:
1290
1293
* Returns: {Promise} Fulfills with `undefined` upon success.
1291
1294
1292
1295
Asynchronously writes data to a file, replacing the file if it already exists.
1293
- `data` can be a string, a {Buffer}, or an object with an own `toString` function
1294
- property.
1296
+ `data` can be a string, a {Buffer}, or, like all variations of `writeFile`, an
1297
+ object with an own (not inherited) `toString` function property.
1295
1298
1296
1299
The `encoding` option is ignored if `data` is a buffer.
1297
1300
@@ -3947,7 +3950,9 @@ When `file` is a file descriptor, the behavior is similar to calling
3947
3950
a file descriptor.
3948
3951
3949
3952
The ` encoding` option is ignored if ` data` is a buffer.
3950
- If ` data` is a normal object, it must have an own ` toString` function property.
3953
+
3954
+ If ` data` is a plain object, like all variations of ` writeFile` , it must have an
3955
+ own (not inherited) ` toString` function property.
3951
3956
3952
3957
` ` ` mjs
3953
3958
import { writeFile } from ' fs' ;
@@ -5034,6 +5039,9 @@ changes:
5034
5039
5035
5040
Returns ` undefined ` .
5036
5041
5042
+ If ` data` is a plain object, like all variations of ` writeFile` , it must have an
5043
+ own (not inherited) ` toString` function property.
5044
+
5037
5045
For detailed information, see the documentation of the asynchronous version of
5038
5046
this API: [` fs .writeFile ()` ][].
5039
5047
0 commit comments