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
0
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.33 to 1.0.34

27

__tests__/index-test.js

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

it('destructuring assignment', function () {
const example = `
const f = function () {
let [A, B] = [1n, 0n];
return A + B;
}
`;
const {code} = babel.transform(example, {plugins: [plugin]});
expect(code).toMatchSnapshot();
});
it('destructuring assignment 2', function () {
const example = `
const f = function () {
let A = 1n;
let B = 0n;
[A, B] = [3n, 4n];
return A + B;
}
`;
const {code} = babel.transform(example, {plugins: [plugin]});
expect(code).toMatchSnapshot();
});

17

index.js

@@ -160,2 +160,5 @@ // see https://github.com/babel/babel/pull/6015

if (path.node.type === 'AssignmentExpression') {
if (path.node.left.type === 'ArrayPattern') {
return maybeJSBI;
}
if (path.node.operator === '=') {

@@ -173,5 +176,8 @@ return canBeBigInt(path.get('right'));

if (x.node != null) {
const X = canBeBigInt(x);
if (tryType(X, binding, path)) {
return X;
let X = null;
if (x.node.type !== 'ArrayExpression') {
X = canBeBigInt(x);
if (tryType(X, binding, path)) {
return X;
}
}

@@ -431,3 +437,6 @@ }

}
console.debug('unknown path.node.type: ' + path.node.type);
if (path.node.type === 'ArrayPattern') {
return maybeJSBI;
}
console.warn('unknown path.node.type: ' + path.node.type);
//TODO:

@@ -434,0 +443,0 @@ return maybeJSBI;

{
"name": "babel-plugin-transform-bigint",
"version": "1.0.33",
"version": "1.0.34",
"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