Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-transform-bigint

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-bigint - npm Package Compare versions

Comparing version 1.0.19 to 1.0.20

12

__tests__/index-test.js

@@ -234,1 +234,13 @@ // to run this test file use `npx jest` in the parent folder or `npm run test`

});
it('sometimes type of conditional expression can be determined as JSBI', function () {
const example = `
function f(a) {
const b = a % 3n === 0n ? 1n : 3n;
return b * b;
}
`;
const {code} = babel.transform(example, {plugins: [plugin]});
expect(code).toMatchSnapshot();
});

4

index.js

@@ -247,3 +247,5 @@ // see https://github.com/babel/babel/pull/6015

if (path.node.type === 'ConditionalExpression') {
return canBeBigInt(path.get('consequent')) !== false || canBeBigInt(path.get('alternate')) !== false ? maybeJSBI : false;
const a = canBeBigInt(path.get('consequent'));
const b = canBeBigInt(path.get('alternate'));
return a === b ? a : maybeJSBI;
}

@@ -250,0 +252,0 @@ if (path.node.type === 'FunctionExpression') {

{
"name": "babel-plugin-transform-bigint",
"version": "1.0.19",
"version": "1.0.20",
"description": "A plugin for babel to transform `x * y` into something like `JSBI.multiply(x, y)` to support bigints.",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc