From 5983110545e7ac78ce6e3310f16ccfc90c0c3c1f Mon Sep 17 00:00:00 2001 From: leviscar <823727280@qq.com> Date: Tue, 22 Oct 2024 13:00:25 +0800 Subject: [PATCH] doc: add `isBigIntObject` to documentation Refs: https://github.com/nodejs/node/pull/19989 Fixes: https://github.com/nodejs/node/issues/55446 PR-URL: https://github.com/nodejs/node/pull/55450 Reviewed-By: Luigi Pinca Reviewed-By: Yagiz Nizipli Reviewed-By: Antoine du Hamel --- doc/api/util.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/api/util.md b/doc/api/util.md index 3d61e24d148596..3306407b85968b 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -2379,6 +2379,24 @@ util.types.isBigInt64Array(new BigInt64Array()); // Returns true util.types.isBigInt64Array(new BigUint64Array()); // Returns false ``` +### `util.types.isBigIntObject(value)` + + + +* `value` {any} +* Returns: {boolean} + +Returns `true` if the value is a BigInt object, e.g. created +by `Object(BigInt(123))`. + +```js +util.types.isBigIntObject(Object(BigInt(123))); // Returns true +util.types.isBigIntObject(BigInt(123)); // Returns false +util.types.isBigIntObject(123); // Returns false +``` + ### `util.types.isBigUint64Array(value)`