committed by
GitHub
parent
20d2b4f98d
commit
e4f3964f67
7
node_modules/@babel/code-frame/package.json
generated
vendored
7
node_modules/@babel/code-frame/package.json
generated
vendored
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/code-frame",
|
||||
"version": "7.16.7",
|
||||
"version": "7.18.6",
|
||||
"description": "Generate errors that contain a code frame that point to source locations.",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-code-frame",
|
||||
@ -16,7 +16,7 @@
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/highlight": "^7.16.7"
|
||||
"@babel/highlight": "^7.18.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/chalk": "^2.0.0",
|
||||
@ -25,5 +25,6 @@
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"type": "commonjs"
|
||||
}
|
153
node_modules/@babel/compat-data/data/corejs2-built-ins.json
generated
vendored
153
node_modules/@babel/compat-data/data/corejs2-built-ins.json
generated
vendored
@ -17,11 +17,11 @@
|
||||
"edge": "12",
|
||||
"firefox": "2",
|
||||
"safari": "3.1",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"electron": "0.20"
|
||||
@ -90,11 +90,11 @@
|
||||
"edge": "12",
|
||||
"firefox": "2",
|
||||
"safari": "3.1",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"electron": "0.20"
|
||||
@ -114,7 +114,7 @@
|
||||
"chrome": "47",
|
||||
"opera": "34",
|
||||
"edge": "14",
|
||||
"firefox": "43",
|
||||
"firefox": "102",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
@ -127,11 +127,11 @@
|
||||
"edge": "12",
|
||||
"firefox": "2",
|
||||
"safari": "3.1",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"electron": "0.20"
|
||||
@ -142,11 +142,11 @@
|
||||
"edge": "12",
|
||||
"firefox": "4",
|
||||
"safari": "4",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"electron": "0.20"
|
||||
@ -169,11 +169,11 @@
|
||||
"edge": "12",
|
||||
"firefox": "2",
|
||||
"safari": "3.1",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"electron": "0.20"
|
||||
@ -207,11 +207,11 @@
|
||||
"edge": "12",
|
||||
"firefox": "3",
|
||||
"safari": "4",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"electron": "0.20"
|
||||
@ -222,11 +222,11 @@
|
||||
"edge": "12",
|
||||
"firefox": "3",
|
||||
"safari": "4",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"electron": "0.20"
|
||||
@ -248,11 +248,11 @@
|
||||
"edge": "12",
|
||||
"firefox": "2",
|
||||
"safari": "3.1",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"electron": "0.20"
|
||||
@ -287,11 +287,11 @@
|
||||
"edge": "12",
|
||||
"firefox": "2",
|
||||
"safari": "4",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"electron": "0.20"
|
||||
@ -302,11 +302,11 @@
|
||||
"edge": "12",
|
||||
"firefox": "3.5",
|
||||
"safari": "4",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"electron": "0.20"
|
||||
@ -317,7 +317,7 @@
|
||||
"edge": "12",
|
||||
"firefox": "4",
|
||||
"safari": "10",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "10",
|
||||
@ -342,11 +342,11 @@
|
||||
"edge": "12",
|
||||
"firefox": "2",
|
||||
"safari": "3.1",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"ie": "10",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"electron": "0.20"
|
||||
@ -357,11 +357,11 @@
|
||||
"edge": "12",
|
||||
"firefox": "4",
|
||||
"safari": "5.1",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"electron": "0.20"
|
||||
@ -383,10 +383,10 @@
|
||||
"edge": "14",
|
||||
"firefox": "2",
|
||||
"safari": "4",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"electron": "0.20"
|
||||
@ -628,6 +628,7 @@
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"samsung": "2",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"es6.number.is-finite": {
|
||||
@ -636,7 +637,7 @@
|
||||
"edge": "12",
|
||||
"firefox": "16",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"node": "0.8",
|
||||
"android": "4.1",
|
||||
"ios": "9",
|
||||
"samsung": "1.5",
|
||||
@ -661,7 +662,7 @@
|
||||
"edge": "12",
|
||||
"firefox": "15",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"node": "0.8",
|
||||
"android": "4.1",
|
||||
"ios": "9",
|
||||
"samsung": "1.5",
|
||||
@ -713,6 +714,7 @@
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"samsung": "2",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"es6.number.parse-int": {
|
||||
@ -724,6 +726,7 @@
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"samsung": "2",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"es6.object.assign": {
|
||||
@ -743,11 +746,11 @@
|
||||
"edge": "12",
|
||||
"firefox": "4",
|
||||
"safari": "4",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"electron": "0.20"
|
||||
@ -780,11 +783,11 @@
|
||||
"edge": "12",
|
||||
"firefox": "4",
|
||||
"safari": "5.1",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"electron": "0.20"
|
||||
@ -795,11 +798,11 @@
|
||||
"edge": "12",
|
||||
"firefox": "4",
|
||||
"safari": "4",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"electron": "0.20"
|
||||
@ -813,6 +816,7 @@
|
||||
"node": "7",
|
||||
"ios": "10.3",
|
||||
"samsung": "6",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "1.4"
|
||||
},
|
||||
"es6.object.freeze": {
|
||||
@ -925,7 +929,7 @@
|
||||
"edge": "12",
|
||||
"firefox": "22",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"node": "0.8",
|
||||
"android": "4.1",
|
||||
"ios": "9",
|
||||
"samsung": "1.5",
|
||||
@ -1014,6 +1018,7 @@
|
||||
"node": "7",
|
||||
"ios": "10.3",
|
||||
"samsung": "6",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "1.4"
|
||||
},
|
||||
"es6.promise": {
|
||||
@ -1299,11 +1304,12 @@
|
||||
"edge": "12",
|
||||
"firefox": "17",
|
||||
"safari": "6",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"android": "4",
|
||||
"ios": "7",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"es6.string.big": {
|
||||
@ -1312,11 +1318,12 @@
|
||||
"edge": "12",
|
||||
"firefox": "17",
|
||||
"safari": "6",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"android": "4",
|
||||
"ios": "7",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"es6.string.blink": {
|
||||
@ -1325,11 +1332,12 @@
|
||||
"edge": "12",
|
||||
"firefox": "17",
|
||||
"safari": "6",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"android": "4",
|
||||
"ios": "7",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"es6.string.bold": {
|
||||
@ -1338,11 +1346,12 @@
|
||||
"edge": "12",
|
||||
"firefox": "17",
|
||||
"safari": "6",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"android": "4",
|
||||
"ios": "7",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"es6.string.code-point-at": {
|
||||
@ -1375,11 +1384,12 @@
|
||||
"edge": "12",
|
||||
"firefox": "17",
|
||||
"safari": "6",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"android": "4",
|
||||
"ios": "7",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"es6.string.fontcolor": {
|
||||
@ -1388,11 +1398,12 @@
|
||||
"edge": "12",
|
||||
"firefox": "17",
|
||||
"safari": "6",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"android": "4",
|
||||
"ios": "7",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"es6.string.fontsize": {
|
||||
@ -1401,11 +1412,12 @@
|
||||
"edge": "12",
|
||||
"firefox": "17",
|
||||
"safari": "6",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"android": "4",
|
||||
"ios": "7",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"es6.string.from-code-point": {
|
||||
@ -1438,11 +1450,12 @@
|
||||
"edge": "12",
|
||||
"firefox": "17",
|
||||
"safari": "6",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"android": "4",
|
||||
"ios": "7",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"es6.string.iterator": {
|
||||
@ -1463,11 +1476,12 @@
|
||||
"edge": "12",
|
||||
"firefox": "17",
|
||||
"safari": "6",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"android": "4",
|
||||
"ios": "7",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"es7.string.pad-start": {
|
||||
@ -1503,6 +1517,7 @@
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"samsung": "3.4",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "0.21"
|
||||
},
|
||||
"es6.string.repeat": {
|
||||
@ -1523,11 +1538,12 @@
|
||||
"edge": "12",
|
||||
"firefox": "17",
|
||||
"safari": "6",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"android": "4",
|
||||
"ios": "7",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"es6.string.starts-with": {
|
||||
@ -1548,11 +1564,12 @@
|
||||
"edge": "12",
|
||||
"firefox": "17",
|
||||
"safari": "6",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"android": "4",
|
||||
"ios": "7",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"es6.string.sub": {
|
||||
@ -1561,11 +1578,12 @@
|
||||
"edge": "12",
|
||||
"firefox": "17",
|
||||
"safari": "6",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"android": "4",
|
||||
"ios": "7",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"es6.string.sup": {
|
||||
@ -1574,11 +1592,12 @@
|
||||
"edge": "12",
|
||||
"firefox": "17",
|
||||
"safari": "6",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"android": "4",
|
||||
"ios": "7",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "0.20"
|
||||
},
|
||||
"es6.string.trim": {
|
||||
@ -1587,11 +1606,11 @@
|
||||
"edge": "12",
|
||||
"firefox": "3.5",
|
||||
"safari": "4",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"electron": "0.20"
|
||||
@ -1637,11 +1656,11 @@
|
||||
"edge": "12",
|
||||
"firefox": "15",
|
||||
"safari": "5.1",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"ie": "10",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"electron": "0.20"
|
||||
|
130
node_modules/@babel/compat-data/data/plugin-bugfixes.json
generated
vendored
130
node_modules/@babel/compat-data/data/plugin-bugfixes.json
generated
vendored
@ -1,15 +1,4 @@
|
||||
{
|
||||
"transform-async-to-generator": {
|
||||
"chrome": "55",
|
||||
"opera": "42",
|
||||
"edge": "15",
|
||||
"firefox": "52",
|
||||
"safari": "10.1",
|
||||
"node": "7.6",
|
||||
"ios": "10.3",
|
||||
"samsung": "6",
|
||||
"electron": "1.6"
|
||||
},
|
||||
"bugfix/transform-async-arrows-in-class": {
|
||||
"chrome": "55",
|
||||
"opera": "42",
|
||||
@ -21,17 +10,6 @@
|
||||
"samsung": "6",
|
||||
"electron": "1.6"
|
||||
},
|
||||
"transform-parameters": {
|
||||
"chrome": "49",
|
||||
"opera": "36",
|
||||
"edge": "15",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"electron": "0.37"
|
||||
},
|
||||
"bugfix/transform-edge-default-parameters": {
|
||||
"chrome": "49",
|
||||
"opera": "36",
|
||||
@ -43,17 +21,6 @@
|
||||
"samsung": "5",
|
||||
"electron": "0.37"
|
||||
},
|
||||
"transform-function-name": {
|
||||
"chrome": "51",
|
||||
"opera": "38",
|
||||
"edge": "14",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"bugfix/transform-edge-function-name": {
|
||||
"chrome": "51",
|
||||
"opera": "38",
|
||||
@ -65,17 +32,6 @@
|
||||
"samsung": "5",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"transform-block-scoping": {
|
||||
"chrome": "49",
|
||||
"opera": "36",
|
||||
"edge": "14",
|
||||
"firefox": "51",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"electron": "0.37"
|
||||
},
|
||||
"bugfix/transform-safari-block-shadowing": {
|
||||
"chrome": "49",
|
||||
"opera": "36",
|
||||
@ -108,20 +64,8 @@
|
||||
"firefox": "2",
|
||||
"node": "6",
|
||||
"samsung": "5",
|
||||
"rhino": "1.7.13",
|
||||
"electron": "0.37"
|
||||
},
|
||||
"transform-template-literals": {
|
||||
"chrome": "41",
|
||||
"opera": "28",
|
||||
"edge": "13",
|
||||
"firefox": "34",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"samsung": "3.4",
|
||||
"electron": "0.21"
|
||||
},
|
||||
"bugfix/transform-tagged-template-caching": {
|
||||
"chrome": "41",
|
||||
"opera": "28",
|
||||
@ -131,8 +75,19 @@
|
||||
"node": "4",
|
||||
"ios": "13",
|
||||
"samsung": "3.4",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "0.21"
|
||||
},
|
||||
"bugfix/transform-v8-spread-parameters-in-optional-chaining": {
|
||||
"chrome": "91",
|
||||
"opera": "77",
|
||||
"edge": "91",
|
||||
"firefox": "74",
|
||||
"safari": "13.1",
|
||||
"node": "16.9",
|
||||
"ios": "13.4",
|
||||
"electron": "13.0"
|
||||
},
|
||||
"proposal-optional-chaining": {
|
||||
"chrome": "80",
|
||||
"opera": "67",
|
||||
@ -144,14 +99,59 @@
|
||||
"samsung": "13",
|
||||
"electron": "8.0"
|
||||
},
|
||||
"bugfix/transform-v8-spread-parameters-in-optional-chaining": {
|
||||
"chrome": "91",
|
||||
"opera": "77",
|
||||
"edge": "91",
|
||||
"firefox": "74",
|
||||
"safari": "13.1",
|
||||
"node": "16.9",
|
||||
"ios": "13.4",
|
||||
"electron": "13.0"
|
||||
"transform-parameters": {
|
||||
"chrome": "49",
|
||||
"opera": "36",
|
||||
"edge": "15",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"electron": "0.37"
|
||||
},
|
||||
"transform-async-to-generator": {
|
||||
"chrome": "55",
|
||||
"opera": "42",
|
||||
"edge": "15",
|
||||
"firefox": "52",
|
||||
"safari": "10.1",
|
||||
"node": "7.6",
|
||||
"ios": "10.3",
|
||||
"samsung": "6",
|
||||
"electron": "1.6"
|
||||
},
|
||||
"transform-template-literals": {
|
||||
"chrome": "41",
|
||||
"opera": "28",
|
||||
"edge": "13",
|
||||
"firefox": "34",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"samsung": "3.4",
|
||||
"electron": "0.21"
|
||||
},
|
||||
"transform-function-name": {
|
||||
"chrome": "51",
|
||||
"opera": "38",
|
||||
"edge": "14",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"transform-block-scoping": {
|
||||
"chrome": "49",
|
||||
"opera": "36",
|
||||
"edge": "14",
|
||||
"firefox": "51",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"electron": "0.37"
|
||||
}
|
||||
}
|
||||
|
19
node_modules/@babel/compat-data/data/plugins.json
generated
vendored
19
node_modules/@babel/compat-data/data/plugins.json
generated
vendored
@ -4,7 +4,8 @@
|
||||
"opera": "80",
|
||||
"edge": "94",
|
||||
"firefox": "93",
|
||||
"node": "16.11"
|
||||
"node": "16.11",
|
||||
"electron": "15.0"
|
||||
},
|
||||
"proposal-private-property-in-object": {
|
||||
"chrome": "91",
|
||||
@ -47,6 +48,7 @@
|
||||
"node": "12.5",
|
||||
"ios": "13",
|
||||
"samsung": "11",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "6.0"
|
||||
},
|
||||
"proposal-logical-assignment-operators": {
|
||||
@ -90,6 +92,7 @@
|
||||
"node": "10",
|
||||
"ios": "12",
|
||||
"samsung": "9",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "3.0"
|
||||
},
|
||||
"proposal-optional-catch-binding": {
|
||||
@ -187,6 +190,7 @@
|
||||
"node": "7",
|
||||
"ios": "10.3",
|
||||
"samsung": "6",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "1.3"
|
||||
},
|
||||
"transform-template-literals": {
|
||||
@ -277,6 +281,7 @@
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"samsung": "4",
|
||||
"rhino": "1.7.14",
|
||||
"electron": "0.27"
|
||||
},
|
||||
"transform-duplicate-keys": {
|
||||
@ -418,11 +423,11 @@
|
||||
"edge": "12",
|
||||
"firefox": "2",
|
||||
"safari": "5.1",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"electron": "0.20"
|
||||
@ -433,11 +438,11 @@
|
||||
"edge": "12",
|
||||
"firefox": "2",
|
||||
"safari": "5.1",
|
||||
"node": "0.10",
|
||||
"node": "0.4",
|
||||
"ie": "9",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"electron": "0.20"
|
||||
@ -448,11 +453,11 @@
|
||||
"edge": "12",
|
||||
"firefox": "2",
|
||||
"safari": "3.1",
|
||||
"node": "0.10",
|
||||
"node": "0.6",
|
||||
"ie": "9",
|
||||
"android": "4.4",
|
||||
"ios": "6",
|
||||
"phantom": "2",
|
||||
"phantom": "1.9",
|
||||
"samsung": "1",
|
||||
"rhino": "1.7.13",
|
||||
"electron": "0.20"
|
||||
|
9
node_modules/@babel/compat-data/package.json
generated
vendored
9
node_modules/@babel/compat-data/package.json
generated
vendored
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/compat-data",
|
||||
"version": "7.16.8",
|
||||
"version": "7.18.6",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"license": "MIT",
|
||||
"description": "",
|
||||
@ -30,10 +30,11 @@
|
||||
],
|
||||
"devDependencies": {
|
||||
"@mdn/browser-compat-data": "^4.0.10",
|
||||
"core-js-compat": "^3.20.2",
|
||||
"electron-to-chromium": "^1.3.893"
|
||||
"core-js-compat": "^3.22.1",
|
||||
"electron-to-chromium": "^1.4.113"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"type": "commonjs"
|
||||
}
|
1
node_modules/@babel/core/lib/config/cache-contexts.js
generated
vendored
1
node_modules/@babel/core/lib/config/cache-contexts.js
generated
vendored
@ -0,0 +1 @@
|
||||
0 && 0;
|
4
node_modules/@babel/core/lib/config/caching.js
generated
vendored
4
node_modules/@babel/core/lib/config/caching.js
generated
vendored
@ -322,4 +322,6 @@ class Lock {
|
||||
this._resolve(value);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
4
node_modules/@babel/core/lib/config/config-chain.js
generated
vendored
4
node_modules/@babel/core/lib/config/config-chain.js
generated
vendored
@ -561,4 +561,6 @@ function matchPattern(pattern, dirname, pathToTest, context) {
|
||||
}
|
||||
|
||||
return pattern.test(pathToTest);
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
4
node_modules/@babel/core/lib/config/config-descriptors.js
generated
vendored
4
node_modules/@babel/core/lib/config/config-descriptors.js
generated
vendored
@ -241,4 +241,6 @@ function assertNoDuplicates(items) {
|
||||
|
||||
nameMap.add(item.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
4
node_modules/@babel/core/lib/config/files/configuration.js
generated
vendored
4
node_modules/@babel/core/lib/config/files/configuration.js
generated
vendored
@ -355,4 +355,6 @@ module.exports = function(api) {
|
||||
// Return the value that will be cached.
|
||||
return { };
|
||||
};`);
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
4
node_modules/@babel/core/lib/config/files/import-meta-resolve.js
generated
vendored
4
node_modules/@babel/core/lib/config/files/import-meta-resolve.js
generated
vendored
@ -38,4 +38,6 @@ function _resolve() {
|
||||
return (yield importMetaResolveP)(specifier, parent);
|
||||
});
|
||||
return _resolve.apply(this, arguments);
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
4
node_modules/@babel/core/lib/config/files/import.js
generated
vendored
4
node_modules/@babel/core/lib/config/files/import.js
generated
vendored
@ -7,4 +7,6 @@ exports.default = import_;
|
||||
|
||||
function import_(filepath) {
|
||||
return import(filepath);
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
4
node_modules/@babel/core/lib/config/files/index-browser.js
generated
vendored
4
node_modules/@babel/core/lib/config/files/index-browser.js
generated
vendored
@ -64,4 +64,6 @@ function loadPlugin(name, dirname) {
|
||||
|
||||
function loadPreset(name, dirname) {
|
||||
throw new Error(`Cannot load preset ${name} relative to ${dirname} in a browser`);
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
3
node_modules/@babel/core/lib/config/files/index.js
generated
vendored
3
node_modules/@babel/core/lib/config/files/index.js
generated
vendored
@ -83,4 +83,5 @@ exports.resolvePlugin = resolvePlugin;
|
||||
|
||||
const resolvePreset = _gensync()(plugins.resolvePreset).sync;
|
||||
|
||||
exports.resolvePreset = resolvePreset;
|
||||
exports.resolvePreset = resolvePreset;
|
||||
0 && 0;
|
17
node_modules/@babel/core/lib/config/files/module-types.js
generated
vendored
17
node_modules/@babel/core/lib/config/files/module-types.js
generated
vendored
@ -38,6 +38,16 @@ function _module() {
|
||||
return data;
|
||||
}
|
||||
|
||||
function _semver() {
|
||||
const data = require("semver");
|
||||
|
||||
_semver = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
||||
|
||||
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
||||
@ -48,7 +58,8 @@ try {
|
||||
import_ = require("./import").default;
|
||||
} catch (_unused) {}
|
||||
|
||||
const supportsESM = !!import_;
|
||||
const supportsESM = _semver().satisfies(process.versions.node, "^12.17 || >=13.2");
|
||||
|
||||
exports.supportsESM = supportsESM;
|
||||
|
||||
function* loadCjsOrMjsDefault(filepath, asyncError, fallbackToTranspiledModule = false) {
|
||||
@ -105,4 +116,6 @@ function _loadMjsDefault() {
|
||||
return module.default;
|
||||
});
|
||||
return _loadMjsDefault.apply(this, arguments);
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
3
node_modules/@babel/core/lib/config/files/package.js
generated
vendored
3
node_modules/@babel/core/lib/config/files/package.js
generated
vendored
@ -73,4 +73,5 @@ const readConfigPackage = (0, _utils.makeStaticFileCache)((filepath, content) =>
|
||||
dirname: _path().dirname(filepath),
|
||||
options
|
||||
};
|
||||
});
|
||||
});
|
||||
0 && 0;
|
12
node_modules/@babel/core/lib/config/files/plugins.js
generated
vendored
12
node_modules/@babel/core/lib/config/files/plugins.js
generated
vendored
@ -187,7 +187,7 @@ function _tryImportMetaResolve() {
|
||||
return _tryImportMetaResolve.apply(this, arguments);
|
||||
}
|
||||
|
||||
function resolveStandardizedNameForRequrie(type, name, dirname) {
|
||||
function resolveStandardizedNameForRequire(type, name, dirname) {
|
||||
const it = resolveAlternativesHelper(type, name);
|
||||
let res = it.next();
|
||||
|
||||
@ -221,20 +221,20 @@ function _resolveStandardizedNameForImport() {
|
||||
|
||||
const resolveStandardizedName = _gensync()({
|
||||
sync(type, name, dirname = process.cwd()) {
|
||||
return resolveStandardizedNameForRequrie(type, name, dirname);
|
||||
return resolveStandardizedNameForRequire(type, name, dirname);
|
||||
},
|
||||
|
||||
async(type, name, dirname = process.cwd()) {
|
||||
return _asyncToGenerator(function* () {
|
||||
if (!_moduleTypes.supportsESM) {
|
||||
return resolveStandardizedNameForRequrie(type, name, dirname);
|
||||
return resolveStandardizedNameForRequire(type, name, dirname);
|
||||
}
|
||||
|
||||
try {
|
||||
return yield resolveStandardizedNameForImport(type, name, dirname);
|
||||
} catch (e) {
|
||||
try {
|
||||
return resolveStandardizedNameForRequrie(type, name, dirname);
|
||||
return resolveStandardizedNameForRequire(type, name, dirname);
|
||||
} catch (e2) {
|
||||
if (e.type === "MODULE_NOT_FOUND") throw e;
|
||||
if (e2.type === "MODULE_NOT_FOUND") throw e2;
|
||||
@ -270,4 +270,6 @@ function* requireModule(type, name) {
|
||||
LOADING_MODULES.delete(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
1
node_modules/@babel/core/lib/config/files/types.js
generated
vendored
1
node_modules/@babel/core/lib/config/files/types.js
generated
vendored
@ -0,0 +1 @@
|
||||
0 && 0;
|
4
node_modules/@babel/core/lib/config/files/utils.js
generated
vendored
4
node_modules/@babel/core/lib/config/files/utils.js
generated
vendored
@ -41,4 +41,6 @@ function fileMtime(filepath) {
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
86
node_modules/@babel/core/lib/config/full.js
generated
vendored
86
node_modules/@babel/core/lib/config/full.js
generated
vendored
@ -27,6 +27,8 @@ var _item = require("./item");
|
||||
|
||||
var _configChain = require("./config-chain");
|
||||
|
||||
var _deepArray = require("./helpers/deep-array");
|
||||
|
||||
function _traverse() {
|
||||
const data = require("@babel/traverse");
|
||||
|
||||
@ -96,6 +98,7 @@ var _default = _gensync()(function* loadFullConfig(inputOpts) {
|
||||
const initialPluginsDescriptors = plugins.map(toDescriptor);
|
||||
const pluginDescriptorsByPass = [[]];
|
||||
const passes = [];
|
||||
const externalDependencies = [];
|
||||
const ignored = yield* enhanceError(context, function* recursePresetDescriptors(rawPresets, pluginDescriptorsPass) {
|
||||
const presets = [];
|
||||
|
||||
@ -104,17 +107,7 @@ var _default = _gensync()(function* loadFullConfig(inputOpts) {
|
||||
|
||||
if (descriptor.options !== false) {
|
||||
try {
|
||||
if (descriptor.ownPass) {
|
||||
presets.push({
|
||||
preset: yield* loadPresetDescriptor(descriptor, presetContext),
|
||||
pass: []
|
||||
});
|
||||
} else {
|
||||
presets.unshift({
|
||||
preset: yield* loadPresetDescriptor(descriptor, presetContext),
|
||||
pass: pluginDescriptorsPass
|
||||
});
|
||||
}
|
||||
var preset = yield* loadPresetDescriptor(descriptor, presetContext);
|
||||
} catch (e) {
|
||||
if (e.code === "BABEL_UNKNOWN_OPTION") {
|
||||
(0, _options.checkNoUnwrappedItemOptionPairs)(rawPresets, i, "preset", e);
|
||||
@ -122,6 +115,20 @@ var _default = _gensync()(function* loadFullConfig(inputOpts) {
|
||||
|
||||
throw e;
|
||||
}
|
||||
|
||||
externalDependencies.push(preset.externalDependencies);
|
||||
|
||||
if (descriptor.ownPass) {
|
||||
presets.push({
|
||||
preset: preset.chain,
|
||||
pass: []
|
||||
});
|
||||
} else {
|
||||
presets.unshift({
|
||||
preset: preset.chain,
|
||||
pass: pluginDescriptorsPass
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -160,7 +167,7 @@ var _default = _gensync()(function* loadFullConfig(inputOpts) {
|
||||
|
||||
if (descriptor.options !== false) {
|
||||
try {
|
||||
pass.push(yield* loadPluginDescriptor(descriptor, pluginContext));
|
||||
var plugin = yield* loadPluginDescriptor(descriptor, pluginContext);
|
||||
} catch (e) {
|
||||
if (e.code === "BABEL_UNKNOWN_PLUGIN_PROPERTY") {
|
||||
(0, _options.checkNoUnwrappedItemOptionPairs)(descs, i, "plugin", e);
|
||||
@ -168,6 +175,9 @@ var _default = _gensync()(function* loadFullConfig(inputOpts) {
|
||||
|
||||
throw e;
|
||||
}
|
||||
|
||||
pass.push(plugin);
|
||||
externalDependencies.push(plugin.externalDependencies);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -179,7 +189,8 @@ var _default = _gensync()(function* loadFullConfig(inputOpts) {
|
||||
opts.passPerPreset = opts.presets.length > 0;
|
||||
return {
|
||||
options: opts,
|
||||
passes: passes
|
||||
passes: passes,
|
||||
externalDependencies: (0, _deepArray.finalize)(externalDependencies)
|
||||
};
|
||||
});
|
||||
|
||||
@ -207,11 +218,12 @@ const makeDescriptorLoader = apiFactory => (0, _caching.makeWeakCache)(function*
|
||||
}, cache) {
|
||||
if (options === false) throw new Error("Assertion failure");
|
||||
options = options || {};
|
||||
const externalDependencies = [];
|
||||
let item = value;
|
||||
|
||||
if (typeof value === "function") {
|
||||
const factory = (0, _async.maybeAsync)(value, `You appear to be using an async plugin/preset, but Babel has been called synchronously`);
|
||||
const api = Object.assign({}, context, apiFactory(cache));
|
||||
const api = Object.assign({}, context, apiFactory(cache, externalDependencies));
|
||||
|
||||
try {
|
||||
item = yield* factory(api, options, dirname);
|
||||
@ -233,11 +245,25 @@ const makeDescriptorLoader = apiFactory => (0, _caching.makeWeakCache)(function*
|
||||
throw new Error(`You appear to be using a promise as a plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, ` + `you may need to upgrade your @babel/core version. ` + `As an alternative, you can prefix the promise with "await". ` + `(While processing: ${JSON.stringify(alias)})`);
|
||||
}
|
||||
|
||||
if (externalDependencies.length > 0 && (!cache.configured() || cache.mode() === "forever")) {
|
||||
let error = `A plugin/preset has external untracked dependencies ` + `(${externalDependencies[0]}), but the cache `;
|
||||
|
||||
if (!cache.configured()) {
|
||||
error += `has not been configured to be invalidated when the external dependencies change. `;
|
||||
} else {
|
||||
error += ` has been configured to never be invalidated. `;
|
||||
}
|
||||
|
||||
error += `Plugins/presets should configure their cache to be invalidated when the external ` + `dependencies change, for example using \`api.cache.invalidate(() => ` + `statSync(filepath).mtimeMs)\` or \`api.cache.never()\`\n` + `(While processing: ${JSON.stringify(alias)})`;
|
||||
throw new Error(error);
|
||||
}
|
||||
|
||||
return {
|
||||
value: item,
|
||||
options,
|
||||
dirname,
|
||||
alias
|
||||
alias,
|
||||
externalDependencies: (0, _deepArray.finalize)(externalDependencies)
|
||||
};
|
||||
});
|
||||
|
||||
@ -260,7 +286,8 @@ const instantiatePlugin = (0, _caching.makeWeakCache)(function* ({
|
||||
value,
|
||||
options,
|
||||
dirname,
|
||||
alias
|
||||
alias,
|
||||
externalDependencies
|
||||
}, cache) {
|
||||
const pluginObj = (0, _plugins.validatePluginObject)(value);
|
||||
const plugin = Object.assign({}, pluginObj);
|
||||
@ -284,15 +311,23 @@ const instantiatePlugin = (0, _caching.makeWeakCache)(function* ({
|
||||
plugin.post = chain(inherits.post, plugin.post);
|
||||
plugin.manipulateOptions = chain(inherits.manipulateOptions, plugin.manipulateOptions);
|
||||
plugin.visitor = _traverse().default.visitors.merge([inherits.visitor || {}, plugin.visitor || {}]);
|
||||
|
||||
if (inherits.externalDependencies.length > 0) {
|
||||
if (externalDependencies.length === 0) {
|
||||
externalDependencies = inherits.externalDependencies;
|
||||
} else {
|
||||
externalDependencies = (0, _deepArray.finalize)([externalDependencies, inherits.externalDependencies]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new _plugin.default(plugin, options, alias);
|
||||
return new _plugin.default(plugin, options, alias, externalDependencies);
|
||||
});
|
||||
|
||||
const validateIfOptionNeedsFilename = (options, descriptor) => {
|
||||
if (options.test || options.include || options.exclude) {
|
||||
const formattedPresetName = descriptor.name ? `"${descriptor.name}"` : "/* your preset */";
|
||||
throw new Error([`Preset ${formattedPresetName} requires a filename to be set when babel is called directly,`, `\`\`\``, `babel.transform(code, { filename: 'file.ts', presets: [${formattedPresetName}] });`, `\`\`\``, `See https://babeljs.io/docs/en/options#filename for more information.`].join("\n"));
|
||||
throw new Error([`Preset ${formattedPresetName} requires a filename to be set when babel is called directly,`, `\`\`\``, `babel.transformSync(code, { filename: 'file.ts', presets: [${formattedPresetName}] });`, `\`\`\``, `See https://babeljs.io/docs/en/options#filename for more information.`].join("\n"));
|
||||
}
|
||||
};
|
||||
|
||||
@ -312,18 +347,23 @@ const validatePreset = (preset, context, descriptor) => {
|
||||
function* loadPresetDescriptor(descriptor, context) {
|
||||
const preset = instantiatePreset(yield* presetDescriptorLoader(descriptor, context));
|
||||
validatePreset(preset, context, descriptor);
|
||||
return yield* (0, _configChain.buildPresetChain)(preset, context);
|
||||
return {
|
||||
chain: yield* (0, _configChain.buildPresetChain)(preset, context),
|
||||
externalDependencies: preset.externalDependencies
|
||||
};
|
||||
}
|
||||
|
||||
const instantiatePreset = (0, _caching.makeWeakCacheSync)(({
|
||||
value,
|
||||
dirname,
|
||||
alias
|
||||
alias,
|
||||
externalDependencies
|
||||
}) => {
|
||||
return {
|
||||
options: (0, _options.validate)("preset", value),
|
||||
alias,
|
||||
dirname
|
||||
dirname,
|
||||
externalDependencies
|
||||
};
|
||||
});
|
||||
|
||||
@ -335,4 +375,6 @@ function chain(a, b) {
|
||||
fn.apply(this, args);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
20
node_modules/@babel/core/lib/config/helpers/config-api.js
generated
vendored
20
node_modules/@babel/core/lib/config/helpers/config-api.js
generated
vendored
@ -31,8 +31,7 @@ function makeConfigAPI(cache) {
|
||||
return (0, _caching.assertSimpleType)(value(data.envName));
|
||||
}
|
||||
|
||||
if (!Array.isArray(value)) value = [value];
|
||||
return value.some(entry => {
|
||||
return (Array.isArray(value) ? value : [value]).some(entry => {
|
||||
if (typeof entry !== "string") {
|
||||
throw new Error("Unexpected non-string value");
|
||||
}
|
||||
@ -53,18 +52,23 @@ function makeConfigAPI(cache) {
|
||||
};
|
||||
}
|
||||
|
||||
function makePresetAPI(cache) {
|
||||
function makePresetAPI(cache, externalDependencies) {
|
||||
const targets = () => JSON.parse(cache.using(data => JSON.stringify(data.targets)));
|
||||
|
||||
const addExternalDependency = ref => {
|
||||
externalDependencies.push(ref);
|
||||
};
|
||||
|
||||
return Object.assign({}, makeConfigAPI(cache), {
|
||||
targets
|
||||
targets,
|
||||
addExternalDependency
|
||||
});
|
||||
}
|
||||
|
||||
function makePluginAPI(cache) {
|
||||
function makePluginAPI(cache, externalDependencies) {
|
||||
const assumption = name => cache.using(data => data.assumptions[name]);
|
||||
|
||||
return Object.assign({}, makePresetAPI(cache), {
|
||||
return Object.assign({}, makePresetAPI(cache, externalDependencies), {
|
||||
assumption
|
||||
});
|
||||
}
|
||||
@ -100,4 +104,6 @@ function assertVersion(range) {
|
||||
version: _.version,
|
||||
range
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
26
node_modules/@babel/core/lib/config/helpers/deep-array.js
generated
vendored
Normal file
26
node_modules/@babel/core/lib/config/helpers/deep-array.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.finalize = finalize;
|
||||
exports.flattenToSet = flattenToSet;
|
||||
|
||||
function finalize(deepArr) {
|
||||
return Object.freeze(deepArr);
|
||||
}
|
||||
|
||||
function flattenToSet(arr) {
|
||||
const result = new Set();
|
||||
const stack = [arr];
|
||||
|
||||
while (stack.length > 0) {
|
||||
for (const el of stack.pop()) {
|
||||
if (Array.isArray(el)) stack.push(el);else result.add(el);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
0 && 0;
|
4
node_modules/@babel/core/lib/config/helpers/environment.js
generated
vendored
4
node_modules/@babel/core/lib/config/helpers/environment.js
generated
vendored
@ -7,4 +7,6 @@ exports.getEnv = getEnv;
|
||||
|
||||
function getEnv(defaultValue = "development") {
|
||||
return process.env.BABEL_ENV || process.env.NODE_ENV || defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
4
node_modules/@babel/core/lib/config/index.js
generated
vendored
4
node_modules/@babel/core/lib/config/index.js
generated
vendored
@ -72,4 +72,6 @@ function createConfigItem(target, options, callback) {
|
||||
} else {
|
||||
return createConfigItemRunner.sync(target, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
3
node_modules/@babel/core/lib/config/item.js
generated
vendored
3
node_modules/@babel/core/lib/config/item.js
generated
vendored
@ -73,4 +73,5 @@ class ConfigItem {
|
||||
|
||||
}
|
||||
|
||||
Object.freeze(ConfigItem.prototype);
|
||||
Object.freeze(ConfigItem.prototype);
|
||||
0 && 0;
|
3
node_modules/@babel/core/lib/config/partial.js
generated
vendored
3
node_modules/@babel/core/lib/config/partial.js
generated
vendored
@ -194,4 +194,5 @@ class PartialConfig {
|
||||
|
||||
}
|
||||
|
||||
Object.freeze(PartialConfig.prototype);
|
||||
Object.freeze(PartialConfig.prototype);
|
||||
0 && 0;
|
4
node_modules/@babel/core/lib/config/pattern-to-regex.js
generated
vendored
4
node_modules/@babel/core/lib/config/pattern-to-regex.js
generated
vendored
@ -41,4 +41,6 @@ function pathToPattern(pattern, dirname) {
|
||||
|
||||
return escapeRegExp(part) + (last ? endSep : sep);
|
||||
})].join(""));
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
9
node_modules/@babel/core/lib/config/plugin.js
generated
vendored
9
node_modules/@babel/core/lib/config/plugin.js
generated
vendored
@ -5,8 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _deepArray = require("./helpers/deep-array");
|
||||
|
||||
class Plugin {
|
||||
constructor(plugin, options, key) {
|
||||
constructor(plugin, options, key, externalDependencies = (0, _deepArray.finalize)([])) {
|
||||
this.key = void 0;
|
||||
this.manipulateOptions = void 0;
|
||||
this.post = void 0;
|
||||
@ -15,6 +17,7 @@ class Plugin {
|
||||
this.parserOverride = void 0;
|
||||
this.generatorOverride = void 0;
|
||||
this.options = void 0;
|
||||
this.externalDependencies = void 0;
|
||||
this.key = plugin.name || key;
|
||||
this.manipulateOptions = plugin.manipulateOptions;
|
||||
this.post = plugin.post;
|
||||
@ -23,8 +26,10 @@ class Plugin {
|
||||
this.parserOverride = plugin.parserOverride;
|
||||
this.generatorOverride = plugin.generatorOverride;
|
||||
this.options = options;
|
||||
this.externalDependencies = externalDependencies;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = Plugin;
|
||||
exports.default = Plugin;
|
||||
0 && 0;
|
5
node_modules/@babel/core/lib/config/printer.js
generated
vendored
5
node_modules/@babel/core/lib/config/printer.js
generated
vendored
@ -81,7 +81,7 @@ function descriptorToConfig(d) {
|
||||
if (typeof d.value === "object") {
|
||||
name = d.value;
|
||||
} else if (typeof d.value === "function") {
|
||||
name = `[Function: ${d.value.toString().substr(0, 50)} ... ]`;
|
||||
name = `[Function: ${d.value.toString().slice(0, 50)} ... ]`;
|
||||
}
|
||||
}
|
||||
|
||||
@ -136,4 +136,5 @@ class ConfigPrinter {
|
||||
|
||||
}
|
||||
|
||||
exports.ConfigPrinter = ConfigPrinter;
|
||||
exports.ConfigPrinter = ConfigPrinter;
|
||||
0 && 0;
|
25
node_modules/@babel/core/lib/config/resolve-targets-browser.js
generated
vendored
25
node_modules/@babel/core/lib/config/resolve-targets-browser.js
generated
vendored
@ -21,22 +21,27 @@ function resolveBrowserslistConfigFile(browserslistConfigFile, configFilePath) {
|
||||
}
|
||||
|
||||
function resolveTargets(options, root) {
|
||||
let targets = options.targets;
|
||||
const optTargets = options.targets;
|
||||
let targets;
|
||||
|
||||
if (typeof targets === "string" || Array.isArray(targets)) {
|
||||
if (typeof optTargets === "string" || Array.isArray(optTargets)) {
|
||||
targets = {
|
||||
browsers: targets
|
||||
browsers: optTargets
|
||||
};
|
||||
}
|
||||
|
||||
if (targets && targets.esmodules) {
|
||||
targets = Object.assign({}, targets, {
|
||||
esmodules: "intersect"
|
||||
});
|
||||
} else if (optTargets) {
|
||||
if ("esmodules" in optTargets) {
|
||||
targets = Object.assign({}, optTargets, {
|
||||
esmodules: "intersect"
|
||||
});
|
||||
} else {
|
||||
targets = optTargets;
|
||||
}
|
||||
}
|
||||
|
||||
return (0, _helperCompilationTargets().default)(targets, {
|
||||
ignoreBrowserslistConfig: true,
|
||||
browserslistEnv: options.browserslistEnv
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
25
node_modules/@babel/core/lib/config/resolve-targets.js
generated
vendored
25
node_modules/@babel/core/lib/config/resolve-targets.js
generated
vendored
@ -33,18 +33,21 @@ function resolveBrowserslistConfigFile(browserslistConfigFile, configFileDir) {
|
||||
}
|
||||
|
||||
function resolveTargets(options, root) {
|
||||
let targets = options.targets;
|
||||
const optTargets = options.targets;
|
||||
let targets;
|
||||
|
||||
if (typeof targets === "string" || Array.isArray(targets)) {
|
||||
if (typeof optTargets === "string" || Array.isArray(optTargets)) {
|
||||
targets = {
|
||||
browsers: targets
|
||||
browsers: optTargets
|
||||
};
|
||||
}
|
||||
|
||||
if (targets && targets.esmodules) {
|
||||
targets = Object.assign({}, targets, {
|
||||
esmodules: "intersect"
|
||||
});
|
||||
} else if (optTargets) {
|
||||
if ("esmodules" in optTargets) {
|
||||
targets = Object.assign({}, optTargets, {
|
||||
esmodules: "intersect"
|
||||
});
|
||||
} else {
|
||||
targets = optTargets;
|
||||
}
|
||||
}
|
||||
|
||||
const {
|
||||
@ -65,4 +68,6 @@ function resolveTargets(options, root) {
|
||||
configPath: root,
|
||||
browserslistEnv: options.browserslistEnv
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
4
node_modules/@babel/core/lib/config/util.js
generated
vendored
4
node_modules/@babel/core/lib/config/util.js
generated
vendored
@ -28,4 +28,6 @@ function mergeDefaultFields(target, source) {
|
||||
|
||||
function isIterableIterator(value) {
|
||||
return !!value && typeof value.next === "function" && typeof value[Symbol.iterator] === "function";
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
4
node_modules/@babel/core/lib/config/validation/option-assertions.js
generated
vendored
4
node_modules/@babel/core/lib/config/validation/option-assertions.js
generated
vendored
@ -349,4 +349,6 @@ function assertAssumptions(loc, value) {
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
7
node_modules/@babel/core/lib/config/validation/options.js
generated
vendored
7
node_modules/@babel/core/lib/config/validation/options.js
generated
vendored
@ -74,7 +74,8 @@ const COMMON_VALIDATORS = {
|
||||
moduleId: _optionAssertions.assertString
|
||||
});
|
||||
}
|
||||
const assumptionsNames = new Set(["arrayLikeIsIterable", "constantReexports", "constantSuper", "enumerableModuleMeta", "ignoreFunctionLength", "ignoreToPrimitiveHint", "iterableIsArray", "mutableTemplateObject", "noClassCalls", "noDocumentAll", "noIncompleteNsImportDetection", "noNewArrows", "objectRestNoSymbols", "privateFieldsAsProperties", "pureGetters", "setClassMethods", "setComputedProperties", "setPublicClassFields", "setSpreadProperties", "skipForOfIteratorClosing", "superIsCallableConstructor"]);
|
||||
const knownAssumptions = ["arrayLikeIsIterable", "constantReexports", "constantSuper", "enumerableModuleMeta", "ignoreFunctionLength", "ignoreToPrimitiveHint", "iterableIsArray", "mutableTemplateObject", "noClassCalls", "noDocumentAll", "noIncompleteNsImportDetection", "noNewArrows", "objectRestNoSymbols", "privateFieldsAsProperties", "pureGetters", "setClassMethods", "setComputedProperties", "setPublicClassFields", "setSpreadProperties", "skipForOfIteratorClosing", "superIsCallableConstructor"];
|
||||
const assumptionsNames = new Set(knownAssumptions);
|
||||
exports.assumptionsNames = assumptionsNames;
|
||||
|
||||
function getSource(loc) {
|
||||
@ -207,4 +208,6 @@ function checkNoUnwrappedItemOptionPairs(items, index, type, e) {
|
||||
if (lastItem.file && lastItem.options === undefined && typeof thisItem.value === "object") {
|
||||
e.message += `\n- Maybe you meant to use\n` + `"${type}s": [\n ["${lastItem.file.request}", ${JSON.stringify(thisItem.value, undefined, 2)}]\n]\n` + `To be a valid ${type}, its name and options should be wrapped in a pair of brackets`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
4
node_modules/@babel/core/lib/config/validation/plugins.js
generated
vendored
4
node_modules/@babel/core/lib/config/validation/plugins.js
generated
vendored
@ -68,4 +68,6 @@ function validatePluginObject(obj) {
|
||||
}
|
||||
});
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
3
node_modules/@babel/core/lib/config/validation/removed.js
generated
vendored
3
node_modules/@babel/core/lib/config/validation/removed.js
generated
vendored
@ -63,4 +63,5 @@ var _default = {
|
||||
message: "The `sourceMapTarget` option has been removed because it makes more sense for the tooling " + "that calls Babel to assign `map.file` themselves."
|
||||
}
|
||||
};
|
||||
exports.default = _default;
|
||||
exports.default = _default;
|
||||
0 && 0;
|
4
node_modules/@babel/core/lib/gensync-utils/async.js
generated
vendored
4
node_modules/@babel/core/lib/gensync-utils/async.js
generated
vendored
@ -91,4 +91,6 @@ exports.waitFor = waitFor;
|
||||
|
||||
function isThenable(val) {
|
||||
return !!val && (typeof val === "object" || typeof val === "function") && !!val.then && typeof val.then === "function";
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
3
node_modules/@babel/core/lib/gensync-utils/fs.js
generated
vendored
3
node_modules/@babel/core/lib/gensync-utils/fs.js
generated
vendored
@ -37,4 +37,5 @@ const stat = _gensync()({
|
||||
errback: _fs().stat
|
||||
});
|
||||
|
||||
exports.stat = stat;
|
||||
exports.stat = stat;
|
||||
0 && 0;
|
16
node_modules/@babel/core/lib/index.js
generated
vendored
16
node_modules/@babel/core/lib/index.js
generated
vendored
@ -108,13 +108,13 @@ Object.defineProperty(exports, "resolvePreset", {
|
||||
return _files.resolvePreset;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "template", {
|
||||
Object.defineProperty((0, exports), "template", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _template().default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "tokTypes", {
|
||||
Object.defineProperty((0, exports), "tokTypes", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _parser().tokTypes;
|
||||
@ -174,7 +174,7 @@ Object.defineProperty(exports, "transformSync", {
|
||||
return _transform.transformSync;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "traverse", {
|
||||
Object.defineProperty((0, exports), "traverse", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _traverse().default;
|
||||
@ -200,7 +200,7 @@ function _types() {
|
||||
return data;
|
||||
}
|
||||
|
||||
Object.defineProperty(exports, "types", {
|
||||
Object.defineProperty((0, exports), "types", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _types();
|
||||
@ -247,14 +247,14 @@ var _transformAst = require("./transform-ast");
|
||||
|
||||
var _parse = require("./parse");
|
||||
|
||||
const version = "7.16.12";
|
||||
const version = "7.18.6";
|
||||
exports.version = version;
|
||||
const DEFAULT_EXTENSIONS = Object.freeze([".js", ".jsx", ".es6", ".es", ".mjs", ".cjs"]);
|
||||
exports.DEFAULT_EXTENSIONS = DEFAULT_EXTENSIONS;
|
||||
|
||||
class OptionManager {
|
||||
init(opts) {
|
||||
return (0, _config.loadOptions)(opts);
|
||||
return (0, _config.loadOptionsSync)(opts);
|
||||
}
|
||||
|
||||
}
|
||||
@ -263,4 +263,6 @@ exports.OptionManager = OptionManager;
|
||||
|
||||
function Plugin(alias) {
|
||||
throw new Error(`The (${alias}) Babel 5 plugin is being run with an unsupported Babel version.`);
|
||||
}
|
||||
}
|
||||
|
||||
0 && (exports.types = exports.traverse = exports.tokTypes = exports.template = 0);
|
10
node_modules/@babel/core/lib/parse.js
generated
vendored
10
node_modules/@babel/core/lib/parse.js
generated
vendored
@ -37,7 +37,12 @@ const parse = function parse(code, opts, callback) {
|
||||
opts = undefined;
|
||||
}
|
||||
|
||||
if (callback === undefined) return parseRunner.sync(code, opts);
|
||||
if (callback === undefined) {
|
||||
{
|
||||
return parseRunner.sync(code, opts);
|
||||
}
|
||||
}
|
||||
|
||||
parseRunner.errback(code, opts, callback);
|
||||
};
|
||||
|
||||
@ -45,4 +50,5 @@ exports.parse = parse;
|
||||
const parseSync = parseRunner.sync;
|
||||
exports.parseSync = parseSync;
|
||||
const parseAsync = parseRunner.async;
|
||||
exports.parseAsync = parseAsync;
|
||||
exports.parseAsync = parseAsync;
|
||||
0 && 0;
|
4
node_modules/@babel/core/lib/parser/index.js
generated
vendored
4
node_modules/@babel/core/lib/parser/index.js
generated
vendored
@ -92,4 +92,6 @@ function* parser(pluginPasses, {
|
||||
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
120
node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js
generated
vendored
120
node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js
generated
vendored
@ -8,273 +8,283 @@ const pluginNameMap = {
|
||||
asyncDoExpressions: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-async-do-expressions",
|
||||
url: "https://git.io/JYer8"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-async-do-expressions"
|
||||
}
|
||||
},
|
||||
classProperties: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-class-properties",
|
||||
url: "https://git.io/vb4yQ"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-class-properties",
|
||||
url: "https://git.io/vb4SL"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-class-properties"
|
||||
}
|
||||
},
|
||||
classPrivateProperties: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-class-properties",
|
||||
url: "https://git.io/vb4yQ"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-class-properties",
|
||||
url: "https://git.io/vb4SL"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-class-properties"
|
||||
}
|
||||
},
|
||||
classPrivateMethods: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-class-properties",
|
||||
url: "https://git.io/vb4yQ"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-private-methods",
|
||||
url: "https://git.io/JvpRG"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-private-methods"
|
||||
}
|
||||
},
|
||||
classStaticBlock: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-class-static-block",
|
||||
url: "https://git.io/JTLB6"
|
||||
url: "https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-syntax-class-static-block"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-class-static-block",
|
||||
url: "https://git.io/JTLBP"
|
||||
url: "https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-proposal-class-static-block"
|
||||
}
|
||||
},
|
||||
decimal: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-decimal",
|
||||
url: "https://git.io/JfKOH"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-decimal"
|
||||
}
|
||||
},
|
||||
decorators: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-decorators",
|
||||
url: "https://git.io/vb4y9"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-decorators"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-decorators",
|
||||
url: "https://git.io/vb4ST"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-decorators"
|
||||
}
|
||||
},
|
||||
doExpressions: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-do-expressions",
|
||||
url: "https://git.io/vb4yh"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-do-expressions"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-do-expressions",
|
||||
url: "https://git.io/vb4S3"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-do-expressions"
|
||||
}
|
||||
},
|
||||
dynamicImport: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-dynamic-import",
|
||||
url: "https://git.io/vb4Sv"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-dynamic-import"
|
||||
}
|
||||
},
|
||||
exportDefaultFrom: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-export-default-from",
|
||||
url: "https://git.io/vb4SO"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-export-default-from"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-export-default-from",
|
||||
url: "https://git.io/vb4yH"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-export-default-from"
|
||||
}
|
||||
},
|
||||
exportNamespaceFrom: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-export-namespace-from",
|
||||
url: "https://git.io/vb4Sf"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-export-namespace-from"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-export-namespace-from",
|
||||
url: "https://git.io/vb4SG"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-export-namespace-from"
|
||||
}
|
||||
},
|
||||
flow: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-flow",
|
||||
url: "https://git.io/vb4yb"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-flow"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/preset-flow",
|
||||
url: "https://git.io/JfeDn"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-preset-flow"
|
||||
}
|
||||
},
|
||||
functionBind: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-function-bind",
|
||||
url: "https://git.io/vb4y7"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-function-bind"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-function-bind",
|
||||
url: "https://git.io/vb4St"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-function-bind"
|
||||
}
|
||||
},
|
||||
functionSent: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-function-sent",
|
||||
url: "https://git.io/vb4yN"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-function-sent"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-function-sent",
|
||||
url: "https://git.io/vb4SZ"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-function-sent"
|
||||
}
|
||||
},
|
||||
importMeta: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-import-meta",
|
||||
url: "https://git.io/vbKK6"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-meta"
|
||||
}
|
||||
},
|
||||
jsx: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-jsx",
|
||||
url: "https://git.io/vb4yA"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-jsx"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/preset-react",
|
||||
url: "https://git.io/JfeDR"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-preset-react"
|
||||
}
|
||||
},
|
||||
importAssertions: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-import-assertions",
|
||||
url: "https://git.io/JUbkv"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-assertions"
|
||||
}
|
||||
},
|
||||
moduleStringNames: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-module-string-names",
|
||||
url: "https://git.io/JTL8G"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-module-string-names"
|
||||
}
|
||||
},
|
||||
numericSeparator: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-numeric-separator",
|
||||
url: "https://git.io/vb4Sq"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-numeric-separator"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-numeric-separator",
|
||||
url: "https://git.io/vb4yS"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-numeric-separator"
|
||||
}
|
||||
},
|
||||
optionalChaining: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-optional-chaining",
|
||||
url: "https://git.io/vb4Sc"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-chaining"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-optional-chaining",
|
||||
url: "https://git.io/vb4Sk"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-optional-chaining"
|
||||
}
|
||||
},
|
||||
pipelineOperator: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-pipeline-operator",
|
||||
url: "https://git.io/vb4yj"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-pipeline-operator"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-pipeline-operator",
|
||||
url: "https://git.io/vb4SU"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-pipeline-operator"
|
||||
}
|
||||
},
|
||||
privateIn: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-private-property-in-object",
|
||||
url: "https://git.io/JfK3q"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-private-property-in-object"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-private-property-in-object",
|
||||
url: "https://git.io/JfK3O"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-private-property-in-object"
|
||||
}
|
||||
},
|
||||
recordAndTuple: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-record-and-tuple",
|
||||
url: "https://git.io/JvKp3"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-record-and-tuple"
|
||||
}
|
||||
},
|
||||
regexpUnicodeSets: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-unicode-sets-regex",
|
||||
url: "https://github.com/babel/babel/blob/main/packages/babel-plugin-syntax-unicode-sets-regex/README.md"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-unicode-sets-regex",
|
||||
url: "https://github.com/babel/babel/blob/main/packages/babel-plugin-proposalunicode-sets-regex/README.md"
|
||||
}
|
||||
},
|
||||
throwExpressions: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-throw-expressions",
|
||||
url: "https://git.io/vb4SJ"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-throw-expressions"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-throw-expressions",
|
||||
url: "https://git.io/vb4yF"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-throw-expressions"
|
||||
}
|
||||
},
|
||||
typescript: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-typescript",
|
||||
url: "https://git.io/vb4SC"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-typescript"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/preset-typescript",
|
||||
url: "https://git.io/JfeDz"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-preset-typescript"
|
||||
}
|
||||
},
|
||||
asyncGenerators: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-async-generators",
|
||||
url: "https://git.io/vb4SY"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-async-generators"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-async-generator-functions",
|
||||
url: "https://git.io/vb4yp"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-async-generator-functions"
|
||||
}
|
||||
},
|
||||
logicalAssignment: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-logical-assignment-operators",
|
||||
url: "https://git.io/vAlBp"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-logical-assignment-operators"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-logical-assignment-operators",
|
||||
url: "https://git.io/vAlRe"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-logical-assignment-operators"
|
||||
}
|
||||
},
|
||||
nullishCoalescingOperator: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-nullish-coalescing-operator",
|
||||
url: "https://git.io/vb4yx"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-nullish-coalescing-operator"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-nullish-coalescing-operator",
|
||||
url: "https://git.io/vb4Se"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-nullish-coalescing-opearator"
|
||||
}
|
||||
},
|
||||
objectRestSpread: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-object-rest-spread",
|
||||
url: "https://git.io/vb4y5"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-object-rest-spread"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-object-rest-spread",
|
||||
url: "https://git.io/vb4Ss"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-object-rest-spread"
|
||||
}
|
||||
},
|
||||
optionalCatchBinding: {
|
||||
syntax: {
|
||||
name: "@babel/plugin-syntax-optional-catch-binding",
|
||||
url: "https://git.io/vb4Sn"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-catch-binding"
|
||||
},
|
||||
transform: {
|
||||
name: "@babel/plugin-proposal-optional-catch-binding",
|
||||
url: "https://git.io/vb4SI"
|
||||
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-optional-catch-binding"
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -310,4 +320,6 @@ If you want to leave it as-is, add ${syntaxPluginInfo} to the 'plugins' section
|
||||
}
|
||||
|
||||
return helpMessage;
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
4
node_modules/@babel/core/lib/tools/build-external-helpers.js
generated
vendored
4
node_modules/@babel/core/lib/tools/build-external-helpers.js
generated
vendored
@ -161,4 +161,6 @@ function _default(allowlist, outputType = "global") {
|
||||
}
|
||||
|
||||
return (0, _generator().default)(tree).code;
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
19
node_modules/@babel/core/lib/transform-ast.js
generated
vendored
19
node_modules/@babel/core/lib/transform-ast.js
generated
vendored
@ -26,14 +26,22 @@ const transformFromAstRunner = _gensync()(function* (ast, code, opts) {
|
||||
return yield* (0, _transformation.run)(config, code, ast);
|
||||
});
|
||||
|
||||
const transformFromAst = function transformFromAst(ast, code, opts, callback) {
|
||||
if (typeof opts === "function") {
|
||||
callback = opts;
|
||||
const transformFromAst = function transformFromAst(ast, code, optsOrCallback, maybeCallback) {
|
||||
let opts;
|
||||
let callback;
|
||||
|
||||
if (typeof optsOrCallback === "function") {
|
||||
callback = optsOrCallback;
|
||||
opts = undefined;
|
||||
} else {
|
||||
opts = optsOrCallback;
|
||||
callback = maybeCallback;
|
||||
}
|
||||
|
||||
if (callback === undefined) {
|
||||
return transformFromAstRunner.sync(ast, code, opts);
|
||||
{
|
||||
return transformFromAstRunner.sync(ast, code, opts);
|
||||
}
|
||||
}
|
||||
|
||||
transformFromAstRunner.errback(ast, code, opts, callback);
|
||||
@ -43,4 +51,5 @@ exports.transformFromAst = transformFromAst;
|
||||
const transformFromAstSync = transformFromAstRunner.sync;
|
||||
exports.transformFromAstSync = transformFromAstSync;
|
||||
const transformFromAstAsync = transformFromAstRunner.async;
|
||||
exports.transformFromAstAsync = transformFromAstAsync;
|
||||
exports.transformFromAstAsync = transformFromAstAsync;
|
||||
0 && 0;
|
4
node_modules/@babel/core/lib/transform-file-browser.js
generated
vendored
4
node_modules/@babel/core/lib/transform-file-browser.js
generated
vendored
@ -23,4 +23,6 @@ function transformFileSync() {
|
||||
|
||||
function transformFileAsync() {
|
||||
return Promise.reject(new Error("Transforming files is not supported in browsers"));
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
3
node_modules/@babel/core/lib/transform-file.js
generated
vendored
3
node_modules/@babel/core/lib/transform-file.js
generated
vendored
@ -38,4 +38,5 @@ exports.transformFile = transformFile;
|
||||
const transformFileSync = transformFileRunner.sync;
|
||||
exports.transformFileSync = transformFileSync;
|
||||
const transformFileAsync = transformFileRunner.async;
|
||||
exports.transformFileAsync = transformFileAsync;
|
||||
exports.transformFileAsync = transformFileAsync;
|
||||
0 && 0;
|
22
node_modules/@babel/core/lib/transform.js
generated
vendored
22
node_modules/@babel/core/lib/transform.js
generated
vendored
@ -25,13 +25,24 @@ const transformRunner = _gensync()(function* transform(code, opts) {
|
||||
return yield* (0, _transformation.run)(config, code);
|
||||
});
|
||||
|
||||
const transform = function transform(code, opts, callback) {
|
||||
if (typeof opts === "function") {
|
||||
callback = opts;
|
||||
const transform = function transform(code, optsOrCallback, maybeCallback) {
|
||||
let opts;
|
||||
let callback;
|
||||
|
||||
if (typeof optsOrCallback === "function") {
|
||||
callback = optsOrCallback;
|
||||
opts = undefined;
|
||||
} else {
|
||||
opts = optsOrCallback;
|
||||
callback = maybeCallback;
|
||||
}
|
||||
|
||||
if (callback === undefined) {
|
||||
{
|
||||
return transformRunner.sync(code, opts);
|
||||
}
|
||||
}
|
||||
|
||||
if (callback === undefined) return transformRunner.sync(code, opts);
|
||||
transformRunner.errback(code, opts, callback);
|
||||
};
|
||||
|
||||
@ -39,4 +50,5 @@ exports.transform = transform;
|
||||
const transformSync = transformRunner.sync;
|
||||
exports.transformSync = transformSync;
|
||||
const transformAsync = transformRunner.async;
|
||||
exports.transformAsync = transformAsync;
|
||||
exports.transformAsync = transformAsync;
|
||||
0 && 0;
|
3
node_modules/@babel/core/lib/transformation/block-hoist-plugin.js
generated
vendored
3
node_modules/@babel/core/lib/transformation/block-hoist-plugin.js
generated
vendored
@ -91,4 +91,5 @@ const blockHoistPlugin = {
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
0 && 0;
|
9
node_modules/@babel/core/lib/transformation/file/file.js
generated
vendored
9
node_modules/@babel/core/lib/transformation/file/file.js
generated
vendored
@ -91,12 +91,12 @@ class File {
|
||||
this._map = new Map();
|
||||
this.opts = void 0;
|
||||
this.declarations = {};
|
||||
this.path = null;
|
||||
this.ast = {};
|
||||
this.path = void 0;
|
||||
this.ast = void 0;
|
||||
this.scope = void 0;
|
||||
this.metadata = {};
|
||||
this.code = "";
|
||||
this.inputMap = null;
|
||||
this.inputMap = void 0;
|
||||
this.hub = {
|
||||
file: this,
|
||||
getCode: () => this.code,
|
||||
@ -251,4 +251,5 @@ class File {
|
||||
|
||||
}
|
||||
|
||||
exports.default = File;
|
||||
exports.default = File;
|
||||
0 && 0;
|
21
node_modules/@babel/core/lib/transformation/file/generate.js
generated
vendored
21
node_modules/@babel/core/lib/transformation/file/generate.js
generated
vendored
@ -34,6 +34,9 @@ function generateCode(pluginPasses, file) {
|
||||
code,
|
||||
inputMap
|
||||
} = file;
|
||||
const {
|
||||
generatorOpts
|
||||
} = opts;
|
||||
const results = [];
|
||||
|
||||
for (const plugins of pluginPasses) {
|
||||
@ -43,7 +46,7 @@ function generateCode(pluginPasses, file) {
|
||||
} = plugin;
|
||||
|
||||
if (generatorOverride) {
|
||||
const result = generatorOverride(ast, opts.generatorOpts, code, _generator().default);
|
||||
const result = generatorOverride(ast, generatorOpts, code, _generator().default);
|
||||
if (result !== undefined) results.push(result);
|
||||
}
|
||||
}
|
||||
@ -52,7 +55,7 @@ function generateCode(pluginPasses, file) {
|
||||
let result;
|
||||
|
||||
if (results.length === 0) {
|
||||
result = (0, _generator().default)(ast, opts.generatorOpts, code);
|
||||
result = (0, _generator().default)(ast, generatorOpts, code);
|
||||
} else if (results.length === 1) {
|
||||
result = results[0];
|
||||
|
||||
@ -65,11 +68,15 @@ function generateCode(pluginPasses, file) {
|
||||
|
||||
let {
|
||||
code: outputCode,
|
||||
map: outputMap
|
||||
decodedMap: outputMap = result.map
|
||||
} = result;
|
||||
|
||||
if (outputMap && inputMap) {
|
||||
outputMap = (0, _mergeMap.default)(inputMap.toObject(), outputMap);
|
||||
if (outputMap) {
|
||||
if (inputMap) {
|
||||
outputMap = (0, _mergeMap.default)(inputMap.toObject(), outputMap, generatorOpts.sourceFileName);
|
||||
} else {
|
||||
outputMap = result.map;
|
||||
}
|
||||
}
|
||||
|
||||
if (opts.sourceMaps === "inline" || opts.sourceMaps === "both") {
|
||||
@ -84,4 +91,6 @@ function generateCode(pluginPasses, file) {
|
||||
outputCode,
|
||||
outputMap
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
244
node_modules/@babel/core/lib/transformation/file/merge-map.js
generated
vendored
244
node_modules/@babel/core/lib/transformation/file/merge-map.js
generated
vendored
@ -5,241 +5,41 @@ Object.defineProperty(exports, "__esModule", {
|
||||
});
|
||||
exports.default = mergeSourceMap;
|
||||
|
||||
function _sourceMap() {
|
||||
const data = require("source-map");
|
||||
function _remapping() {
|
||||
const data = require("@ampproject/remapping");
|
||||
|
||||
_sourceMap = function () {
|
||||
_remapping = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function mergeSourceMap(inputMap, map) {
|
||||
const input = buildMappingData(inputMap);
|
||||
const output = buildMappingData(map);
|
||||
const mergedGenerator = new (_sourceMap().SourceMapGenerator)();
|
||||
function mergeSourceMap(inputMap, map, sourceFileName) {
|
||||
const source = sourceFileName.replace(/\\/g, "/");
|
||||
let found = false;
|
||||
|
||||
for (const {
|
||||
source
|
||||
} of input.sources) {
|
||||
if (typeof source.content === "string") {
|
||||
mergedGenerator.setSourceContent(source.path, source.content);
|
||||
const result = _remapping()(rootless(map), (s, ctx) => {
|
||||
if (s === source && !found) {
|
||||
found = true;
|
||||
ctx.source = "";
|
||||
return rootless(inputMap);
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
|
||||
if (typeof inputMap.sourceRoot === "string") {
|
||||
result.sourceRoot = inputMap.sourceRoot;
|
||||
}
|
||||
|
||||
if (output.sources.length === 1) {
|
||||
const defaultSource = output.sources[0];
|
||||
const insertedMappings = new Map();
|
||||
eachInputGeneratedRange(input, (generated, original, source) => {
|
||||
eachOverlappingGeneratedOutputRange(defaultSource, generated, item => {
|
||||
const key = makeMappingKey(item);
|
||||
if (insertedMappings.has(key)) return;
|
||||
insertedMappings.set(key, item);
|
||||
mergedGenerator.addMapping({
|
||||
source: source.path,
|
||||
original: {
|
||||
line: original.line,
|
||||
column: original.columnStart
|
||||
},
|
||||
generated: {
|
||||
line: item.line,
|
||||
column: item.columnStart
|
||||
},
|
||||
name: original.name
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
for (const item of insertedMappings.values()) {
|
||||
if (item.columnEnd === Infinity) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const clearItem = {
|
||||
line: item.line,
|
||||
columnStart: item.columnEnd
|
||||
};
|
||||
const key = makeMappingKey(clearItem);
|
||||
|
||||
if (insertedMappings.has(key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
mergedGenerator.addMapping({
|
||||
generated: {
|
||||
line: clearItem.line,
|
||||
column: clearItem.columnStart
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const result = mergedGenerator.toJSON();
|
||||
|
||||
if (typeof input.sourceRoot === "string") {
|
||||
result.sourceRoot = input.sourceRoot;
|
||||
}
|
||||
|
||||
return result;
|
||||
return Object.assign({}, result);
|
||||
}
|
||||
|
||||
function makeMappingKey(item) {
|
||||
return `${item.line}/${item.columnStart}`;
|
||||
}
|
||||
|
||||
function eachOverlappingGeneratedOutputRange(outputFile, inputGeneratedRange, callback) {
|
||||
const overlappingOriginal = filterApplicableOriginalRanges(outputFile, inputGeneratedRange);
|
||||
|
||||
for (const {
|
||||
generated
|
||||
} of overlappingOriginal) {
|
||||
for (const item of generated) {
|
||||
callback(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function filterApplicableOriginalRanges({
|
||||
mappings
|
||||
}, {
|
||||
line,
|
||||
columnStart,
|
||||
columnEnd
|
||||
}) {
|
||||
return filterSortedArray(mappings, ({
|
||||
original: outOriginal
|
||||
}) => {
|
||||
if (line > outOriginal.line) return -1;
|
||||
if (line < outOriginal.line) return 1;
|
||||
if (columnStart >= outOriginal.columnEnd) return -1;
|
||||
if (columnEnd <= outOriginal.columnStart) return 1;
|
||||
return 0;
|
||||
function rootless(map) {
|
||||
return Object.assign({}, map, {
|
||||
sourceRoot: null
|
||||
});
|
||||
}
|
||||
|
||||
function eachInputGeneratedRange(map, callback) {
|
||||
for (const {
|
||||
source,
|
||||
mappings
|
||||
} of map.sources) {
|
||||
for (const {
|
||||
original,
|
||||
generated
|
||||
} of mappings) {
|
||||
for (const item of generated) {
|
||||
callback(item, original, source);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function buildMappingData(map) {
|
||||
const consumer = new (_sourceMap().SourceMapConsumer)(Object.assign({}, map, {
|
||||
sourceRoot: null
|
||||
}));
|
||||
const sources = new Map();
|
||||
const mappings = new Map();
|
||||
let last = null;
|
||||
consumer.computeColumnSpans();
|
||||
consumer.eachMapping(m => {
|
||||
if (m.originalLine === null) return;
|
||||
let source = sources.get(m.source);
|
||||
|
||||
if (!source) {
|
||||
source = {
|
||||
path: m.source,
|
||||
content: consumer.sourceContentFor(m.source, true)
|
||||
};
|
||||
sources.set(m.source, source);
|
||||
}
|
||||
|
||||
let sourceData = mappings.get(source);
|
||||
|
||||
if (!sourceData) {
|
||||
sourceData = {
|
||||
source,
|
||||
mappings: []
|
||||
};
|
||||
mappings.set(source, sourceData);
|
||||
}
|
||||
|
||||
const obj = {
|
||||
line: m.originalLine,
|
||||
columnStart: m.originalColumn,
|
||||
columnEnd: Infinity,
|
||||
name: m.name
|
||||
};
|
||||
|
||||
if (last && last.source === source && last.mapping.line === m.originalLine) {
|
||||
last.mapping.columnEnd = m.originalColumn;
|
||||
}
|
||||
|
||||
last = {
|
||||
source,
|
||||
mapping: obj
|
||||
};
|
||||
sourceData.mappings.push({
|
||||
original: obj,
|
||||
generated: consumer.allGeneratedPositionsFor({
|
||||
source: m.source,
|
||||
line: m.originalLine,
|
||||
column: m.originalColumn
|
||||
}).map(item => ({
|
||||
line: item.line,
|
||||
columnStart: item.column,
|
||||
columnEnd: item.lastColumn + 1
|
||||
}))
|
||||
});
|
||||
}, null, _sourceMap().SourceMapConsumer.ORIGINAL_ORDER);
|
||||
return {
|
||||
file: map.file,
|
||||
sourceRoot: map.sourceRoot,
|
||||
sources: Array.from(mappings.values())
|
||||
};
|
||||
}
|
||||
|
||||
function findInsertionLocation(array, callback) {
|
||||
let left = 0;
|
||||
let right = array.length;
|
||||
|
||||
while (left < right) {
|
||||
const mid = Math.floor((left + right) / 2);
|
||||
const item = array[mid];
|
||||
const result = callback(item);
|
||||
|
||||
if (result === 0) {
|
||||
left = mid;
|
||||
break;
|
||||
}
|
||||
|
||||
if (result >= 0) {
|
||||
right = mid;
|
||||
} else {
|
||||
left = mid + 1;
|
||||
}
|
||||
}
|
||||
|
||||
let i = left;
|
||||
|
||||
if (i < array.length) {
|
||||
while (i >= 0 && callback(array[i]) >= 0) {
|
||||
i--;
|
||||
}
|
||||
|
||||
return i + 1;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
function filterSortedArray(array, callback) {
|
||||
const start = findInsertionLocation(array, callback);
|
||||
const results = [];
|
||||
|
||||
for (let i = start; i < array.length && callback(array[i]) === 0; i++) {
|
||||
results.push(array[i]);
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
0 && 0;
|
9
node_modules/@babel/core/lib/transformation/index.js
generated
vendored
9
node_modules/@babel/core/lib/transformation/index.js
generated
vendored
@ -25,6 +25,8 @@ var _normalizeFile = require("./normalize-file");
|
||||
|
||||
var _generate = require("./file/generate");
|
||||
|
||||
var _deepArray = require("../config/helpers/deep-array");
|
||||
|
||||
function* run(config, code, ast) {
|
||||
const file = yield* (0, _normalizeFile.default)(config.passes, (0, _normalizeOpts.default)(config), code, ast);
|
||||
const opts = file.opts;
|
||||
@ -70,7 +72,8 @@ function* run(config, code, ast) {
|
||||
ast: opts.ast === true ? file.ast : null,
|
||||
code: outputCode === undefined ? null : outputCode,
|
||||
map: outputMap === undefined ? null : outputMap,
|
||||
sourceType: file.ast.program.sourceType
|
||||
sourceType: file.ast.program.sourceType,
|
||||
externalDependencies: (0, _deepArray.flattenToSet)(config.externalDependencies)
|
||||
};
|
||||
}
|
||||
|
||||
@ -121,4 +124,6 @@ function* transformFile(file, pluginPasses) {
|
||||
|
||||
function isThenable(val) {
|
||||
return !!val && (typeof val === "object" || typeof val === "function") && !!val.then && typeof val.then === "function";
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
6
node_modules/@babel/core/lib/transformation/normalize-file.js
generated
vendored
6
node_modules/@babel/core/lib/transformation/normalize-file.js
generated
vendored
@ -68,7 +68,7 @@ const {
|
||||
|
||||
const debug = _debug()("babel:transform:file");
|
||||
|
||||
const LARGE_INPUT_SOURCEMAP_THRESHOLD = 1000000;
|
||||
const LARGE_INPUT_SOURCEMAP_THRESHOLD = 3000000;
|
||||
|
||||
function* normalizeFile(pluginPasses, options, code, ast) {
|
||||
code = `${code || ""}`;
|
||||
@ -164,4 +164,6 @@ function extractComments(regex, ast) {
|
||||
[node.trailingComments, lastComment] = extractCommentsFromList(regex, node.trailingComments, lastComment);
|
||||
});
|
||||
return lastComment;
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
4
node_modules/@babel/core/lib/transformation/normalize-opts.js
generated
vendored
4
node_modules/@babel/core/lib/transformation/normalize-opts.js
generated
vendored
@ -59,4 +59,6 @@ function normalizeOptions(config) {
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
}
|
||||
|
||||
0 && 0;
|
3
node_modules/@babel/core/lib/transformation/plugin-pass.js
generated
vendored
3
node_modules/@babel/core/lib/transformation/plugin-pass.js
generated
vendored
@ -51,4 +51,5 @@ exports.default = PluginPass;
|
||||
PluginPass.prototype.getModuleName = function getModuleName() {
|
||||
return this.file.getModuleName();
|
||||
};
|
||||
}
|
||||
}
|
||||
0 && 0;
|
25
node_modules/@babel/core/lib/transformation/util/clone-deep-browser.js
generated
vendored
25
node_modules/@babel/core/lib/transformation/util/clone-deep-browser.js
generated
vendored
@ -1,25 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
const serialized = "$$ babel internal serialized type" + Math.random();
|
||||
|
||||
function serialize(key, value) {
|
||||
if (typeof value !== "bigint") return value;
|
||||
return {
|
||||
[serialized]: "BigInt",
|
||||
value: value.toString()
|
||||
};
|
||||
}
|
||||
|
||||
function revive(key, value) {
|
||||
if (!value || typeof value !== "object") return value;
|
||||
if (value[serialized] !== "BigInt") return value;
|
||||
return BigInt(value.value);
|
||||
}
|
||||
|
||||
function _default(value) {
|
||||
return JSON.parse(JSON.stringify(value, serialize), revive);
|
||||
}
|
41
node_modules/@babel/core/lib/transformation/util/clone-deep.js
generated
vendored
41
node_modules/@babel/core/lib/transformation/util/clone-deep.js
generated
vendored
@ -5,22 +5,37 @@ Object.defineProperty(exports, "__esModule", {
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
function _v() {
|
||||
const data = require("v8");
|
||||
function deepClone(value, cache) {
|
||||
if (value !== null) {
|
||||
if (cache.has(value)) return cache.get(value);
|
||||
let cloned;
|
||||
|
||||
_v = function () {
|
||||
return data;
|
||||
};
|
||||
if (Array.isArray(value)) {
|
||||
cloned = new Array(value.length);
|
||||
|
||||
return data;
|
||||
}
|
||||
for (let i = 0; i < value.length; i++) {
|
||||
cloned[i] = typeof value[i] !== "object" ? value[i] : deepClone(value[i], cache);
|
||||
}
|
||||
} else {
|
||||
cloned = {};
|
||||
const keys = Object.keys(value);
|
||||
|
||||
var _cloneDeepBrowser = require("./clone-deep-browser");
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
const key = keys[i];
|
||||
cloned[key] = typeof value[key] !== "object" ? value[key] : deepClone(value[key], cache);
|
||||
}
|
||||
}
|
||||
|
||||
function _default(value) {
|
||||
if (_v().deserialize && _v().serialize) {
|
||||
return _v().deserialize(_v().serialize(value));
|
||||
cache.set(value, cloned);
|
||||
return cloned;
|
||||
}
|
||||
|
||||
return (0, _cloneDeepBrowser.default)(value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
function _default(value) {
|
||||
if (typeof value !== "object") return value;
|
||||
return deepClone(value, new Map());
|
||||
}
|
||||
|
||||
0 && 0;
|
2845
node_modules/@babel/core/lib/vendor/import-meta-resolve.js
generated
vendored
2845
node_modules/@babel/core/lib/vendor/import-meta-resolve.js
generated
vendored
File diff suppressed because it is too large
Load Diff
301
node_modules/@babel/core/node_modules/source-map/CHANGELOG.md
generated
vendored
301
node_modules/@babel/core/node_modules/source-map/CHANGELOG.md
generated
vendored
@ -1,301 +0,0 @@
|
||||
# Change Log
|
||||
|
||||
## 0.5.6
|
||||
|
||||
* Fix for regression when people were using numbers as names in source maps. See
|
||||
#236.
|
||||
|
||||
## 0.5.5
|
||||
|
||||
* Fix "regression" of unsupported, implementation behavior that half the world
|
||||
happens to have come to depend on. See #235.
|
||||
|
||||
* Fix regression involving function hoisting in SpiderMonkey. See #233.
|
||||
|
||||
## 0.5.4
|
||||
|
||||
* Large performance improvements to source-map serialization. See #228 and #229.
|
||||
|
||||
## 0.5.3
|
||||
|
||||
* Do not include unnecessary distribution files. See
|
||||
commit ef7006f8d1647e0a83fdc60f04f5a7ca54886f86.
|
||||
|
||||
## 0.5.2
|
||||
|
||||
* Include browser distributions of the library in package.json's `files`. See
|
||||
issue #212.
|
||||
|
||||
## 0.5.1
|
||||
|
||||
* Fix latent bugs in IndexedSourceMapConsumer.prototype._parseMappings. See
|
||||
ff05274becc9e6e1295ed60f3ea090d31d843379.
|
||||
|
||||
## 0.5.0
|
||||
|
||||
* Node 0.8 is no longer supported.
|
||||
|
||||
* Use webpack instead of dryice for bundling.
|
||||
|
||||
* Big speedups serializing source maps. See pull request #203.
|
||||
|
||||
* Fix a bug with `SourceMapConsumer.prototype.sourceContentFor` and sources that
|
||||
explicitly start with the source root. See issue #199.
|
||||
|
||||
## 0.4.4
|
||||
|
||||
* Fix an issue where using a `SourceMapGenerator` after having created a
|
||||
`SourceMapConsumer` from it via `SourceMapConsumer.fromSourceMap` failed. See
|
||||
issue #191.
|
||||
|
||||
* Fix an issue with where `SourceMapGenerator` would mistakenly consider
|
||||
different mappings as duplicates of each other and avoid generating them. See
|
||||
issue #192.
|
||||
|
||||
## 0.4.3
|
||||
|
||||
* A very large number of performance improvements, particularly when parsing
|
||||
source maps. Collectively about 75% of time shaved off of the source map
|
||||
parsing benchmark!
|
||||
|
||||
* Fix a bug in `SourceMapConsumer.prototype.allGeneratedPositionsFor` and fuzzy
|
||||
searching in the presence of a column option. See issue #177.
|
||||
|
||||
* Fix a bug with joining a source and its source root when the source is above
|
||||
the root. See issue #182.
|
||||
|
||||
* Add the `SourceMapConsumer.prototype.hasContentsOfAllSources` method to
|
||||
determine when all sources' contents are inlined into the source map. See
|
||||
issue #190.
|
||||
|
||||
## 0.4.2
|
||||
|
||||
* Add an `.npmignore` file so that the benchmarks aren't pulled down by
|
||||
dependent projects. Issue #169.
|
||||
|
||||
* Add an optional `column` argument to
|
||||
`SourceMapConsumer.prototype.allGeneratedPositionsFor` and better handle lines
|
||||
with no mappings. Issues #172 and #173.
|
||||
|
||||
## 0.4.1
|
||||
|
||||
* Fix accidentally defining a global variable. #170.
|
||||
|
||||
## 0.4.0
|
||||
|
||||
* The default direction for fuzzy searching was changed back to its original
|
||||
direction. See #164.
|
||||
|
||||
* There is now a `bias` option you can supply to `SourceMapConsumer` to control
|
||||
the fuzzy searching direction. See #167.
|
||||
|
||||
* About an 8% speed up in parsing source maps. See #159.
|
||||
|
||||
* Added a benchmark for parsing and generating source maps.
|
||||
|
||||
## 0.3.0
|
||||
|
||||
* Change the default direction that searching for positions fuzzes when there is
|
||||
not an exact match. See #154.
|
||||
|
||||
* Support for environments using json2.js for JSON serialization. See #156.
|
||||
|
||||
## 0.2.0
|
||||
|
||||
* Support for consuming "indexed" source maps which do not have any remote
|
||||
sections. See pull request #127. This introduces a minor backwards
|
||||
incompatibility if you are monkey patching `SourceMapConsumer.prototype`
|
||||
methods.
|
||||
|
||||
## 0.1.43
|
||||
|
||||
* Performance improvements for `SourceMapGenerator` and `SourceNode`. See issue
|
||||
#148 for some discussion and issues #150, #151, and #152 for implementations.
|
||||
|
||||
## 0.1.42
|
||||
|
||||
* Fix an issue where `SourceNode`s from different versions of the source-map
|
||||
library couldn't be used in conjunction with each other. See issue #142.
|
||||
|
||||
## 0.1.41
|
||||
|
||||
* Fix a bug with getting the source content of relative sources with a "./"
|
||||
prefix. See issue #145 and [Bug 1090768](bugzil.la/1090768).
|
||||
|
||||
* Add the `SourceMapConsumer.prototype.computeColumnSpans` method to compute the
|
||||
column span of each mapping.
|
||||
|
||||
* Add the `SourceMapConsumer.prototype.allGeneratedPositionsFor` method to find
|
||||
all generated positions associated with a given original source and line.
|
||||
|
||||
## 0.1.40
|
||||
|
||||
* Performance improvements for parsing source maps in SourceMapConsumer.
|
||||
|
||||
## 0.1.39
|
||||
|
||||
* Fix a bug where setting a source's contents to null before any source content
|
||||
had been set before threw a TypeError. See issue #131.
|
||||
|
||||
## 0.1.38
|
||||
|
||||
* Fix a bug where finding relative paths from an empty path were creating
|
||||
absolute paths. See issue #129.
|
||||
|
||||
## 0.1.37
|
||||
|
||||
* Fix a bug where if the source root was an empty string, relative source paths
|
||||
would turn into absolute source paths. Issue #124.
|
||||
|
||||
## 0.1.36
|
||||
|
||||
* Allow the `names` mapping property to be an empty string. Issue #121.
|
||||
|
||||
## 0.1.35
|
||||
|
||||
* A third optional parameter was added to `SourceNode.fromStringWithSourceMap`
|
||||
to specify a path that relative sources in the second parameter should be
|
||||
relative to. Issue #105.
|
||||
|
||||
* If no file property is given to a `SourceMapGenerator`, then the resulting
|
||||
source map will no longer have a `null` file property. The property will
|
||||
simply not exist. Issue #104.
|
||||
|
||||
* Fixed a bug where consecutive newlines were ignored in `SourceNode`s.
|
||||
Issue #116.
|
||||
|
||||
## 0.1.34
|
||||
|
||||
* Make `SourceNode` work with windows style ("\r\n") newlines. Issue #103.
|
||||
|
||||
* Fix bug involving source contents and the
|
||||
`SourceMapGenerator.prototype.applySourceMap`. Issue #100.
|
||||
|
||||
## 0.1.33
|
||||
|
||||
* Fix some edge cases surrounding path joining and URL resolution.
|
||||
|
||||
* Add a third parameter for relative path to
|
||||
`SourceMapGenerator.prototype.applySourceMap`.
|
||||
|
||||
* Fix issues with mappings and EOLs.
|
||||
|
||||
## 0.1.32
|
||||
|
||||
* Fixed a bug where SourceMapConsumer couldn't handle negative relative columns
|
||||
(issue 92).
|
||||
|
||||
* Fixed test runner to actually report number of failed tests as its process
|
||||
exit code.
|
||||
|
||||
* Fixed a typo when reporting bad mappings (issue 87).
|
||||
|
||||
## 0.1.31
|
||||
|
||||
* Delay parsing the mappings in SourceMapConsumer until queried for a source
|
||||
location.
|
||||
|
||||
* Support Sass source maps (which at the time of writing deviate from the spec
|
||||
in small ways) in SourceMapConsumer.
|
||||
|
||||
## 0.1.30
|
||||
|
||||
* Do not join source root with a source, when the source is a data URI.
|
||||
|
||||
* Extend the test runner to allow running single specific test files at a time.
|
||||
|
||||
* Performance improvements in `SourceNode.prototype.walk` and
|
||||
`SourceMapConsumer.prototype.eachMapping`.
|
||||
|
||||
* Source map browser builds will now work inside Workers.
|
||||
|
||||
* Better error messages when attempting to add an invalid mapping to a
|
||||
`SourceMapGenerator`.
|
||||
|
||||
## 0.1.29
|
||||
|
||||
* Allow duplicate entries in the `names` and `sources` arrays of source maps
|
||||
(usually from TypeScript) we are parsing. Fixes github issue 72.
|
||||
|
||||
## 0.1.28
|
||||
|
||||
* Skip duplicate mappings when creating source maps from SourceNode; github
|
||||
issue 75.
|
||||
|
||||
## 0.1.27
|
||||
|
||||
* Don't throw an error when the `file` property is missing in SourceMapConsumer,
|
||||
we don't use it anyway.
|
||||
|
||||
## 0.1.26
|
||||
|
||||
* Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70.
|
||||
|
||||
## 0.1.25
|
||||
|
||||
* Make compatible with browserify
|
||||
|
||||
## 0.1.24
|
||||
|
||||
* Fix issue with absolute paths and `file://` URIs. See
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=885597
|
||||
|
||||
## 0.1.23
|
||||
|
||||
* Fix issue with absolute paths and sourcesContent, github issue 64.
|
||||
|
||||
## 0.1.22
|
||||
|
||||
* Ignore duplicate mappings in SourceMapGenerator. Fixes github issue 21.
|
||||
|
||||
## 0.1.21
|
||||
|
||||
* Fixed handling of sources that start with a slash so that they are relative to
|
||||
the source root's host.
|
||||
|
||||
## 0.1.20
|
||||
|
||||
* Fixed github issue #43: absolute URLs aren't joined with the source root
|
||||
anymore.
|
||||
|
||||
## 0.1.19
|
||||
|
||||
* Using Travis CI to run tests.
|
||||
|
||||
## 0.1.18
|
||||
|
||||
* Fixed a bug in the handling of sourceRoot.
|
||||
|
||||
## 0.1.17
|
||||
|
||||
* Added SourceNode.fromStringWithSourceMap.
|
||||
|
||||
## 0.1.16
|
||||
|
||||
* Added missing documentation.
|
||||
|
||||
* Fixed the generating of empty mappings in SourceNode.
|
||||
|
||||
## 0.1.15
|
||||
|
||||
* Added SourceMapGenerator.applySourceMap.
|
||||
|
||||
## 0.1.14
|
||||
|
||||
* The sourceRoot is now handled consistently.
|
||||
|
||||
## 0.1.13
|
||||
|
||||
* Added SourceMapGenerator.fromSourceMap.
|
||||
|
||||
## 0.1.12
|
||||
|
||||
* SourceNode now generates empty mappings too.
|
||||
|
||||
## 0.1.11
|
||||
|
||||
* Added name support to SourceNode.
|
||||
|
||||
## 0.1.10
|
||||
|
||||
* Added sourcesContent support to the customer and generator.
|
28
node_modules/@babel/core/node_modules/source-map/LICENSE
generated
vendored
28
node_modules/@babel/core/node_modules/source-map/LICENSE
generated
vendored
@ -1,28 +0,0 @@
|
||||
|
||||
Copyright (c) 2009-2011, Mozilla Foundation and contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the names of the Mozilla Foundation nor the names of project
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
729
node_modules/@babel/core/node_modules/source-map/README.md
generated
vendored
729
node_modules/@babel/core/node_modules/source-map/README.md
generated
vendored
@ -1,729 +0,0 @@
|
||||
# Source Map
|
||||
|
||||
[](https://travis-ci.org/mozilla/source-map)
|
||||
|
||||
[](https://www.npmjs.com/package/source-map)
|
||||
|
||||
This is a library to generate and consume the source map format
|
||||
[described here][format].
|
||||
|
||||
[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit
|
||||
|
||||
## Use with Node
|
||||
|
||||
$ npm install source-map
|
||||
|
||||
## Use on the Web
|
||||
|
||||
<script src="https://raw.githubusercontent.com/mozilla/source-map/master/dist/source-map.min.js" defer></script>
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
<!-- `npm run toc` to regenerate the Table of Contents -->
|
||||
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
## Table of Contents
|
||||
|
||||
- [Examples](#examples)
|
||||
- [Consuming a source map](#consuming-a-source-map)
|
||||
- [Generating a source map](#generating-a-source-map)
|
||||
- [With SourceNode (high level API)](#with-sourcenode-high-level-api)
|
||||
- [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api)
|
||||
- [API](#api)
|
||||
- [SourceMapConsumer](#sourcemapconsumer)
|
||||
- [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap)
|
||||
- [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans)
|
||||
- [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition)
|
||||
- [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition)
|
||||
- [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition)
|
||||
- [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources)
|
||||
- [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing)
|
||||
- [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order)
|
||||
- [SourceMapGenerator](#sourcemapgenerator)
|
||||
- [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap)
|
||||
- [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer)
|
||||
- [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping)
|
||||
- [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent)
|
||||
- [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath)
|
||||
- [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring)
|
||||
- [SourceNode](#sourcenode)
|
||||
- [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name)
|
||||
- [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath)
|
||||
- [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk)
|
||||
- [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk)
|
||||
- [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent)
|
||||
- [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn)
|
||||
- [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn)
|
||||
- [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep)
|
||||
- [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement)
|
||||
- [SourceNode.prototype.toString()](#sourcenodeprototypetostring)
|
||||
- [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
## Examples
|
||||
|
||||
### Consuming a source map
|
||||
|
||||
```js
|
||||
var rawSourceMap = {
|
||||
version: 3,
|
||||
file: 'min.js',
|
||||
names: ['bar', 'baz', 'n'],
|
||||
sources: ['one.js', 'two.js'],
|
||||
sourceRoot: 'http://example.com/www/js/',
|
||||
mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
|
||||
};
|
||||
|
||||
var smc = new SourceMapConsumer(rawSourceMap);
|
||||
|
||||
console.log(smc.sources);
|
||||
// [ 'http://example.com/www/js/one.js',
|
||||
// 'http://example.com/www/js/two.js' ]
|
||||
|
||||
console.log(smc.originalPositionFor({
|
||||
line: 2,
|
||||
column: 28
|
||||
}));
|
||||
// { source: 'http://example.com/www/js/two.js',
|
||||
// line: 2,
|
||||
// column: 10,
|
||||
// name: 'n' }
|
||||
|
||||
console.log(smc.generatedPositionFor({
|
||||
source: 'http://example.com/www/js/two.js',
|
||||
line: 2,
|
||||
column: 10
|
||||
}));
|
||||
// { line: 2, column: 28 }
|
||||
|
||||
smc.eachMapping(function (m) {
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
### Generating a source map
|
||||
|
||||
In depth guide:
|
||||
[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/)
|
||||
|
||||
#### With SourceNode (high level API)
|
||||
|
||||
```js
|
||||
function compile(ast) {
|
||||
switch (ast.type) {
|
||||
case 'BinaryExpression':
|
||||
return new SourceNode(
|
||||
ast.location.line,
|
||||
ast.location.column,
|
||||
ast.location.source,
|
||||
[compile(ast.left), " + ", compile(ast.right)]
|
||||
);
|
||||
case 'Literal':
|
||||
return new SourceNode(
|
||||
ast.location.line,
|
||||
ast.location.column,
|
||||
ast.location.source,
|
||||
String(ast.value)
|
||||
);
|
||||
// ...
|
||||
default:
|
||||
throw new Error("Bad AST");
|
||||
}
|
||||
}
|
||||
|
||||
var ast = parse("40 + 2", "add.js");
|
||||
console.log(compile(ast).toStringWithSourceMap({
|
||||
file: 'add.js'
|
||||
}));
|
||||
// { code: '40 + 2',
|
||||
// map: [object SourceMapGenerator] }
|
||||
```
|
||||
|
||||
#### With SourceMapGenerator (low level API)
|
||||
|
||||
```js
|
||||
var map = new SourceMapGenerator({
|
||||
file: "source-mapped.js"
|
||||
});
|
||||
|
||||
map.addMapping({
|
||||
generated: {
|
||||
line: 10,
|
||||
column: 35
|
||||
},
|
||||
source: "foo.js",
|
||||
original: {
|
||||
line: 33,
|
||||
column: 2
|
||||
},
|
||||
name: "christopher"
|
||||
});
|
||||
|
||||
console.log(map.toString());
|
||||
// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}'
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
Get a reference to the module:
|
||||
|
||||
```js
|
||||
// Node.js
|
||||
var sourceMap = require('source-map');
|
||||
|
||||
// Browser builds
|
||||
var sourceMap = window.sourceMap;
|
||||
|
||||
// Inside Firefox
|
||||
const sourceMap = require("devtools/toolkit/sourcemap/source-map.js");
|
||||
```
|
||||
|
||||
### SourceMapConsumer
|
||||
|
||||
A SourceMapConsumer instance represents a parsed source map which we can query
|
||||
for information about the original file positions by giving it a file position
|
||||
in the generated source.
|
||||
|
||||
#### new SourceMapConsumer(rawSourceMap)
|
||||
|
||||
The only parameter is the raw source map (either as a string which can be
|
||||
`JSON.parse`'d, or an object). According to the spec, source maps have the
|
||||
following attributes:
|
||||
|
||||
* `version`: Which version of the source map spec this map is following.
|
||||
|
||||
* `sources`: An array of URLs to the original source files.
|
||||
|
||||
* `names`: An array of identifiers which can be referenced by individual
|
||||
mappings.
|
||||
|
||||
* `sourceRoot`: Optional. The URL root from which all sources are relative.
|
||||
|
||||
* `sourcesContent`: Optional. An array of contents of the original source files.
|
||||
|
||||
* `mappings`: A string of base64 VLQs which contain the actual mappings.
|
||||
|
||||
* `file`: Optional. The generated filename this source map is associated with.
|
||||
|
||||
```js
|
||||
var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData);
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.computeColumnSpans()
|
||||
|
||||
Compute the last column for each generated mapping. The last column is
|
||||
inclusive.
|
||||
|
||||
```js
|
||||
// Before:
|
||||
consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" })
|
||||
// [ { line: 2,
|
||||
// column: 1 },
|
||||
// { line: 2,
|
||||
// column: 10 },
|
||||
// { line: 2,
|
||||
// column: 20 } ]
|
||||
|
||||
consumer.computeColumnSpans();
|
||||
|
||||
// After:
|
||||
consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" })
|
||||
// [ { line: 2,
|
||||
// column: 1,
|
||||
// lastColumn: 9 },
|
||||
// { line: 2,
|
||||
// column: 10,
|
||||
// lastColumn: 19 },
|
||||
// { line: 2,
|
||||
// column: 20,
|
||||
// lastColumn: Infinity } ]
|
||||
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition)
|
||||
|
||||
Returns the original source, line, and column information for the generated
|
||||
source's line and column positions provided. The only argument is an object with
|
||||
the following properties:
|
||||
|
||||
* `line`: The line number in the generated source.
|
||||
|
||||
* `column`: The column number in the generated source.
|
||||
|
||||
* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or
|
||||
`SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest
|
||||
element that is smaller than or greater than the one we are searching for,
|
||||
respectively, if the exact element cannot be found. Defaults to
|
||||
`SourceMapConsumer.GREATEST_LOWER_BOUND`.
|
||||
|
||||
and an object is returned with the following properties:
|
||||
|
||||
* `source`: The original source file, or null if this information is not
|
||||
available.
|
||||
|
||||
* `line`: The line number in the original source, or null if this information is
|
||||
not available.
|
||||
|
||||
* `column`: The column number in the original source, or null if this
|
||||
information is not available.
|
||||
|
||||
* `name`: The original identifier, or null if this information is not available.
|
||||
|
||||
```js
|
||||
consumer.originalPositionFor({ line: 2, column: 10 })
|
||||
// { source: 'foo.coffee',
|
||||
// line: 2,
|
||||
// column: 2,
|
||||
// name: null }
|
||||
|
||||
consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 })
|
||||
// { source: null,
|
||||
// line: null,
|
||||
// column: null,
|
||||
// name: null }
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition)
|
||||
|
||||
Returns the generated line and column information for the original source,
|
||||
line, and column positions provided. The only argument is an object with
|
||||
the following properties:
|
||||
|
||||
* `source`: The filename of the original source.
|
||||
|
||||
* `line`: The line number in the original source.
|
||||
|
||||
* `column`: The column number in the original source.
|
||||
|
||||
and an object is returned with the following properties:
|
||||
|
||||
* `line`: The line number in the generated source, or null.
|
||||
|
||||
* `column`: The column number in the generated source, or null.
|
||||
|
||||
```js
|
||||
consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 })
|
||||
// { line: 1,
|
||||
// column: 56 }
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)
|
||||
|
||||
Returns all generated line and column information for the original source, line,
|
||||
and column provided. If no column is provided, returns all mappings
|
||||
corresponding to a either the line we are searching for or the next closest line
|
||||
that has any mappings. Otherwise, returns all mappings corresponding to the
|
||||
given line and either the column we are searching for or the next closest column
|
||||
that has any offsets.
|
||||
|
||||
The only argument is an object with the following properties:
|
||||
|
||||
* `source`: The filename of the original source.
|
||||
|
||||
* `line`: The line number in the original source.
|
||||
|
||||
* `column`: Optional. The column number in the original source.
|
||||
|
||||
and an array of objects is returned, each with the following properties:
|
||||
|
||||
* `line`: The line number in the generated source, or null.
|
||||
|
||||
* `column`: The column number in the generated source, or null.
|
||||
|
||||
```js
|
||||
consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" })
|
||||
// [ { line: 2,
|
||||
// column: 1 },
|
||||
// { line: 2,
|
||||
// column: 10 },
|
||||
// { line: 2,
|
||||
// column: 20 } ]
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.hasContentsOfAllSources()
|
||||
|
||||
Return true if we have the embedded source content for every source listed in
|
||||
the source map, false otherwise.
|
||||
|
||||
In other words, if this method returns `true`, then
|
||||
`consumer.sourceContentFor(s)` will succeed for every source `s` in
|
||||
`consumer.sources`.
|
||||
|
||||
```js
|
||||
// ...
|
||||
if (consumer.hasContentsOfAllSources()) {
|
||||
consumerReadyCallback(consumer);
|
||||
} else {
|
||||
fetchSources(consumer, consumerReadyCallback);
|
||||
}
|
||||
// ...
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])
|
||||
|
||||
Returns the original source content for the source provided. The only
|
||||
argument is the URL of the original source file.
|
||||
|
||||
If the source content for the given source is not found, then an error is
|
||||
thrown. Optionally, pass `true` as the second param to have `null` returned
|
||||
instead.
|
||||
|
||||
```js
|
||||
consumer.sources
|
||||
// [ "my-cool-lib.clj" ]
|
||||
|
||||
consumer.sourceContentFor("my-cool-lib.clj")
|
||||
// "..."
|
||||
|
||||
consumer.sourceContentFor("this is not in the source map");
|
||||
// Error: "this is not in the source map" is not in the source map
|
||||
|
||||
consumer.sourceContentFor("this is not in the source map", true);
|
||||
// null
|
||||
```
|
||||
|
||||
#### SourceMapConsumer.prototype.eachMapping(callback, context, order)
|
||||
|
||||
Iterate over each mapping between an original source/line/column and a
|
||||
generated line/column in this source map.
|
||||
|
||||
* `callback`: The function that is called with each mapping. Mappings have the
|
||||
form `{ source, generatedLine, generatedColumn, originalLine, originalColumn,
|
||||
name }`
|
||||
|
||||
* `context`: Optional. If specified, this object will be the value of `this`
|
||||
every time that `callback` is called.
|
||||
|
||||
* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or
|
||||
`SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over
|
||||
the mappings sorted by the generated file's line/column order or the
|
||||
original's source/line/column order, respectively. Defaults to
|
||||
`SourceMapConsumer.GENERATED_ORDER`.
|
||||
|
||||
```js
|
||||
consumer.eachMapping(function (m) { console.log(m); })
|
||||
// ...
|
||||
// { source: 'illmatic.js',
|
||||
// generatedLine: 1,
|
||||
// generatedColumn: 0,
|
||||
// originalLine: 1,
|
||||
// originalColumn: 0,
|
||||
// name: null }
|
||||
// { source: 'illmatic.js',
|
||||
// generatedLine: 2,
|
||||
// generatedColumn: 0,
|
||||
// originalLine: 2,
|
||||
// originalColumn: 0,
|
||||
// name: null }
|
||||
// ...
|
||||
```
|
||||
### SourceMapGenerator
|
||||
|
||||
An instance of the SourceMapGenerator represents a source map which is being
|
||||
built incrementally.
|
||||
|
||||
#### new SourceMapGenerator([startOfSourceMap])
|
||||
|
||||
You may pass an object with the following properties:
|
||||
|
||||
* `file`: The filename of the generated source that this source map is
|
||||
associated with.
|
||||
|
||||
* `sourceRoot`: A root for all relative URLs in this source map.
|
||||
|
||||
* `skipValidation`: Optional. When `true`, disables validation of mappings as
|
||||
they are added. This can improve performance but should be used with
|
||||
discretion, as a last resort. Even then, one should avoid using this flag when
|
||||
running tests, if possible.
|
||||
|
||||
```js
|
||||
var generator = new sourceMap.SourceMapGenerator({
|
||||
file: "my-generated-javascript-file.js",
|
||||
sourceRoot: "http://example.com/app/js/"
|
||||
});
|
||||
```
|
||||
|
||||
#### SourceMapGenerator.fromSourceMap(sourceMapConsumer)
|
||||
|
||||
Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance.
|
||||
|
||||
* `sourceMapConsumer` The SourceMap.
|
||||
|
||||
```js
|
||||
var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer);
|
||||
```
|
||||
|
||||
#### SourceMapGenerator.prototype.addMapping(mapping)
|
||||
|
||||
Add a single mapping from original source line and column to the generated
|
||||
source's line and column for this source map being created. The mapping object
|
||||
should have the following properties:
|
||||
|
||||
* `generated`: An object with the generated line and column positions.
|
||||
|
||||
* `original`: An object with the original line and column positions.
|
||||
|
||||
* `source`: The original source file (relative to the sourceRoot).
|
||||
|
||||
* `name`: An optional original token name for this mapping.
|
||||
|
||||
```js
|
||||
generator.addMapping({
|
||||
source: "module-one.scm",
|
||||
original: { line: 128, column: 0 },
|
||||
generated: { line: 3, column: 456 }
|
||||
})
|
||||
```
|
||||
|
||||
#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)
|
||||
|
||||
Set the source content for an original source file.
|
||||
|
||||
* `sourceFile` the URL of the original source file.
|
||||
|
||||
* `sourceContent` the content of the source file.
|
||||
|
||||
```js
|
||||
generator.setSourceContent("module-one.scm",
|
||||
fs.readFileSync("path/to/module-one.scm"))
|
||||
```
|
||||
|
||||
#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])
|
||||
|
||||
Applies a SourceMap for a source file to the SourceMap.
|
||||
Each mapping to the supplied source file is rewritten using the
|
||||
supplied SourceMap. Note: The resolution for the resulting mappings
|
||||
is the minimum of this map and the supplied map.
|
||||
|
||||
* `sourceMapConsumer`: The SourceMap to be applied.
|
||||
|
||||
* `sourceFile`: Optional. The filename of the source file.
|
||||
If omitted, sourceMapConsumer.file will be used, if it exists.
|
||||
Otherwise an error will be thrown.
|
||||
|
||||
* `sourceMapPath`: Optional. The dirname of the path to the SourceMap
|
||||
to be applied. If relative, it is relative to the SourceMap.
|
||||
|
||||
This parameter is needed when the two SourceMaps aren't in the same
|
||||
directory, and the SourceMap to be applied contains relative source
|
||||
paths. If so, those relative source paths need to be rewritten
|
||||
relative to the SourceMap.
|
||||
|
||||
If omitted, it is assumed that both SourceMaps are in the same directory,
|
||||
thus not needing any rewriting. (Supplying `'.'` has the same effect.)
|
||||
|
||||
#### SourceMapGenerator.prototype.toString()
|
||||
|
||||
Renders the source map being generated to a string.
|
||||
|
||||
```js
|
||||
generator.toString()
|
||||
// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}'
|
||||
```
|
||||
|
||||
### SourceNode
|
||||
|
||||
SourceNodes provide a way to abstract over interpolating and/or concatenating
|
||||
snippets of generated JavaScript source code, while maintaining the line and
|
||||
column information associated between those snippets and the original source
|
||||
code. This is useful as the final intermediate representation a compiler might
|
||||
use before outputting the generated JS and source map.
|
||||
|
||||
#### new SourceNode([line, column, source[, chunk[, name]]])
|
||||
|
||||
* `line`: The original line number associated with this source node, or null if
|
||||
it isn't associated with an original line.
|
||||
|
||||
* `column`: The original column number associated with this source node, or null
|
||||
if it isn't associated with an original column.
|
||||
|
||||
* `source`: The original source's filename; null if no filename is provided.
|
||||
|
||||
* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see
|
||||
below.
|
||||
|
||||
* `name`: Optional. The original identifier.
|
||||
|
||||
```js
|
||||
var node = new SourceNode(1, 2, "a.cpp", [
|
||||
new SourceNode(3, 4, "b.cpp", "extern int status;\n"),
|
||||
new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"),
|
||||
new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"),
|
||||
]);
|
||||
```
|
||||
|
||||
#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])
|
||||
|
||||
Creates a SourceNode from generated code and a SourceMapConsumer.
|
||||
|
||||
* `code`: The generated code
|
||||
|
||||
* `sourceMapConsumer` The SourceMap for the generated code
|
||||
|
||||
* `relativePath` The optional path that relative sources in `sourceMapConsumer`
|
||||
should be relative to.
|
||||
|
||||
```js
|
||||
var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8"));
|
||||
var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"),
|
||||
consumer);
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.add(chunk)
|
||||
|
||||
Add a chunk of generated JS to this source node.
|
||||
|
||||
* `chunk`: A string snippet of generated JS code, another instance of
|
||||
`SourceNode`, or an array where each member is one of those things.
|
||||
|
||||
```js
|
||||
node.add(" + ");
|
||||
node.add(otherNode);
|
||||
node.add([leftHandOperandNode, " + ", rightHandOperandNode]);
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.prepend(chunk)
|
||||
|
||||
Prepend a chunk of generated JS to this source node.
|
||||
|
||||
* `chunk`: A string snippet of generated JS code, another instance of
|
||||
`SourceNode`, or an array where each member is one of those things.
|
||||
|
||||
```js
|
||||
node.prepend("/** Build Id: f783haef86324gf **/\n\n");
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent)
|
||||
|
||||
Set the source content for a source file. This will be added to the
|
||||
`SourceMap` in the `sourcesContent` field.
|
||||
|
||||
* `sourceFile`: The filename of the source file
|
||||
|
||||
* `sourceContent`: The content of the source file
|
||||
|
||||
```js
|
||||
node.setSourceContent("module-one.scm",
|
||||
fs.readFileSync("path/to/module-one.scm"))
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.walk(fn)
|
||||
|
||||
Walk over the tree of JS snippets in this node and its children. The walking
|
||||
function is called once for each snippet of JS and is passed that snippet and
|
||||
the its original associated source's line/column location.
|
||||
|
||||
* `fn`: The traversal function.
|
||||
|
||||
```js
|
||||
var node = new SourceNode(1, 2, "a.js", [
|
||||
new SourceNode(3, 4, "b.js", "uno"),
|
||||
"dos",
|
||||
[
|
||||
"tres",
|
||||
new SourceNode(5, 6, "c.js", "quatro")
|
||||
]
|
||||
]);
|
||||
|
||||
node.walk(function (code, loc) { console.log("WALK:", code, loc); })
|
||||
// WALK: uno { source: 'b.js', line: 3, column: 4, name: null }
|
||||
// WALK: dos { source: 'a.js', line: 1, column: 2, name: null }
|
||||
// WALK: tres { source: 'a.js', line: 1, column: 2, name: null }
|
||||
// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null }
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.walkSourceContents(fn)
|
||||
|
||||
Walk over the tree of SourceNodes. The walking function is called for each
|
||||
source file content and is passed the filename and source content.
|
||||
|
||||
* `fn`: The traversal function.
|
||||
|
||||
```js
|
||||
var a = new SourceNode(1, 2, "a.js", "generated from a");
|
||||
a.setSourceContent("a.js", "original a");
|
||||
var b = new SourceNode(1, 2, "b.js", "generated from b");
|
||||
b.setSourceContent("b.js", "original b");
|
||||
var c = new SourceNode(1, 2, "c.js", "generated from c");
|
||||
c.setSourceContent("c.js", "original c");
|
||||
|
||||
var node = new SourceNode(null, null, null, [a, b, c]);
|
||||
node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); })
|
||||
// WALK: a.js : original a
|
||||
// WALK: b.js : original b
|
||||
// WALK: c.js : original c
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.join(sep)
|
||||
|
||||
Like `Array.prototype.join` except for SourceNodes. Inserts the separator
|
||||
between each of this source node's children.
|
||||
|
||||
* `sep`: The separator.
|
||||
|
||||
```js
|
||||
var lhs = new SourceNode(1, 2, "a.rs", "my_copy");
|
||||
var operand = new SourceNode(3, 4, "a.rs", "=");
|
||||
var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()");
|
||||
|
||||
var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]);
|
||||
var joinedNode = node.join(" ");
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.replaceRight(pattern, replacement)
|
||||
|
||||
Call `String.prototype.replace` on the very right-most source snippet. Useful
|
||||
for trimming white space from the end of a source node, etc.
|
||||
|
||||
* `pattern`: The pattern to replace.
|
||||
|
||||
* `replacement`: The thing to replace the pattern with.
|
||||
|
||||
```js
|
||||
// Trim trailing white space.
|
||||
node.replaceRight(/\s*$/, "");
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.toString()
|
||||
|
||||
Return the string representation of this source node. Walks over the tree and
|
||||
concatenates all the various snippets together to one string.
|
||||
|
||||
```js
|
||||
var node = new SourceNode(1, 2, "a.js", [
|
||||
new SourceNode(3, 4, "b.js", "uno"),
|
||||
"dos",
|
||||
[
|
||||
"tres",
|
||||
new SourceNode(5, 6, "c.js", "quatro")
|
||||
]
|
||||
]);
|
||||
|
||||
node.toString()
|
||||
// 'unodostresquatro'
|
||||
```
|
||||
|
||||
#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])
|
||||
|
||||
Returns the string representation of this tree of source nodes, plus a
|
||||
SourceMapGenerator which contains all the mappings between the generated and
|
||||
original sources.
|
||||
|
||||
The arguments are the same as those to `new SourceMapGenerator`.
|
||||
|
||||
```js
|
||||
var node = new SourceNode(1, 2, "a.js", [
|
||||
new SourceNode(3, 4, "b.js", "uno"),
|
||||
"dos",
|
||||
[
|
||||
"tres",
|
||||
new SourceNode(5, 6, "c.js", "quatro")
|
||||
]
|
||||
]);
|
||||
|
||||
node.toStringWithSourceMap({ file: "my-output-file.js" })
|
||||
// { code: 'unodostresquatro',
|
||||
// map: [object SourceMapGenerator] }
|
||||
```
|
3091
node_modules/@babel/core/node_modules/source-map/dist/source-map.debug.js
generated
vendored
3091
node_modules/@babel/core/node_modules/source-map/dist/source-map.debug.js
generated
vendored
File diff suppressed because one or more lines are too long
3090
node_modules/@babel/core/node_modules/source-map/dist/source-map.js
generated
vendored
3090
node_modules/@babel/core/node_modules/source-map/dist/source-map.js
generated
vendored
File diff suppressed because it is too large
Load Diff
2
node_modules/@babel/core/node_modules/source-map/dist/source-map.min.js
generated
vendored
2
node_modules/@babel/core/node_modules/source-map/dist/source-map.min.js
generated
vendored
File diff suppressed because one or more lines are too long
1
node_modules/@babel/core/node_modules/source-map/dist/source-map.min.js.map
generated
vendored
1
node_modules/@babel/core/node_modules/source-map/dist/source-map.min.js.map
generated
vendored
File diff suppressed because one or more lines are too long
121
node_modules/@babel/core/node_modules/source-map/lib/array-set.js
generated
vendored
121
node_modules/@babel/core/node_modules/source-map/lib/array-set.js
generated
vendored
@ -1,121 +0,0 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var util = require('./util');
|
||||
var has = Object.prototype.hasOwnProperty;
|
||||
var hasNativeMap = typeof Map !== "undefined";
|
||||
|
||||
/**
|
||||
* A data structure which is a combination of an array and a set. Adding a new
|
||||
* member is O(1), testing for membership is O(1), and finding the index of an
|
||||
* element is O(1). Removing elements from the set is not supported. Only
|
||||
* strings are supported for membership.
|
||||
*/
|
||||
function ArraySet() {
|
||||
this._array = [];
|
||||
this._set = hasNativeMap ? new Map() : Object.create(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Static method for creating ArraySet instances from an existing array.
|
||||
*/
|
||||
ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
|
||||
var set = new ArraySet();
|
||||
for (var i = 0, len = aArray.length; i < len; i++) {
|
||||
set.add(aArray[i], aAllowDuplicates);
|
||||
}
|
||||
return set;
|
||||
};
|
||||
|
||||
/**
|
||||
* Return how many unique items are in this ArraySet. If duplicates have been
|
||||
* added, than those do not count towards the size.
|
||||
*
|
||||
* @returns Number
|
||||
*/
|
||||
ArraySet.prototype.size = function ArraySet_size() {
|
||||
return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
|
||||
};
|
||||
|
||||
/**
|
||||
* Add the given string to this set.
|
||||
*
|
||||
* @param String aStr
|
||||
*/
|
||||
ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
|
||||
var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
|
||||
var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
|
||||
var idx = this._array.length;
|
||||
if (!isDuplicate || aAllowDuplicates) {
|
||||
this._array.push(aStr);
|
||||
}
|
||||
if (!isDuplicate) {
|
||||
if (hasNativeMap) {
|
||||
this._set.set(aStr, idx);
|
||||
} else {
|
||||
this._set[sStr] = idx;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Is the given string a member of this set?
|
||||
*
|
||||
* @param String aStr
|
||||
*/
|
||||
ArraySet.prototype.has = function ArraySet_has(aStr) {
|
||||
if (hasNativeMap) {
|
||||
return this._set.has(aStr);
|
||||
} else {
|
||||
var sStr = util.toSetString(aStr);
|
||||
return has.call(this._set, sStr);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* What is the index of the given string in the array?
|
||||
*
|
||||
* @param String aStr
|
||||
*/
|
||||
ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
|
||||
if (hasNativeMap) {
|
||||
var idx = this._set.get(aStr);
|
||||
if (idx >= 0) {
|
||||
return idx;
|
||||
}
|
||||
} else {
|
||||
var sStr = util.toSetString(aStr);
|
||||
if (has.call(this._set, sStr)) {
|
||||
return this._set[sStr];
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error('"' + aStr + '" is not in the set.');
|
||||
};
|
||||
|
||||
/**
|
||||
* What is the element at the given index?
|
||||
*
|
||||
* @param Number aIdx
|
||||
*/
|
||||
ArraySet.prototype.at = function ArraySet_at(aIdx) {
|
||||
if (aIdx >= 0 && aIdx < this._array.length) {
|
||||
return this._array[aIdx];
|
||||
}
|
||||
throw new Error('No element indexed by ' + aIdx);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the array representation of this set (which has the proper indices
|
||||
* indicated by indexOf). Note that this is a copy of the internal array used
|
||||
* for storing the members so that no one can mess with internal state.
|
||||
*/
|
||||
ArraySet.prototype.toArray = function ArraySet_toArray() {
|
||||
return this._array.slice();
|
||||
};
|
||||
|
||||
exports.ArraySet = ArraySet;
|
140
node_modules/@babel/core/node_modules/source-map/lib/base64-vlq.js
generated
vendored
140
node_modules/@babel/core/node_modules/source-map/lib/base64-vlq.js
generated
vendored
@ -1,140 +0,0 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
* Based on the Base 64 VLQ implementation in Closure Compiler:
|
||||
* https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
|
||||
*
|
||||
* Copyright 2011 The Closure Compiler Authors. All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of Google Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
var base64 = require('./base64');
|
||||
|
||||
// A single base 64 digit can contain 6 bits of data. For the base 64 variable
|
||||
// length quantities we use in the source map spec, the first bit is the sign,
|
||||
// the next four bits are the actual value, and the 6th bit is the
|
||||
// continuation bit. The continuation bit tells us whether there are more
|
||||
// digits in this value following this digit.
|
||||
//
|
||||
// Continuation
|
||||
// | Sign
|
||||
// | |
|
||||
// V V
|
||||
// 101011
|
||||
|
||||
var VLQ_BASE_SHIFT = 5;
|
||||
|
||||
// binary: 100000
|
||||
var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
|
||||
|
||||
// binary: 011111
|
||||
var VLQ_BASE_MASK = VLQ_BASE - 1;
|
||||
|
||||
// binary: 100000
|
||||
var VLQ_CONTINUATION_BIT = VLQ_BASE;
|
||||
|
||||
/**
|
||||
* Converts from a two-complement value to a value where the sign bit is
|
||||
* placed in the least significant bit. For example, as decimals:
|
||||
* 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
|
||||
* 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
|
||||
*/
|
||||
function toVLQSigned(aValue) {
|
||||
return aValue < 0
|
||||
? ((-aValue) << 1) + 1
|
||||
: (aValue << 1) + 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts to a two-complement value from a value where the sign bit is
|
||||
* placed in the least significant bit. For example, as decimals:
|
||||
* 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
|
||||
* 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
|
||||
*/
|
||||
function fromVLQSigned(aValue) {
|
||||
var isNegative = (aValue & 1) === 1;
|
||||
var shifted = aValue >> 1;
|
||||
return isNegative
|
||||
? -shifted
|
||||
: shifted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the base 64 VLQ encoded value.
|
||||
*/
|
||||
exports.encode = function base64VLQ_encode(aValue) {
|
||||
var encoded = "";
|
||||
var digit;
|
||||
|
||||
var vlq = toVLQSigned(aValue);
|
||||
|
||||
do {
|
||||
digit = vlq & VLQ_BASE_MASK;
|
||||
vlq >>>= VLQ_BASE_SHIFT;
|
||||
if (vlq > 0) {
|
||||
// There are still more digits in this value, so we must make sure the
|
||||
// continuation bit is marked.
|
||||
digit |= VLQ_CONTINUATION_BIT;
|
||||
}
|
||||
encoded += base64.encode(digit);
|
||||
} while (vlq > 0);
|
||||
|
||||
return encoded;
|
||||
};
|
||||
|
||||
/**
|
||||
* Decodes the next base 64 VLQ value from the given string and returns the
|
||||
* value and the rest of the string via the out parameter.
|
||||
*/
|
||||
exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
|
||||
var strLen = aStr.length;
|
||||
var result = 0;
|
||||
var shift = 0;
|
||||
var continuation, digit;
|
||||
|
||||
do {
|
||||
if (aIndex >= strLen) {
|
||||
throw new Error("Expected more digits in base 64 VLQ value.");
|
||||
}
|
||||
|
||||
digit = base64.decode(aStr.charCodeAt(aIndex++));
|
||||
if (digit === -1) {
|
||||
throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
|
||||
}
|
||||
|
||||
continuation = !!(digit & VLQ_CONTINUATION_BIT);
|
||||
digit &= VLQ_BASE_MASK;
|
||||
result = result + (digit << shift);
|
||||
shift += VLQ_BASE_SHIFT;
|
||||
} while (continuation);
|
||||
|
||||
aOutParam.value = fromVLQSigned(result);
|
||||
aOutParam.rest = aIndex;
|
||||
};
|
67
node_modules/@babel/core/node_modules/source-map/lib/base64.js
generated
vendored
67
node_modules/@babel/core/node_modules/source-map/lib/base64.js
generated
vendored
@ -1,67 +0,0 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
|
||||
|
||||
/**
|
||||
* Encode an integer in the range of 0 to 63 to a single base 64 digit.
|
||||
*/
|
||||
exports.encode = function (number) {
|
||||
if (0 <= number && number < intToCharMap.length) {
|
||||
return intToCharMap[number];
|
||||
}
|
||||
throw new TypeError("Must be between 0 and 63: " + number);
|
||||
};
|
||||
|
||||
/**
|
||||
* Decode a single base 64 character code digit to an integer. Returns -1 on
|
||||
* failure.
|
||||
*/
|
||||
exports.decode = function (charCode) {
|
||||
var bigA = 65; // 'A'
|
||||
var bigZ = 90; // 'Z'
|
||||
|
||||
var littleA = 97; // 'a'
|
||||
var littleZ = 122; // 'z'
|
||||
|
||||
var zero = 48; // '0'
|
||||
var nine = 57; // '9'
|
||||
|
||||
var plus = 43; // '+'
|
||||
var slash = 47; // '/'
|
||||
|
||||
var littleOffset = 26;
|
||||
var numberOffset = 52;
|
||||
|
||||
// 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
if (bigA <= charCode && charCode <= bigZ) {
|
||||
return (charCode - bigA);
|
||||
}
|
||||
|
||||
// 26 - 51: abcdefghijklmnopqrstuvwxyz
|
||||
if (littleA <= charCode && charCode <= littleZ) {
|
||||
return (charCode - littleA + littleOffset);
|
||||
}
|
||||
|
||||
// 52 - 61: 0123456789
|
||||
if (zero <= charCode && charCode <= nine) {
|
||||
return (charCode - zero + numberOffset);
|
||||
}
|
||||
|
||||
// 62: +
|
||||
if (charCode == plus) {
|
||||
return 62;
|
||||
}
|
||||
|
||||
// 63: /
|
||||
if (charCode == slash) {
|
||||
return 63;
|
||||
}
|
||||
|
||||
// Invalid base64 digit.
|
||||
return -1;
|
||||
};
|
111
node_modules/@babel/core/node_modules/source-map/lib/binary-search.js
generated
vendored
111
node_modules/@babel/core/node_modules/source-map/lib/binary-search.js
generated
vendored
@ -1,111 +0,0 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
exports.GREATEST_LOWER_BOUND = 1;
|
||||
exports.LEAST_UPPER_BOUND = 2;
|
||||
|
||||
/**
|
||||
* Recursive implementation of binary search.
|
||||
*
|
||||
* @param aLow Indices here and lower do not contain the needle.
|
||||
* @param aHigh Indices here and higher do not contain the needle.
|
||||
* @param aNeedle The element being searched for.
|
||||
* @param aHaystack The non-empty array being searched.
|
||||
* @param aCompare Function which takes two elements and returns -1, 0, or 1.
|
||||
* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
|
||||
* 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
|
||||
* closest element that is smaller than or greater than the one we are
|
||||
* searching for, respectively, if the exact element cannot be found.
|
||||
*/
|
||||
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
|
||||
// This function terminates when one of the following is true:
|
||||
//
|
||||
// 1. We find the exact element we are looking for.
|
||||
//
|
||||
// 2. We did not find the exact element, but we can return the index of
|
||||
// the next-closest element.
|
||||
//
|
||||
// 3. We did not find the exact element, and there is no next-closest
|
||||
// element than the one we are searching for, so we return -1.
|
||||
var mid = Math.floor((aHigh - aLow) / 2) + aLow;
|
||||
var cmp = aCompare(aNeedle, aHaystack[mid], true);
|
||||
if (cmp === 0) {
|
||||
// Found the element we are looking for.
|
||||
return mid;
|
||||
}
|
||||
else if (cmp > 0) {
|
||||
// Our needle is greater than aHaystack[mid].
|
||||
if (aHigh - mid > 1) {
|
||||
// The element is in the upper half.
|
||||
return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
|
||||
}
|
||||
|
||||
// The exact needle element was not found in this haystack. Determine if
|
||||
// we are in termination case (3) or (2) and return the appropriate thing.
|
||||
if (aBias == exports.LEAST_UPPER_BOUND) {
|
||||
return aHigh < aHaystack.length ? aHigh : -1;
|
||||
} else {
|
||||
return mid;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Our needle is less than aHaystack[mid].
|
||||
if (mid - aLow > 1) {
|
||||
// The element is in the lower half.
|
||||
return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
|
||||
}
|
||||
|
||||
// we are in termination case (3) or (2) and return the appropriate thing.
|
||||
if (aBias == exports.LEAST_UPPER_BOUND) {
|
||||
return mid;
|
||||
} else {
|
||||
return aLow < 0 ? -1 : aLow;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is an implementation of binary search which will always try and return
|
||||
* the index of the closest element if there is no exact hit. This is because
|
||||
* mappings between original and generated line/col pairs are single points,
|
||||
* and there is an implicit region between each of them, so a miss just means
|
||||
* that you aren't on the very start of a region.
|
||||
*
|
||||
* @param aNeedle The element you are looking for.
|
||||
* @param aHaystack The array that is being searched.
|
||||
* @param aCompare A function which takes the needle and an element in the
|
||||
* array and returns -1, 0, or 1 depending on whether the needle is less
|
||||
* than, equal to, or greater than the element, respectively.
|
||||
* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
|
||||
* 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
|
||||
* closest element that is smaller than or greater than the one we are
|
||||
* searching for, respectively, if the exact element cannot be found.
|
||||
* Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
|
||||
*/
|
||||
exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
|
||||
if (aHaystack.length === 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
|
||||
aCompare, aBias || exports.GREATEST_LOWER_BOUND);
|
||||
if (index < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// We have found either the exact element, or the next-closest element than
|
||||
// the one we are searching for. However, there may be more than one such
|
||||
// element. Make sure we always return the smallest of these.
|
||||
while (index - 1 >= 0) {
|
||||
if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
|
||||
break;
|
||||
}
|
||||
--index;
|
||||
}
|
||||
|
||||
return index;
|
||||
};
|
79
node_modules/@babel/core/node_modules/source-map/lib/mapping-list.js
generated
vendored
79
node_modules/@babel/core/node_modules/source-map/lib/mapping-list.js
generated
vendored
@ -1,79 +0,0 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2014 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var util = require('./util');
|
||||
|
||||
/**
|
||||
* Determine whether mappingB is after mappingA with respect to generated
|
||||
* position.
|
||||
*/
|
||||
function generatedPositionAfter(mappingA, mappingB) {
|
||||
// Optimized for most common case
|
||||
var lineA = mappingA.generatedLine;
|
||||
var lineB = mappingB.generatedLine;
|
||||
var columnA = mappingA.generatedColumn;
|
||||
var columnB = mappingB.generatedColumn;
|
||||
return lineB > lineA || lineB == lineA && columnB >= columnA ||
|
||||
util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* A data structure to provide a sorted view of accumulated mappings in a
|
||||
* performance conscious manner. It trades a neglibable overhead in general
|
||||
* case for a large speedup in case of mappings being added in order.
|
||||
*/
|
||||
function MappingList() {
|
||||
this._array = [];
|
||||
this._sorted = true;
|
||||
// Serves as infimum
|
||||
this._last = {generatedLine: -1, generatedColumn: 0};
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterate through internal items. This method takes the same arguments that
|
||||
* `Array.prototype.forEach` takes.
|
||||
*
|
||||
* NOTE: The order of the mappings is NOT guaranteed.
|
||||
*/
|
||||
MappingList.prototype.unsortedForEach =
|
||||
function MappingList_forEach(aCallback, aThisArg) {
|
||||
this._array.forEach(aCallback, aThisArg);
|
||||
};
|
||||
|
||||
/**
|
||||
* Add the given source mapping.
|
||||
*
|
||||
* @param Object aMapping
|
||||
*/
|
||||
MappingList.prototype.add = function MappingList_add(aMapping) {
|
||||
if (generatedPositionAfter(this._last, aMapping)) {
|
||||
this._last = aMapping;
|
||||
this._array.push(aMapping);
|
||||
} else {
|
||||
this._sorted = false;
|
||||
this._array.push(aMapping);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the flat, sorted array of mappings. The mappings are sorted by
|
||||
* generated position.
|
||||
*
|
||||
* WARNING: This method returns internal data without copying, for
|
||||
* performance. The return value must NOT be mutated, and should be treated as
|
||||
* an immutable borrow. If you want to take ownership, you must make your own
|
||||
* copy.
|
||||
*/
|
||||
MappingList.prototype.toArray = function MappingList_toArray() {
|
||||
if (!this._sorted) {
|
||||
this._array.sort(util.compareByGeneratedPositionsInflated);
|
||||
this._sorted = true;
|
||||
}
|
||||
return this._array;
|
||||
};
|
||||
|
||||
exports.MappingList = MappingList;
|
114
node_modules/@babel/core/node_modules/source-map/lib/quick-sort.js
generated
vendored
114
node_modules/@babel/core/node_modules/source-map/lib/quick-sort.js
generated
vendored
@ -1,114 +0,0 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
// It turns out that some (most?) JavaScript engines don't self-host
|
||||
// `Array.prototype.sort`. This makes sense because C++ will likely remain
|
||||
// faster than JS when doing raw CPU-intensive sorting. However, when using a
|
||||
// custom comparator function, calling back and forth between the VM's C++ and
|
||||
// JIT'd JS is rather slow *and* loses JIT type information, resulting in
|
||||
// worse generated code for the comparator function than would be optimal. In
|
||||
// fact, when sorting with a comparator, these costs outweigh the benefits of
|
||||
// sorting in C++. By using our own JS-implemented Quick Sort (below), we get
|
||||
// a ~3500ms mean speed-up in `bench/bench.html`.
|
||||
|
||||
/**
|
||||
* Swap the elements indexed by `x` and `y` in the array `ary`.
|
||||
*
|
||||
* @param {Array} ary
|
||||
* The array.
|
||||
* @param {Number} x
|
||||
* The index of the first item.
|
||||
* @param {Number} y
|
||||
* The index of the second item.
|
||||
*/
|
||||
function swap(ary, x, y) {
|
||||
var temp = ary[x];
|
||||
ary[x] = ary[y];
|
||||
ary[y] = temp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a random integer within the range `low .. high` inclusive.
|
||||
*
|
||||
* @param {Number} low
|
||||
* The lower bound on the range.
|
||||
* @param {Number} high
|
||||
* The upper bound on the range.
|
||||
*/
|
||||
function randomIntInRange(low, high) {
|
||||
return Math.round(low + (Math.random() * (high - low)));
|
||||
}
|
||||
|
||||
/**
|
||||
* The Quick Sort algorithm.
|
||||
*
|
||||
* @param {Array} ary
|
||||
* An array to sort.
|
||||
* @param {function} comparator
|
||||
* Function to use to compare two items.
|
||||
* @param {Number} p
|
||||
* Start index of the array
|
||||
* @param {Number} r
|
||||
* End index of the array
|
||||
*/
|
||||
function doQuickSort(ary, comparator, p, r) {
|
||||
// If our lower bound is less than our upper bound, we (1) partition the
|
||||
// array into two pieces and (2) recurse on each half. If it is not, this is
|
||||
// the empty array and our base case.
|
||||
|
||||
if (p < r) {
|
||||
// (1) Partitioning.
|
||||
//
|
||||
// The partitioning chooses a pivot between `p` and `r` and moves all
|
||||
// elements that are less than or equal to the pivot to the before it, and
|
||||
// all the elements that are greater than it after it. The effect is that
|
||||
// once partition is done, the pivot is in the exact place it will be when
|
||||
// the array is put in sorted order, and it will not need to be moved
|
||||
// again. This runs in O(n) time.
|
||||
|
||||
// Always choose a random pivot so that an input array which is reverse
|
||||
// sorted does not cause O(n^2) running time.
|
||||
var pivotIndex = randomIntInRange(p, r);
|
||||
var i = p - 1;
|
||||
|
||||
swap(ary, pivotIndex, r);
|
||||
var pivot = ary[r];
|
||||
|
||||
// Immediately after `j` is incremented in this loop, the following hold
|
||||
// true:
|
||||
//
|
||||
// * Every element in `ary[p .. i]` is less than or equal to the pivot.
|
||||
//
|
||||
// * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
|
||||
for (var j = p; j < r; j++) {
|
||||
if (comparator(ary[j], pivot) <= 0) {
|
||||
i += 1;
|
||||
swap(ary, i, j);
|
||||
}
|
||||
}
|
||||
|
||||
swap(ary, i + 1, j);
|
||||
var q = i + 1;
|
||||
|
||||
// (2) Recurse on each half.
|
||||
|
||||
doQuickSort(ary, comparator, p, q - 1);
|
||||
doQuickSort(ary, comparator, q + 1, r);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort the given array in-place with the given comparator function.
|
||||
*
|
||||
* @param {Array} ary
|
||||
* An array to sort.
|
||||
* @param {function} comparator
|
||||
* Function to use to compare two items.
|
||||
*/
|
||||
exports.quickSort = function (ary, comparator) {
|
||||
doQuickSort(ary, comparator, 0, ary.length - 1);
|
||||
};
|
1082
node_modules/@babel/core/node_modules/source-map/lib/source-map-consumer.js
generated
vendored
1082
node_modules/@babel/core/node_modules/source-map/lib/source-map-consumer.js
generated
vendored
File diff suppressed because it is too large
Load Diff
416
node_modules/@babel/core/node_modules/source-map/lib/source-map-generator.js
generated
vendored
416
node_modules/@babel/core/node_modules/source-map/lib/source-map-generator.js
generated
vendored
@ -1,416 +0,0 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var base64VLQ = require('./base64-vlq');
|
||||
var util = require('./util');
|
||||
var ArraySet = require('./array-set').ArraySet;
|
||||
var MappingList = require('./mapping-list').MappingList;
|
||||
|
||||
/**
|
||||
* An instance of the SourceMapGenerator represents a source map which is
|
||||
* being built incrementally. You may pass an object with the following
|
||||
* properties:
|
||||
*
|
||||
* - file: The filename of the generated source.
|
||||
* - sourceRoot: A root for all relative URLs in this source map.
|
||||
*/
|
||||
function SourceMapGenerator(aArgs) {
|
||||
if (!aArgs) {
|
||||
aArgs = {};
|
||||
}
|
||||
this._file = util.getArg(aArgs, 'file', null);
|
||||
this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
|
||||
this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
|
||||
this._sources = new ArraySet();
|
||||
this._names = new ArraySet();
|
||||
this._mappings = new MappingList();
|
||||
this._sourcesContents = null;
|
||||
}
|
||||
|
||||
SourceMapGenerator.prototype._version = 3;
|
||||
|
||||
/**
|
||||
* Creates a new SourceMapGenerator based on a SourceMapConsumer
|
||||
*
|
||||
* @param aSourceMapConsumer The SourceMap.
|
||||
*/
|
||||
SourceMapGenerator.fromSourceMap =
|
||||
function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
|
||||
var sourceRoot = aSourceMapConsumer.sourceRoot;
|
||||
var generator = new SourceMapGenerator({
|
||||
file: aSourceMapConsumer.file,
|
||||
sourceRoot: sourceRoot
|
||||
});
|
||||
aSourceMapConsumer.eachMapping(function (mapping) {
|
||||
var newMapping = {
|
||||
generated: {
|
||||
line: mapping.generatedLine,
|
||||
column: mapping.generatedColumn
|
||||
}
|
||||
};
|
||||
|
||||
if (mapping.source != null) {
|
||||
newMapping.source = mapping.source;
|
||||
if (sourceRoot != null) {
|
||||
newMapping.source = util.relative(sourceRoot, newMapping.source);
|
||||
}
|
||||
|
||||
newMapping.original = {
|
||||
line: mapping.originalLine,
|
||||
column: mapping.originalColumn
|
||||
};
|
||||
|
||||
if (mapping.name != null) {
|
||||
newMapping.name = mapping.name;
|
||||
}
|
||||
}
|
||||
|
||||
generator.addMapping(newMapping);
|
||||
});
|
||||
aSourceMapConsumer.sources.forEach(function (sourceFile) {
|
||||
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
||||
if (content != null) {
|
||||
generator.setSourceContent(sourceFile, content);
|
||||
}
|
||||
});
|
||||
return generator;
|
||||
};
|
||||
|
||||
/**
|
||||
* Add a single mapping from original source line and column to the generated
|
||||
* source's line and column for this source map being created. The mapping
|
||||
* object should have the following properties:
|
||||
*
|
||||
* - generated: An object with the generated line and column positions.
|
||||
* - original: An object with the original line and column positions.
|
||||
* - source: The original source file (relative to the sourceRoot).
|
||||
* - name: An optional original token name for this mapping.
|
||||
*/
|
||||
SourceMapGenerator.prototype.addMapping =
|
||||
function SourceMapGenerator_addMapping(aArgs) {
|
||||
var generated = util.getArg(aArgs, 'generated');
|
||||
var original = util.getArg(aArgs, 'original', null);
|
||||
var source = util.getArg(aArgs, 'source', null);
|
||||
var name = util.getArg(aArgs, 'name', null);
|
||||
|
||||
if (!this._skipValidation) {
|
||||
this._validateMapping(generated, original, source, name);
|
||||
}
|
||||
|
||||
if (source != null) {
|
||||
source = String(source);
|
||||
if (!this._sources.has(source)) {
|
||||
this._sources.add(source);
|
||||
}
|
||||
}
|
||||
|
||||
if (name != null) {
|
||||
name = String(name);
|
||||
if (!this._names.has(name)) {
|
||||
this._names.add(name);
|
||||
}
|
||||
}
|
||||
|
||||
this._mappings.add({
|
||||
generatedLine: generated.line,
|
||||
generatedColumn: generated.column,
|
||||
originalLine: original != null && original.line,
|
||||
originalColumn: original != null && original.column,
|
||||
source: source,
|
||||
name: name
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the source content for a source file.
|
||||
*/
|
||||
SourceMapGenerator.prototype.setSourceContent =
|
||||
function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
|
||||
var source = aSourceFile;
|
||||
if (this._sourceRoot != null) {
|
||||
source = util.relative(this._sourceRoot, source);
|
||||
}
|
||||
|
||||
if (aSourceContent != null) {
|
||||
// Add the source content to the _sourcesContents map.
|
||||
// Create a new _sourcesContents map if the property is null.
|
||||
if (!this._sourcesContents) {
|
||||
this._sourcesContents = Object.create(null);
|
||||
}
|
||||
this._sourcesContents[util.toSetString(source)] = aSourceContent;
|
||||
} else if (this._sourcesContents) {
|
||||
// Remove the source file from the _sourcesContents map.
|
||||
// If the _sourcesContents map is empty, set the property to null.
|
||||
delete this._sourcesContents[util.toSetString(source)];
|
||||
if (Object.keys(this._sourcesContents).length === 0) {
|
||||
this._sourcesContents = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Applies the mappings of a sub-source-map for a specific source file to the
|
||||
* source map being generated. Each mapping to the supplied source file is
|
||||
* rewritten using the supplied source map. Note: The resolution for the
|
||||
* resulting mappings is the minimium of this map and the supplied map.
|
||||
*
|
||||
* @param aSourceMapConsumer The source map to be applied.
|
||||
* @param aSourceFile Optional. The filename of the source file.
|
||||
* If omitted, SourceMapConsumer's file property will be used.
|
||||
* @param aSourceMapPath Optional. The dirname of the path to the source map
|
||||
* to be applied. If relative, it is relative to the SourceMapConsumer.
|
||||
* This parameter is needed when the two source maps aren't in the same
|
||||
* directory, and the source map to be applied contains relative source
|
||||
* paths. If so, those relative source paths need to be rewritten
|
||||
* relative to the SourceMapGenerator.
|
||||
*/
|
||||
SourceMapGenerator.prototype.applySourceMap =
|
||||
function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
|
||||
var sourceFile = aSourceFile;
|
||||
// If aSourceFile is omitted, we will use the file property of the SourceMap
|
||||
if (aSourceFile == null) {
|
||||
if (aSourceMapConsumer.file == null) {
|
||||
throw new Error(
|
||||
'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
|
||||
'or the source map\'s "file" property. Both were omitted.'
|
||||
);
|
||||
}
|
||||
sourceFile = aSourceMapConsumer.file;
|
||||
}
|
||||
var sourceRoot = this._sourceRoot;
|
||||
// Make "sourceFile" relative if an absolute Url is passed.
|
||||
if (sourceRoot != null) {
|
||||
sourceFile = util.relative(sourceRoot, sourceFile);
|
||||
}
|
||||
// Applying the SourceMap can add and remove items from the sources and
|
||||
// the names array.
|
||||
var newSources = new ArraySet();
|
||||
var newNames = new ArraySet();
|
||||
|
||||
// Find mappings for the "sourceFile"
|
||||
this._mappings.unsortedForEach(function (mapping) {
|
||||
if (mapping.source === sourceFile && mapping.originalLine != null) {
|
||||
// Check if it can be mapped by the source map, then update the mapping.
|
||||
var original = aSourceMapConsumer.originalPositionFor({
|
||||
line: mapping.originalLine,
|
||||
column: mapping.originalColumn
|
||||
});
|
||||
if (original.source != null) {
|
||||
// Copy mapping
|
||||
mapping.source = original.source;
|
||||
if (aSourceMapPath != null) {
|
||||
mapping.source = util.join(aSourceMapPath, mapping.source)
|
||||
}
|
||||
if (sourceRoot != null) {
|
||||
mapping.source = util.relative(sourceRoot, mapping.source);
|
||||
}
|
||||
mapping.originalLine = original.line;
|
||||
mapping.originalColumn = original.column;
|
||||
if (original.name != null) {
|
||||
mapping.name = original.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var source = mapping.source;
|
||||
if (source != null && !newSources.has(source)) {
|
||||
newSources.add(source);
|
||||
}
|
||||
|
||||
var name = mapping.name;
|
||||
if (name != null && !newNames.has(name)) {
|
||||
newNames.add(name);
|
||||
}
|
||||
|
||||
}, this);
|
||||
this._sources = newSources;
|
||||
this._names = newNames;
|
||||
|
||||
// Copy sourcesContents of applied map.
|
||||
aSourceMapConsumer.sources.forEach(function (sourceFile) {
|
||||
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
||||
if (content != null) {
|
||||
if (aSourceMapPath != null) {
|
||||
sourceFile = util.join(aSourceMapPath, sourceFile);
|
||||
}
|
||||
if (sourceRoot != null) {
|
||||
sourceFile = util.relative(sourceRoot, sourceFile);
|
||||
}
|
||||
this.setSourceContent(sourceFile, content);
|
||||
}
|
||||
}, this);
|
||||
};
|
||||
|
||||
/**
|
||||
* A mapping can have one of the three levels of data:
|
||||
*
|
||||
* 1. Just the generated position.
|
||||
* 2. The Generated position, original position, and original source.
|
||||
* 3. Generated and original position, original source, as well as a name
|
||||
* token.
|
||||
*
|
||||
* To maintain consistency, we validate that any new mapping being added falls
|
||||
* in to one of these categories.
|
||||
*/
|
||||
SourceMapGenerator.prototype._validateMapping =
|
||||
function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
|
||||
aName) {
|
||||
// When aOriginal is truthy but has empty values for .line and .column,
|
||||
// it is most likely a programmer error. In this case we throw a very
|
||||
// specific error message to try to guide them the right way.
|
||||
// For example: https://github.com/Polymer/polymer-bundler/pull/519
|
||||
if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {
|
||||
throw new Error(
|
||||
'original.line and original.column are not numbers -- you probably meant to omit ' +
|
||||
'the original mapping entirely and only map the generated position. If so, pass ' +
|
||||
'null for the original mapping instead of an object with empty or null values.'
|
||||
);
|
||||
}
|
||||
|
||||
if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
|
||||
&& aGenerated.line > 0 && aGenerated.column >= 0
|
||||
&& !aOriginal && !aSource && !aName) {
|
||||
// Case 1.
|
||||
return;
|
||||
}
|
||||
else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
|
||||
&& aOriginal && 'line' in aOriginal && 'column' in aOriginal
|
||||
&& aGenerated.line > 0 && aGenerated.column >= 0
|
||||
&& aOriginal.line > 0 && aOriginal.column >= 0
|
||||
&& aSource) {
|
||||
// Cases 2 and 3.
|
||||
return;
|
||||
}
|
||||
else {
|
||||
throw new Error('Invalid mapping: ' + JSON.stringify({
|
||||
generated: aGenerated,
|
||||
source: aSource,
|
||||
original: aOriginal,
|
||||
name: aName
|
||||
}));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Serialize the accumulated mappings in to the stream of base 64 VLQs
|
||||
* specified by the source map format.
|
||||
*/
|
||||
SourceMapGenerator.prototype._serializeMappings =
|
||||
function SourceMapGenerator_serializeMappings() {
|
||||
var previousGeneratedColumn = 0;
|
||||
var previousGeneratedLine = 1;
|
||||
var previousOriginalColumn = 0;
|
||||
var previousOriginalLine = 0;
|
||||
var previousName = 0;
|
||||
var previousSource = 0;
|
||||
var result = '';
|
||||
var next;
|
||||
var mapping;
|
||||
var nameIdx;
|
||||
var sourceIdx;
|
||||
|
||||
var mappings = this._mappings.toArray();
|
||||
for (var i = 0, len = mappings.length; i < len; i++) {
|
||||
mapping = mappings[i];
|
||||
next = ''
|
||||
|
||||
if (mapping.generatedLine !== previousGeneratedLine) {
|
||||
previousGeneratedColumn = 0;
|
||||
while (mapping.generatedLine !== previousGeneratedLine) {
|
||||
next += ';';
|
||||
previousGeneratedLine++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (i > 0) {
|
||||
if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
|
||||
continue;
|
||||
}
|
||||
next += ',';
|
||||
}
|
||||
}
|
||||
|
||||
next += base64VLQ.encode(mapping.generatedColumn
|
||||
- previousGeneratedColumn);
|
||||
previousGeneratedColumn = mapping.generatedColumn;
|
||||
|
||||
if (mapping.source != null) {
|
||||
sourceIdx = this._sources.indexOf(mapping.source);
|
||||
next += base64VLQ.encode(sourceIdx - previousSource);
|
||||
previousSource = sourceIdx;
|
||||
|
||||
// lines are stored 0-based in SourceMap spec version 3
|
||||
next += base64VLQ.encode(mapping.originalLine - 1
|
||||
- previousOriginalLine);
|
||||
previousOriginalLine = mapping.originalLine - 1;
|
||||
|
||||
next += base64VLQ.encode(mapping.originalColumn
|
||||
- previousOriginalColumn);
|
||||
previousOriginalColumn = mapping.originalColumn;
|
||||
|
||||
if (mapping.name != null) {
|
||||
nameIdx = this._names.indexOf(mapping.name);
|
||||
next += base64VLQ.encode(nameIdx - previousName);
|
||||
previousName = nameIdx;
|
||||
}
|
||||
}
|
||||
|
||||
result += next;
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
SourceMapGenerator.prototype._generateSourcesContent =
|
||||
function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
|
||||
return aSources.map(function (source) {
|
||||
if (!this._sourcesContents) {
|
||||
return null;
|
||||
}
|
||||
if (aSourceRoot != null) {
|
||||
source = util.relative(aSourceRoot, source);
|
||||
}
|
||||
var key = util.toSetString(source);
|
||||
return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
|
||||
? this._sourcesContents[key]
|
||||
: null;
|
||||
}, this);
|
||||
};
|
||||
|
||||
/**
|
||||
* Externalize the source map.
|
||||
*/
|
||||
SourceMapGenerator.prototype.toJSON =
|
||||
function SourceMapGenerator_toJSON() {
|
||||
var map = {
|
||||
version: this._version,
|
||||
sources: this._sources.toArray(),
|
||||
names: this._names.toArray(),
|
||||
mappings: this._serializeMappings()
|
||||
};
|
||||
if (this._file != null) {
|
||||
map.file = this._file;
|
||||
}
|
||||
if (this._sourceRoot != null) {
|
||||
map.sourceRoot = this._sourceRoot;
|
||||
}
|
||||
if (this._sourcesContents) {
|
||||
map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
|
||||
}
|
||||
|
||||
return map;
|
||||
};
|
||||
|
||||
/**
|
||||
* Render the source map being generated to a string.
|
||||
*/
|
||||
SourceMapGenerator.prototype.toString =
|
||||
function SourceMapGenerator_toString() {
|
||||
return JSON.stringify(this.toJSON());
|
||||
};
|
||||
|
||||
exports.SourceMapGenerator = SourceMapGenerator;
|
413
node_modules/@babel/core/node_modules/source-map/lib/source-node.js
generated
vendored
413
node_modules/@babel/core/node_modules/source-map/lib/source-node.js
generated
vendored
@ -1,413 +0,0 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;
|
||||
var util = require('./util');
|
||||
|
||||
// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
|
||||
// operating systems these days (capturing the result).
|
||||
var REGEX_NEWLINE = /(\r?\n)/;
|
||||
|
||||
// Newline character code for charCodeAt() comparisons
|
||||
var NEWLINE_CODE = 10;
|
||||
|
||||
// Private symbol for identifying `SourceNode`s when multiple versions of
|
||||
// the source-map library are loaded. This MUST NOT CHANGE across
|
||||
// versions!
|
||||
var isSourceNode = "$$$isSourceNode$$$";
|
||||
|
||||
/**
|
||||
* SourceNodes provide a way to abstract over interpolating/concatenating
|
||||
* snippets of generated JavaScript source code while maintaining the line and
|
||||
* column information associated with the original source code.
|
||||
*
|
||||
* @param aLine The original line number.
|
||||
* @param aColumn The original column number.
|
||||
* @param aSource The original source's filename.
|
||||
* @param aChunks Optional. An array of strings which are snippets of
|
||||
* generated JS, or other SourceNodes.
|
||||
* @param aName The original identifier.
|
||||
*/
|
||||
function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
|
||||
this.children = [];
|
||||
this.sourceContents = {};
|
||||
this.line = aLine == null ? null : aLine;
|
||||
this.column = aColumn == null ? null : aColumn;
|
||||
this.source = aSource == null ? null : aSource;
|
||||
this.name = aName == null ? null : aName;
|
||||
this[isSourceNode] = true;
|
||||
if (aChunks != null) this.add(aChunks);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a SourceNode from generated code and a SourceMapConsumer.
|
||||
*
|
||||
* @param aGeneratedCode The generated code
|
||||
* @param aSourceMapConsumer The SourceMap for the generated code
|
||||
* @param aRelativePath Optional. The path that relative sources in the
|
||||
* SourceMapConsumer should be relative to.
|
||||
*/
|
||||
SourceNode.fromStringWithSourceMap =
|
||||
function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
|
||||
// The SourceNode we want to fill with the generated code
|
||||
// and the SourceMap
|
||||
var node = new SourceNode();
|
||||
|
||||
// All even indices of this array are one line of the generated code,
|
||||
// while all odd indices are the newlines between two adjacent lines
|
||||
// (since `REGEX_NEWLINE` captures its match).
|
||||
// Processed fragments are accessed by calling `shiftNextLine`.
|
||||
var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
|
||||
var remainingLinesIndex = 0;
|
||||
var shiftNextLine = function() {
|
||||
var lineContents = getNextLine();
|
||||
// The last line of a file might not have a newline.
|
||||
var newLine = getNextLine() || "";
|
||||
return lineContents + newLine;
|
||||
|
||||
function getNextLine() {
|
||||
return remainingLinesIndex < remainingLines.length ?
|
||||
remainingLines[remainingLinesIndex++] : undefined;
|
||||
}
|
||||
};
|
||||
|
||||
// We need to remember the position of "remainingLines"
|
||||
var lastGeneratedLine = 1, lastGeneratedColumn = 0;
|
||||
|
||||
// The generate SourceNodes we need a code range.
|
||||
// To extract it current and last mapping is used.
|
||||
// Here we store the last mapping.
|
||||
var lastMapping = null;
|
||||
|
||||
aSourceMapConsumer.eachMapping(function (mapping) {
|
||||
if (lastMapping !== null) {
|
||||
// We add the code from "lastMapping" to "mapping":
|
||||
// First check if there is a new line in between.
|
||||
if (lastGeneratedLine < mapping.generatedLine) {
|
||||
// Associate first line with "lastMapping"
|
||||
addMappingWithCode(lastMapping, shiftNextLine());
|
||||
lastGeneratedLine++;
|
||||
lastGeneratedColumn = 0;
|
||||
// The remaining code is added without mapping
|
||||
} else {
|
||||
// There is no new line in between.
|
||||
// Associate the code between "lastGeneratedColumn" and
|
||||
// "mapping.generatedColumn" with "lastMapping"
|
||||
var nextLine = remainingLines[remainingLinesIndex];
|
||||
var code = nextLine.substr(0, mapping.generatedColumn -
|
||||
lastGeneratedColumn);
|
||||
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -
|
||||
lastGeneratedColumn);
|
||||
lastGeneratedColumn = mapping.generatedColumn;
|
||||
addMappingWithCode(lastMapping, code);
|
||||
// No more remaining code, continue
|
||||
lastMapping = mapping;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// We add the generated code until the first mapping
|
||||
// to the SourceNode without any mapping.
|
||||
// Each line is added as separate string.
|
||||
while (lastGeneratedLine < mapping.generatedLine) {
|
||||
node.add(shiftNextLine());
|
||||
lastGeneratedLine++;
|
||||
}
|
||||
if (lastGeneratedColumn < mapping.generatedColumn) {
|
||||
var nextLine = remainingLines[remainingLinesIndex];
|
||||
node.add(nextLine.substr(0, mapping.generatedColumn));
|
||||
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
|
||||
lastGeneratedColumn = mapping.generatedColumn;
|
||||
}
|
||||
lastMapping = mapping;
|
||||
}, this);
|
||||
// We have processed all mappings.
|
||||
if (remainingLinesIndex < remainingLines.length) {
|
||||
if (lastMapping) {
|
||||
// Associate the remaining code in the current line with "lastMapping"
|
||||
addMappingWithCode(lastMapping, shiftNextLine());
|
||||
}
|
||||
// and add the remaining lines without any mapping
|
||||
node.add(remainingLines.splice(remainingLinesIndex).join(""));
|
||||
}
|
||||
|
||||
// Copy sourcesContent into SourceNode
|
||||
aSourceMapConsumer.sources.forEach(function (sourceFile) {
|
||||
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
||||
if (content != null) {
|
||||
if (aRelativePath != null) {
|
||||
sourceFile = util.join(aRelativePath, sourceFile);
|
||||
}
|
||||
node.setSourceContent(sourceFile, content);
|
||||
}
|
||||
});
|
||||
|
||||
return node;
|
||||
|
||||
function addMappingWithCode(mapping, code) {
|
||||
if (mapping === null || mapping.source === undefined) {
|
||||
node.add(code);
|
||||
} else {
|
||||
var source = aRelativePath
|
||||
? util.join(aRelativePath, mapping.source)
|
||||
: mapping.source;
|
||||
node.add(new SourceNode(mapping.originalLine,
|
||||
mapping.originalColumn,
|
||||
source,
|
||||
code,
|
||||
mapping.name));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Add a chunk of generated JS to this source node.
|
||||
*
|
||||
* @param aChunk A string snippet of generated JS code, another instance of
|
||||
* SourceNode, or an array where each member is one of those things.
|
||||
*/
|
||||
SourceNode.prototype.add = function SourceNode_add(aChunk) {
|
||||
if (Array.isArray(aChunk)) {
|
||||
aChunk.forEach(function (chunk) {
|
||||
this.add(chunk);
|
||||
}, this);
|
||||
}
|
||||
else if (aChunk[isSourceNode] || typeof aChunk === "string") {
|
||||
if (aChunk) {
|
||||
this.children.push(aChunk);
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw new TypeError(
|
||||
"Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
|
||||
);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Add a chunk of generated JS to the beginning of this source node.
|
||||
*
|
||||
* @param aChunk A string snippet of generated JS code, another instance of
|
||||
* SourceNode, or an array where each member is one of those things.
|
||||
*/
|
||||
SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
|
||||
if (Array.isArray(aChunk)) {
|
||||
for (var i = aChunk.length-1; i >= 0; i--) {
|
||||
this.prepend(aChunk[i]);
|
||||
}
|
||||
}
|
||||
else if (aChunk[isSourceNode] || typeof aChunk === "string") {
|
||||
this.children.unshift(aChunk);
|
||||
}
|
||||
else {
|
||||
throw new TypeError(
|
||||
"Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
|
||||
);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Walk over the tree of JS snippets in this node and its children. The
|
||||
* walking function is called once for each snippet of JS and is passed that
|
||||
* snippet and the its original associated source's line/column location.
|
||||
*
|
||||
* @param aFn The traversal function.
|
||||
*/
|
||||
SourceNode.prototype.walk = function SourceNode_walk(aFn) {
|
||||
var chunk;
|
||||
for (var i = 0, len = this.children.length; i < len; i++) {
|
||||
chunk = this.children[i];
|
||||
if (chunk[isSourceNode]) {
|
||||
chunk.walk(aFn);
|
||||
}
|
||||
else {
|
||||
if (chunk !== '') {
|
||||
aFn(chunk, { source: this.source,
|
||||
line: this.line,
|
||||
column: this.column,
|
||||
name: this.name });
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
|
||||
* each of `this.children`.
|
||||
*
|
||||
* @param aSep The separator.
|
||||
*/
|
||||
SourceNode.prototype.join = function SourceNode_join(aSep) {
|
||||
var newChildren;
|
||||
var i;
|
||||
var len = this.children.length;
|
||||
if (len > 0) {
|
||||
newChildren = [];
|
||||
for (i = 0; i < len-1; i++) {
|
||||
newChildren.push(this.children[i]);
|
||||
newChildren.push(aSep);
|
||||
}
|
||||
newChildren.push(this.children[i]);
|
||||
this.children = newChildren;
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Call String.prototype.replace on the very right-most source snippet. Useful
|
||||
* for trimming whitespace from the end of a source node, etc.
|
||||
*
|
||||
* @param aPattern The pattern to replace.
|
||||
* @param aReplacement The thing to replace the pattern with.
|
||||
*/
|
||||
SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
|
||||
var lastChild = this.children[this.children.length - 1];
|
||||
if (lastChild[isSourceNode]) {
|
||||
lastChild.replaceRight(aPattern, aReplacement);
|
||||
}
|
||||
else if (typeof lastChild === 'string') {
|
||||
this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
|
||||
}
|
||||
else {
|
||||
this.children.push(''.replace(aPattern, aReplacement));
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the source content for a source file. This will be added to the SourceMapGenerator
|
||||
* in the sourcesContent field.
|
||||
*
|
||||
* @param aSourceFile The filename of the source file
|
||||
* @param aSourceContent The content of the source file
|
||||
*/
|
||||
SourceNode.prototype.setSourceContent =
|
||||
function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
|
||||
this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
|
||||
};
|
||||
|
||||
/**
|
||||
* Walk over the tree of SourceNodes. The walking function is called for each
|
||||
* source file content and is passed the filename and source content.
|
||||
*
|
||||
* @param aFn The traversal function.
|
||||
*/
|
||||
SourceNode.prototype.walkSourceContents =
|
||||
function SourceNode_walkSourceContents(aFn) {
|
||||
for (var i = 0, len = this.children.length; i < len; i++) {
|
||||
if (this.children[i][isSourceNode]) {
|
||||
this.children[i].walkSourceContents(aFn);
|
||||
}
|
||||
}
|
||||
|
||||
var sources = Object.keys(this.sourceContents);
|
||||
for (var i = 0, len = sources.length; i < len; i++) {
|
||||
aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the string representation of this source node. Walks over the tree
|
||||
* and concatenates all the various snippets together to one string.
|
||||
*/
|
||||
SourceNode.prototype.toString = function SourceNode_toString() {
|
||||
var str = "";
|
||||
this.walk(function (chunk) {
|
||||
str += chunk;
|
||||
});
|
||||
return str;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the string representation of this source node along with a source
|
||||
* map.
|
||||
*/
|
||||
SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
|
||||
var generated = {
|
||||
code: "",
|
||||
line: 1,
|
||||
column: 0
|
||||
};
|
||||
var map = new SourceMapGenerator(aArgs);
|
||||
var sourceMappingActive = false;
|
||||
var lastOriginalSource = null;
|
||||
var lastOriginalLine = null;
|
||||
var lastOriginalColumn = null;
|
||||
var lastOriginalName = null;
|
||||
this.walk(function (chunk, original) {
|
||||
generated.code += chunk;
|
||||
if (original.source !== null
|
||||
&& original.line !== null
|
||||
&& original.column !== null) {
|
||||
if(lastOriginalSource !== original.source
|
||||
|| lastOriginalLine !== original.line
|
||||
|| lastOriginalColumn !== original.column
|
||||
|| lastOriginalName !== original.name) {
|
||||
map.addMapping({
|
||||
source: original.source,
|
||||
original: {
|
||||
line: original.line,
|
||||
column: original.column
|
||||
},
|
||||
generated: {
|
||||
line: generated.line,
|
||||
column: generated.column
|
||||
},
|
||||
name: original.name
|
||||
});
|
||||
}
|
||||
lastOriginalSource = original.source;
|
||||
lastOriginalLine = original.line;
|
||||
lastOriginalColumn = original.column;
|
||||
lastOriginalName = original.name;
|
||||
sourceMappingActive = true;
|
||||
} else if (sourceMappingActive) {
|
||||
map.addMapping({
|
||||
generated: {
|
||||
line: generated.line,
|
||||
column: generated.column
|
||||
}
|
||||
});
|
||||
lastOriginalSource = null;
|
||||
sourceMappingActive = false;
|
||||
}
|
||||
for (var idx = 0, length = chunk.length; idx < length; idx++) {
|
||||
if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
|
||||
generated.line++;
|
||||
generated.column = 0;
|
||||
// Mappings end at eol
|
||||
if (idx + 1 === length) {
|
||||
lastOriginalSource = null;
|
||||
sourceMappingActive = false;
|
||||
} else if (sourceMappingActive) {
|
||||
map.addMapping({
|
||||
source: original.source,
|
||||
original: {
|
||||
line: original.line,
|
||||
column: original.column
|
||||
},
|
||||
generated: {
|
||||
line: generated.line,
|
||||
column: generated.column
|
||||
},
|
||||
name: original.name
|
||||
});
|
||||
}
|
||||
} else {
|
||||
generated.column++;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.walkSourceContents(function (sourceFile, sourceContent) {
|
||||
map.setSourceContent(sourceFile, sourceContent);
|
||||
});
|
||||
|
||||
return { code: generated.code, map: map };
|
||||
};
|
||||
|
||||
exports.SourceNode = SourceNode;
|
417
node_modules/@babel/core/node_modules/source-map/lib/util.js
generated
vendored
417
node_modules/@babel/core/node_modules/source-map/lib/util.js
generated
vendored
@ -1,417 +0,0 @@
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
/*
|
||||
* Copyright 2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
/**
|
||||
* This is a helper function for getting values from parameter/options
|
||||
* objects.
|
||||
*
|
||||
* @param args The object we are extracting values from
|
||||
* @param name The name of the property we are getting.
|
||||
* @param defaultValue An optional value to return if the property is missing
|
||||
* from the object. If this is not specified and the property is missing, an
|
||||
* error will be thrown.
|
||||
*/
|
||||
function getArg(aArgs, aName, aDefaultValue) {
|
||||
if (aName in aArgs) {
|
||||
return aArgs[aName];
|
||||
} else if (arguments.length === 3) {
|
||||
return aDefaultValue;
|
||||
} else {
|
||||
throw new Error('"' + aName + '" is a required argument.');
|
||||
}
|
||||
}
|
||||
exports.getArg = getArg;
|
||||
|
||||
var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;
|
||||
var dataUrlRegexp = /^data:.+\,.+$/;
|
||||
|
||||
function urlParse(aUrl) {
|
||||
var match = aUrl.match(urlRegexp);
|
||||
if (!match) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
scheme: match[1],
|
||||
auth: match[2],
|
||||
host: match[3],
|
||||
port: match[4],
|
||||
path: match[5]
|
||||
};
|
||||
}
|
||||
exports.urlParse = urlParse;
|
||||
|
||||
function urlGenerate(aParsedUrl) {
|
||||
var url = '';
|
||||
if (aParsedUrl.scheme) {
|
||||
url += aParsedUrl.scheme + ':';
|
||||
}
|
||||
url += '//';
|
||||
if (aParsedUrl.auth) {
|
||||
url += aParsedUrl.auth + '@';
|
||||
}
|
||||
if (aParsedUrl.host) {
|
||||
url += aParsedUrl.host;
|
||||
}
|
||||
if (aParsedUrl.port) {
|
||||
url += ":" + aParsedUrl.port
|
||||
}
|
||||
if (aParsedUrl.path) {
|
||||
url += aParsedUrl.path;
|
||||
}
|
||||
return url;
|
||||
}
|
||||
exports.urlGenerate = urlGenerate;
|
||||
|
||||
/**
|
||||
* Normalizes a path, or the path portion of a URL:
|
||||
*
|
||||
* - Replaces consecutive slashes with one slash.
|
||||
* - Removes unnecessary '.' parts.
|
||||
* - Removes unnecessary '<dir>/..' parts.
|
||||
*
|
||||
* Based on code in the Node.js 'path' core module.
|
||||
*
|
||||
* @param aPath The path or url to normalize.
|
||||
*/
|
||||
function normalize(aPath) {
|
||||
var path = aPath;
|
||||
var url = urlParse(aPath);
|
||||
if (url) {
|
||||
if (!url.path) {
|
||||
return aPath;
|
||||
}
|
||||
path = url.path;
|
||||
}
|
||||
var isAbsolute = exports.isAbsolute(path);
|
||||
|
||||
var parts = path.split(/\/+/);
|
||||
for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
|
||||
part = parts[i];
|
||||
if (part === '.') {
|
||||
parts.splice(i, 1);
|
||||
} else if (part === '..') {
|
||||
up++;
|
||||
} else if (up > 0) {
|
||||
if (part === '') {
|
||||
// The first part is blank if the path is absolute. Trying to go
|
||||
// above the root is a no-op. Therefore we can remove all '..' parts
|
||||
// directly after the root.
|
||||
parts.splice(i + 1, up);
|
||||
up = 0;
|
||||
} else {
|
||||
parts.splice(i, 2);
|
||||
up--;
|
||||
}
|
||||
}
|
||||
}
|
||||
path = parts.join('/');
|
||||
|
||||
if (path === '') {
|
||||
path = isAbsolute ? '/' : '.';
|
||||
}
|
||||
|
||||
if (url) {
|
||||
url.path = path;
|
||||
return urlGenerate(url);
|
||||
}
|
||||
return path;
|
||||
}
|
||||
exports.normalize = normalize;
|
||||
|
||||
/**
|
||||
* Joins two paths/URLs.
|
||||
*
|
||||
* @param aRoot The root path or URL.
|
||||
* @param aPath The path or URL to be joined with the root.
|
||||
*
|
||||
* - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
|
||||
* scheme-relative URL: Then the scheme of aRoot, if any, is prepended
|
||||
* first.
|
||||
* - Otherwise aPath is a path. If aRoot is a URL, then its path portion
|
||||
* is updated with the result and aRoot is returned. Otherwise the result
|
||||
* is returned.
|
||||
* - If aPath is absolute, the result is aPath.
|
||||
* - Otherwise the two paths are joined with a slash.
|
||||
* - Joining for example 'http://' and 'www.example.com' is also supported.
|
||||
*/
|
||||
function join(aRoot, aPath) {
|
||||
if (aRoot === "") {
|
||||
aRoot = ".";
|
||||
}
|
||||
if (aPath === "") {
|
||||
aPath = ".";
|
||||
}
|
||||
var aPathUrl = urlParse(aPath);
|
||||
var aRootUrl = urlParse(aRoot);
|
||||
if (aRootUrl) {
|
||||
aRoot = aRootUrl.path || '/';
|
||||
}
|
||||
|
||||
// `join(foo, '//www.example.org')`
|
||||
if (aPathUrl && !aPathUrl.scheme) {
|
||||
if (aRootUrl) {
|
||||
aPathUrl.scheme = aRootUrl.scheme;
|
||||
}
|
||||
return urlGenerate(aPathUrl);
|
||||
}
|
||||
|
||||
if (aPathUrl || aPath.match(dataUrlRegexp)) {
|
||||
return aPath;
|
||||
}
|
||||
|
||||
// `join('http://', 'www.example.com')`
|
||||
if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
|
||||
aRootUrl.host = aPath;
|
||||
return urlGenerate(aRootUrl);
|
||||
}
|
||||
|
||||
var joined = aPath.charAt(0) === '/'
|
||||
? aPath
|
||||
: normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
|
||||
|
||||
if (aRootUrl) {
|
||||
aRootUrl.path = joined;
|
||||
return urlGenerate(aRootUrl);
|
||||
}
|
||||
return joined;
|
||||
}
|
||||
exports.join = join;
|
||||
|
||||
exports.isAbsolute = function (aPath) {
|
||||
return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);
|
||||
};
|
||||
|
||||
/**
|
||||
* Make a path relative to a URL or another path.
|
||||
*
|
||||
* @param aRoot The root path or URL.
|
||||
* @param aPath The path or URL to be made relative to aRoot.
|
||||
*/
|
||||
function relative(aRoot, aPath) {
|
||||
if (aRoot === "") {
|
||||
aRoot = ".";
|
||||
}
|
||||
|
||||
aRoot = aRoot.replace(/\/$/, '');
|
||||
|
||||
// It is possible for the path to be above the root. In this case, simply
|
||||
// checking whether the root is a prefix of the path won't work. Instead, we
|
||||
// need to remove components from the root one by one, until either we find
|
||||
// a prefix that fits, or we run out of components to remove.
|
||||
var level = 0;
|
||||
while (aPath.indexOf(aRoot + '/') !== 0) {
|
||||
var index = aRoot.lastIndexOf("/");
|
||||
if (index < 0) {
|
||||
return aPath;
|
||||
}
|
||||
|
||||
// If the only part of the root that is left is the scheme (i.e. http://,
|
||||
// file:///, etc.), one or more slashes (/), or simply nothing at all, we
|
||||
// have exhausted all components, so the path is not relative to the root.
|
||||
aRoot = aRoot.slice(0, index);
|
||||
if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
|
||||
return aPath;
|
||||
}
|
||||
|
||||
++level;
|
||||
}
|
||||
|
||||
// Make sure we add a "../" for each component we removed from the root.
|
||||
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
|
||||
}
|
||||
exports.relative = relative;
|
||||
|
||||
var supportsNullProto = (function () {
|
||||
var obj = Object.create(null);
|
||||
return !('__proto__' in obj);
|
||||
}());
|
||||
|
||||
function identity (s) {
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
* Because behavior goes wacky when you set `__proto__` on objects, we
|
||||
* have to prefix all the strings in our set with an arbitrary character.
|
||||
*
|
||||
* See https://github.com/mozilla/source-map/pull/31 and
|
||||
* https://github.com/mozilla/source-map/issues/30
|
||||
*
|
||||
* @param String aStr
|
||||
*/
|
||||
function toSetString(aStr) {
|
||||
if (isProtoString(aStr)) {
|
||||
return '$' + aStr;
|
||||
}
|
||||
|
||||
return aStr;
|
||||
}
|
||||
exports.toSetString = supportsNullProto ? identity : toSetString;
|
||||
|
||||
function fromSetString(aStr) {
|
||||
if (isProtoString(aStr)) {
|
||||
return aStr.slice(1);
|
||||
}
|
||||
|
||||
return aStr;
|
||||
}
|
||||
exports.fromSetString = supportsNullProto ? identity : fromSetString;
|
||||
|
||||
function isProtoString(s) {
|
||||
if (!s) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var length = s.length;
|
||||
|
||||
if (length < 9 /* "__proto__".length */) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||
|
||||
s.charCodeAt(length - 2) !== 95 /* '_' */ ||
|
||||
s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
|
||||
s.charCodeAt(length - 4) !== 116 /* 't' */ ||
|
||||
s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
|
||||
s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
|
||||
s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
|
||||
s.charCodeAt(length - 8) !== 95 /* '_' */ ||
|
||||
s.charCodeAt(length - 9) !== 95 /* '_' */) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var i = length - 10; i >= 0; i--) {
|
||||
if (s.charCodeAt(i) !== 36 /* '$' */) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Comparator between two mappings where the original positions are compared.
|
||||
*
|
||||
* Optionally pass in `true` as `onlyCompareGenerated` to consider two
|
||||
* mappings with the same original source/line/column, but different generated
|
||||
* line and column the same. Useful when searching for a mapping with a
|
||||
* stubbed out mapping.
|
||||
*/
|
||||
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
|
||||
var cmp = mappingA.source - mappingB.source;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalLine - mappingB.originalLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
||||
if (cmp !== 0 || onlyCompareOriginal) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.generatedLine - mappingB.generatedLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
return mappingA.name - mappingB.name;
|
||||
}
|
||||
exports.compareByOriginalPositions = compareByOriginalPositions;
|
||||
|
||||
/**
|
||||
* Comparator between two mappings with deflated source and name indices where
|
||||
* the generated positions are compared.
|
||||
*
|
||||
* Optionally pass in `true` as `onlyCompareGenerated` to consider two
|
||||
* mappings with the same generated line and column, but different
|
||||
* source/name/original line and column the same. Useful when searching for a
|
||||
* mapping with a stubbed out mapping.
|
||||
*/
|
||||
function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
|
||||
var cmp = mappingA.generatedLine - mappingB.generatedLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
||||
if (cmp !== 0 || onlyCompareGenerated) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.source - mappingB.source;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalLine - mappingB.originalLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
return mappingA.name - mappingB.name;
|
||||
}
|
||||
exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
|
||||
|
||||
function strcmp(aStr1, aStr2) {
|
||||
if (aStr1 === aStr2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (aStr1 > aStr2) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Comparator between two mappings with inflated source and name strings where
|
||||
* the generated positions are compared.
|
||||
*/
|
||||
function compareByGeneratedPositionsInflated(mappingA, mappingB) {
|
||||
var cmp = mappingA.generatedLine - mappingB.generatedLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = strcmp(mappingA.source, mappingB.source);
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalLine - mappingB.originalLine;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
||||
if (cmp !== 0) {
|
||||
return cmp;
|
||||
}
|
||||
|
||||
return strcmp(mappingA.name, mappingB.name);
|
||||
}
|
||||
exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
|
72
node_modules/@babel/core/node_modules/source-map/package.json
generated
vendored
72
node_modules/@babel/core/node_modules/source-map/package.json
generated
vendored
@ -1,72 +0,0 @@
|
||||
{
|
||||
"name": "source-map",
|
||||
"description": "Generates and consumes source maps",
|
||||
"version": "0.5.7",
|
||||
"homepage": "https://github.com/mozilla/source-map",
|
||||
"author": "Nick Fitzgerald <nfitzgerald@mozilla.com>",
|
||||
"contributors": [
|
||||
"Tobias Koppers <tobias.koppers@googlemail.com>",
|
||||
"Duncan Beevers <duncan@dweebd.com>",
|
||||
"Stephen Crane <scrane@mozilla.com>",
|
||||
"Ryan Seddon <seddon.ryan@gmail.com>",
|
||||
"Miles Elam <miles.elam@deem.com>",
|
||||
"Mihai Bazon <mihai.bazon@gmail.com>",
|
||||
"Michael Ficarra <github.public.email@michael.ficarra.me>",
|
||||
"Todd Wolfson <todd@twolfson.com>",
|
||||
"Alexander Solovyov <alexander@solovyov.net>",
|
||||
"Felix Gnass <fgnass@gmail.com>",
|
||||
"Conrad Irwin <conrad.irwin@gmail.com>",
|
||||
"usrbincc <usrbincc@yahoo.com>",
|
||||
"David Glasser <glasser@davidglasser.net>",
|
||||
"Chase Douglas <chase@newrelic.com>",
|
||||
"Evan Wallace <evan.exe@gmail.com>",
|
||||
"Heather Arthur <fayearthur@gmail.com>",
|
||||
"Hugh Kennedy <hughskennedy@gmail.com>",
|
||||
"David Glasser <glasser@davidglasser.net>",
|
||||
"Simon Lydell <simon.lydell@gmail.com>",
|
||||
"Jmeas Smith <jellyes2@gmail.com>",
|
||||
"Michael Z Goddard <mzgoddard@gmail.com>",
|
||||
"azu <azu@users.noreply.github.com>",
|
||||
"John Gozde <john@gozde.ca>",
|
||||
"Adam Kirkton <akirkton@truefitinnovation.com>",
|
||||
"Chris Montgomery <christopher.montgomery@dowjones.com>",
|
||||
"J. Ryan Stinnett <jryans@gmail.com>",
|
||||
"Jack Herrington <jherrington@walmartlabs.com>",
|
||||
"Chris Truter <jeffpalentine@gmail.com>",
|
||||
"Daniel Espeset <daniel@danielespeset.com>",
|
||||
"Jamie Wong <jamie.lf.wong@gmail.com>",
|
||||
"Eddy Bruël <ejpbruel@mozilla.com>",
|
||||
"Hawken Rives <hawkrives@gmail.com>",
|
||||
"Gilad Peleg <giladp007@gmail.com>",
|
||||
"djchie <djchie.dev@gmail.com>",
|
||||
"Gary Ye <garysye@gmail.com>",
|
||||
"Nicolas Lalevée <nicolas.lalevee@hibnet.org>"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://github.com/mozilla/source-map.git"
|
||||
},
|
||||
"main": "./source-map.js",
|
||||
"files": [
|
||||
"source-map.js",
|
||||
"lib/",
|
||||
"dist/source-map.debug.js",
|
||||
"dist/source-map.js",
|
||||
"dist/source-map.min.js",
|
||||
"dist/source-map.min.js.map"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"license": "BSD-3-Clause",
|
||||
"scripts": {
|
||||
"test": "npm run build && node test/run-tests.js",
|
||||
"build": "webpack --color",
|
||||
"toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md"
|
||||
},
|
||||
"devDependencies": {
|
||||
"doctoc": "^0.15.0",
|
||||
"webpack": "^1.12.0"
|
||||
},
|
||||
"typings": "source-map"
|
||||
}
|
8
node_modules/@babel/core/node_modules/source-map/source-map.js
generated
vendored
8
node_modules/@babel/core/node_modules/source-map/source-map.js
generated
vendored
@ -1,8 +0,0 @@
|
||||
/*
|
||||
* Copyright 2009-2011 Mozilla Foundation and contributors
|
||||
* Licensed under the New BSD license. See LICENSE.txt or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;
|
||||
exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;
|
||||
exports.SourceNode = require('./lib/source-node').SourceNode;
|
43
node_modules/@babel/core/package.json
generated
vendored
43
node_modules/@babel/core/package.json
generated
vendored
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/core",
|
||||
"version": "7.16.12",
|
||||
"version": "7.18.6",
|
||||
"description": "Babel compiler core.",
|
||||
"main": "./lib/index.js",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
@ -41,36 +41,39 @@
|
||||
"./lib/config/files/index.js": "./lib/config/files/index-browser.js",
|
||||
"./lib/config/resolve-targets.js": "./lib/config/resolve-targets-browser.js",
|
||||
"./lib/transform-file.js": "./lib/transform-file-browser.js",
|
||||
"./lib/transformation/util/clone-deep.js": "./lib/transformation/util/clone-deep-browser.js",
|
||||
"./src/config/files/index.ts": "./src/config/files/index-browser.ts",
|
||||
"./src/config/resolve-targets.ts": "./src/config/resolve-targets-browser.ts",
|
||||
"./src/transform-file.ts": "./src/transform-file-browser.ts",
|
||||
"./src/transformation/util/clone-deep.ts": "./src/transformation/util/clone-deep-browser.ts"
|
||||
"./src/transform-file.ts": "./src/transform-file-browser.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.16.7",
|
||||
"@babel/generator": "^7.16.8",
|
||||
"@babel/helper-compilation-targets": "^7.16.7",
|
||||
"@babel/helper-module-transforms": "^7.16.7",
|
||||
"@babel/helpers": "^7.16.7",
|
||||
"@babel/parser": "^7.16.12",
|
||||
"@babel/template": "^7.16.7",
|
||||
"@babel/traverse": "^7.16.10",
|
||||
"@babel/types": "^7.16.8",
|
||||
"@ampproject/remapping": "^2.1.0",
|
||||
"@babel/code-frame": "^7.18.6",
|
||||
"@babel/generator": "^7.18.6",
|
||||
"@babel/helper-compilation-targets": "^7.18.6",
|
||||
"@babel/helper-module-transforms": "^7.18.6",
|
||||
"@babel/helpers": "^7.18.6",
|
||||
"@babel/parser": "^7.18.6",
|
||||
"@babel/template": "^7.18.6",
|
||||
"@babel/traverse": "^7.18.6",
|
||||
"@babel/types": "^7.18.6",
|
||||
"convert-source-map": "^1.7.0",
|
||||
"debug": "^4.1.0",
|
||||
"gensync": "^1.0.0-beta.2",
|
||||
"json5": "^2.1.2",
|
||||
"semver": "^6.3.0",
|
||||
"source-map": "^0.5.0"
|
||||
"json5": "^2.2.1",
|
||||
"semver": "^6.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-transform-fixture-test-runner": "^7.16.7",
|
||||
"@babel/plugin-transform-modules-commonjs": "^7.16.8",
|
||||
"@babel/helper-transform-fixture-test-runner": "^7.18.6",
|
||||
"@babel/plugin-syntax-flow": "^7.18.6",
|
||||
"@babel/plugin-transform-flow-strip-types": "^7.18.6",
|
||||
"@babel/plugin-transform-modules-commonjs": "^7.18.6",
|
||||
"@babel/preset-env": "^7.18.6",
|
||||
"@jridgewell/trace-mapping": "^0.3.8",
|
||||
"@types/convert-source-map": "^1.5.1",
|
||||
"@types/debug": "^4.1.0",
|
||||
"@types/resolve": "^1.3.2",
|
||||
"@types/semver": "^5.4.0",
|
||||
"@types/source-map": "^0.5.0"
|
||||
}
|
||||
"rimraf": "^3.0.0"
|
||||
},
|
||||
"type": "commonjs"
|
||||
}
|
8
node_modules/@babel/core/src/config/files/index-browser.ts
generated
vendored
8
node_modules/@babel/core/src/config/files/index-browser.ts
generated
vendored
@ -35,7 +35,7 @@ export function* findRelativeConfig(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
envName: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
caller: CallerMetadata | void,
|
||||
caller: CallerMetadata | undefined,
|
||||
): Handler<RelativeConfig> {
|
||||
return { config: null, ignore: null };
|
||||
}
|
||||
@ -47,7 +47,7 @@ export function* findRootConfig(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
envName: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
caller: CallerMetadata | void,
|
||||
caller: CallerMetadata | undefined,
|
||||
): Handler<ConfigFile | null> {
|
||||
return null;
|
||||
}
|
||||
@ -59,7 +59,7 @@ export function* loadConfig(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
envName: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
caller: CallerMetadata | void,
|
||||
caller: CallerMetadata | undefined,
|
||||
): Handler<ConfigFile> {
|
||||
throw new Error(`Cannot load ${name} relative to ${dirname} in a browser`);
|
||||
}
|
||||
@ -72,7 +72,7 @@ export function* resolveShowConfigPath(
|
||||
return null;
|
||||
}
|
||||
|
||||
export const ROOT_CONFIG_FILENAMES = [];
|
||||
export const ROOT_CONFIG_FILENAMES: string[] = [];
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export function resolvePlugin(name: string, dirname: string): string | null {
|
||||
|
23
node_modules/@babel/core/src/config/resolve-targets-browser.ts
generated
vendored
23
node_modules/@babel/core/src/config/resolve-targets-browser.ts
generated
vendored
@ -1,5 +1,7 @@
|
||||
import type { ValidatedOptions } from "./validation/options";
|
||||
import getTargets from "@babel/helper-compilation-targets";
|
||||
import getTargets, {
|
||||
type InputTargets,
|
||||
} from "@babel/helper-compilation-targets";
|
||||
|
||||
import type { Targets } from "@babel/helper-compilation-targets";
|
||||
|
||||
@ -17,13 +19,18 @@ export function resolveTargets(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
root: string,
|
||||
): Targets {
|
||||
// todo(flow->ts) remove any and refactor to not assign different types into same variable
|
||||
let targets: any = options.targets;
|
||||
if (typeof targets === "string" || Array.isArray(targets)) {
|
||||
targets = { browsers: targets };
|
||||
}
|
||||
if (targets && targets.esmodules) {
|
||||
targets = { ...targets, esmodules: "intersect" };
|
||||
const optTargets = options.targets;
|
||||
let targets: InputTargets;
|
||||
|
||||
if (typeof optTargets === "string" || Array.isArray(optTargets)) {
|
||||
targets = { browsers: optTargets };
|
||||
} else if (optTargets) {
|
||||
if ("esmodules" in optTargets) {
|
||||
targets = { ...optTargets, esmodules: "intersect" };
|
||||
} else {
|
||||
// https://github.com/microsoft/TypeScript/issues/17002
|
||||
targets = optTargets as InputTargets;
|
||||
}
|
||||
}
|
||||
|
||||
return getTargets(targets, {
|
||||
|
23
node_modules/@babel/core/src/config/resolve-targets.ts
generated
vendored
23
node_modules/@babel/core/src/config/resolve-targets.ts
generated
vendored
@ -7,7 +7,9 @@ type nodeType = typeof import("./resolve-targets");
|
||||
|
||||
import type { ValidatedOptions } from "./validation/options";
|
||||
import path from "path";
|
||||
import getTargets from "@babel/helper-compilation-targets";
|
||||
import getTargets, {
|
||||
type InputTargets,
|
||||
} from "@babel/helper-compilation-targets";
|
||||
|
||||
import type { Targets } from "@babel/helper-compilation-targets";
|
||||
|
||||
@ -22,13 +24,18 @@ export function resolveTargets(
|
||||
options: ValidatedOptions,
|
||||
root: string,
|
||||
): Targets {
|
||||
// todo(flow->ts) remove any and refactor to not assign different types into same variable
|
||||
let targets: any = options.targets;
|
||||
if (typeof targets === "string" || Array.isArray(targets)) {
|
||||
targets = { browsers: targets };
|
||||
}
|
||||
if (targets && targets.esmodules) {
|
||||
targets = { ...targets, esmodules: "intersect" };
|
||||
const optTargets = options.targets;
|
||||
let targets: InputTargets;
|
||||
|
||||
if (typeof optTargets === "string" || Array.isArray(optTargets)) {
|
||||
targets = { browsers: optTargets };
|
||||
} else if (optTargets) {
|
||||
if ("esmodules" in optTargets) {
|
||||
targets = { ...optTargets, esmodules: "intersect" };
|
||||
} else {
|
||||
// https://github.com/microsoft/TypeScript/issues/17002
|
||||
targets = optTargets as InputTargets;
|
||||
}
|
||||
}
|
||||
|
||||
const { browserslistConfigFile } = options;
|
||||
|
10
node_modules/@babel/core/src/transform-file-browser.ts
generated
vendored
10
node_modules/@babel/core/src/transform-file-browser.ts
generated
vendored
@ -1,13 +1,17 @@
|
||||
// duplicated from transform-file so we do not have to import anything here
|
||||
type TransformFile = {
|
||||
(filename: string, callback: Function): void;
|
||||
(filename: string, opts: any, callback: Function): void;
|
||||
(filename: string, callback: (error: Error, file: null) => void): void;
|
||||
(
|
||||
filename: string,
|
||||
opts: any,
|
||||
callback: (error: Error, file: null) => void,
|
||||
): void;
|
||||
};
|
||||
|
||||
export const transformFile: TransformFile = function transformFile(
|
||||
filename,
|
||||
opts,
|
||||
callback?,
|
||||
callback?: (error: Error, file: null) => void,
|
||||
) {
|
||||
if (typeof opts === "function") {
|
||||
callback = opts;
|
||||
|
19
node_modules/@babel/core/src/transformation/util/clone-deep-browser.ts
generated
vendored
19
node_modules/@babel/core/src/transformation/util/clone-deep-browser.ts
generated
vendored
@ -1,19 +0,0 @@
|
||||
const serialized = "$$ babel internal serialized type" + Math.random();
|
||||
|
||||
function serialize(key, value) {
|
||||
if (typeof value !== "bigint") return value;
|
||||
return {
|
||||
[serialized]: "BigInt",
|
||||
value: value.toString(),
|
||||
};
|
||||
}
|
||||
|
||||
function revive(key, value) {
|
||||
if (!value || typeof value !== "object") return value;
|
||||
if (value[serialized] !== "BigInt") return value;
|
||||
return BigInt(value.value);
|
||||
}
|
||||
|
||||
export default function (value) {
|
||||
return JSON.parse(JSON.stringify(value, serialize), revive);
|
||||
}
|
9
node_modules/@babel/core/src/transformation/util/clone-deep.ts
generated
vendored
9
node_modules/@babel/core/src/transformation/util/clone-deep.ts
generated
vendored
@ -1,9 +0,0 @@
|
||||
import v8 from "v8";
|
||||
import cloneDeep from "./clone-deep-browser";
|
||||
|
||||
export default function (value) {
|
||||
if (v8.deserialize && v8.serialize) {
|
||||
return v8.deserialize(v8.serialize(value));
|
||||
}
|
||||
return cloneDeep(value);
|
||||
}
|
125
node_modules/@babel/generator/lib/buffer.js
generated
vendored
125
node_modules/@babel/generator/lib/buffer.js
generated
vendored
@ -4,6 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function SourcePos() {
|
||||
return {
|
||||
identifierName: undefined,
|
||||
line: undefined,
|
||||
column: undefined,
|
||||
filename: undefined
|
||||
};
|
||||
}
|
||||
|
||||
const SPACES_RE = /^[ \t]+$/;
|
||||
|
||||
class Buffer {
|
||||
@ -16,12 +26,7 @@ class Buffer {
|
||||
line: 1,
|
||||
column: 0
|
||||
};
|
||||
this._sourcePosition = {
|
||||
identifierName: null,
|
||||
line: null,
|
||||
column: null,
|
||||
filename: null
|
||||
};
|
||||
this._sourcePosition = SourcePos();
|
||||
this._disallowedPop = null;
|
||||
this._map = map;
|
||||
}
|
||||
@ -32,29 +37,35 @@ class Buffer {
|
||||
const map = this._map;
|
||||
const result = {
|
||||
code: this._buf.trimRight(),
|
||||
map: null,
|
||||
rawMappings: map == null ? void 0 : map.getRawMappings()
|
||||
decodedMap: map == null ? void 0 : map.getDecoded(),
|
||||
|
||||
get map() {
|
||||
const resultMap = map ? map.get() : null;
|
||||
result.map = resultMap;
|
||||
return resultMap;
|
||||
},
|
||||
|
||||
set map(value) {
|
||||
Object.defineProperty(result, "map", {
|
||||
value,
|
||||
writable: true
|
||||
});
|
||||
},
|
||||
|
||||
get rawMappings() {
|
||||
const mappings = map == null ? void 0 : map.getRawMappings();
|
||||
result.rawMappings = mappings;
|
||||
return mappings;
|
||||
},
|
||||
|
||||
set rawMappings(value) {
|
||||
Object.defineProperty(result, "rawMappings", {
|
||||
value,
|
||||
writable: true
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
if (map) {
|
||||
Object.defineProperty(result, "map", {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
|
||||
get() {
|
||||
return this.map = map.get();
|
||||
},
|
||||
|
||||
set(value) {
|
||||
Object.defineProperty(this, "map", {
|
||||
value,
|
||||
writable: true
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -65,11 +76,10 @@ class Buffer {
|
||||
line,
|
||||
column,
|
||||
filename,
|
||||
identifierName,
|
||||
force
|
||||
identifierName
|
||||
} = this._sourcePosition;
|
||||
|
||||
this._append(str, line, column, identifierName, filename, force);
|
||||
this._append(str, line, column, identifierName, filename);
|
||||
}
|
||||
|
||||
queue(str) {
|
||||
@ -83,11 +93,14 @@ class Buffer {
|
||||
line,
|
||||
column,
|
||||
filename,
|
||||
identifierName,
|
||||
force
|
||||
identifierName
|
||||
} = this._sourcePosition;
|
||||
|
||||
this._queue.unshift([str, line, column, identifierName, filename, force]);
|
||||
this._queue.unshift([str, line, column, identifierName, filename]);
|
||||
}
|
||||
|
||||
queueIndentation(str) {
|
||||
this._queue.unshift([str, undefined, undefined, undefined, undefined]);
|
||||
}
|
||||
|
||||
_flush() {
|
||||
@ -98,14 +111,14 @@ class Buffer {
|
||||
}
|
||||
}
|
||||
|
||||
_append(str, line, column, identifierName, filename, force) {
|
||||
_append(str, line, column, identifierName, filename) {
|
||||
this._buf += str;
|
||||
this._last = str.charCodeAt(str.length - 1);
|
||||
let i = str.indexOf("\n");
|
||||
let last = 0;
|
||||
|
||||
if (i !== 0) {
|
||||
this._mark(line, column, identifierName, filename, force);
|
||||
this._mark(line, column, identifierName, filename);
|
||||
}
|
||||
|
||||
while (i !== -1) {
|
||||
@ -114,7 +127,7 @@ class Buffer {
|
||||
last = i + 1;
|
||||
|
||||
if (last < str.length) {
|
||||
this._mark(++line, 0, identifierName, filename, force);
|
||||
this._mark(++line, 0, identifierName, filename);
|
||||
}
|
||||
|
||||
i = str.indexOf("\n", last);
|
||||
@ -123,10 +136,10 @@ class Buffer {
|
||||
this._position.column += str.length - last;
|
||||
}
|
||||
|
||||
_mark(line, column, identifierName, filename, force) {
|
||||
_mark(line, column, identifierName, filename) {
|
||||
var _this$_map;
|
||||
|
||||
(_this$_map = this._map) == null ? void 0 : _this$_map.mark(this._position.line, this._position.column, line, column, identifierName, filename, force);
|
||||
(_this$_map = this._map) == null ? void 0 : _this$_map.mark(this._position, line, column, identifierName, filename);
|
||||
}
|
||||
|
||||
removeTrailingNewline() {
|
||||
@ -176,17 +189,17 @@ class Buffer {
|
||||
}
|
||||
|
||||
exactSource(loc, cb) {
|
||||
this.source("start", loc, true);
|
||||
this.source("start", loc);
|
||||
cb();
|
||||
this.source("end", loc);
|
||||
|
||||
this._disallowPop("start", loc);
|
||||
}
|
||||
|
||||
source(prop, loc, force) {
|
||||
source(prop, loc) {
|
||||
if (prop && !loc) return;
|
||||
|
||||
this._normalizePosition(prop, loc, this._sourcePosition, force);
|
||||
this._normalizePosition(prop, loc, this._sourcePosition);
|
||||
}
|
||||
|
||||
withSource(prop, loc, cb) {
|
||||
@ -198,46 +211,26 @@ class Buffer {
|
||||
this.source(prop, loc);
|
||||
cb();
|
||||
|
||||
if ((!this._sourcePosition.force || this._sourcePosition.line !== originalLine || this._sourcePosition.column !== originalColumn || this._sourcePosition.filename !== originalFilename) && (!this._disallowedPop || this._disallowedPop.line !== originalLine || this._disallowedPop.column !== originalColumn || this._disallowedPop.filename !== originalFilename)) {
|
||||
if (!this._disallowedPop || this._disallowedPop.line !== originalLine || this._disallowedPop.column !== originalColumn || this._disallowedPop.filename !== originalFilename) {
|
||||
this._sourcePosition.line = originalLine;
|
||||
this._sourcePosition.column = originalColumn;
|
||||
this._sourcePosition.filename = originalFilename;
|
||||
this._sourcePosition.identifierName = originalIdentifierName;
|
||||
this._sourcePosition.force = false;
|
||||
this._disallowedPop = null;
|
||||
}
|
||||
}
|
||||
|
||||
_disallowPop(prop, loc) {
|
||||
if (prop && !loc) return;
|
||||
this._disallowedPop = this._normalizePosition(prop, loc);
|
||||
this._disallowedPop = this._normalizePosition(prop, loc, SourcePos());
|
||||
}
|
||||
|
||||
_normalizePosition(prop, loc, targetObj, force) {
|
||||
_normalizePosition(prop, loc, targetObj) {
|
||||
const pos = loc ? loc[prop] : null;
|
||||
|
||||
if (targetObj === undefined) {
|
||||
targetObj = {
|
||||
identifierName: null,
|
||||
line: null,
|
||||
column: null,
|
||||
filename: null,
|
||||
force: false
|
||||
};
|
||||
}
|
||||
|
||||
const origLine = targetObj.line;
|
||||
const origColumn = targetObj.column;
|
||||
const origFilename = targetObj.filename;
|
||||
targetObj.identifierName = prop === "start" && (loc == null ? void 0 : loc.identifierName) || null;
|
||||
targetObj.identifierName = prop === "start" && (loc == null ? void 0 : loc.identifierName) || undefined;
|
||||
targetObj.line = pos == null ? void 0 : pos.line;
|
||||
targetObj.column = pos == null ? void 0 : pos.column;
|
||||
targetObj.filename = loc == null ? void 0 : loc.filename;
|
||||
|
||||
if (force || targetObj.line !== origLine || targetObj.column !== origColumn || targetObj.filename !== origFilename) {
|
||||
targetObj.force = force;
|
||||
}
|
||||
|
||||
return targetObj;
|
||||
}
|
||||
|
||||
|
2
node_modules/@babel/generator/lib/generators/base.js
generated
vendored
2
node_modules/@babel/generator/lib/generators/base.js
generated
vendored
@ -63,7 +63,7 @@ const unescapedDoubleQuoteRE = /(?:^|[^\\])(?:\\\\)*"/;
|
||||
function DirectiveLiteral(node) {
|
||||
const raw = this.getPossibleRaw(node);
|
||||
|
||||
if (!this.format.minified && raw != null) {
|
||||
if (!this.format.minified && raw !== undefined) {
|
||||
this.token(raw);
|
||||
return;
|
||||
}
|
||||
|
49
node_modules/@babel/generator/lib/generators/classes.js
generated
vendored
49
node_modules/@babel/generator/lib/generators/classes.js
generated
vendored
@ -3,6 +3,7 @@
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.ClassAccessorProperty = ClassAccessorProperty;
|
||||
exports.ClassBody = ClassBody;
|
||||
exports.ClassExpression = exports.ClassDeclaration = ClassDeclaration;
|
||||
exports.ClassMethod = ClassMethod;
|
||||
@ -20,8 +21,10 @@ const {
|
||||
} = _t;
|
||||
|
||||
function ClassDeclaration(node, parent) {
|
||||
if (!this.format.decoratorsBeforeExport || !isExportDefaultDeclaration(parent) && !isExportNamedDeclaration(parent)) {
|
||||
this.printJoin(node.decorators, node);
|
||||
{
|
||||
if (!this.format.decoratorsBeforeExport || !isExportDefaultDeclaration(parent) && !isExportNamedDeclaration(parent)) {
|
||||
this.printJoin(node.decorators, node);
|
||||
}
|
||||
}
|
||||
|
||||
if (node.declare) {
|
||||
@ -82,7 +85,45 @@ function ClassBody(node) {
|
||||
function ClassProperty(node) {
|
||||
this.printJoin(node.decorators, node);
|
||||
this.source("end", node.key.loc);
|
||||
this.tsPrintClassMemberModifiers(node, true);
|
||||
this.tsPrintClassMemberModifiers(node);
|
||||
|
||||
if (node.computed) {
|
||||
this.token("[");
|
||||
this.print(node.key, node);
|
||||
this.token("]");
|
||||
} else {
|
||||
this._variance(node);
|
||||
|
||||
this.print(node.key, node);
|
||||
}
|
||||
|
||||
if (node.optional) {
|
||||
this.token("?");
|
||||
}
|
||||
|
||||
if (node.definite) {
|
||||
this.token("!");
|
||||
}
|
||||
|
||||
this.print(node.typeAnnotation, node);
|
||||
|
||||
if (node.value) {
|
||||
this.space();
|
||||
this.token("=");
|
||||
this.space();
|
||||
this.print(node.value, node);
|
||||
}
|
||||
|
||||
this.semicolon();
|
||||
}
|
||||
|
||||
function ClassAccessorProperty(node) {
|
||||
this.printJoin(node.decorators, node);
|
||||
this.source("end", node.key.loc);
|
||||
this.tsPrintClassMemberModifiers(node);
|
||||
this.word("accessor");
|
||||
this.printInnerComments(node);
|
||||
this.space();
|
||||
|
||||
if (node.computed) {
|
||||
this.token("[");
|
||||
@ -152,7 +193,7 @@ function ClassPrivateMethod(node) {
|
||||
function _classMethodHead(node) {
|
||||
this.printJoin(node.decorators, node);
|
||||
this.source("end", node.key.loc);
|
||||
this.tsPrintClassMemberModifiers(node, false);
|
||||
this.tsPrintClassMemberModifiers(node);
|
||||
|
||||
this._methodHead(node);
|
||||
}
|
||||
|
82
node_modules/@babel/generator/lib/generators/expressions.js
generated
vendored
82
node_modules/@babel/generator/lib/generators/expressions.js
generated
vendored
@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
||||
});
|
||||
exports.LogicalExpression = exports.BinaryExpression = exports.AssignmentExpression = AssignmentExpression;
|
||||
exports.AssignmentPattern = AssignmentPattern;
|
||||
exports.AwaitExpression = void 0;
|
||||
exports.AwaitExpression = AwaitExpression;
|
||||
exports.BindExpression = BindExpression;
|
||||
exports.CallExpression = CallExpression;
|
||||
exports.ConditionalExpression = ConditionalExpression;
|
||||
@ -28,7 +28,7 @@ exports.ThisExpression = ThisExpression;
|
||||
exports.UnaryExpression = UnaryExpression;
|
||||
exports.UpdateExpression = UpdateExpression;
|
||||
exports.V8IntrinsicIdentifier = V8IntrinsicIdentifier;
|
||||
exports.YieldExpression = void 0;
|
||||
exports.YieldExpression = YieldExpression;
|
||||
|
||||
var _t = require("@babel/types");
|
||||
|
||||
@ -74,9 +74,7 @@ function UpdateExpression(node) {
|
||||
this.token(node.operator);
|
||||
this.print(node.argument, node);
|
||||
} else {
|
||||
this.startTerminatorless(true);
|
||||
this.print(node.argument, node);
|
||||
this.endTerminatorless();
|
||||
this.printTerminatorless(node.argument, node, true);
|
||||
this.token(node.operator);
|
||||
}
|
||||
}
|
||||
@ -128,9 +126,45 @@ function Super() {
|
||||
this.word("super");
|
||||
}
|
||||
|
||||
function isDecoratorMemberExpression(node) {
|
||||
switch (node.type) {
|
||||
case "Identifier":
|
||||
return true;
|
||||
|
||||
case "MemberExpression":
|
||||
return !node.computed && node.property.type === "Identifier" && isDecoratorMemberExpression(node.object);
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function shouldParenthesizeDecoratorExpression(node) {
|
||||
if (node.type === "CallExpression") {
|
||||
node = node.callee;
|
||||
}
|
||||
|
||||
if (node.type === "ParenthesizedExpression") {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !isDecoratorMemberExpression(node);
|
||||
}
|
||||
|
||||
function Decorator(node) {
|
||||
this.token("@");
|
||||
this.print(node.expression, node);
|
||||
const {
|
||||
expression
|
||||
} = node;
|
||||
|
||||
if (shouldParenthesizeDecoratorExpression(expression)) {
|
||||
this.token("(");
|
||||
this.print(expression, node);
|
||||
this.token(")");
|
||||
} else {
|
||||
this.print(expression, node);
|
||||
}
|
||||
|
||||
this.newline();
|
||||
}
|
||||
|
||||
@ -191,27 +225,27 @@ function Import() {
|
||||
this.word("import");
|
||||
}
|
||||
|
||||
function buildYieldAwait(keyword) {
|
||||
return function (node) {
|
||||
this.word(keyword);
|
||||
function AwaitExpression(node) {
|
||||
this.word("await");
|
||||
|
||||
if (node.delegate) {
|
||||
this.token("*");
|
||||
}
|
||||
|
||||
if (node.argument) {
|
||||
this.space();
|
||||
const terminatorState = this.startTerminatorless();
|
||||
this.print(node.argument, node);
|
||||
this.endTerminatorless(terminatorState);
|
||||
}
|
||||
};
|
||||
if (node.argument) {
|
||||
this.space();
|
||||
this.printTerminatorless(node.argument, node, false);
|
||||
}
|
||||
}
|
||||
|
||||
const YieldExpression = buildYieldAwait("yield");
|
||||
exports.YieldExpression = YieldExpression;
|
||||
const AwaitExpression = buildYieldAwait("await");
|
||||
exports.AwaitExpression = AwaitExpression;
|
||||
function YieldExpression(node) {
|
||||
this.word("yield");
|
||||
|
||||
if (node.delegate) {
|
||||
this.token("*");
|
||||
}
|
||||
|
||||
if (node.argument) {
|
||||
this.space();
|
||||
this.printTerminatorless(node.argument, node, false);
|
||||
}
|
||||
}
|
||||
|
||||
function EmptyStatement() {
|
||||
this.semicolon(true);
|
||||
|
6
node_modules/@babel/generator/lib/generators/flow.js
generated
vendored
6
node_modules/@babel/generator/lib/generators/flow.js
generated
vendored
@ -219,14 +219,14 @@ function DeclareExportDeclaration(node) {
|
||||
this.space();
|
||||
}
|
||||
|
||||
FlowExportDeclaration.apply(this, arguments);
|
||||
FlowExportDeclaration.call(this, node);
|
||||
}
|
||||
|
||||
function DeclareExportAllDeclaration() {
|
||||
function DeclareExportAllDeclaration(node) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
|
||||
_modules.ExportAllDeclaration.apply(this, arguments);
|
||||
_modules.ExportAllDeclaration.call(this, node);
|
||||
}
|
||||
|
||||
function EnumDeclaration(node) {
|
||||
|
2
node_modules/@babel/generator/lib/generators/jsx.js
generated
vendored
2
node_modules/@babel/generator/lib/generators/jsx.js
generated
vendored
@ -67,7 +67,7 @@ function JSXSpreadChild(node) {
|
||||
function JSXText(node) {
|
||||
const raw = this.getPossibleRaw(node);
|
||||
|
||||
if (raw != null) {
|
||||
if (raw !== undefined) {
|
||||
this.token(raw);
|
||||
} else {
|
||||
this.token(node.value);
|
||||
|
10
node_modules/@babel/generator/lib/generators/methods.js
generated
vendored
10
node_modules/@babel/generator/lib/generators/methods.js
generated
vendored
@ -42,7 +42,11 @@ function _parameters(parameters, parent) {
|
||||
function _param(parameter, parent) {
|
||||
this.printJoin(parameter.decorators, parameter);
|
||||
this.print(parameter, parent);
|
||||
if (parameter.optional) this.token("?");
|
||||
|
||||
if (parameter.optional) {
|
||||
this.token("?");
|
||||
}
|
||||
|
||||
this.print(parameter.typeAnnotation, parameter);
|
||||
}
|
||||
|
||||
@ -111,7 +115,9 @@ function _functionHead(node) {
|
||||
|
||||
this._params(node);
|
||||
|
||||
this._predicate(node);
|
||||
if (node.type !== "TSDeclareFunction") {
|
||||
this._predicate(node);
|
||||
}
|
||||
}
|
||||
|
||||
function FunctionExpression(node) {
|
||||
|
80
node_modules/@babel/generator/lib/generators/modules.js
generated
vendored
80
node_modules/@babel/generator/lib/generators/modules.js
generated
vendored
@ -93,28 +93,14 @@ function ExportAllDeclaration(node) {
|
||||
}
|
||||
|
||||
function ExportNamedDeclaration(node) {
|
||||
if (this.format.decoratorsBeforeExport && isClassDeclaration(node.declaration)) {
|
||||
this.printJoin(node.declaration.decorators, node);
|
||||
{
|
||||
if (this.format.decoratorsBeforeExport && isClassDeclaration(node.declaration)) {
|
||||
this.printJoin(node.declaration.decorators, node);
|
||||
}
|
||||
}
|
||||
|
||||
this.word("export");
|
||||
this.space();
|
||||
ExportDeclaration.apply(this, arguments);
|
||||
}
|
||||
|
||||
function ExportDefaultDeclaration(node) {
|
||||
if (this.format.decoratorsBeforeExport && isClassDeclaration(node.declaration)) {
|
||||
this.printJoin(node.declaration.decorators, node);
|
||||
}
|
||||
|
||||
this.word("export");
|
||||
this.space();
|
||||
this.word("default");
|
||||
this.space();
|
||||
ExportDeclaration.apply(this, arguments);
|
||||
}
|
||||
|
||||
function ExportDeclaration(node) {
|
||||
if (node.declaration) {
|
||||
const declar = node.declaration;
|
||||
this.print(declar, node);
|
||||
@ -168,41 +154,61 @@ function ExportDeclaration(node) {
|
||||
}
|
||||
}
|
||||
|
||||
function ExportDefaultDeclaration(node) {
|
||||
{
|
||||
if (this.format.decoratorsBeforeExport && isClassDeclaration(node.declaration)) {
|
||||
this.printJoin(node.declaration.decorators, node);
|
||||
}
|
||||
}
|
||||
this.word("export");
|
||||
this.space();
|
||||
this.word("default");
|
||||
this.space();
|
||||
const declar = node.declaration;
|
||||
this.print(declar, node);
|
||||
if (!isStatement(declar)) this.semicolon();
|
||||
}
|
||||
|
||||
function ImportDeclaration(node) {
|
||||
this.word("import");
|
||||
this.space();
|
||||
const isTypeKind = node.importKind === "type" || node.importKind === "typeof";
|
||||
|
||||
if (node.importKind === "type" || node.importKind === "typeof") {
|
||||
if (isTypeKind) {
|
||||
this.word(node.importKind);
|
||||
this.space();
|
||||
}
|
||||
|
||||
const specifiers = node.specifiers.slice(0);
|
||||
const hasSpecifiers = !!specifiers.length;
|
||||
|
||||
if (specifiers != null && specifiers.length) {
|
||||
for (;;) {
|
||||
const first = specifiers[0];
|
||||
while (hasSpecifiers) {
|
||||
const first = specifiers[0];
|
||||
|
||||
if (isImportDefaultSpecifier(first) || isImportNamespaceSpecifier(first)) {
|
||||
this.print(specifiers.shift(), node);
|
||||
if (isImportDefaultSpecifier(first) || isImportNamespaceSpecifier(first)) {
|
||||
this.print(specifiers.shift(), node);
|
||||
|
||||
if (specifiers.length) {
|
||||
this.token(",");
|
||||
this.space();
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
if (specifiers.length) {
|
||||
this.token(",");
|
||||
this.space();
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (specifiers.length) {
|
||||
this.token("{");
|
||||
this.space();
|
||||
this.printList(specifiers, node);
|
||||
this.space();
|
||||
this.token("}");
|
||||
}
|
||||
if (specifiers.length) {
|
||||
this.token("{");
|
||||
this.space();
|
||||
this.printList(specifiers, node);
|
||||
this.space();
|
||||
this.token("}");
|
||||
} else if (isTypeKind && !hasSpecifiers) {
|
||||
this.token("{");
|
||||
this.token("}");
|
||||
}
|
||||
|
||||
if (hasSpecifiers || isTypeKind) {
|
||||
this.space();
|
||||
this.word("from");
|
||||
this.space();
|
||||
|
105
node_modules/@babel/generator/lib/generators/statements.js
generated
vendored
105
node_modules/@babel/generator/lib/generators/statements.js
generated
vendored
@ -3,19 +3,19 @@
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.BreakStatement = void 0;
|
||||
exports.BreakStatement = BreakStatement;
|
||||
exports.CatchClause = CatchClause;
|
||||
exports.ContinueStatement = void 0;
|
||||
exports.ContinueStatement = ContinueStatement;
|
||||
exports.DebuggerStatement = DebuggerStatement;
|
||||
exports.DoWhileStatement = DoWhileStatement;
|
||||
exports.ForOfStatement = exports.ForInStatement = void 0;
|
||||
exports.ForStatement = ForStatement;
|
||||
exports.IfStatement = IfStatement;
|
||||
exports.LabeledStatement = LabeledStatement;
|
||||
exports.ReturnStatement = void 0;
|
||||
exports.ReturnStatement = ReturnStatement;
|
||||
exports.SwitchCase = SwitchCase;
|
||||
exports.SwitchStatement = SwitchStatement;
|
||||
exports.ThrowStatement = void 0;
|
||||
exports.ThrowStatement = ThrowStatement;
|
||||
exports.TryStatement = TryStatement;
|
||||
exports.VariableDeclaration = VariableDeclaration;
|
||||
exports.VariableDeclarator = VariableDeclarator;
|
||||
@ -72,8 +72,15 @@ function IfStatement(node) {
|
||||
}
|
||||
|
||||
function getLastStatement(statement) {
|
||||
if (!isStatement(statement.body)) return statement;
|
||||
return getLastStatement(statement.body);
|
||||
const {
|
||||
body
|
||||
} = statement;
|
||||
|
||||
if (isStatement(body) === false) {
|
||||
return statement;
|
||||
}
|
||||
|
||||
return getLastStatement(body);
|
||||
}
|
||||
|
||||
function ForStatement(node) {
|
||||
@ -110,30 +117,29 @@ function WhileStatement(node) {
|
||||
this.printBlock(node);
|
||||
}
|
||||
|
||||
const buildForXStatement = function (op) {
|
||||
return function (node) {
|
||||
this.word("for");
|
||||
this.space();
|
||||
function ForXStatement(node) {
|
||||
this.word("for");
|
||||
this.space();
|
||||
const isForOf = node.type === "ForOfStatement";
|
||||
|
||||
if (op === "of" && node.await) {
|
||||
this.word("await");
|
||||
this.space();
|
||||
}
|
||||
|
||||
this.token("(");
|
||||
this.print(node.left, node);
|
||||
if (isForOf && node.await) {
|
||||
this.word("await");
|
||||
this.space();
|
||||
this.word(op);
|
||||
this.space();
|
||||
this.print(node.right, node);
|
||||
this.token(")");
|
||||
this.printBlock(node);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
const ForInStatement = buildForXStatement("in");
|
||||
this.token("(");
|
||||
this.print(node.left, node);
|
||||
this.space();
|
||||
this.word(isForOf ? "of" : "in");
|
||||
this.space();
|
||||
this.print(node.right, node);
|
||||
this.token(")");
|
||||
this.printBlock(node);
|
||||
}
|
||||
|
||||
const ForInStatement = ForXStatement;
|
||||
exports.ForInStatement = ForInStatement;
|
||||
const ForOfStatement = buildForXStatement("of");
|
||||
const ForOfStatement = ForXStatement;
|
||||
exports.ForOfStatement = ForOfStatement;
|
||||
|
||||
function DoWhileStatement(node) {
|
||||
@ -149,31 +155,34 @@ function DoWhileStatement(node) {
|
||||
this.semicolon();
|
||||
}
|
||||
|
||||
function buildLabelStatement(prefix, key = "label") {
|
||||
return function (node) {
|
||||
this.word(prefix);
|
||||
const label = node[key];
|
||||
function printStatementAfterKeyword(printer, node, parent, isLabel) {
|
||||
if (node) {
|
||||
printer.space();
|
||||
printer.printTerminatorless(node, parent, isLabel);
|
||||
}
|
||||
|
||||
if (label) {
|
||||
this.space();
|
||||
const isLabel = key == "label";
|
||||
const terminatorState = this.startTerminatorless(isLabel);
|
||||
this.print(label, node);
|
||||
this.endTerminatorless(terminatorState);
|
||||
}
|
||||
|
||||
this.semicolon();
|
||||
};
|
||||
printer.semicolon();
|
||||
}
|
||||
|
||||
const ContinueStatement = buildLabelStatement("continue");
|
||||
exports.ContinueStatement = ContinueStatement;
|
||||
const ReturnStatement = buildLabelStatement("return", "argument");
|
||||
exports.ReturnStatement = ReturnStatement;
|
||||
const BreakStatement = buildLabelStatement("break");
|
||||
exports.BreakStatement = BreakStatement;
|
||||
const ThrowStatement = buildLabelStatement("throw", "argument");
|
||||
exports.ThrowStatement = ThrowStatement;
|
||||
function BreakStatement(node) {
|
||||
this.word("break");
|
||||
printStatementAfterKeyword(this, node.label, node, true);
|
||||
}
|
||||
|
||||
function ContinueStatement(node) {
|
||||
this.word("continue");
|
||||
printStatementAfterKeyword(this, node.label, node, true);
|
||||
}
|
||||
|
||||
function ReturnStatement(node) {
|
||||
this.word("return");
|
||||
printStatementAfterKeyword(this, node.argument, node, false);
|
||||
}
|
||||
|
||||
function ThrowStatement(node) {
|
||||
this.word("throw");
|
||||
printStatementAfterKeyword(this, node.argument, node, false);
|
||||
}
|
||||
|
||||
function LabeledStatement(node) {
|
||||
this.print(node.label, node);
|
||||
|
8
node_modules/@babel/generator/lib/generators/types.js
generated
vendored
8
node_modules/@babel/generator/lib/generators/types.js
generated
vendored
@ -213,7 +213,7 @@ function NumericLiteral(node) {
|
||||
function StringLiteral(node) {
|
||||
const raw = this.getPossibleRaw(node);
|
||||
|
||||
if (!this.format.minified && raw != null) {
|
||||
if (!this.format.minified && raw !== undefined) {
|
||||
this.token(raw);
|
||||
return;
|
||||
}
|
||||
@ -228,7 +228,7 @@ function StringLiteral(node) {
|
||||
function BigIntLiteral(node) {
|
||||
const raw = this.getPossibleRaw(node);
|
||||
|
||||
if (!this.format.minified && raw != null) {
|
||||
if (!this.format.minified && raw !== undefined) {
|
||||
this.word(raw);
|
||||
return;
|
||||
}
|
||||
@ -239,7 +239,7 @@ function BigIntLiteral(node) {
|
||||
function DecimalLiteral(node) {
|
||||
const raw = this.getPossibleRaw(node);
|
||||
|
||||
if (!this.format.minified && raw != null) {
|
||||
if (!this.format.minified && raw !== undefined) {
|
||||
this.word(raw);
|
||||
return;
|
||||
}
|
||||
@ -247,7 +247,7 @@ function DecimalLiteral(node) {
|
||||
this.word(node.value + "m");
|
||||
}
|
||||
|
||||
const validTopicTokenSet = new Set(["^", "%", "#"]);
|
||||
const validTopicTokenSet = new Set(["^^", "@@", "^", "%", "#"]);
|
||||
|
||||
function TopicReference() {
|
||||
const {
|
||||
|
58
node_modules/@babel/generator/lib/generators/typescript.js
generated
vendored
58
node_modules/@babel/generator/lib/generators/typescript.js
generated
vendored
@ -25,6 +25,7 @@ exports.TSImportType = TSImportType;
|
||||
exports.TSIndexSignature = TSIndexSignature;
|
||||
exports.TSIndexedAccessType = TSIndexedAccessType;
|
||||
exports.TSInferType = TSInferType;
|
||||
exports.TSInstantiationExpression = TSInstantiationExpression;
|
||||
exports.TSInterfaceBody = TSInterfaceBody;
|
||||
exports.TSInterfaceDeclaration = TSInterfaceDeclaration;
|
||||
exports.TSIntersectionType = TSIntersectionType;
|
||||
@ -65,13 +66,11 @@ exports.TSUndefinedKeyword = TSUndefinedKeyword;
|
||||
exports.TSUnionType = TSUnionType;
|
||||
exports.TSUnknownKeyword = TSUnknownKeyword;
|
||||
exports.TSVoidKeyword = TSVoidKeyword;
|
||||
exports.tsPrintBraced = tsPrintBraced;
|
||||
exports.tsPrintClassMemberModifiers = tsPrintClassMemberModifiers;
|
||||
exports.tsPrintFunctionOrConstructorType = tsPrintFunctionOrConstructorType;
|
||||
exports.tsPrintPropertyOrMethodName = tsPrintPropertyOrMethodName;
|
||||
exports.tsPrintSignatureDeclarationBase = tsPrintSignatureDeclarationBase;
|
||||
exports.tsPrintTypeLiteralOrInterfaceBody = tsPrintTypeLiteralOrInterfaceBody;
|
||||
exports.tsPrintUnionOrIntersectionType = tsPrintUnionOrIntersectionType;
|
||||
|
||||
function TSTypeAnnotation(node) {
|
||||
this.token(":");
|
||||
@ -92,6 +91,16 @@ function TSTypeParameterInstantiation(node, parent) {
|
||||
}
|
||||
|
||||
function TSTypeParameter(node) {
|
||||
if (node.in) {
|
||||
this.word("in");
|
||||
this.space();
|
||||
}
|
||||
|
||||
if (node.out) {
|
||||
this.word("out");
|
||||
this.space();
|
||||
}
|
||||
|
||||
this.word(node.name);
|
||||
|
||||
if (node.constraint) {
|
||||
@ -352,6 +361,10 @@ function TSTypeQuery(node) {
|
||||
this.word("typeof");
|
||||
this.space();
|
||||
this.print(node.exprName);
|
||||
|
||||
if (node.typeParameters) {
|
||||
this.print(node.typeParameters, node);
|
||||
}
|
||||
}
|
||||
|
||||
function TSTypeLiteral(node) {
|
||||
@ -359,25 +372,25 @@ function TSTypeLiteral(node) {
|
||||
}
|
||||
|
||||
function tsPrintTypeLiteralOrInterfaceBody(members, node) {
|
||||
this.tsPrintBraced(members, node);
|
||||
tsPrintBraced(this, members, node);
|
||||
}
|
||||
|
||||
function tsPrintBraced(members, node) {
|
||||
this.token("{");
|
||||
function tsPrintBraced(printer, members, node) {
|
||||
printer.token("{");
|
||||
|
||||
if (members.length) {
|
||||
this.indent();
|
||||
this.newline();
|
||||
printer.indent();
|
||||
printer.newline();
|
||||
|
||||
for (const member of members) {
|
||||
this.print(member, node);
|
||||
this.newline();
|
||||
printer.print(member, node);
|
||||
printer.newline();
|
||||
}
|
||||
|
||||
this.dedent();
|
||||
this.rightBrace();
|
||||
printer.dedent();
|
||||
printer.rightBrace();
|
||||
} else {
|
||||
this.token("}");
|
||||
printer.token("}");
|
||||
}
|
||||
}
|
||||
|
||||
@ -411,15 +424,15 @@ function TSNamedTupleMember(node) {
|
||||
}
|
||||
|
||||
function TSUnionType(node) {
|
||||
this.tsPrintUnionOrIntersectionType(node, "|");
|
||||
tsPrintUnionOrIntersectionType(this, node, "|");
|
||||
}
|
||||
|
||||
function TSIntersectionType(node) {
|
||||
this.tsPrintUnionOrIntersectionType(node, "&");
|
||||
tsPrintUnionOrIntersectionType(this, node, "&");
|
||||
}
|
||||
|
||||
function tsPrintUnionOrIntersectionType(node, sep) {
|
||||
this.printJoin(node.types, node, {
|
||||
function tsPrintUnionOrIntersectionType(printer, node, sep) {
|
||||
printer.printJoin(node.types, node, {
|
||||
separator() {
|
||||
this.space();
|
||||
this.token(sep);
|
||||
@ -611,6 +624,11 @@ function TSTypeAssertion(node) {
|
||||
this.print(expression, node);
|
||||
}
|
||||
|
||||
function TSInstantiationExpression(node) {
|
||||
this.print(node.expression, node);
|
||||
this.print(node.typeParameters, node);
|
||||
}
|
||||
|
||||
function TSEnumDeclaration(node) {
|
||||
const {
|
||||
declare,
|
||||
@ -633,7 +651,7 @@ function TSEnumDeclaration(node) {
|
||||
this.space();
|
||||
this.print(id, node);
|
||||
this.space();
|
||||
this.tsPrintBraced(members, node);
|
||||
tsPrintBraced(this, members, node);
|
||||
}
|
||||
|
||||
function TSEnumMember(node) {
|
||||
@ -689,7 +707,7 @@ function TSModuleDeclaration(node) {
|
||||
}
|
||||
|
||||
function TSModuleBlock(node) {
|
||||
this.tsPrintBraced(node.body, node);
|
||||
tsPrintBraced(this, node.body, node);
|
||||
}
|
||||
|
||||
function TSImportType(node) {
|
||||
@ -780,7 +798,9 @@ function tsPrintSignatureDeclarationBase(node) {
|
||||
this.print(returnType, node);
|
||||
}
|
||||
|
||||
function tsPrintClassMemberModifiers(node, isField) {
|
||||
function tsPrintClassMemberModifiers(node) {
|
||||
const isField = node.type === "ClassAccessorProperty" || node.type === "ClassProperty";
|
||||
|
||||
if (isField && node.declare) {
|
||||
this.word("declare");
|
||||
this.space();
|
||||
|
2
node_modules/@babel/generator/lib/index.js
generated
vendored
2
node_modules/@babel/generator/lib/index.js
generated
vendored
@ -41,7 +41,6 @@ function normalizeOptions(code, opts) {
|
||||
style: " ",
|
||||
base: 0
|
||||
},
|
||||
decoratorsBeforeExport: !!opts.decoratorsBeforeExport,
|
||||
jsescOption: Object.assign({
|
||||
quotes: "double",
|
||||
wrap: true,
|
||||
@ -51,6 +50,7 @@ function normalizeOptions(code, opts) {
|
||||
topicToken: opts.topicToken
|
||||
};
|
||||
{
|
||||
format.decoratorsBeforeExport = !!opts.decoratorsBeforeExport;
|
||||
format.jsonCompatibleStrings = opts.jsonCompatibleStrings;
|
||||
}
|
||||
|
||||
|
6
node_modules/@babel/generator/lib/node/index.js
generated
vendored
6
node_modules/@babel/generator/lib/node/index.js
generated
vendored
@ -66,7 +66,7 @@ function isOrHasCallExpression(node) {
|
||||
}
|
||||
|
||||
function needsWhitespace(node, parent, type) {
|
||||
if (!node) return 0;
|
||||
if (!node) return false;
|
||||
|
||||
if (isExpressionStatement(node)) {
|
||||
node = node.expression;
|
||||
@ -86,10 +86,10 @@ function needsWhitespace(node, parent, type) {
|
||||
}
|
||||
|
||||
if (typeof linesInfo === "object" && linesInfo !== null) {
|
||||
return linesInfo[type] || 0;
|
||||
return linesInfo[type] || false;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
function needsWhitespaceBefore(node, parent) {
|
||||
|
25
node_modules/@babel/generator/lib/node/parentheses.js
generated
vendored
25
node_modules/@babel/generator/lib/node/parentheses.js
generated
vendored
@ -21,6 +21,7 @@ exports.OptionalCallExpression = exports.OptionalMemberExpression = OptionalMemb
|
||||
exports.SequenceExpression = SequenceExpression;
|
||||
exports.TSAsExpression = TSAsExpression;
|
||||
exports.TSInferType = TSInferType;
|
||||
exports.TSInstantiationExpression = TSInstantiationExpression;
|
||||
exports.TSTypeAssertion = TSTypeAssertion;
|
||||
exports.TSIntersectionType = exports.TSUnionType = TSUnionType;
|
||||
exports.UnaryLike = UnaryLike;
|
||||
@ -37,8 +38,9 @@ const {
|
||||
isAwaitExpression,
|
||||
isBinary,
|
||||
isBinaryExpression,
|
||||
isUpdateExpression,
|
||||
isCallExpression,
|
||||
isClassDeclaration,
|
||||
isClass,
|
||||
isClassExpression,
|
||||
isConditional,
|
||||
isConditionalExpression,
|
||||
@ -49,6 +51,7 @@ const {
|
||||
isForInStatement,
|
||||
isForOfStatement,
|
||||
isForStatement,
|
||||
isFunctionExpression,
|
||||
isIfStatement,
|
||||
isIndexedAccessType,
|
||||
isIntersectionTypeAnnotation,
|
||||
@ -64,6 +67,7 @@ const {
|
||||
isSwitchStatement,
|
||||
isTSArrayType,
|
||||
isTSAsExpression,
|
||||
isTSInstantiationExpression,
|
||||
isTSIntersectionType,
|
||||
isTSNonNullExpression,
|
||||
isTSOptionalType,
|
||||
@ -82,6 +86,7 @@ const {
|
||||
const PRECEDENCE = {
|
||||
"||": 0,
|
||||
"??": 0,
|
||||
"|>": 0,
|
||||
"&&": 1,
|
||||
"|": 2,
|
||||
"^": 3,
|
||||
@ -107,7 +112,9 @@ const PRECEDENCE = {
|
||||
"**": 10
|
||||
};
|
||||
|
||||
const isClassExtendsClause = (node, parent) => (isClassDeclaration(parent) || isClassExpression(parent)) && parent.superClass === node;
|
||||
const isClassExtendsClause = (node, parent) => isClass(parent, {
|
||||
superClass: node
|
||||
});
|
||||
|
||||
const hasPostfixPart = (node, parent) => (isMemberExpression(parent) || isOptionalMemberExpression(parent)) && parent.object === node || (isCallExpression(parent) || isOptionalCallExpression(parent) || isNewExpression(parent)) && parent.callee === node || isTaggedTemplateExpression(parent) && parent.tag === node || isTSNonNullExpression(parent);
|
||||
|
||||
@ -189,6 +196,10 @@ function TSInferType(node, parent) {
|
||||
return isTSArrayType(parent) || isTSOptionalType(parent);
|
||||
}
|
||||
|
||||
function TSInstantiationExpression(node, parent) {
|
||||
return (isCallExpression(parent) || isOptionalCallExpression(parent) || isNewExpression(parent) || isTSInstantiationExpression(parent)) && !!parent.typeParameters;
|
||||
}
|
||||
|
||||
function BinaryExpression(node, parent) {
|
||||
return node.operator === "in" && (isVariableDeclarator(parent) || isFor(parent));
|
||||
}
|
||||
@ -273,6 +284,14 @@ function LogicalExpression(node, parent) {
|
||||
}
|
||||
|
||||
function Identifier(node, parent, printStack) {
|
||||
var _node$extra;
|
||||
|
||||
if ((_node$extra = node.extra) != null && _node$extra.parenthesized && isAssignmentExpression(parent, {
|
||||
left: node
|
||||
}) && (isFunctionExpression(parent.right) || isClassExpression(parent.right)) && parent.right.id == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (node.name === "let") {
|
||||
const isFollowedByBracket = isMemberExpression(parent, {
|
||||
object: node,
|
||||
@ -323,7 +342,7 @@ function isFirstInContext(printStack, {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (hasPostfixPart(node, parent) && !isNewExpression(parent) || isSequenceExpression(parent) && parent.expressions[0] === node || isConditional(parent, {
|
||||
if (hasPostfixPart(node, parent) && !isNewExpression(parent) || isSequenceExpression(parent) && parent.expressions[0] === node || isUpdateExpression(parent) && !parent.prefix || isConditional(parent, {
|
||||
test: node
|
||||
}) || isBinary(parent, {
|
||||
left: node
|
||||
|
12
node_modules/@babel/generator/lib/node/whitespace.js
generated
vendored
12
node_modules/@babel/generator/lib/node/whitespace.js
generated
vendored
@ -199,16 +199,12 @@ const list = {
|
||||
};
|
||||
exports.list = list;
|
||||
[["Function", true], ["Class", true], ["Loop", true], ["LabeledStatement", true], ["SwitchStatement", true], ["TryStatement", true]].forEach(function ([type, amounts]) {
|
||||
if (typeof amounts === "boolean") {
|
||||
amounts = {
|
||||
after: amounts,
|
||||
before: amounts
|
||||
};
|
||||
}
|
||||
|
||||
[type].concat(FLIPPED_ALIAS_KEYS[type] || []).forEach(function (type) {
|
||||
nodes[type] = function () {
|
||||
return amounts;
|
||||
return {
|
||||
after: amounts,
|
||||
before: amounts
|
||||
};
|
||||
};
|
||||
});
|
||||
});
|
25
node_modules/@babel/generator/lib/printer.js
generated
vendored
25
node_modules/@babel/generator/lib/printer.js
generated
vendored
@ -196,7 +196,7 @@ class Printer {
|
||||
|
||||
_maybeIndent(str) {
|
||||
if (this._indent && this.endsWith(10) && str.charCodeAt(0) !== 10) {
|
||||
this._buf.queue(this._getIndent());
|
||||
this._buf.queueIndentation(this._getIndent());
|
||||
}
|
||||
}
|
||||
|
||||
@ -253,24 +253,23 @@ class Printer {
|
||||
return this.format.indent.style.repeat(this._indent);
|
||||
}
|
||||
|
||||
startTerminatorless(isLabel = false) {
|
||||
printTerminatorless(node, parent, isLabel) {
|
||||
if (isLabel) {
|
||||
this._noLineTerminator = true;
|
||||
return null;
|
||||
this.print(node, parent);
|
||||
this._noLineTerminator = false;
|
||||
} else {
|
||||
return this._parenPushNewlineState = {
|
||||
const terminatorState = {
|
||||
printed: false
|
||||
};
|
||||
}
|
||||
}
|
||||
this._parenPushNewlineState = terminatorState;
|
||||
this.print(node, parent);
|
||||
|
||||
endTerminatorless(state) {
|
||||
this._noLineTerminator = false;
|
||||
|
||||
if (state != null && state.printed) {
|
||||
this.dedent();
|
||||
this.newline();
|
||||
this.token(")");
|
||||
if (terminatorState.printed) {
|
||||
this.dedent();
|
||||
this.newline();
|
||||
this.token(")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user