Socket
Socket
Sign inDemoInstall

babel-plugin-transform-bigint

Package Overview
Dependencies
55
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.11 to 1.0.12

15

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

@@ -12,10 +12,4 @@ "main": "index.js",

"dependencies": {
"@babel/plugin-syntax-bigint": "^7.8.3",
"big-integer": "^1.6.48"
"@babel/plugin-syntax-bigint": "^7.8.3"
},
"devDependencies": {
"@babel/cli": "^7.12.10",
"@babel/core": "^7.12.10",
"jest": "^27.0.6"
},
"keywords": [

@@ -33,3 +27,8 @@ "babel-plugin",

"url": "git+https://github.com/Yaffle/babel-plugin-transform-bigint.git"
},
"devDependencies": {
"@babel/cli": "^7.14.8",
"@babel/core": "^7.14.8",
"jest": "^27.0.6"
}
}

@@ -81,3 +81,4 @@ # babel-plugin-transform-bigint

1. Create a file test.js:
1. Create a folder "example".
2. Create a file test.js:
```javascript

@@ -126,10 +127,19 @@ // floor(log2(n)), n >= 1

2. Use babel:
3. Use babel:
```sh
npm init
npm install --save https://github.com/Yaffle/babel-plugin-transform-bigint
npm install --save-dev @babel/core @babel/cli
npm install jsbi --save
npm install --global http-server
npx babel --plugins=babel-plugin-transform-bigint test.js > test-transformed.js
http-server -p 8081
```
3. create a file `test.html`.
4. Comment out the next line in test-transformed.js:
```javascript
import JSBI from "./jsbi.mjs";
```
5. Create a file `test.html`.
```html

@@ -140,4 +150,3 @@ <!DOCTYPE html>

<meta charset="utf-8" />
<script src="node_modules/big-integer/BigInteger.js"></script>
<script src="node_modules/babel-plugin-transform-bigint/runtime.js"></script>
<script src="./node_modules/jsbi/dist/jsbi-umd.js"></script>
<script src="test-transformed.js"></script>

@@ -147,12 +156,10 @@ <script>

const form = document.querySelector("form");
const update = function () {
form.oninput = function () {
const value = form.value.value;
const digits = Number(form.digits.value);
const s = squareRoot(value, digits);
form.output.value = '√' + value + ' ≈ ' + s.slice(0, 0 - digits - 1) + '.' + s.slice(0 - digits - 1, -1) + '…';
// IE 11 does not support <output> element, so `form.output.value = "value";` is not working.
form.querySelector("output").textContent = '√' + value + ' ≈ ' + s.slice(0, 0 - digits - 1) + '.' + s.slice(0 - digits - 1, -1) + '…';
};
form.oninput = function () {
update();
};
update();
form.oninput();
}, false);

@@ -184,2 +191,2 @@ </script>

4. Open `test.html` in a web browser.
6. Open `http://127.0.0.1:8081/test.html` in a web browser.
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc