5efbd57ecb047ea4b48896eab490a9b6c0649f20c6b8b73d00e26a1d67fc7bcb48f0bef09e2d0ffc259e0fc90f07be99f961449c617b69076813144bda815e 417 B

123456789101112131415
  1. 'use strict';
  2. var GetIntrinsic = require('get-intrinsic');
  3. var $BigInt = GetIntrinsic('%BigInt%', true);
  4. var $TypeError = require('es-errors/type');
  5. // https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-bitwiseNOT
  6. module.exports = function BigIntBitwiseNOT(x) {
  7. if (typeof x !== 'bigint') {
  8. throw new $TypeError('Assertion failed: `x` argument must be a BigInt');
  9. }
  10. return -x - $BigInt(1);
  11. };