Skip to content

Commit

Permalink
doc: add annotation to writeFile data as Object
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobJingleheimer committed Jun 29, 2021
1 parent 44ecd41 commit ced7748
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1280,8 +1280,8 @@ changes:
-->
* `file` {string|Buffer|URL|FileHandle} filename or `FileHandle`
* `data` {string|Buffer|TypedArray|DataView|Object|AsyncIterable|Iterable
|Stream}
* `data` {string|Buffer|TypedArray|DataView|AsyncIterable|Iterable|Stream|
Object}*
* `options` {Object|string}
* `encoding` {string|null} **Default:** `'utf8'`
* `mode` {integer} **Default:** `0o666`
Expand All @@ -1290,8 +1290,8 @@ changes:
* Returns: {Promise} Fulfills with `undefined` upon success.
Asynchronously writes data to a file, replacing the file if it already exists.
`data` can be a string, a {Buffer}, or an object with an own `toString` function
property.
`data` can be a string, a {Buffer}, or, like all variations of `writeFile`, an
object with an own (not inherited) `toString` function property.
The `encoding` option is ignored if `data` is a buffer.
Expand Down Expand Up @@ -3930,7 +3930,7 @@ changes:
-->
* `file` {string|Buffer|URL|integer} filename or file descriptor
* `data` {string|Buffer|TypedArray|DataView|Object}
* `data` {string|Buffer|TypedArray|DataView|Object}*
* `options` {Object|string}
* `encoding` {string|null} **Default:** `'utf8'`
* `mode` {integer} **Default:** `0o666`
Expand All @@ -3947,7 +3947,9 @@ When `file` is a file descriptor, the behavior is similar to calling
a file descriptor.
The `encoding` option is ignored if `data` is a buffer.
If `data` is a normal object, it must have an own `toString` function property.
\* If `data` is a normal object, it must have an own (not inherited) `toString`
function property.
```mjs
import { writeFile } from 'fs';
Expand Down Expand Up @@ -5026,7 +5028,7 @@ changes:
-->
* `file` {string|Buffer|URL|integer} filename or file descriptor
* `data` {string|Buffer|TypedArray|DataView|Object}
* `data` {string|Buffer|TypedArray|DataView|Object}*
* `options` {Object|string}
* `encoding` {string|null} **Default:** `'utf8'`
* `mode` {integer} **Default:** `0o666`
Expand Down

0 comments on commit ced7748

Please sign in to comment.