@@ -440,6 +440,9 @@ changes:
440
440
441
441
Write ` buffer` to the file.
442
442
443
+ If ` buffer` is a plain object, it must have an own (not inherited) ` toString`
444
+ function property.
445
+
443
446
The promise is resolved with an object containing two properties:
444
447
445
448
* ` bytesWritten` {integer} the number of bytes written
@@ -1284,8 +1287,8 @@ changes:
1284
1287
* Returns: {Promise} Fulfills with `undefined` upon success.
1285
1288
1286
1289
Asynchronously writes data to a file, replacing the file if it already exists.
1287
- `data` can be a string, a {Buffer}, or an object with an own `toString` function
1288
- property.
1290
+ `data` can be a string, a {Buffer}, or, an object with an own (not inherited)
1291
+ `toString` function property.
1289
1292
1290
1293
The `encoding` option is ignored if `data` is a buffer.
1291
1294
@@ -3937,7 +3940,9 @@ When `file` is a file descriptor, the behavior is similar to calling
3937
3940
a file descriptor.
3938
3941
3939
3942
The ` encoding` option is ignored if ` data` is a buffer.
3940
- If ` data` is a normal object, it must have an own ` toString` function property.
3943
+
3944
+ If ` data` is a plain object, it must have an own (not inherited) ` toString`
3945
+ function property.
3941
3946
3942
3947
` ` ` mjs
3943
3948
import { writeFile } from ' fs' ;
@@ -5031,6 +5036,9 @@ changes:
5031
5036
5032
5037
Returns ` undefined ` .
5033
5038
5039
+ If ` data` is a plain object, it must have an own (not inherited) ` toString`
5040
+ function property.
5041
+
5034
5042
For detailed information, see the documentation of the asynchronous version of
5035
5043
this API: [` fs .writeFile ()` ][].
5036
5044
@@ -5065,6 +5073,9 @@ changes:
5065
5073
* ` position` {integer}
5066
5074
* Returns: {number} The number of bytes written.
5067
5075
5076
+ If ` buffer` is a plain object, it must have an own (not inherited) ` toString`
5077
+ function property.
5078
+
5068
5079
For detailed information, see the documentation of the asynchronous version of
5069
5080
this API: [` fs .write (fd, buffer... )` ][].
5070
5081
@@ -5091,6 +5102,9 @@ changes:
5091
5102
* ` encoding` {string}
5092
5103
* Returns: {number} The number of bytes written.
5093
5104
5105
+ If ` string` is a plain object, it must have an own (not inherited) ` toString`
5106
+ function property.
5107
+
5094
5108
For detailed information, see the documentation of the asynchronous version of
5095
5109
this API: [` fs .write (fd, string... )` ][].
5096
5110
0 commit comments