Skip to content

Commit

Permalink
doc: add util.types.isArrayBufferView()
Browse files Browse the repository at this point in the history
This function was added by #15663,
but was never documented. This commit documents it.

PR-URL: #33092
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Masashi Hirano <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Andrey Pechkurov <[email protected]>
  • Loading branch information
kevinoid authored and targos committed May 7, 2020
1 parent 15ca2fb commit 09a7a4e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions doc/api/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -1254,6 +1254,25 @@ util.types.isAnyArrayBuffer(new ArrayBuffer()); // Returns true
util.types.isAnyArrayBuffer(new SharedArrayBuffer()); // Returns true
```

### `util.types.isArrayBufferView(value)`
<!-- YAML
added: v10.0.0
-->

* `value` {any}
* Returns: {boolean}

Returns `true` if the value is an instance of one of the [`ArrayBuffer`][]
views, such as typed array objects or [`DataView`][]. Equivalent to
[`ArrayBuffer.isView()`][].

```js
util.types.isArrayBufferView(new Int8Array()); // true
util.types.isArrayBufferView(Buffer.from('hello world')); // true
util.types.isArrayBufferView(new DataView(new ArrayBuffer(16))); // true
util.types.isArrayBufferView(new ArrayBuffer()); // false
```

### `util.types.isArgumentsObject(value)`
<!-- YAML
added: v10.0.0
Expand Down

0 comments on commit 09a7a4e

Please sign in to comment.