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 nodejs#15663, but was never documented.
This commit documents it.
  • Loading branch information
kevinoid committed Apr 27, 2020
1 parent b37ec37 commit cb8f51e
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 @@ -1255,6 +1255,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 cb8f51e

Please sign in to comment.