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: nodejs#47950
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
Semigradsky authored and Ceres6 committed Aug 14, 2023
1 parent 86d676e commit 5d302c1
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 @@ -1080,7 +1080,7 @@ console.log(String(myMIME));
// Prints: text/plain
```

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

* {string}

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

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

* {string}

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

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

* {string}

Expand Down Expand Up @@ -1177,15 +1177,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 @@ -1194,7 +1194,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 @@ -1225,7 +1225,7 @@ console.log(JSON.stringify(myMIMES));
// Prints: ["image/png", "image/gif"]
```

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

<!-- YAML
added:
Expand All @@ -1236,7 +1236,7 @@ added:
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 @@ -1252,21 +1252,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 @@ -1275,14 +1275,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 @@ -1312,7 +1312,7 @@ for (const name of params.keys()) {
// bar
```

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

* `name` {string}
* `value` {string}
Expand Down Expand Up @@ -1341,13 +1341,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 5d302c1

Please sign in to comment.