Skip to content

Commit c546746

Browse files
cjihrigtargos
authored andcommitted
doc: add util.types.isBig{Int,Uint}64Array()
These methods are exposed, even though the BigInt64Array and BigUint64Array types are currently behind the --harmony-bigint command line flag. PR-URL: #20615 Fixes: #20602 Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent d568952 commit c546746

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

doc/api/util.md

+38
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,44 @@ util.types.isAsyncFunction(function foo() {}); // Returns false
10091009
util.types.isAsyncFunction(async function foo() {}); // Returns true
10101010
```
10111011

1012+
### util.types.isBigInt64Array(value)
1013+
<!-- YAML
1014+
added: v10.0.0
1015+
-->
1016+
1017+
* Returns: {boolean}
1018+
1019+
Returns `true` if the value is a `BigInt64Array` instance. The
1020+
`--harmony-bigint` command line flag is required in order to use the
1021+
`BigInt64Array` type, but it is not required in order to use
1022+
`isBigInt64Array()`.
1023+
1024+
For example:
1025+
1026+
```js
1027+
util.types.isBigInt64Array(new BigInt64Array()); // Returns true
1028+
util.types.isBigInt64Array(new BigUint64Array()); // Returns false
1029+
```
1030+
1031+
### util.types.isBigUint64Array(value)
1032+
<!-- YAML
1033+
added: v10.0.0
1034+
-->
1035+
1036+
* Returns: {boolean}
1037+
1038+
Returns `true` if the value is a `BigUint64Array` instance. The
1039+
`--harmony-bigint` command line flag is required in order to use the
1040+
`BigUint64Array` type, but it is not required in order to use
1041+
`isBigUint64Array()`.
1042+
1043+
For example:
1044+
1045+
```js
1046+
util.types.isBigUint64Array(new BigInt64Array()); // Returns false
1047+
util.types.isBigUint64Array(new BigUint64Array()); // Returns true
1048+
```
1049+
10121050
### util.types.isBooleanObject(value)
10131051
<!-- YAML
10141052
added: v10.0.0

0 commit comments

Comments
 (0)