Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

to-big-int.js 423B

12345678910111213
  1. 'use strict';
  2. var toPrimitive = require('../internals/to-primitive');
  3. var $TypeError = TypeError;
  4. // `ToBigInt` abstract operation
  5. // https://tc39.es/ecma262/#sec-tobigint
  6. module.exports = function (argument) {
  7. var prim = toPrimitive(argument, 'number');
  8. if (typeof prim == 'number') throw new $TypeError("Can't convert number to bigint");
  9. // eslint-disable-next-line es/no-bigint -- safe
  10. return BigInt(prim);
  11. };