Skip to content

Commit

Permalink
doc: unnest mime and MIMEParams from MIMEType constructor
Browse files Browse the repository at this point in the history
PR-URL: #47950
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
Semigradsky authored and ruyadorno committed Sep 12, 2023
1 parent 071eaad commit 1fe75dc
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions doc/api/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ console.log(String(myMIME));
// Prints: text/plain
```

#### `mime.type`
### `mime.type`

* {string}

Expand Down Expand Up @@ -1106,7 +1106,7 @@ console.log(String(myMIME));
// Prints: application/javascript
```

#### `mime.subtype`
### `mime.subtype`

* {string}

Expand Down Expand Up @@ -1138,7 +1138,7 @@ console.log(String(myMIME));
// Prints: text/javascript
```

#### `mime.essence`
### `mime.essence`

* {string}

Expand Down Expand Up @@ -1171,15 +1171,15 @@ console.log(String(myMIME));
// Prints: application/javascript;key=value
```

#### `mime.params`
### `mime.params`

* {MIMEParams}

Gets the [`MIMEParams`][] object representing the
parameters of the MIME. This property is read-only. See
[`MIMEParams`][] documentation for details.

#### `mime.toString()`
### `mime.toString()`

* Returns: {string}

Expand All @@ -1188,7 +1188,7 @@ The `toString()` method on the `MIMEType` object returns the serialized MIME.
Because of the need for standard compliance, this method does not allow users
to customize the serialization process of the MIME.

#### `mime.toJSON()`
### `mime.toJSON()`

* Returns: {string}

Expand Down Expand Up @@ -1219,7 +1219,7 @@ console.log(JSON.stringify(myMIMES));
// Prints: ["image/png", "image/gif"]
```

### Class: `util.MIMEParams`
## Class: `util.MIMEParams`

<!-- YAML
added: v18.13.0
Expand All @@ -1228,7 +1228,7 @@ added: v18.13.0
The `MIMEParams` API provides read and write access to the parameters of a
`MIMEType`.

#### Constructor: `new MIMEParams()`
### Constructor: `new MIMEParams()`

Creates a new `MIMEParams` object by with empty parameters

Expand All @@ -1244,21 +1244,21 @@ const { MIMEParams } = require('node:util');
const myParams = new MIMEParams();
```

#### `mimeParams.delete(name)`
### `mimeParams.delete(name)`

* `name` {string}

Remove all name-value pairs whose name is `name`.

#### `mimeParams.entries()`
### `mimeParams.entries()`

* Returns: {Iterator}

Returns an iterator over each of the name-value pairs in the parameters.
Each item of the iterator is a JavaScript `Array`. The first item of the array
is the `name`, the second item of the array is the `value`.

#### `mimeParams.get(name)`
### `mimeParams.get(name)`

* `name` {string}
* Returns: {string} or `null` if there is no name-value pair with the given
Expand All @@ -1267,14 +1267,14 @@ is the `name`, the second item of the array is the `value`.
Returns the value of the first name-value pair whose name is `name`. If there
are no such pairs, `null` is returned.

#### `mimeParams.has(name)`
### `mimeParams.has(name)`

* `name` {string}
* Returns: {boolean}

Returns `true` if there is at least one name-value pair whose name is `name`.

#### `mimeParams.keys()`
### `mimeParams.keys()`

* Returns: {Iterator}

Expand Down Expand Up @@ -1304,7 +1304,7 @@ for (const name of params.keys()) {
// bar
```

#### `mimeParams.set(name, value)`
### `mimeParams.set(name, value)`

* `name` {string}
* `value` {string}
Expand Down Expand Up @@ -1333,13 +1333,13 @@ console.log(params.toString());
// Prints: foo=def&bar=1&baz=xyz
```

#### `mimeParams.values()`
### `mimeParams.values()`

* Returns: {Iterator}

Returns an iterator over the values of each name-value pair.

#### `mimeParams[@@iterator]()`
### `mimeParams[@@iterator]()`

* Returns: {Iterator}

Expand Down

0 comments on commit 1fe75dc

Please sign in to comment.