@@ -435,6 +435,9 @@ changes:
435
435
436
436
Write ` buffer` to the file.
437
437
438
+ If ` buffer` is a plain object, it must have an own (not inherited) ` toString`
439
+ function property.
440
+
438
441
The promise is resolved with an object containing two properties:
439
442
440
443
* ` bytesWritten` {integer} the number of bytes written
@@ -1273,8 +1276,8 @@ changes:
1273
1276
* Returns: {Promise} Fulfills with `undefined` upon success.
1274
1277
1275
1278
Asynchronously writes data to a file, replacing the file if it already exists.
1276
- `data` can be a string, a {Buffer}, or an object with an own `toString` function
1277
- property.
1279
+ `data` can be a string, a {Buffer}, or, an object with an own (not inherited)
1280
+ `toString` function property.
1278
1281
1279
1282
The `encoding` option is ignored if `data` is a buffer.
1280
1283
@@ -3893,7 +3896,9 @@ When `file` is a file descriptor, the behavior is similar to calling
3893
3896
a file descriptor.
3894
3897
3895
3898
The ` encoding` option is ignored if ` data` is a buffer.
3896
- If ` data` is a normal object, it must have an own ` toString` function property.
3899
+
3900
+ If ` data` is a plain object, it must have an own (not inherited) ` toString`
3901
+ function property.
3897
3902
3898
3903
` ` ` mjs
3899
3904
import { writeFile } from ' fs' ;
@@ -4973,6 +4978,9 @@ changes:
4973
4978
4974
4979
Returns ` undefined ` .
4975
4980
4981
+ If ` data` is a plain object, it must have an own (not inherited) ` toString`
4982
+ function property.
4983
+
4976
4984
For detailed information, see the documentation of the asynchronous version of
4977
4985
this API: [` fs .writeFile ()` ][].
4978
4986
@@ -5007,6 +5015,9 @@ changes:
5007
5015
* ` position` {integer}
5008
5016
* Returns: {number} The number of bytes written.
5009
5017
5018
+ If ` buffer` is a plain object, it must have an own (not inherited) ` toString`
5019
+ function property.
5020
+
5010
5021
For detailed information, see the documentation of the asynchronous version of
5011
5022
this API: [` fs .write (fd, buffer... )` ][].
5012
5023
@@ -5033,6 +5044,9 @@ changes:
5033
5044
* ` encoding` {string}
5034
5045
* Returns: {number} The number of bytes written.
5035
5046
5047
+ If ` string` is a plain object, it must have an own (not inherited) ` toString`
5048
+ function property.
5049
+
5036
5050
For detailed information, see the documentation of the asynchronous version of
5037
5051
this API: [` fs .write (fd, string... )` ][].
5038
5052
0 commit comments