@putout/babel 2.10.0 → 2.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bundle/index.js +20 -10
- package/package.json +8 -17
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[NPMIMGURL]: https://img.shields.io/npm/v/@putout/babel.svg?style=flat&longCache=true
|
|
4
4
|
[NPMURL]: https://npmjs.org/package/@putout/babel "npm"
|
|
5
5
|
|
|
6
|
-
**CommonJS** pre-builts of Babel 8: if you want to migrate to [v8](https://github.com/babel/babel/releases/tag/v8.0.0-alpha.
|
|
6
|
+
**CommonJS** pre-builts of Babel 8: if you want to migrate to [v8](https://github.com/babel/babel/releases/tag/v8.0.0-alpha.13), but cannot support **ESM** right now.
|
|
7
7
|
|
|
8
8
|
Usage
|
|
9
9
|
|
package/bundle/index.js
CHANGED
|
@@ -1377,6 +1377,9 @@ var require_jsesc = __commonJS({
|
|
|
1377
1377
|
var isNumber2 = function(value1) {
|
|
1378
1378
|
return typeof value1 == "number" || toString.call(value1) == "[object Number]";
|
|
1379
1379
|
};
|
|
1380
|
+
var isBigInt = function(value1) {
|
|
1381
|
+
return (typeof value1 === "undefined" ? "undefined" : _type_of(value1)) == "bigint";
|
|
1382
|
+
};
|
|
1380
1383
|
var isFunction5 = function(value1) {
|
|
1381
1384
|
return typeof value1 == "function";
|
|
1382
1385
|
};
|
|
@@ -1494,26 +1497,33 @@ var require_jsesc = __commonJS({
|
|
|
1494
1497
|
return "[" + result.join(", ") + "]";
|
|
1495
1498
|
}
|
|
1496
1499
|
return "[" + newLine + result.join("," + newLine) + newLine + (compact ? "" : oldIndent) + "]";
|
|
1497
|
-
} else if (isNumber2(argument)) {
|
|
1500
|
+
} else if (isNumber2(argument) || isBigInt(argument)) {
|
|
1498
1501
|
if (json) {
|
|
1499
|
-
return JSON.stringify(argument);
|
|
1502
|
+
return JSON.stringify(Number(argument));
|
|
1500
1503
|
}
|
|
1504
|
+
var result2;
|
|
1501
1505
|
if (useDecNumbers) {
|
|
1502
|
-
|
|
1503
|
-
}
|
|
1504
|
-
if (useHexNumbers) {
|
|
1506
|
+
result2 = String(argument);
|
|
1507
|
+
} else if (useHexNumbers) {
|
|
1505
1508
|
var hexadecimal2 = argument.toString(16);
|
|
1506
1509
|
if (!lowercaseHex) {
|
|
1507
1510
|
hexadecimal2 = hexadecimal2.toUpperCase();
|
|
1508
1511
|
}
|
|
1509
|
-
|
|
1512
|
+
result2 = "0x" + hexadecimal2;
|
|
1513
|
+
} else if (useBinNumbers) {
|
|
1514
|
+
result2 = "0b" + argument.toString(2);
|
|
1515
|
+
} else if (useOctNumbers) {
|
|
1516
|
+
result2 = "0o" + argument.toString(8);
|
|
1510
1517
|
}
|
|
1511
|
-
if (
|
|
1512
|
-
return
|
|
1518
|
+
if (isBigInt(argument)) {
|
|
1519
|
+
return result2 + "n";
|
|
1513
1520
|
}
|
|
1514
|
-
|
|
1515
|
-
|
|
1521
|
+
return result2;
|
|
1522
|
+
} else if (isBigInt(argument)) {
|
|
1523
|
+
if (json) {
|
|
1524
|
+
return JSON.stringify(Number(argument));
|
|
1516
1525
|
}
|
|
1526
|
+
return argument + "n";
|
|
1517
1527
|
} else if (!isObject(argument)) {
|
|
1518
1528
|
if (json) {
|
|
1519
1529
|
return JSON.stringify(argument) || "null";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/babel",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.2",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "Babel 8 in CommonJS",
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
"coverage": "madrun coverage",
|
|
31
31
|
"report": "madrun report",
|
|
32
32
|
"wisdom": "madrun wisdom",
|
|
33
|
-
"build-old": "madrun build-old",
|
|
34
33
|
"clean": "madrun clean",
|
|
35
34
|
"build": "madrun build",
|
|
36
35
|
"build:js": "madrun build:js",
|
|
@@ -44,17 +43,12 @@
|
|
|
44
43
|
"commonjs"
|
|
45
44
|
],
|
|
46
45
|
"devDependencies": {
|
|
47
|
-
"@babel/code-frame": "^8.0.0-alpha.
|
|
48
|
-
"@babel/generator": "^8.0.0-alpha.
|
|
49
|
-
"@babel/parser": "^8.0.0-alpha.
|
|
50
|
-
"@babel/template": "^8.0.0-alpha.
|
|
51
|
-
"@babel/traverse": "^8.0.0-alpha.
|
|
52
|
-
"@babel/types": "^8.0.0-alpha.
|
|
53
|
-
"@rollup/plugin-alias": "^5.0.0",
|
|
54
|
-
"@rollup/plugin-commonjs": "^28.0.1",
|
|
55
|
-
"@rollup/plugin-json": "^6.0.0",
|
|
56
|
-
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
57
|
-
"@rollup/plugin-replace": "^6.0.1",
|
|
46
|
+
"@babel/code-frame": "^8.0.0-alpha.13",
|
|
47
|
+
"@babel/generator": "^8.0.0-alpha.13",
|
|
48
|
+
"@babel/parser": "^8.0.0-alpha.13",
|
|
49
|
+
"@babel/template": "^8.0.0-alpha.13",
|
|
50
|
+
"@babel/traverse": "^8.0.0-alpha.13",
|
|
51
|
+
"@babel/types": "^8.0.0-alpha.13",
|
|
58
52
|
"@swc/core": "^1.3.101",
|
|
59
53
|
"@types/node": "^22.10.1",
|
|
60
54
|
"acorn-stage3": "^4.0.0",
|
|
@@ -66,10 +60,7 @@
|
|
|
66
60
|
"globals": "^15.0.0",
|
|
67
61
|
"madrun": "^10.0.0",
|
|
68
62
|
"nodemon": "^3.0.1",
|
|
69
|
-
"putout": "^
|
|
70
|
-
"rollup": "^4.8.0",
|
|
71
|
-
"rollup-plugin-node-externals": "^7.0.0",
|
|
72
|
-
"rollup-plugin-polyfill-node": "^0.13.0",
|
|
63
|
+
"putout": "^37.2.0",
|
|
73
64
|
"supertape": "^10.0.0",
|
|
74
65
|
"tsup": "^8.0.1",
|
|
75
66
|
"typescript": "^5.2.2"
|