chore:更换到主分支
5
.env
Normal file
@ -0,0 +1,5 @@
|
||||
# public path
|
||||
VITE_PUBLIC_PATH = /
|
||||
|
||||
# Cross-domain proxy, you can configure multiple
|
||||
VITE_PROXY = [ ["/api", "http://127.0.0.1:3000" ] ]
|
11
.env.development
Normal file
@ -0,0 +1,11 @@
|
||||
# port
|
||||
VITE_PORT = 3001
|
||||
|
||||
# open
|
||||
VITE_OPEN = false
|
||||
|
||||
# public path
|
||||
VITE_PUBLIC_PATH = /
|
||||
|
||||
# Cross-domain proxy, you can configure multiple
|
||||
VITE_PROXY = [ ["/api", "http://127.0.0.1:3000" ] ]
|
2
.env.production
Normal file
@ -0,0 +1,2 @@
|
||||
# public path
|
||||
VITE_PUBLIC_PATH = /manages/
|
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/node_modules
|
||||
/dist
|
||||
.DS_Store
|
||||
src/.DS_Store
|
51
README.md
@ -1,17 +1,56 @@
|
||||
# 后端管理项目文档
|
||||
# Vue3.0后台管理系统
|
||||
### 功能已开发完毕,新需求请提issues
|
||||
|
||||
## 知识库地址
|
||||
|
||||
帮助你获取最新的 API
|
||||
[vue3.0 中文文档地址]: https://vue3js.cn/docs/zh/
|
||||
[element-plus 中文文档地址]: https://element-plus.org/#/zh-CN
|
||||
[composition-Api 中文文档地址]: https://composition-api.vuejs.org/zh/
|
||||
[vue-router-next 文档地址]: https://next.router.vuejs.org/
|
||||
[next.vuex 文档地址]: https://next.vuex.vuejs.org/
|
||||
[vite 源码]: https://github.com/vitejs/vite
|
||||
[vite 文档地址]: https://vitejs.dev/
|
||||
[vite 中文文档地址(非官方版本)]: https://vite-design.surge.sh/guide/chinese-doc.html
|
||||
[vue-i18n-next]: https://vue-i18n-next.intlify.dev/
|
||||
[composition-api-vue-i18n-next]: https://vue-i18n-next.intlify.dev/advanced/composition.html#local-scope
|
||||
|
||||
## 安装依赖
|
||||
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
## 文档启动
|
||||
## 项目运行
|
||||
|
||||
```
|
||||
npm run docs
|
||||
npm run serve
|
||||
```
|
||||
|
||||
## 文档打包
|
||||
## 项目打包
|
||||
|
||||
```
|
||||
npm run docs:build
|
||||
npm run build
|
||||
```
|
||||
打包后会在.vitepress文件夹下生成dist目录
|
||||
|
||||
## 注意点
|
||||
|
||||
请先全局安装 typescript、ts-node、vite 如安装请忽略
|
||||
|
||||
```
|
||||
npm install -g typescript
|
||||
npm install -g ts-node
|
||||
npm install -g create-vite-app
|
||||
```
|
||||
|
||||
坑位
|
||||
1.
|
||||
path模块线上部署会遇到process is undefined问题
|
||||
解决办法:在源码中开头加入window.process = {}
|
||||
issues:https://github.com/jinder/path/issues/7
|
||||
2.
|
||||
运行项目时控制台报NODE_ENV not found
|
||||
解决办法:删除node_modules和package-lock.json文件,重新npm install
|
||||
3.
|
||||
运行项目会感觉菜单切换比较卡,这个原因是使用route造成的,watch(route)是隐式的{ deep: true },最好使用watchEffect
|
||||
issues:https://github.com/vuejs/vue-next/issues/2027
|
6
babel.config.js
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
const productPlugins = []
|
||||
process.env.NODE_ENV === "production" && productPlugins.push("transform-remove-console")
|
||||
module.exports = {
|
||||
plugins: [...productPlugins],
|
||||
}
|
19
build/proxy.ts
Normal file
@ -0,0 +1,19 @@
|
||||
type ProxyItem = [string, string];
|
||||
|
||||
type ProxyList = ProxyItem[];
|
||||
|
||||
const regExps = (value: string,reg: string): string => {
|
||||
return value.replace(new RegExp(reg, 'g'), '');
|
||||
}
|
||||
|
||||
export function createProxy(list: ProxyList = []) {
|
||||
const ret: any = {};
|
||||
for (const [prefix, target] of list) {
|
||||
ret[prefix] = {
|
||||
target: target,
|
||||
changeOrigin: true,
|
||||
rewrite: (path:string) => regExps(path, prefix)
|
||||
};
|
||||
}
|
||||
return ret;
|
||||
}
|
38
build/utils.ts
Normal file
@ -0,0 +1,38 @@
|
||||
import dotenv from 'dotenv';
|
||||
|
||||
export interface ViteEnv {
|
||||
VITE_PORT: number;
|
||||
VITE_OPEN: boolean;
|
||||
VITE_USE_MOCK: boolean;
|
||||
VITE_PUBLIC_PATH: string;
|
||||
VITE_PROXY: [string, string][];
|
||||
}
|
||||
|
||||
export function loadEnv(): ViteEnv {
|
||||
const env = process.env.NODE_ENV;
|
||||
const ret: any = {};
|
||||
const envList = [`.env.${env}.local`, `.env.${env}`, '.env.local', '.env', ,]
|
||||
envList.forEach((e) => {
|
||||
dotenv.config({
|
||||
path: e,
|
||||
});
|
||||
});
|
||||
for (const envName of Object.keys(process.env)) {
|
||||
let realName = (process.env as any)[envName].replace(/\\n/g, '\n');
|
||||
realName = realName === 'true' ? true : realName === 'false' ? false : realName;
|
||||
if (envName === 'VITE_PORT') {
|
||||
realName = Number(realName);
|
||||
}
|
||||
if (envName === 'VITE_OPEN') {
|
||||
realName = Boolean(realName);
|
||||
}
|
||||
if (envName === 'VITE_PROXY') {
|
||||
try {
|
||||
realName = JSON.parse(realName);
|
||||
} catch (error) { }
|
||||
}
|
||||
ret[envName] = realName;
|
||||
process.env[envName] = realName;
|
||||
}
|
||||
return ret;
|
||||
}
|
27
deploy.sh
@ -1,27 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# 确保脚本抛出遇到的错误
|
||||
set -e
|
||||
|
||||
# 生成静态文件
|
||||
npm run docs:build
|
||||
|
||||
# 进入生成的文件夹
|
||||
cd docs/.vitepress/dist
|
||||
|
||||
touch .nojekyll
|
||||
|
||||
# 如果是发布到自定义域名
|
||||
# echo 'www.example.com' > CNAME
|
||||
|
||||
git init
|
||||
git add -A
|
||||
git commit -m 'deploy'
|
||||
|
||||
# 如果发布到 https://<USERNAME>.github.io
|
||||
git push -f git@github.com:xiaoxian521/xiaoxian521.github.io.git master:main
|
||||
|
||||
# 如果发布到 https://<USERNAME>.github.io/<REPO>
|
||||
# git push -f git@github.com:<USERNAME>/<REPO>.git master:gh-pages
|
||||
|
||||
cd -
|
@ -1,47 +0,0 @@
|
||||
const config = {
|
||||
title: '简约而不简单的文档',
|
||||
themeConfig: {
|
||||
repo: 'https://github.com/xiaoxian521',
|
||||
docsDir: 'docs',
|
||||
locales: {
|
||||
'/': {
|
||||
lang: 'zh-CN',
|
||||
nav: [
|
||||
{ text: '书写规范', link: '/zh/standard/' },
|
||||
{ text: '插件分享', link: '/zh/plugs/' },
|
||||
],
|
||||
sidebar: [
|
||||
{
|
||||
text: '简介',
|
||||
children: [
|
||||
{ text: '项目描述', link: '/zh/introduction/description' },
|
||||
{ text: '开源精神', link: '/zh/introduction/openSource' },
|
||||
{ text: '贡献者', link: '/zh/introduction/contributor' },
|
||||
{ text: '设计图及UI规范', link: '/zh/introduction/ui' },
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
'/en/': {
|
||||
lang: 'en-US',
|
||||
nav: [
|
||||
{ text: 'Standard', link: '/en/standard/' },
|
||||
{ text: 'PlugsShare', link: '/zh/plugs/' },
|
||||
],
|
||||
sidebar: [
|
||||
{
|
||||
text: 'introduction',
|
||||
children: [
|
||||
{ text: 'description', link: '/en/introduction/description' },
|
||||
{ text: 'openSource', link: '/en/introduction/openSource' },
|
||||
{ text: 'contributor', link: '/en/introduction/contributor' },
|
||||
{ text: 'DesignDrawing、UISpecification', link: '/en/introduction/ui' },
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = config
|
@ -1,8 +0,0 @@
|
||||
:tada: :100:
|
||||
::: tip
|
||||
Welcome to join the open source family. Let's look at the document on the left and explore it! :heart_eyes_cat:
|
||||
:::
|
||||
|
||||
::: warning
|
||||
This document is written by vitepress. As vitepress is being improved, it is normal to encounter small bugs in browsing :joy:
|
||||
:::
|
@ -1,33 +0,0 @@
|
||||
# contributor
|
||||
|
||||
:tada: :100:
|
||||
::: tip
|
||||
```
|
||||
和尚
|
||||
```
|
||||
GitHub:https://github.com/xiaoxian521
|
||||
:::
|
||||
|
||||
:tada: :100:
|
||||
::: tip
|
||||
```
|
||||
chenxi
|
||||
```
|
||||
GitHub:https://github.com/chenxi19950223/wxnode
|
||||
:::
|
||||
|
||||
:tada: :100:
|
||||
::: tip
|
||||
```
|
||||
ChaoSuperScholar
|
||||
```
|
||||
GitHub:https://github.com/ChaoSuperScholar/smallhouse
|
||||
:::
|
||||
|
||||
:tada: :100:
|
||||
::: tip
|
||||
```
|
||||
Yinwenxu
|
||||
```
|
||||
GitHub:https://github.com/Yinwenxu/Student
|
||||
:::
|
@ -1,8 +0,0 @@
|
||||
# description
|
||||
|
||||
### A system of adding, deleting, modifying and checking based on TS
|
||||
|
||||
## Main Technologies:
|
||||
| front end | after end | database |
|
||||
| -- |:--:| -- |
|
||||
| Vue3.0、React、Angular | Node | MySQL、MongoDB、SQlite |
|
Before Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 541 KiB |
@ -1,26 +0,0 @@
|
||||
# openSource
|
||||
|
||||
## Why contribute to open source?
|
||||
|
||||
### Improve software you rely on
|
||||
Lots of open source contributors start by being users of software they contribute to. When you find a bug in an open source software you use, you may want to look at the source to see if you can patch it yourself. If that’s the case, then contributing the patch back is the best way to ensure that your friends (and yourself when you update to the next release) will be able to benefit from it.
|
||||
|
||||
### Improve existing skills
|
||||
Whether it’s coding, user interface design, graphic design, writing, or organizing, if you’re looking for practice, there’s a task for you on an open source project.
|
||||
|
||||
### Meet people who are interested in similar things
|
||||
Open source projects with warm, welcoming communities keep people coming back for years. Many people form lifelong friendships through their participation in open source, whether it’s running into each other at conferences or late night online chats about burritos.
|
||||
|
||||
### Find mentors and teach others
|
||||
Working with others on a shared project means you’ll have to explain how you do things, as well as ask other people for help. The acts of learning and teaching can be a fulfilling activity for everyone involved.
|
||||
|
||||
### Build public artifacts that help you grow a reputation (and a career)
|
||||
By definition, all of your open source work is public, which means you get free examples to take anywhere as a demonstration of what you can do.
|
||||
|
||||
### Learn people skills
|
||||
Open source offers opportunities to practice leadership and management skills, such as resolving conflicts, organizing teams of people, and prioritizing work.
|
||||
|
||||
### It’s empowering to be able to make changes, even small ones
|
||||
You don’t have to become a lifelong contributor to enjoy participating in open source. Have you ever seen a typo on a website, and wished someone would fix it? On an open source project, you can do just that. Open source helps people feel agency over their lives and how they experience the world, and that in itself is gratifying.
|
||||
|
||||
### You can learn about the open source spirit here: http://opensource.guide/
|
@ -1,15 +0,0 @@
|
||||
## UI specification
|
||||
#### 1. A good "product" reflects your cultural and aesthetic details, ha ha, try to unify the page effect! :grin:
|
||||
#### 2. Using the unified icon, I will pull you into the corresponding iconfont project :kissing_heart:
|
||||
|
||||
## Design drawings
|
||||
|
||||

|
||||
#### Background image (right click to save as picture)
|
||||

|
||||
#### Login page
|
||||

|
||||
#### Register page
|
||||
|
||||
## Project reference address (UI appearance)
|
||||
http://beautiful.panm.cn/vue-admin-beautiful-pro/?hmsr=github&hmpl=&hmcu=&hmkw=&hmci=#/login?redirect=%2Findex
|
Before Width: | Height: | Size: 243 KiB |
Before Width: | Height: | Size: 252 KiB |
@ -1,37 +0,0 @@
|
||||
## 1. VsCode Plugs
|
||||
|
||||
please install TSLint、Vetur、vscode-icons、ES7 React
|
||||
|
||||
## 2. Quick generation of code fragment by vscode
|
||||
Ctrl+Shift+P Check configure user code fragment search vue.json Copy the code below Enter Vue in the .vue file and press enter
|
||||
```
|
||||
{
|
||||
"Vue3.0Quick template generation": {
|
||||
"prefix": "Vue3.0",
|
||||
"body": [
|
||||
"<template>",
|
||||
"\t<div>\n",
|
||||
"\t</div>",
|
||||
"</template>\n",
|
||||
"<script lang='ts'>",
|
||||
"export default {",
|
||||
"\tsetup(){",
|
||||
"\t\treturn{\n\n\t\t}",
|
||||
"\t},",
|
||||
"}",
|
||||
"</script>\n",
|
||||
"<style scoped>\n",
|
||||
"</style>",
|
||||
"$2"
|
||||
],
|
||||
"description": "Vue3.0"
|
||||
}
|
||||
}
|
||||
```
|
||||

|
||||
## 3. hyper
|
||||
|
||||

|
||||
|
||||
A beautification command panel plug-in, based on TS, version: windows, MAC, Linux
|
||||
Download address: https://hyper.is/#installation
|
@ -1,16 +0,0 @@
|
||||
# Writing Standard
|
||||
|
||||
:tada: :100:
|
||||
::: tip
|
||||
① Interface documents use swagger
|
||||
② The author must strictly abide by the tslint writing rules in the project
|
||||
③ The author must strictly follow the code naming semantics and improve the readability of the code
|
||||
④ The author must go through the unit test to ensure the usability of the code
|
||||
⑤ Typescript must be used completely to ensure code rigor and maintainability
|
||||
⑥ If the code submitted by the writer conflicts, it must be resolved first. In pushing, GIT push - f origin branch is strictly prohibited
|
||||
⑦ Put Vue code under Vue TS branch, react code under react TS branch and angular code under angular TS branch
|
||||
:::
|
||||
|
||||
::: danger
|
||||
Managers are not allowed to push or merge the code directly into the main branch. The main branch is only used to store the back-end code and document code. In this way, it avoids the need to wait for a long time to pull the code for the first time. After the code is written as a whole, it will be merged into the main branch
|
||||
:::
|
@ -1,12 +0,0 @@
|
||||
:tada: :100:
|
||||
::: tip
|
||||
欢迎加入开源大家庭,下面让我们来查看左侧文档进行相关探索吧!:heart_eyes_cat:
|
||||
:::
|
||||
|
||||
::: warning
|
||||
本文档采用vitepress编写,因vitepress正在完善中,浏览中如遇小bug是正常现象。 :joy:
|
||||
:::
|
||||
|
||||
::: danger
|
||||
开发者可能都是比较忙的,感谢付出你的时间来开发此项目,进程会慢,但一定会做完,加油! :thumbsup:
|
||||
:::
|
@ -1,32 +0,0 @@
|
||||
# 贡献者
|
||||
|
||||
:tada: :100:
|
||||
::: tip
|
||||
```
|
||||
和尚
|
||||
```
|
||||
GitHub:https://github.com/xiaoxian521
|
||||
:::
|
||||
|
||||
:tada: :100:
|
||||
::: tip
|
||||
```
|
||||
chenxi
|
||||
```
|
||||
GitHub:https://github.com/chenxi19950223/wxnode
|
||||
:::
|
||||
|
||||
:tada: :100:
|
||||
::: tip
|
||||
```
|
||||
ChaoSuperScholar
|
||||
```
|
||||
GitHub:https://github.com/ChaoSuperScholar/smallhouse
|
||||
:::
|
||||
|
||||
:tada: :100:
|
||||
::: tip
|
||||
```
|
||||
Yinwenxu
|
||||
```
|
||||
:::
|
@ -1,8 +0,0 @@
|
||||
# 项目描述
|
||||
|
||||
### 一套整体基于TS的增删改查系统
|
||||
|
||||
## 主要技术:
|
||||
| 前端 | 后端 | 数据库 |
|
||||
| -- |:--:| -- |
|
||||
| Vue3.0、React、Angular | Node | MySQL、MongoDB、SQlite |
|
Before Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 541 KiB |
@ -1,23 +0,0 @@
|
||||
# 开源精神
|
||||
|
||||
## 为什么要为开源做贡献?
|
||||
|
||||
### 巩固现有技能
|
||||
无论是撰写代码、设计用户界面、图形设计、撰写文档、亦或是组织活动,假如你有实践的愿望,你总能在开源项目中找到自己的位置。
|
||||
|
||||
### 遇见那些和你”臭味相投”的人
|
||||
开源项目一般都会有一个和谐、热心的社区,以让大家团结一致。实际上,开源界经常发生这样的情形,很多人的深厚友谊都是通过共同参与开源所建立起来的,至于具体的方式,可能是在一次技术研讨会上相谈甚欢,也可能是一直在聊天室中探讨问题。
|
||||
|
||||
### 寻找导师,并且尝试帮助他人
|
||||
和他人共同在一个共享的项目下工作,这意味着需要向他人解释清楚自己是如何做的,同理,也需要向他人求助,询问别人是如何做的。相互学习和彼此教学对于每位参与者都能满载而归。
|
||||
|
||||
### 在公众间建立你的声誉(职业口碑)
|
||||
根据开源的定义,你在开源下所有的工作都是公开的,这也就意味着开源项目是一个很好展示你实力的地方。
|
||||
|
||||
### 学习领导和管理的艺术
|
||||
开源为实践领导力和管理技能提供了很好的机会,比如解决冲突、组织团队、工作的优先级排列。
|
||||
|
||||
### 鼓励作出改变,哪怕改变是很微小的
|
||||
在开源的世界里,作出贡献的不一定非得是花了很长时间拥有大量经验的人。你是否遇到过浏览某些网站发现有拼写错误,希望有人能修改它?其实,在开源的项目中,你只需要做就可以了。没有那么多的顾忌,开源让人们在很舒服的状态做事,而这才是这个世界应有的体验。
|
||||
|
||||
### 关于开源精神你可以来这里学习:http://opensource.guide/zh-hans/
|
@ -1,15 +0,0 @@
|
||||
## UI规范
|
||||
#### 1. 一款好的“产品”体现了您的文化、审美底蕴,哈哈,尽量页面效果统一! :grin:
|
||||
#### 2. 使用统一的icon,我会拉你们进对应的iconfont项目! :kissing_heart:
|
||||
|
||||
## 设计图
|
||||
|
||||

|
||||
#### 背景图(可右键另存为图片)
|
||||

|
||||
#### 登录页
|
||||

|
||||
#### 注册页
|
||||
|
||||
## 项目参考地址(UI外观)
|
||||
http://beautiful.panm.cn/vue-admin-beautiful-pro/?hmsr=github&hmpl=&hmcu=&hmkw=&hmci=#/login?redirect=%2Findex
|
Before Width: | Height: | Size: 243 KiB |
Before Width: | Height: | Size: 252 KiB |
@ -1,38 +0,0 @@
|
||||
## 1. VsCode插件
|
||||
|
||||
请安装TSLint、Vetur、vscode-icons、ES7 React
|
||||
|
||||
## 2. VsCode快速生成代码片段
|
||||
Ctrl+Shift+P 选中配置用户代码片段 搜索vue.json,将下面代码复制进去,在.vue文件输入vue回车即可
|
||||
```
|
||||
{
|
||||
"Vue3.0快速生成模板": {
|
||||
"prefix": "Vue3.0",
|
||||
"body": [
|
||||
"<template>",
|
||||
"\t<div>\n",
|
||||
"\t</div>",
|
||||
"</template>\n",
|
||||
"<script lang='ts'>",
|
||||
"export default {",
|
||||
"\tsetup(){",
|
||||
"\t\treturn{\n\n\t\t}",
|
||||
"\t},",
|
||||
"}",
|
||||
"</script>\n",
|
||||
"<style scoped>\n",
|
||||
"</style>",
|
||||
"$2"
|
||||
],
|
||||
"description": "Vue3.0"
|
||||
}
|
||||
}
|
||||
```
|
||||

|
||||
|
||||
## 3. hyper
|
||||
|
||||

|
||||
|
||||
一款美化命令面板插件,基于TS,版本:windows、mac、linux
|
||||
下载地址:https://hyper.is/#installation
|
@ -1,16 +0,0 @@
|
||||
# 书写规范
|
||||
|
||||
:tada: :100:
|
||||
::: tip
|
||||
① 接口文档使用Swagger
|
||||
② 编写者必须严格遵守项目中tslint编写规则
|
||||
③ 编写者必须严格遵循代码命名语义化、提高代码可读性
|
||||
④ 编写者编写代码完毕必须经过单元测试,保证代码可用性
|
||||
⑤ 编写必须完全使用TypeScript,保证代码严谨性、可维护性
|
||||
⑥ 编写者提交代码发生冲突,必须先解决,在推送,严禁使用git push -f origin 分支
|
||||
⑦ vue代码请放在vue-ts分支下,react代码请放在react-ts分支下,angular代码请放在angular-ts分支下
|
||||
:::
|
||||
|
||||
::: danger
|
||||
管理者严禁将代码直接推送或合并到main分支,main分支只用来存放后端代码和文档代码,这样避免了首次拉取代码需要等很长时间,代码整体编写完毕后会合并到main分支
|
||||
:::
|
262
index.html
Normal file
@ -0,0 +1,262 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<link rel="stylesheet" href="/iconfont.css" />
|
||||
<link rel="stylesheet" href="/animate.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>后台管理系统</title>
|
||||
<script src="https://cdn.bootcdn.net/ajax/libs/Sortable/1.13.0/Sortable.js"></script>
|
||||
<script>
|
||||
window.process = {}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<style>
|
||||
html,
|
||||
body,
|
||||
#app {
|
||||
height: 100%;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.chromeframe {
|
||||
margin: 0.2em 0;
|
||||
background: #ccc;
|
||||
color: #000;
|
||||
padding: 0.2em 0;
|
||||
}
|
||||
|
||||
#loader-wrapper {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 999999;
|
||||
}
|
||||
|
||||
#loader {
|
||||
display: block;
|
||||
position: relative;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
margin: -75px 0 0 -75px;
|
||||
border-radius: 50%;
|
||||
border: 3px solid transparent;
|
||||
/* COLOR 1 */
|
||||
border-top-color: #FFF;
|
||||
-webkit-animation: spin 2s linear infinite;
|
||||
/* Chrome, Opera 15+, Safari 5+ */
|
||||
-ms-animation: spin 2s linear infinite;
|
||||
/* Chrome, Opera 15+, Safari 5+ */
|
||||
-moz-animation: spin 2s linear infinite;
|
||||
/* Chrome, Opera 15+, Safari 5+ */
|
||||
-o-animation: spin 2s linear infinite;
|
||||
/* Chrome, Opera 15+, Safari 5+ */
|
||||
animation: spin 2s linear infinite;
|
||||
/* Chrome, Firefox 16+, IE 10+, Opera */
|
||||
z-index: 1001;
|
||||
}
|
||||
|
||||
#loader:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 5px;
|
||||
right: 5px;
|
||||
bottom: 5px;
|
||||
border-radius: 50%;
|
||||
border: 3px solid transparent;
|
||||
/* COLOR 2 */
|
||||
border-top-color: #FFF;
|
||||
-webkit-animation: spin 3s linear infinite;
|
||||
/* Chrome, Opera 15+, Safari 5+ */
|
||||
-moz-animation: spin 3s linear infinite;
|
||||
/* Chrome, Opera 15+, Safari 5+ */
|
||||
-o-animation: spin 3s linear infinite;
|
||||
/* Chrome, Opera 15+, Safari 5+ */
|
||||
-ms-animation: spin 3s linear infinite;
|
||||
/* Chrome, Opera 15+, Safari 5+ */
|
||||
animation: spin 3s linear infinite;
|
||||
/* Chrome, Firefox 16+, IE 10+, Opera */
|
||||
}
|
||||
|
||||
#loader:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
left: 15px;
|
||||
right: 15px;
|
||||
bottom: 15px;
|
||||
border-radius: 50%;
|
||||
border: 3px solid transparent;
|
||||
border-top-color: #FFF;
|
||||
/* COLOR 3 */
|
||||
-moz-animation: spin 1.5s linear infinite;
|
||||
/* Chrome, Opera 15+, Safari 5+ */
|
||||
-o-animation: spin 1.5s linear infinite;
|
||||
/* Chrome, Opera 15+, Safari 5+ */
|
||||
-ms-animation: spin 1.5s linear infinite;
|
||||
/* Chrome, Opera 15+, Safari 5+ */
|
||||
-webkit-animation: spin 1.5s linear infinite;
|
||||
/* Chrome, Opera 15+, Safari 5+ */
|
||||
animation: spin 1.5s linear infinite;
|
||||
/* Chrome, Firefox 16+, IE 10+, Opera */
|
||||
}
|
||||
|
||||
@-webkit-keyframes spin {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
/* Chrome, Opera 15+, Safari 3.1+ */
|
||||
-ms-transform: rotate(0deg);
|
||||
/* IE 9 */
|
||||
transform: rotate(0deg);
|
||||
/* Firefox 16+, IE 10+, Opera */
|
||||
}
|
||||
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
/* Chrome, Opera 15+, Safari 3.1+ */
|
||||
-ms-transform: rotate(360deg);
|
||||
/* IE 9 */
|
||||
transform: rotate(360deg);
|
||||
/* Firefox 16+, IE 10+, Opera */
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
/* Chrome, Opera 15+, Safari 3.1+ */
|
||||
-ms-transform: rotate(0deg);
|
||||
/* IE 9 */
|
||||
transform: rotate(0deg);
|
||||
/* Firefox 16+, IE 10+, Opera */
|
||||
}
|
||||
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
/* Chrome, Opera 15+, Safari 3.1+ */
|
||||
-ms-transform: rotate(360deg);
|
||||
/* IE 9 */
|
||||
transform: rotate(360deg);
|
||||
/* Firefox 16+, IE 10+, Opera */
|
||||
}
|
||||
}
|
||||
|
||||
#loader-wrapper .loader-section {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
width: 51%;
|
||||
height: 100%;
|
||||
background: #5d94f8;
|
||||
/* Old browsers */
|
||||
z-index: 1000;
|
||||
-webkit-transform: translateX(0);
|
||||
/* Chrome, Opera 15+, Safari 3.1+ */
|
||||
-ms-transform: translateX(0);
|
||||
/* IE 9 */
|
||||
transform: translateX(0);
|
||||
/* Firefox 16+, IE 10+, Opera */
|
||||
}
|
||||
|
||||
#loader-wrapper .loader-section.section-left {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
#loader-wrapper .loader-section.section-right {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
/* Loaded */
|
||||
.loaded #loader-wrapper .loader-section.section-left {
|
||||
-webkit-transform: translateX(-100%);
|
||||
/* Chrome, Opera 15+, Safari 3.1+ */
|
||||
-ms-transform: translateX(-100%);
|
||||
/* IE 9 */
|
||||
transform: translateX(-100%);
|
||||
/* Firefox 16+, IE 10+, Opera */
|
||||
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
|
||||
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
|
||||
}
|
||||
|
||||
.loaded #loader-wrapper .loader-section.section-right {
|
||||
-webkit-transform: translateX(100%);
|
||||
/* Chrome, Opera 15+, Safari 3.1+ */
|
||||
-ms-transform: translateX(100%);
|
||||
/* IE 9 */
|
||||
transform: translateX(100%);
|
||||
/* Firefox 16+, IE 10+, Opera */
|
||||
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
|
||||
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
|
||||
}
|
||||
|
||||
.loaded #loader {
|
||||
opacity: 0;
|
||||
-webkit-transition: all 0.3s ease-out;
|
||||
transition: all 0.3s ease-out;
|
||||
}
|
||||
|
||||
.loaded #loader-wrapper {
|
||||
visibility: hidden;
|
||||
-webkit-transform: translateY(-100%);
|
||||
/* Chrome, Opera 15+, Safari 3.1+ */
|
||||
-ms-transform: translateY(-100%);
|
||||
/* IE 9 */
|
||||
transform: translateY(-100%);
|
||||
/* Firefox 16+, IE 10+, Opera */
|
||||
-webkit-transition: all 0.3s 1s ease-out;
|
||||
transition: all 0.3s 1s ease-out;
|
||||
}
|
||||
|
||||
/* JavaScript Turned Off */
|
||||
.no-js #loader-wrapper {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.no-js h1 {
|
||||
color: #222222;
|
||||
}
|
||||
|
||||
#loader-wrapper .load_title {
|
||||
font-family: 'Open Sans';
|
||||
color: #FFF;
|
||||
font-size: 19px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
z-index: 9999999999999;
|
||||
position: absolute;
|
||||
top: 60%;
|
||||
opacity: 1;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
#loader-wrapper .load_title span {
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
font-size: 13px;
|
||||
color: #FFF;
|
||||
opacity: 0.5;
|
||||
}
|
||||
</style>
|
||||
<div id="loader-wrapper">
|
||||
<div id="loader"></div>
|
||||
<div class="loader-section section-left"></div>
|
||||
<div class="loader-section section-right"></div>
|
||||
<div class="load_title">加载中,请耐心等待...
|
||||
<br>
|
||||
<span id="version">V0.0.1</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
15
node_modules/.bin/esparse
generated
vendored
@ -1,15 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../esprima/bin/esparse.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../esprima/bin/esparse.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
17
node_modules/.bin/esparse.cmd
generated
vendored
@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
"%_prog%" "%dp0%\..\esprima\bin\esparse.js" %*
|
||||
ENDLOCAL
|
||||
EXIT /b %errorlevel%
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
18
node_modules/.bin/esparse.ps1
generated
vendored
@ -1,18 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
& "$basedir/node$exe" "$basedir/../esprima/bin/esparse.js" $args
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
& "node$exe" "$basedir/../esprima/bin/esparse.js" $args
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
15
node_modules/.bin/esvalidate
generated
vendored
@ -1,15 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../esprima/bin/esvalidate.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../esprima/bin/esvalidate.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
17
node_modules/.bin/esvalidate.cmd
generated
vendored
@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
"%_prog%" "%dp0%\..\esprima\bin\esvalidate.js" %*
|
||||
ENDLOCAL
|
||||
EXIT /b %errorlevel%
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
18
node_modules/.bin/esvalidate.ps1
generated
vendored
@ -1,18 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
& "$basedir/node$exe" "$basedir/../esprima/bin/esvalidate.js" $args
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
& "node$exe" "$basedir/../esprima/bin/esvalidate.js" $args
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
15
node_modules/.bin/is-docker
generated
vendored
@ -1,15 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../is-docker/cli.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../is-docker/cli.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
17
node_modules/.bin/is-docker.cmd
generated
vendored
@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
"%_prog%" "%dp0%\..\is-docker\cli.js" %*
|
||||
ENDLOCAL
|
||||
EXIT /b %errorlevel%
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
18
node_modules/.bin/is-docker.ps1
generated
vendored
@ -1,18 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
& "$basedir/node$exe" "$basedir/../is-docker/cli.js" $args
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
& "node$exe" "$basedir/../is-docker/cli.js" $args
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
15
node_modules/.bin/js-yaml
generated
vendored
@ -1,15 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../js-yaml/bin/js-yaml.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../js-yaml/bin/js-yaml.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
17
node_modules/.bin/js-yaml.cmd
generated
vendored
@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
"%_prog%" "%dp0%\..\js-yaml\bin\js-yaml.js" %*
|
||||
ENDLOCAL
|
||||
EXIT /b %errorlevel%
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
18
node_modules/.bin/js-yaml.ps1
generated
vendored
@ -1,18 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
& "$basedir/node$exe" "$basedir/../js-yaml/bin/js-yaml.js" $args
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
& "node$exe" "$basedir/../js-yaml/bin/js-yaml.js" $args
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
15
node_modules/.bin/markdown-it
generated
vendored
@ -1,15 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../markdown-it/bin/markdown-it.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../markdown-it/bin/markdown-it.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
17
node_modules/.bin/markdown-it.cmd
generated
vendored
@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
"%_prog%" "%dp0%\..\markdown-it\bin\markdown-it.js" %*
|
||||
ENDLOCAL
|
||||
EXIT /b %errorlevel%
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
18
node_modules/.bin/markdown-it.ps1
generated
vendored
@ -1,18 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
& "$basedir/node$exe" "$basedir/../markdown-it/bin/markdown-it.js" $args
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
& "node$exe" "$basedir/../markdown-it/bin/markdown-it.js" $args
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
15
node_modules/.bin/node-which
generated
vendored
@ -1,15 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../which/bin/node-which" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../which/bin/node-which" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
17
node_modules/.bin/node-which.cmd
generated
vendored
@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
"%_prog%" "%dp0%\..\which\bin\node-which" %*
|
||||
ENDLOCAL
|
||||
EXIT /b %errorlevel%
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
18
node_modules/.bin/node-which.ps1
generated
vendored
@ -1,18 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
& "$basedir/node$exe" "$basedir/../which/bin/node-which" $args
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
& "node$exe" "$basedir/../which/bin/node-which" $args
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
15
node_modules/.bin/terser
generated
vendored
@ -1,15 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../terser/bin/terser" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../terser/bin/terser" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
17
node_modules/.bin/terser.cmd
generated
vendored
@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
"%_prog%" "%dp0%\..\terser\bin\terser" %*
|
||||
ENDLOCAL
|
||||
EXIT /b %errorlevel%
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
18
node_modules/.bin/terser.ps1
generated
vendored
@ -1,18 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
& "$basedir/node$exe" "$basedir/../terser/bin/terser" $args
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
& "node$exe" "$basedir/../terser/bin/terser" $args
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
15
node_modules/.bin/vitepress
generated
vendored
@ -1,15 +0,0 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../vitepress/bin/vitepress.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../vitepress/bin/vitepress.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
17
node_modules/.bin/vitepress.cmd
generated
vendored
@ -1,17 +0,0 @@
|
||||
@ECHO off
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
"%_prog%" "%dp0%\..\vitepress\bin\vitepress.js" %*
|
||||
ENDLOCAL
|
||||
EXIT /b %errorlevel%
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
18
node_modules/.bin/vitepress.ps1
generated
vendored
@ -1,18 +0,0 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
& "$basedir/node$exe" "$basedir/../vitepress/bin/vitepress.js" $args
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
& "node$exe" "$basedir/../vitepress/bin/vitepress.js" $args
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
1
node_modules/.vite_opt_cache/hash
generated
vendored
@ -1 +0,0 @@
|
||||
Q2anvQHGddPtypewx/fx89wZxo4=
|
22
node_modules/@babel/code-frame/LICENSE
generated
vendored
@ -1,22 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
19
node_modules/@babel/code-frame/README.md
generated
vendored
@ -1,19 +0,0 @@
|
||||
# @babel/code-frame
|
||||
|
||||
> Generate errors that contain a code frame that point to source locations.
|
||||
|
||||
See our website [@babel/code-frame](https://babeljs.io/docs/en/next/babel-code-frame.html) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/code-frame
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/code-frame --dev
|
||||
```
|
167
node_modules/@babel/code-frame/lib/index.js
generated
vendored
@ -1,167 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.codeFrameColumns = codeFrameColumns;
|
||||
exports.default = _default;
|
||||
|
||||
var _highlight = _interopRequireWildcard(require("@babel/highlight"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
let deprecationWarningShown = false;
|
||||
|
||||
function getDefs(chalk) {
|
||||
return {
|
||||
gutter: chalk.grey,
|
||||
marker: chalk.red.bold,
|
||||
message: chalk.red.bold
|
||||
};
|
||||
}
|
||||
|
||||
const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
||||
|
||||
function getMarkerLines(loc, source, opts) {
|
||||
const startLoc = Object.assign({
|
||||
column: 0,
|
||||
line: -1
|
||||
}, loc.start);
|
||||
const endLoc = Object.assign({}, startLoc, loc.end);
|
||||
const {
|
||||
linesAbove = 2,
|
||||
linesBelow = 3
|
||||
} = opts || {};
|
||||
const startLine = startLoc.line;
|
||||
const startColumn = startLoc.column;
|
||||
const endLine = endLoc.line;
|
||||
const endColumn = endLoc.column;
|
||||
let start = Math.max(startLine - (linesAbove + 1), 0);
|
||||
let end = Math.min(source.length, endLine + linesBelow);
|
||||
|
||||
if (startLine === -1) {
|
||||
start = 0;
|
||||
}
|
||||
|
||||
if (endLine === -1) {
|
||||
end = source.length;
|
||||
}
|
||||
|
||||
const lineDiff = endLine - startLine;
|
||||
const markerLines = {};
|
||||
|
||||
if (lineDiff) {
|
||||
for (let i = 0; i <= lineDiff; i++) {
|
||||
const lineNumber = i + startLine;
|
||||
|
||||
if (!startColumn) {
|
||||
markerLines[lineNumber] = true;
|
||||
} else if (i === 0) {
|
||||
const sourceLength = source[lineNumber - 1].length;
|
||||
markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
|
||||
} else if (i === lineDiff) {
|
||||
markerLines[lineNumber] = [0, endColumn];
|
||||
} else {
|
||||
const sourceLength = source[lineNumber - i].length;
|
||||
markerLines[lineNumber] = [0, sourceLength];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (startColumn === endColumn) {
|
||||
if (startColumn) {
|
||||
markerLines[startLine] = [startColumn, 0];
|
||||
} else {
|
||||
markerLines[startLine] = true;
|
||||
}
|
||||
} else {
|
||||
markerLines[startLine] = [startColumn, endColumn - startColumn];
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
start,
|
||||
end,
|
||||
markerLines
|
||||
};
|
||||
}
|
||||
|
||||
function codeFrameColumns(rawLines, loc, opts = {}) {
|
||||
const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);
|
||||
const chalk = (0, _highlight.getChalk)(opts);
|
||||
const defs = getDefs(chalk);
|
||||
|
||||
const maybeHighlight = (chalkFn, string) => {
|
||||
return highlighted ? chalkFn(string) : string;
|
||||
};
|
||||
|
||||
const lines = rawLines.split(NEWLINE);
|
||||
const {
|
||||
start,
|
||||
end,
|
||||
markerLines
|
||||
} = getMarkerLines(loc, lines, opts);
|
||||
const hasColumns = loc.start && typeof loc.start.column === "number";
|
||||
const numberMaxWidth = String(end).length;
|
||||
const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines;
|
||||
let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => {
|
||||
const number = start + 1 + index;
|
||||
const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
|
||||
const gutter = ` ${paddedNumber} | `;
|
||||
const hasMarker = markerLines[number];
|
||||
const lastMarkerLine = !markerLines[number + 1];
|
||||
|
||||
if (hasMarker) {
|
||||
let markerLine = "";
|
||||
|
||||
if (Array.isArray(hasMarker)) {
|
||||
const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
|
||||
const numberOfMarkers = hasMarker[1] || 1;
|
||||
markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join("");
|
||||
|
||||
if (lastMarkerLine && opts.message) {
|
||||
markerLine += " " + maybeHighlight(defs.message, opts.message);
|
||||
}
|
||||
}
|
||||
|
||||
return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join("");
|
||||
} else {
|
||||
return ` ${maybeHighlight(defs.gutter, gutter)}${line}`;
|
||||
}
|
||||
}).join("\n");
|
||||
|
||||
if (opts.message && !hasColumns) {
|
||||
frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`;
|
||||
}
|
||||
|
||||
if (highlighted) {
|
||||
return chalk.reset(frame);
|
||||
} else {
|
||||
return frame;
|
||||
}
|
||||
}
|
||||
|
||||
function _default(rawLines, lineNumber, colNumber, opts = {}) {
|
||||
if (!deprecationWarningShown) {
|
||||
deprecationWarningShown = true;
|
||||
const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
|
||||
|
||||
if (process.emitWarning) {
|
||||
process.emitWarning(message, "DeprecationWarning");
|
||||
} else {
|
||||
const deprecationError = new Error(message);
|
||||
deprecationError.name = "DeprecationWarning";
|
||||
console.warn(new Error(message));
|
||||
}
|
||||
}
|
||||
|
||||
colNumber = Math.max(colNumber, 0);
|
||||
const location = {
|
||||
start: {
|
||||
column: colNumber,
|
||||
line: lineNumber
|
||||
}
|
||||
};
|
||||
return codeFrameColumns(rawLines, location, opts);
|
||||
}
|
62
node_modules/@babel/code-frame/package.json
generated
vendored
@ -1,62 +0,0 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@babel/code-frame@7.10.4",
|
||||
"J:\\Github\\CURD-TS"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "@babel/code-frame@7.10.4",
|
||||
"_id": "@babel/code-frame@7.10.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-Fo2ho26Q2miujUnA8bSMfGJJITo=",
|
||||
"_location": "/@babel/code-frame",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@babel/code-frame@7.10.4",
|
||||
"name": "@babel/code-frame",
|
||||
"escapedName": "@babel%2fcode-frame",
|
||||
"scope": "@babel",
|
||||
"rawSpec": "7.10.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7.10.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/parse-json",
|
||||
"/rollup-plugin-terser"
|
||||
],
|
||||
"_resolved": "http://192.168.250.101:4873/@babel%2fcode-frame/-/code-frame-7.10.4.tgz",
|
||||
"_spec": "7.10.4",
|
||||
"_where": "J:\\Github\\CURD-TS",
|
||||
"author": {
|
||||
"name": "Sebastian McKenzie",
|
||||
"email": "sebmck@gmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/babel/babel/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/highlight": "^7.10.4"
|
||||
},
|
||||
"description": "Generate errors that contain a code frame that point to source locations.",
|
||||
"devDependencies": {
|
||||
"chalk": "^2.0.0",
|
||||
"strip-ansi": "^4.0.0"
|
||||
},
|
||||
"gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "@babel/code-frame",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-code-frame"
|
||||
},
|
||||
"version": "7.10.4"
|
||||
}
|
2
node_modules/@babel/helper-validator-identifier/README.md
generated
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
> Validate identifier/keywords name
|
||||
|
||||
See our website [@babel/helper-validator-identifier](https://babeljs.io/docs/en/next/babel-helper-validator-identifier.html) for more information.
|
||||
See our website [@babel/helper-validator-identifier](https://babeljs.io/docs/en/babel-helper-validator-identifier) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
|
23
node_modules/@babel/helper-validator-identifier/package.json
generated
vendored
@ -1,34 +1,32 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@babel/helper-validator-identifier@7.10.4",
|
||||
"@babel/helper-validator-identifier@7.12.11",
|
||||
"J:\\Github\\CURD-TS"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "@babel/helper-validator-identifier@7.10.4",
|
||||
"_id": "@babel/helper-validator-identifier@7.10.4",
|
||||
"_from": "@babel/helper-validator-identifier@7.12.11",
|
||||
"_id": "@babel/helper-validator-identifier@7.12.11",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-p4x6clHgH2FlEtMbEK3PUq2l4NI=",
|
||||
"_integrity": "sha1-yaHwIZF9y1zPDU5FPjmQIpgfye0=",
|
||||
"_location": "/@babel/helper-validator-identifier",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@babel/helper-validator-identifier@7.10.4",
|
||||
"raw": "@babel/helper-validator-identifier@7.12.11",
|
||||
"name": "@babel/helper-validator-identifier",
|
||||
"escapedName": "@babel%2fhelper-validator-identifier",
|
||||
"scope": "@babel",
|
||||
"rawSpec": "7.10.4",
|
||||
"rawSpec": "7.12.11",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7.10.4"
|
||||
"fetchSpec": "7.12.11"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@babel/highlight",
|
||||
"/@babel/types"
|
||||
],
|
||||
"_resolved": "http://192.168.250.101:4873/@babel%2fhelper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz",
|
||||
"_spec": "7.10.4",
|
||||
"_resolved": "http://192.168.250.101:4873/@babel%2fhelper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz",
|
||||
"_spec": "7.12.11",
|
||||
"_where": "J:\\Github\\CURD-TS",
|
||||
"bugs": {
|
||||
"url": "https://github.com/babel/babel/issues"
|
||||
@ -39,7 +37,6 @@
|
||||
"unicode-13.0.0": "^0.8.0"
|
||||
},
|
||||
"exports": "./lib/index.js",
|
||||
"gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df",
|
||||
"homepage": "https://github.com/babel/babel#readme",
|
||||
"license": "MIT",
|
||||
"main": "./lib/index.js",
|
||||
@ -52,5 +49,5 @@
|
||||
"url": "git+https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-helper-validator-identifier"
|
||||
},
|
||||
"version": "7.10.4"
|
||||
"version": "7.12.11"
|
||||
}
|
||||
|
22
node_modules/@babel/highlight/LICENSE
generated
vendored
@ -1,22 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
19
node_modules/@babel/highlight/README.md
generated
vendored
@ -1,19 +0,0 @@
|
||||
# @babel/highlight
|
||||
|
||||
> Syntax highlight JavaScript strings for output in terminals.
|
||||
|
||||
See our website [@babel/highlight](https://babeljs.io/docs/en/next/babel-highlight.html) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/highlight
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/highlight --dev
|
||||
```
|
107
node_modules/@babel/highlight/lib/index.js
generated
vendored
@ -1,107 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.shouldHighlight = shouldHighlight;
|
||||
exports.getChalk = getChalk;
|
||||
exports.default = highlight;
|
||||
|
||||
var _jsTokens = _interopRequireWildcard(require("js-tokens"));
|
||||
|
||||
var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
|
||||
|
||||
var _chalk = _interopRequireDefault(require("chalk"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function getDefs(chalk) {
|
||||
return {
|
||||
keyword: chalk.cyan,
|
||||
capitalized: chalk.yellow,
|
||||
jsx_tag: chalk.yellow,
|
||||
punctuator: chalk.yellow,
|
||||
number: chalk.magenta,
|
||||
string: chalk.green,
|
||||
regex: chalk.magenta,
|
||||
comment: chalk.grey,
|
||||
invalid: chalk.white.bgRed.bold
|
||||
};
|
||||
}
|
||||
|
||||
const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
||||
const JSX_TAG = /^[a-z][\w-]*$/i;
|
||||
const BRACKET = /^[()[\]{}]$/;
|
||||
|
||||
function getTokenType(match) {
|
||||
const [offset, text] = match.slice(-2);
|
||||
const token = (0, _jsTokens.matchToToken)(match);
|
||||
|
||||
if (token.type === "name") {
|
||||
if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isReservedWord)(token.value)) {
|
||||
return "keyword";
|
||||
}
|
||||
|
||||
if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == "</")) {
|
||||
return "jsx_tag";
|
||||
}
|
||||
|
||||
if (token.value[0] !== token.value[0].toLowerCase()) {
|
||||
return "capitalized";
|
||||
}
|
||||
}
|
||||
|
||||
if (token.type === "punctuator" && BRACKET.test(token.value)) {
|
||||
return "bracket";
|
||||
}
|
||||
|
||||
if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
|
||||
return "punctuator";
|
||||
}
|
||||
|
||||
return token.type;
|
||||
}
|
||||
|
||||
function highlightTokens(defs, text) {
|
||||
return text.replace(_jsTokens.default, function (...args) {
|
||||
const type = getTokenType(args);
|
||||
const colorize = defs[type];
|
||||
|
||||
if (colorize) {
|
||||
return args[0].split(NEWLINE).map(str => colorize(str)).join("\n");
|
||||
} else {
|
||||
return args[0];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function shouldHighlight(options) {
|
||||
return _chalk.default.supportsColor || options.forceColor;
|
||||
}
|
||||
|
||||
function getChalk(options) {
|
||||
let chalk = _chalk.default;
|
||||
|
||||
if (options.forceColor) {
|
||||
chalk = new _chalk.default.constructor({
|
||||
enabled: true,
|
||||
level: 1
|
||||
});
|
||||
}
|
||||
|
||||
return chalk;
|
||||
}
|
||||
|
||||
function highlight(code, options = {}) {
|
||||
if (shouldHighlight(options)) {
|
||||
const chalk = getChalk(options);
|
||||
const defs = getDefs(chalk);
|
||||
return highlightTokens(defs, code);
|
||||
} else {
|
||||
return code;
|
||||
}
|
||||
}
|
62
node_modules/@babel/highlight/package.json
generated
vendored
@ -1,62 +0,0 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@babel/highlight@7.10.4",
|
||||
"J:\\Github\\CURD-TS"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "@babel/highlight@7.10.4",
|
||||
"_id": "@babel/highlight@7.10.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-fRvf1ldTU4+r5sOFls23bZrGAUM=",
|
||||
"_location": "/@babel/highlight",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@babel/highlight@7.10.4",
|
||||
"name": "@babel/highlight",
|
||||
"escapedName": "@babel%2fhighlight",
|
||||
"scope": "@babel",
|
||||
"rawSpec": "7.10.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7.10.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@babel/code-frame"
|
||||
],
|
||||
"_resolved": "http://192.168.250.101:4873/@babel%2fhighlight/-/highlight-7.10.4.tgz",
|
||||
"_spec": "7.10.4",
|
||||
"_where": "J:\\Github\\CURD-TS",
|
||||
"author": {
|
||||
"name": "suchipi",
|
||||
"email": "me@suchipi.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/babel/babel/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/helper-validator-identifier": "^7.10.4",
|
||||
"chalk": "^2.0.0",
|
||||
"js-tokens": "^4.0.0"
|
||||
},
|
||||
"description": "Syntax highlight JavaScript strings for output in terminals.",
|
||||
"devDependencies": {
|
||||
"strip-ansi": "^4.0.0"
|
||||
},
|
||||
"gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "@babel/highlight",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-highlight"
|
||||
},
|
||||
"version": "7.10.4"
|
||||
}
|
532
node_modules/@babel/parser/lib/index.js
generated
vendored
2
node_modules/@babel/parser/lib/index.js.map
generated
vendored
35
node_modules/@babel/parser/lib/options.js
generated
vendored
@ -1,35 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getOptions = getOptions;
|
||||
exports.defaultOptions = void 0;
|
||||
const defaultOptions = {
|
||||
sourceType: "script",
|
||||
sourceFilename: undefined,
|
||||
startLine: 1,
|
||||
allowAwaitOutsideFunction: false,
|
||||
allowReturnOutsideFunction: false,
|
||||
allowImportExportEverywhere: false,
|
||||
allowSuperOutsideMethod: false,
|
||||
allowUndeclaredExports: false,
|
||||
plugins: [],
|
||||
strictMode: null,
|
||||
ranges: false,
|
||||
tokens: false,
|
||||
createParenthesizedExpressions: false,
|
||||
errorRecovery: false
|
||||
};
|
||||
exports.defaultOptions = defaultOptions;
|
||||
|
||||
function getOptions(opts) {
|
||||
const options = {};
|
||||
|
||||
for (let _i = 0, _Object$keys = Object.keys(defaultOptions); _i < _Object$keys.length; _i++) {
|
||||
const key = _Object$keys[_i];
|
||||
options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key];
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
24
node_modules/@babel/parser/lib/parser/base.js
generated
vendored
@ -1,24 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
class BaseParser {
|
||||
constructor() {
|
||||
this.sawUnambiguousESM = false;
|
||||
this.ambiguousScriptDifferentAst = false;
|
||||
}
|
||||
|
||||
hasPlugin(name) {
|
||||
return this.plugins.has(name);
|
||||
}
|
||||
|
||||
getPluginOption(plugin, name) {
|
||||
if (this.hasPlugin(plugin)) return this.plugins.get(plugin)[name];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = BaseParser;
|
205
node_modules/@babel/parser/lib/parser/comments.js
generated
vendored
@ -1,205 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _base = _interopRequireDefault(require("./base"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function last(stack) {
|
||||
return stack[stack.length - 1];
|
||||
}
|
||||
|
||||
class CommentsParser extends _base.default {
|
||||
addComment(comment) {
|
||||
if (this.filename) comment.loc.filename = this.filename;
|
||||
this.state.trailingComments.push(comment);
|
||||
this.state.leadingComments.push(comment);
|
||||
}
|
||||
|
||||
adjustCommentsAfterTrailingComma(node, elements, takeAllComments) {
|
||||
if (this.state.leadingComments.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
let lastElement = null;
|
||||
let i = elements.length;
|
||||
|
||||
while (lastElement === null && i > 0) {
|
||||
lastElement = elements[--i];
|
||||
}
|
||||
|
||||
if (lastElement === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (let j = 0; j < this.state.leadingComments.length; j++) {
|
||||
if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) {
|
||||
this.state.leadingComments.splice(j, 1);
|
||||
j--;
|
||||
}
|
||||
}
|
||||
|
||||
const newTrailingComments = [];
|
||||
|
||||
for (let i = 0; i < this.state.leadingComments.length; i++) {
|
||||
const leadingComment = this.state.leadingComments[i];
|
||||
|
||||
if (leadingComment.end < node.end) {
|
||||
newTrailingComments.push(leadingComment);
|
||||
|
||||
if (!takeAllComments) {
|
||||
this.state.leadingComments.splice(i, 1);
|
||||
i--;
|
||||
}
|
||||
} else {
|
||||
if (node.trailingComments === undefined) {
|
||||
node.trailingComments = [];
|
||||
}
|
||||
|
||||
node.trailingComments.push(leadingComment);
|
||||
}
|
||||
}
|
||||
|
||||
if (takeAllComments) this.state.leadingComments = [];
|
||||
|
||||
if (newTrailingComments.length > 0) {
|
||||
lastElement.trailingComments = newTrailingComments;
|
||||
} else if (lastElement.trailingComments !== undefined) {
|
||||
lastElement.trailingComments = [];
|
||||
}
|
||||
}
|
||||
|
||||
processComment(node) {
|
||||
if (node.type === "Program" && node.body.length > 0) return;
|
||||
const stack = this.state.commentStack;
|
||||
let firstChild, lastChild, trailingComments, i, j;
|
||||
|
||||
if (this.state.trailingComments.length > 0) {
|
||||
if (this.state.trailingComments[0].start >= node.end) {
|
||||
trailingComments = this.state.trailingComments;
|
||||
this.state.trailingComments = [];
|
||||
} else {
|
||||
this.state.trailingComments.length = 0;
|
||||
}
|
||||
} else if (stack.length > 0) {
|
||||
const lastInStack = last(stack);
|
||||
|
||||
if (lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) {
|
||||
trailingComments = lastInStack.trailingComments;
|
||||
delete lastInStack.trailingComments;
|
||||
}
|
||||
}
|
||||
|
||||
if (stack.length > 0 && last(stack).start >= node.start) {
|
||||
firstChild = stack.pop();
|
||||
}
|
||||
|
||||
while (stack.length > 0 && last(stack).start >= node.start) {
|
||||
lastChild = stack.pop();
|
||||
}
|
||||
|
||||
if (!lastChild && firstChild) lastChild = firstChild;
|
||||
|
||||
if (firstChild) {
|
||||
switch (node.type) {
|
||||
case "ObjectExpression":
|
||||
this.adjustCommentsAfterTrailingComma(node, node.properties);
|
||||
break;
|
||||
|
||||
case "ObjectPattern":
|
||||
this.adjustCommentsAfterTrailingComma(node, node.properties, true);
|
||||
break;
|
||||
|
||||
case "CallExpression":
|
||||
this.adjustCommentsAfterTrailingComma(node, node.arguments);
|
||||
break;
|
||||
|
||||
case "ArrayExpression":
|
||||
this.adjustCommentsAfterTrailingComma(node, node.elements);
|
||||
break;
|
||||
|
||||
case "ArrayPattern":
|
||||
this.adjustCommentsAfterTrailingComma(node, node.elements, true);
|
||||
break;
|
||||
}
|
||||
} else if (this.state.commentPreviousNode && (this.state.commentPreviousNode.type === "ImportSpecifier" && node.type !== "ImportSpecifier" || this.state.commentPreviousNode.type === "ExportSpecifier" && node.type !== "ExportSpecifier")) {
|
||||
this.adjustCommentsAfterTrailingComma(node, [this.state.commentPreviousNode]);
|
||||
}
|
||||
|
||||
if (lastChild) {
|
||||
if (lastChild.leadingComments) {
|
||||
if (lastChild !== node && lastChild.leadingComments.length > 0 && last(lastChild.leadingComments).end <= node.start) {
|
||||
node.leadingComments = lastChild.leadingComments;
|
||||
delete lastChild.leadingComments;
|
||||
} else {
|
||||
for (i = lastChild.leadingComments.length - 2; i >= 0; --i) {
|
||||
if (lastChild.leadingComments[i].end <= node.start) {
|
||||
node.leadingComments = lastChild.leadingComments.splice(0, i + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (this.state.leadingComments.length > 0) {
|
||||
if (last(this.state.leadingComments).end <= node.start) {
|
||||
if (this.state.commentPreviousNode) {
|
||||
for (j = 0; j < this.state.leadingComments.length; j++) {
|
||||
if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) {
|
||||
this.state.leadingComments.splice(j, 1);
|
||||
j--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.state.leadingComments.length > 0) {
|
||||
node.leadingComments = this.state.leadingComments;
|
||||
this.state.leadingComments = [];
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < this.state.leadingComments.length; i++) {
|
||||
if (this.state.leadingComments[i].end > node.start) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const leadingComments = this.state.leadingComments.slice(0, i);
|
||||
|
||||
if (leadingComments.length) {
|
||||
node.leadingComments = leadingComments;
|
||||
}
|
||||
|
||||
trailingComments = this.state.leadingComments.slice(i);
|
||||
|
||||
if (trailingComments.length === 0) {
|
||||
trailingComments = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.state.commentPreviousNode = node;
|
||||
|
||||
if (trailingComments) {
|
||||
if (trailingComments.length && trailingComments[0].start >= node.start && last(trailingComments).end <= node.end) {
|
||||
node.innerComments = trailingComments;
|
||||
} else {
|
||||
const firstTrailingCommentIndex = trailingComments.findIndex(comment => comment.end >= node.end);
|
||||
|
||||
if (firstTrailingCommentIndex > 0) {
|
||||
node.innerComments = trailingComments.slice(0, firstTrailingCommentIndex);
|
||||
node.trailingComments = trailingComments.slice(firstTrailingCommentIndex);
|
||||
} else {
|
||||
node.trailingComments = trailingComments;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stack.push(node);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = CommentsParser;
|
154
node_modules/@babel/parser/lib/parser/error-message.js
generated
vendored
@ -1,154 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.ErrorMessages = void 0;
|
||||
const ErrorMessages = Object.freeze({
|
||||
AccessorIsGenerator: "A %0ter cannot be a generator",
|
||||
ArgumentsInClass: "'arguments' is only allowed in functions and class methods",
|
||||
AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block",
|
||||
AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function",
|
||||
AwaitExpressionFormalParameter: "await is not allowed in async function parameters",
|
||||
AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules",
|
||||
AwaitNotInAsyncFunction: "'await' is only allowed within async functions",
|
||||
BadGetterArity: "getter must not have any formal parameters",
|
||||
BadSetterArity: "setter must have exactly one formal parameter",
|
||||
BadSetterRestParameter: "setter function argument must not be a rest parameter",
|
||||
ConstructorClassField: "Classes may not have a field named 'constructor'",
|
||||
ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'",
|
||||
ConstructorIsAccessor: "Class constructor may not be an accessor",
|
||||
ConstructorIsAsync: "Constructor can't be an async function",
|
||||
ConstructorIsGenerator: "Constructor can't be a generator",
|
||||
DeclarationMissingInitializer: "%0 require an initialization value",
|
||||
DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax",
|
||||
DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",
|
||||
DecoratorExportClass: "Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.",
|
||||
DecoratorSemicolon: "Decorators must not be followed by a semicolon",
|
||||
DecoratorStaticBlock: "Decorators can't be used with a static block",
|
||||
DeletePrivateField: "Deleting a private field is not allowed",
|
||||
DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.",
|
||||
DuplicateConstructor: "Duplicate constructor in the same class",
|
||||
DuplicateDefaultExport: "Only one default export allowed per module.",
|
||||
DuplicateExport: "`%0` has already been exported. Exported identifiers must be unique.",
|
||||
DuplicateProto: "Redefinition of __proto__ property",
|
||||
DuplicateRegExpFlags: "Duplicate regular expression flag",
|
||||
DuplicateStaticBlock: "Duplicate static block in the same class",
|
||||
ElementAfterRest: "Rest element must be last element",
|
||||
EscapedCharNotAnIdentifier: "Invalid Unicode escape",
|
||||
ExportBindingIsString: "A string literal cannot be used as an exported binding without `from`.\n- Did you mean `export { %0 as '%1' } from 'some-module'`?",
|
||||
ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'",
|
||||
ForInOfLoopInitializer: "%0 loop variable declaration may not have an initializer",
|
||||
GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block",
|
||||
IllegalBreakContinue: "Unsyntactic %0",
|
||||
IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list",
|
||||
IllegalReturn: "'return' outside of function",
|
||||
ImportBindingIsString: 'A string literal cannot be used as an imported binding.\n- Did you mean `import { "%0" as foo }`?',
|
||||
ImportCallArgumentTrailingComma: "Trailing comma is disallowed inside import(...) arguments",
|
||||
ImportCallArity: "import() requires exactly %0",
|
||||
ImportCallNotNewExpression: "Cannot use new with import(...)",
|
||||
ImportCallSpreadArgument: "... is not allowed in import()",
|
||||
ImportMetaOutsideModule: `import.meta may appear only with 'sourceType: "module"'`,
|
||||
ImportOutsideModule: `'import' and 'export' may appear only with 'sourceType: "module"'`,
|
||||
InvalidBigIntLiteral: "Invalid BigIntLiteral",
|
||||
InvalidCodePoint: "Code point out of bounds",
|
||||
InvalidDecimal: "Invalid decimal",
|
||||
InvalidDigit: "Expected number in radix %0",
|
||||
InvalidEscapeSequence: "Bad character escape sequence",
|
||||
InvalidEscapeSequenceTemplate: "Invalid escape sequence in template",
|
||||
InvalidEscapedReservedWord: "Escape sequence in keyword %0",
|
||||
InvalidIdentifier: "Invalid identifier %0",
|
||||
InvalidLhs: "Invalid left-hand side in %0",
|
||||
InvalidLhsBinding: "Binding invalid left-hand side in %0",
|
||||
InvalidNumber: "Invalid number",
|
||||
InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'",
|
||||
InvalidOrUnexpectedToken: "Unexpected character '%0'",
|
||||
InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern",
|
||||
InvalidPrivateFieldResolution: "Private name #%0 is not defined",
|
||||
InvalidPropertyBindingPattern: "Binding member expression",
|
||||
InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions",
|
||||
InvalidRestAssignmentPattern: "Invalid rest operator's argument",
|
||||
LabelRedeclaration: "Label '%0' is already declared",
|
||||
LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations.",
|
||||
LineTerminatorBeforeArrow: "No line break is allowed before '=>'",
|
||||
MalformedRegExpFlags: "Invalid regular expression flag",
|
||||
MissingClassName: "A class name is required",
|
||||
MissingEqInAssignment: "Only '=' operator can be used for specifying default value.",
|
||||
MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX",
|
||||
MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators",
|
||||
ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`",
|
||||
ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values",
|
||||
ModuleAttributesWithDuplicateKeys: 'Duplicate key "%0" is not allowed in module attributes',
|
||||
ModuleExportNameHasLoneSurrogate: "An export name cannot include a lone surrogate, found '\\u%0'",
|
||||
ModuleExportUndefined: "Export '%0' is not defined",
|
||||
MultipleDefaultsInSwitch: "Multiple default clauses",
|
||||
NewlineAfterThrow: "Illegal newline after throw",
|
||||
NoCatchOrFinally: "Missing catch or finally clause",
|
||||
NumberIdentifier: "Identifier directly after number",
|
||||
NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences",
|
||||
ObsoleteAwaitStar: "await* has been removed from the async functions proposal. Use Promise.all() instead.",
|
||||
OptionalChainingNoNew: "constructors in/after an Optional Chain are not allowed",
|
||||
OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain",
|
||||
ParamDupe: "Argument name clash",
|
||||
PatternHasAccessor: "Object pattern can't contain getter or setter",
|
||||
PatternHasMethod: "Object pattern can't contain methods",
|
||||
PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized',
|
||||
PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression",
|
||||
PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression",
|
||||
PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference",
|
||||
PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding",
|
||||
PrimaryTopicRequiresSmartPipeline: "Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option.",
|
||||
PrivateInExpectedIn: "Private names are only allowed in property accesses (`obj.#%0`) or in `in` expressions (`#%0 in obj`)",
|
||||
PrivateNameRedeclaration: "Duplicate private name #%0",
|
||||
RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'",
|
||||
RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'",
|
||||
RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'",
|
||||
RecordNoProto: "'__proto__' is not allowed in Record expressions",
|
||||
RestTrailingComma: "Unexpected trailing comma after rest element",
|
||||
SloppyFunction: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement",
|
||||
StaticPrototype: "Classes may not have static property named prototype",
|
||||
StrictDelete: "Deleting local variable in strict mode",
|
||||
StrictEvalArguments: "Assigning to '%0' in strict mode",
|
||||
StrictEvalArgumentsBinding: "Binding '%0' in strict mode",
|
||||
StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block",
|
||||
StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'",
|
||||
StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode",
|
||||
StrictWith: "'with' in strict mode",
|
||||
SuperNotAllowed: "super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",
|
||||
SuperPrivateField: "Private fields can't be accessed on super",
|
||||
TrailingDecorator: "Decorators must be attached to a class element",
|
||||
TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'",
|
||||
TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'",
|
||||
TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'",
|
||||
UnexpectedArgumentPlaceholder: "Unexpected argument placeholder",
|
||||
UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal',
|
||||
UnexpectedDigitAfterHash: "Unexpected digit after hash token",
|
||||
UnexpectedImportExport: "'import' and 'export' may only appear at the top level",
|
||||
UnexpectedKeyword: "Unexpected keyword '%0'",
|
||||
UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration",
|
||||
UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context",
|
||||
UnexpectedNewTarget: "new.target can only be used in functions",
|
||||
UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits",
|
||||
UnexpectedPrivateField: "Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\n or a property of member expression (i.e. this.#p).",
|
||||
UnexpectedReservedWord: "Unexpected reserved word '%0'",
|
||||
UnexpectedSuper: "super is only allowed in object methods and classes",
|
||||
UnexpectedToken: "Unexpected token '%0'",
|
||||
UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",
|
||||
UnsupportedBind: "Binding should be performed on object property.",
|
||||
UnsupportedDecoratorExport: "A decorated export must export a class declaration",
|
||||
UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.",
|
||||
UnsupportedImport: "import can only be used in import() or import.meta",
|
||||
UnsupportedMetaProperty: "The only valid meta property for %0 is %0.%1",
|
||||
UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters",
|
||||
UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties",
|
||||
UnsupportedSuper: "super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop])",
|
||||
UnterminatedComment: "Unterminated comment",
|
||||
UnterminatedRegExp: "Unterminated regular expression",
|
||||
UnterminatedString: "Unterminated string constant",
|
||||
UnterminatedTemplate: "Unterminated template",
|
||||
VarRedeclaration: "Identifier '%0' has already been declared",
|
||||
YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator",
|
||||
YieldInParameter: "Yield expression is not allowed in formal parameters",
|
||||
ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0"
|
||||
});
|
||||
exports.ErrorMessages = ErrorMessages;
|
56
node_modules/@babel/parser/lib/parser/error.js
generated
vendored
@ -1,56 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "Errors", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _errorMessage.ErrorMessages;
|
||||
}
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _location = require("../util/location");
|
||||
|
||||
var _comments = _interopRequireDefault(require("./comments"));
|
||||
|
||||
var _errorMessage = require("./error-message.js");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
class ParserError extends _comments.default {
|
||||
getLocationForPosition(pos) {
|
||||
let loc;
|
||||
if (pos === this.state.start) loc = this.state.startLoc;else if (pos === this.state.lastTokStart) loc = this.state.lastTokStartLoc;else if (pos === this.state.end) loc = this.state.endLoc;else if (pos === this.state.lastTokEnd) loc = this.state.lastTokEndLoc;else loc = (0, _location.getLineInfo)(this.input, pos);
|
||||
return loc;
|
||||
}
|
||||
|
||||
raise(pos, errorTemplate, ...params) {
|
||||
return this.raiseWithData(pos, undefined, errorTemplate, ...params);
|
||||
}
|
||||
|
||||
raiseWithData(pos, data, errorTemplate, ...params) {
|
||||
const loc = this.getLocationForPosition(pos);
|
||||
const message = errorTemplate.replace(/%(\d+)/g, (_, i) => params[i]) + ` (${loc.line}:${loc.column})`;
|
||||
return this._raise(Object.assign({
|
||||
loc,
|
||||
pos
|
||||
}, data), message);
|
||||
}
|
||||
|
||||
_raise(errorContext, message) {
|
||||
const err = new SyntaxError(message);
|
||||
Object.assign(err, errorContext);
|
||||
|
||||
if (this.options.errorRecovery) {
|
||||
if (!this.isLookahead) this.state.errors.push(err);
|
||||
return err;
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = ParserError;
|
1835
node_modules/@babel/parser/lib/parser/expression.js
generated
vendored
79
node_modules/@babel/parser/lib/parser/index.js
generated
vendored
@ -1,79 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _options = require("../options");
|
||||
|
||||
var _statement = _interopRequireDefault(require("./statement"));
|
||||
|
||||
var _scopeflags = require("../util/scopeflags");
|
||||
|
||||
var _scope = _interopRequireDefault(require("../util/scope"));
|
||||
|
||||
var _classScope = _interopRequireDefault(require("../util/class-scope"));
|
||||
|
||||
var _expressionScope = _interopRequireDefault(require("../util/expression-scope"));
|
||||
|
||||
var _productionParameter = _interopRequireWildcard(require("../util/production-parameter"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
class Parser extends _statement.default {
|
||||
constructor(options, input) {
|
||||
options = (0, _options.getOptions)(options);
|
||||
super(options, input);
|
||||
const ScopeHandler = this.getScopeHandler();
|
||||
this.options = options;
|
||||
this.inModule = this.options.sourceType === "module";
|
||||
this.scope = new ScopeHandler(this.raise.bind(this), this.inModule);
|
||||
this.prodParam = new _productionParameter.default();
|
||||
this.classScope = new _classScope.default(this.raise.bind(this));
|
||||
this.expressionScope = new _expressionScope.default(this.raise.bind(this));
|
||||
this.plugins = pluginsMap(this.options.plugins);
|
||||
this.filename = options.sourceFilename;
|
||||
}
|
||||
|
||||
getScopeHandler() {
|
||||
return _scope.default;
|
||||
}
|
||||
|
||||
parse() {
|
||||
let paramFlags = _productionParameter.PARAM;
|
||||
|
||||
if (this.hasPlugin("topLevelAwait") && this.inModule) {
|
||||
paramFlags |= _productionParameter.PARAM_AWAIT;
|
||||
}
|
||||
|
||||
this.scope.enter(_scopeflags.SCOPE_PROGRAM);
|
||||
this.prodParam.enter(paramFlags);
|
||||
const file = this.startNode();
|
||||
const program = this.startNode();
|
||||
this.nextToken();
|
||||
file.errors = null;
|
||||
this.parseTopLevel(file, program);
|
||||
file.errors = this.state.errors;
|
||||
return file;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = Parser;
|
||||
|
||||
function pluginsMap(plugins) {
|
||||
const pluginMap = new Map();
|
||||
|
||||
for (let _i = 0; _i < plugins.length; _i++) {
|
||||
const plugin = plugins[_i];
|
||||
const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}];
|
||||
if (!pluginMap.has(name)) pluginMap.set(name, options || {});
|
||||
}
|
||||
|
||||
return pluginMap;
|
||||
}
|
358
node_modules/@babel/parser/lib/parser/lval.js
generated
vendored
@ -1,358 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _types = require("../tokenizer/types");
|
||||
|
||||
var _identifier = require("../util/identifier");
|
||||
|
||||
var _node = require("./node");
|
||||
|
||||
var _scopeflags = require("../util/scopeflags");
|
||||
|
||||
var _util = require("./util");
|
||||
|
||||
var _error = require("./error");
|
||||
|
||||
const unwrapParenthesizedExpression = node => {
|
||||
return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node;
|
||||
};
|
||||
|
||||
class LValParser extends _node.NodeUtils {
|
||||
toAssignable(node) {
|
||||
let parenthesized = undefined;
|
||||
|
||||
if (node.type === "ParenthesizedExpression" || node.extra?.parenthesized) {
|
||||
parenthesized = unwrapParenthesizedExpression(node);
|
||||
|
||||
if (parenthesized.type !== "Identifier" && parenthesized.type !== "MemberExpression") {
|
||||
this.raise(node.start, _error.Errors.InvalidParenthesizedAssignment);
|
||||
}
|
||||
}
|
||||
|
||||
switch (node.type) {
|
||||
case "Identifier":
|
||||
case "ObjectPattern":
|
||||
case "ArrayPattern":
|
||||
case "AssignmentPattern":
|
||||
break;
|
||||
|
||||
case "ObjectExpression":
|
||||
node.type = "ObjectPattern";
|
||||
|
||||
for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) {
|
||||
const prop = node.properties[i];
|
||||
const isLast = i === last;
|
||||
this.toAssignableObjectExpressionProp(prop, isLast);
|
||||
|
||||
if (isLast && prop.type === "RestElement" && node.extra?.trailingComma) {
|
||||
this.raiseRestNotLast(node.extra.trailingComma);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "ObjectProperty":
|
||||
this.toAssignable(node.value);
|
||||
break;
|
||||
|
||||
case "SpreadElement":
|
||||
{
|
||||
this.checkToRestConversion(node);
|
||||
node.type = "RestElement";
|
||||
const arg = node.argument;
|
||||
this.toAssignable(arg);
|
||||
break;
|
||||
}
|
||||
|
||||
case "ArrayExpression":
|
||||
node.type = "ArrayPattern";
|
||||
this.toAssignableList(node.elements, node.extra?.trailingComma);
|
||||
break;
|
||||
|
||||
case "AssignmentExpression":
|
||||
if (node.operator !== "=") {
|
||||
this.raise(node.left.end, _error.Errors.MissingEqInAssignment);
|
||||
}
|
||||
|
||||
node.type = "AssignmentPattern";
|
||||
delete node.operator;
|
||||
this.toAssignable(node.left);
|
||||
break;
|
||||
|
||||
case "ParenthesizedExpression":
|
||||
this.toAssignable(parenthesized);
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
toAssignableObjectExpressionProp(prop, isLast) {
|
||||
if (prop.type === "ObjectMethod") {
|
||||
const error = prop.kind === "get" || prop.kind === "set" ? _error.Errors.PatternHasAccessor : _error.Errors.PatternHasMethod;
|
||||
this.raise(prop.key.start, error);
|
||||
} else if (prop.type === "SpreadElement" && !isLast) {
|
||||
this.raiseRestNotLast(prop.start);
|
||||
} else {
|
||||
this.toAssignable(prop);
|
||||
}
|
||||
}
|
||||
|
||||
toAssignableList(exprList, trailingCommaPos) {
|
||||
let end = exprList.length;
|
||||
|
||||
if (end) {
|
||||
const last = exprList[end - 1];
|
||||
|
||||
if (last?.type === "RestElement") {
|
||||
--end;
|
||||
} else if (last?.type === "SpreadElement") {
|
||||
last.type = "RestElement";
|
||||
const arg = last.argument;
|
||||
this.toAssignable(arg);
|
||||
|
||||
if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern" && arg.type !== "ObjectPattern") {
|
||||
this.unexpected(arg.start);
|
||||
}
|
||||
|
||||
if (trailingCommaPos) {
|
||||
this.raiseTrailingCommaAfterRest(trailingCommaPos);
|
||||
}
|
||||
|
||||
--end;
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < end; i++) {
|
||||
const elt = exprList[i];
|
||||
|
||||
if (elt) {
|
||||
this.toAssignable(elt);
|
||||
|
||||
if (elt.type === "RestElement") {
|
||||
this.raiseRestNotLast(elt.start);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return exprList;
|
||||
}
|
||||
|
||||
toReferencedList(exprList, isParenthesizedExpr) {
|
||||
return exprList;
|
||||
}
|
||||
|
||||
toReferencedListDeep(exprList, isParenthesizedExpr) {
|
||||
this.toReferencedList(exprList, isParenthesizedExpr);
|
||||
|
||||
for (let _i = 0; _i < exprList.length; _i++) {
|
||||
const expr = exprList[_i];
|
||||
|
||||
if (expr?.type === "ArrayExpression") {
|
||||
this.toReferencedListDeep(expr.elements);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parseSpread(refExpressionErrors, refNeedsArrowPos) {
|
||||
const node = this.startNode();
|
||||
this.next();
|
||||
node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined, refNeedsArrowPos);
|
||||
return this.finishNode(node, "SpreadElement");
|
||||
}
|
||||
|
||||
parseRestBinding() {
|
||||
const node = this.startNode();
|
||||
this.next();
|
||||
node.argument = this.parseBindingAtom();
|
||||
return this.finishNode(node, "RestElement");
|
||||
}
|
||||
|
||||
parseBindingAtom() {
|
||||
switch (this.state.type) {
|
||||
case _types.types.bracketL:
|
||||
{
|
||||
const node = this.startNode();
|
||||
this.next();
|
||||
node.elements = this.parseBindingList(_types.types.bracketR, 93, true);
|
||||
return this.finishNode(node, "ArrayPattern");
|
||||
}
|
||||
|
||||
case _types.types.braceL:
|
||||
return this.parseObjectLike(_types.types.braceR, true);
|
||||
}
|
||||
|
||||
return this.parseIdentifier();
|
||||
}
|
||||
|
||||
parseBindingList(close, closeCharCode, allowEmpty, allowModifiers) {
|
||||
const elts = [];
|
||||
let first = true;
|
||||
|
||||
while (!this.eat(close)) {
|
||||
if (first) {
|
||||
first = false;
|
||||
} else {
|
||||
this.expect(_types.types.comma);
|
||||
}
|
||||
|
||||
if (allowEmpty && this.match(_types.types.comma)) {
|
||||
elts.push(null);
|
||||
} else if (this.eat(close)) {
|
||||
break;
|
||||
} else if (this.match(_types.types.ellipsis)) {
|
||||
elts.push(this.parseAssignableListItemTypes(this.parseRestBinding()));
|
||||
this.checkCommaAfterRest(closeCharCode);
|
||||
this.expect(close);
|
||||
break;
|
||||
} else {
|
||||
const decorators = [];
|
||||
|
||||
if (this.match(_types.types.at) && this.hasPlugin("decorators")) {
|
||||
this.raise(this.state.start, _error.Errors.UnsupportedParameterDecorator);
|
||||
}
|
||||
|
||||
while (this.match(_types.types.at)) {
|
||||
decorators.push(this.parseDecorator());
|
||||
}
|
||||
|
||||
elts.push(this.parseAssignableListItem(allowModifiers, decorators));
|
||||
}
|
||||
}
|
||||
|
||||
return elts;
|
||||
}
|
||||
|
||||
parseAssignableListItem(allowModifiers, decorators) {
|
||||
const left = this.parseMaybeDefault();
|
||||
this.parseAssignableListItemTypes(left);
|
||||
const elt = this.parseMaybeDefault(left.start, left.loc.start, left);
|
||||
|
||||
if (decorators.length) {
|
||||
left.decorators = decorators;
|
||||
}
|
||||
|
||||
return elt;
|
||||
}
|
||||
|
||||
parseAssignableListItemTypes(param) {
|
||||
return param;
|
||||
}
|
||||
|
||||
parseMaybeDefault(startPos, startLoc, left) {
|
||||
startLoc = startLoc ?? this.state.startLoc;
|
||||
startPos = startPos ?? this.state.start;
|
||||
left = left ?? this.parseBindingAtom();
|
||||
if (!this.eat(_types.types.eq)) return left;
|
||||
const node = this.startNodeAt(startPos, startLoc);
|
||||
node.left = left;
|
||||
node.right = this.parseMaybeAssignAllowIn();
|
||||
return this.finishNode(node, "AssignmentPattern");
|
||||
}
|
||||
|
||||
checkLVal(expr, bindingType = _scopeflags.BIND_NONE, checkClashes, contextDescription, disallowLetBinding, strictModeChanged = false) {
|
||||
switch (expr.type) {
|
||||
case "Identifier":
|
||||
if (this.state.strict && (strictModeChanged ? (0, _identifier.isStrictBindReservedWord)(expr.name, this.inModule) : (0, _identifier.isStrictBindOnlyReservedWord)(expr.name))) {
|
||||
this.raise(expr.start, bindingType === _scopeflags.BIND_NONE ? _error.Errors.StrictEvalArguments : _error.Errors.StrictEvalArgumentsBinding, expr.name);
|
||||
}
|
||||
|
||||
if (checkClashes) {
|
||||
const key = `_${expr.name}`;
|
||||
|
||||
if (checkClashes[key]) {
|
||||
this.raise(expr.start, _error.Errors.ParamDupe);
|
||||
} else {
|
||||
checkClashes[key] = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (disallowLetBinding && expr.name === "let") {
|
||||
this.raise(expr.start, _error.Errors.LetInLexicalBinding);
|
||||
}
|
||||
|
||||
if (!(bindingType & _scopeflags.BIND_NONE)) {
|
||||
this.scope.declareName(expr.name, bindingType, expr.start);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "MemberExpression":
|
||||
if (bindingType !== _scopeflags.BIND_NONE) {
|
||||
this.raise(expr.start, _error.Errors.InvalidPropertyBindingPattern);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "ObjectPattern":
|
||||
for (let _i2 = 0, _expr$properties = expr.properties; _i2 < _expr$properties.length; _i2++) {
|
||||
let prop = _expr$properties[_i2];
|
||||
if (prop.type === "ObjectProperty") prop = prop.value;else if (prop.type === "ObjectMethod") continue;
|
||||
this.checkLVal(prop, bindingType, checkClashes, "object destructuring pattern", disallowLetBinding);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "ArrayPattern":
|
||||
for (let _i3 = 0, _expr$elements = expr.elements; _i3 < _expr$elements.length; _i3++) {
|
||||
const elem = _expr$elements[_i3];
|
||||
|
||||
if (elem) {
|
||||
this.checkLVal(elem, bindingType, checkClashes, "array destructuring pattern", disallowLetBinding);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "AssignmentPattern":
|
||||
this.checkLVal(expr.left, bindingType, checkClashes, "assignment pattern");
|
||||
break;
|
||||
|
||||
case "RestElement":
|
||||
this.checkLVal(expr.argument, bindingType, checkClashes, "rest element");
|
||||
break;
|
||||
|
||||
case "ParenthesizedExpression":
|
||||
this.checkLVal(expr.expression, bindingType, checkClashes, "parenthesized expression");
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
this.raise(expr.start, bindingType === _scopeflags.BIND_NONE ? _error.Errors.InvalidLhs : _error.Errors.InvalidLhsBinding, contextDescription);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
checkToRestConversion(node) {
|
||||
if (node.argument.type !== "Identifier" && node.argument.type !== "MemberExpression") {
|
||||
this.raise(node.argument.start, _error.Errors.InvalidRestAssignmentPattern);
|
||||
}
|
||||
}
|
||||
|
||||
checkCommaAfterRest(close) {
|
||||
if (this.match(_types.types.comma)) {
|
||||
if (this.lookaheadCharCode() === close) {
|
||||
this.raiseTrailingCommaAfterRest(this.state.start);
|
||||
} else {
|
||||
this.raiseRestNotLast(this.state.start);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
raiseRestNotLast(pos) {
|
||||
throw this.raise(pos, _error.Errors.ElementAfterRest);
|
||||
}
|
||||
|
||||
raiseTrailingCommaAfterRest(pos) {
|
||||
this.raise(pos, _error.Errors.RestTrailingComma);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = LValParser;
|
98
node_modules/@babel/parser/lib/parser/node.js
generated
vendored
@ -1,98 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.NodeUtils = void 0;
|
||||
|
||||
var _util = _interopRequireDefault(require("./util"));
|
||||
|
||||
var _location = require("../util/location");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
class Node {
|
||||
constructor(parser, pos, loc) {
|
||||
this.type = void 0;
|
||||
this.start = void 0;
|
||||
this.end = void 0;
|
||||
this.loc = void 0;
|
||||
this.range = void 0;
|
||||
this.leadingComments = void 0;
|
||||
this.trailingComments = void 0;
|
||||
this.innerComments = void 0;
|
||||
this.extra = void 0;
|
||||
this.type = "";
|
||||
this.start = pos;
|
||||
this.end = 0;
|
||||
this.loc = new _location.SourceLocation(loc);
|
||||
if (parser?.options.ranges) this.range = [pos, 0];
|
||||
if (parser?.filename) this.loc.filename = parser.filename;
|
||||
}
|
||||
|
||||
__clone() {
|
||||
const newNode = new Node();
|
||||
const keys = Object.keys(this);
|
||||
|
||||
for (let i = 0, length = keys.length; i < length; i++) {
|
||||
const key = keys[i];
|
||||
|
||||
if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") {
|
||||
newNode[key] = this[key];
|
||||
}
|
||||
}
|
||||
|
||||
return newNode;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class NodeUtils extends _util.default {
|
||||
startNode() {
|
||||
return new Node(this, this.state.start, this.state.startLoc);
|
||||
}
|
||||
|
||||
startNodeAt(pos, loc) {
|
||||
return new Node(this, pos, loc);
|
||||
}
|
||||
|
||||
startNodeAtNode(type) {
|
||||
return this.startNodeAt(type.start, type.loc.start);
|
||||
}
|
||||
|
||||
finishNode(node, type) {
|
||||
return this.finishNodeAt(node, type, this.state.lastTokEnd, this.state.lastTokEndLoc);
|
||||
}
|
||||
|
||||
finishNodeAt(node, type, pos, loc) {
|
||||
if (process.env.NODE_ENV !== "production" && node.end > 0) {
|
||||
throw new Error("Do not call finishNode*() twice on the same node." + " Instead use resetEndLocation() or change type directly.");
|
||||
}
|
||||
|
||||
node.type = type;
|
||||
node.end = pos;
|
||||
node.loc.end = loc;
|
||||
if (this.options.ranges) node.range[1] = pos;
|
||||
this.processComment(node);
|
||||
return node;
|
||||
}
|
||||
|
||||
resetStartLocation(node, start, startLoc) {
|
||||
node.start = start;
|
||||
node.loc.start = startLoc;
|
||||
if (this.options.ranges) node.range[0] = start;
|
||||
}
|
||||
|
||||
resetEndLocation(node, end = this.state.lastTokEnd, endLoc = this.state.lastTokEndLoc) {
|
||||
node.end = end;
|
||||
node.loc.end = endLoc;
|
||||
if (this.options.ranges) node.range[1] = end;
|
||||
}
|
||||
|
||||
resetStartLocationFromNode(node, locationNode) {
|
||||
this.resetStartLocation(node, locationNode.start, locationNode.loc.start);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.NodeUtils = NodeUtils;
|
1741
node_modules/@babel/parser/lib/parser/statement.js
generated
vendored
206
node_modules/@babel/parser/lib/parser/util.js
generated
vendored
@ -1,206 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.ExpressionErrors = exports.default = void 0;
|
||||
|
||||
var _types = require("../tokenizer/types");
|
||||
|
||||
var _tokenizer = _interopRequireDefault(require("../tokenizer"));
|
||||
|
||||
var _state = _interopRequireDefault(require("../tokenizer/state"));
|
||||
|
||||
var _whitespace = require("../util/whitespace");
|
||||
|
||||
var _identifier = require("../util/identifier");
|
||||
|
||||
var _error = require("./error");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
class UtilParser extends _tokenizer.default {
|
||||
addExtra(node, key, val) {
|
||||
if (!node) return;
|
||||
const extra = node.extra = node.extra || {};
|
||||
extra[key] = val;
|
||||
}
|
||||
|
||||
isRelational(op) {
|
||||
return this.match(_types.types.relational) && this.state.value === op;
|
||||
}
|
||||
|
||||
expectRelational(op) {
|
||||
if (this.isRelational(op)) {
|
||||
this.next();
|
||||
} else {
|
||||
this.unexpected(null, _types.types.relational);
|
||||
}
|
||||
}
|
||||
|
||||
isContextual(name) {
|
||||
return this.match(_types.types.name) && this.state.value === name && !this.state.containsEsc;
|
||||
}
|
||||
|
||||
isUnparsedContextual(nameStart, name) {
|
||||
const nameEnd = nameStart + name.length;
|
||||
return this.input.slice(nameStart, nameEnd) === name && (nameEnd === this.input.length || !(0, _identifier.isIdentifierChar)(this.input.charCodeAt(nameEnd)));
|
||||
}
|
||||
|
||||
isLookaheadContextual(name) {
|
||||
const next = this.nextTokenStart();
|
||||
return this.isUnparsedContextual(next, name);
|
||||
}
|
||||
|
||||
eatContextual(name) {
|
||||
return this.isContextual(name) && this.eat(_types.types.name);
|
||||
}
|
||||
|
||||
expectContextual(name, message) {
|
||||
if (!this.eatContextual(name)) this.unexpected(null, message);
|
||||
}
|
||||
|
||||
canInsertSemicolon() {
|
||||
return this.match(_types.types.eof) || this.match(_types.types.braceR) || this.hasPrecedingLineBreak();
|
||||
}
|
||||
|
||||
hasPrecedingLineBreak() {
|
||||
return _whitespace.lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start));
|
||||
}
|
||||
|
||||
isLineTerminator() {
|
||||
return this.eat(_types.types.semi) || this.canInsertSemicolon();
|
||||
}
|
||||
|
||||
semicolon() {
|
||||
if (!this.isLineTerminator()) this.unexpected(null, _types.types.semi);
|
||||
}
|
||||
|
||||
expect(type, pos) {
|
||||
this.eat(type) || this.unexpected(pos, type);
|
||||
}
|
||||
|
||||
assertNoSpace(message = "Unexpected space.") {
|
||||
if (this.state.start > this.state.lastTokEnd) {
|
||||
this.raise(this.state.lastTokEnd, message);
|
||||
}
|
||||
}
|
||||
|
||||
unexpected(pos, messageOrType = "Unexpected token") {
|
||||
if (typeof messageOrType !== "string") {
|
||||
messageOrType = `Unexpected token, expected "${messageOrType.label}"`;
|
||||
}
|
||||
|
||||
throw this.raise(pos != null ? pos : this.state.start, messageOrType);
|
||||
}
|
||||
|
||||
expectPlugin(name, pos) {
|
||||
if (!this.hasPlugin(name)) {
|
||||
throw this.raiseWithData(pos != null ? pos : this.state.start, {
|
||||
missingPlugin: [name]
|
||||
}, `This experimental syntax requires enabling the parser plugin: '${name}'`);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
expectOnePlugin(names, pos) {
|
||||
if (!names.some(n => this.hasPlugin(n))) {
|
||||
throw this.raiseWithData(pos != null ? pos : this.state.start, {
|
||||
missingPlugin: names
|
||||
}, `This experimental syntax requires enabling one of the following parser plugin(s): '${names.join(", ")}'`);
|
||||
}
|
||||
}
|
||||
|
||||
tryParse(fn, oldState = this.state.clone()) {
|
||||
const abortSignal = {
|
||||
node: null
|
||||
};
|
||||
|
||||
try {
|
||||
const node = fn((node = null) => {
|
||||
abortSignal.node = node;
|
||||
throw abortSignal;
|
||||
});
|
||||
|
||||
if (this.state.errors.length > oldState.errors.length) {
|
||||
const failState = this.state;
|
||||
this.state = oldState;
|
||||
return {
|
||||
node,
|
||||
error: failState.errors[oldState.errors.length],
|
||||
thrown: false,
|
||||
aborted: false,
|
||||
failState
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
node,
|
||||
error: null,
|
||||
thrown: false,
|
||||
aborted: false,
|
||||
failState: null
|
||||
};
|
||||
} catch (error) {
|
||||
const failState = this.state;
|
||||
this.state = oldState;
|
||||
|
||||
if (error instanceof SyntaxError) {
|
||||
return {
|
||||
node: null,
|
||||
error,
|
||||
thrown: true,
|
||||
aborted: false,
|
||||
failState
|
||||
};
|
||||
}
|
||||
|
||||
if (error === abortSignal) {
|
||||
return {
|
||||
node: abortSignal.node,
|
||||
error: null,
|
||||
thrown: false,
|
||||
aborted: true,
|
||||
failState
|
||||
};
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
checkExpressionErrors(refExpressionErrors, andThrow) {
|
||||
if (!refExpressionErrors) return false;
|
||||
const {
|
||||
shorthandAssign,
|
||||
doubleProto
|
||||
} = refExpressionErrors;
|
||||
if (!andThrow) return shorthandAssign >= 0 || doubleProto >= 0;
|
||||
|
||||
if (shorthandAssign >= 0) {
|
||||
this.unexpected(shorthandAssign);
|
||||
}
|
||||
|
||||
if (doubleProto >= 0) {
|
||||
this.raise(doubleProto, _error.Errors.DuplicateProto);
|
||||
}
|
||||
}
|
||||
|
||||
isLiteralPropertyName() {
|
||||
return this.match(_types.types.name) || !!this.state.type.keyword || this.match(_types.types.string) || this.match(_types.types.num) || this.match(_types.types.bigint) || this.match(_types.types.decimal);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = UtilParser;
|
||||
|
||||
class ExpressionErrors {
|
||||
constructor() {
|
||||
this.shorthandAssign = -1;
|
||||
this.doubleProto = -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.ExpressionErrors = ExpressionErrors;
|
108
node_modules/@babel/parser/lib/plugin-utils.js
generated
vendored
@ -1,108 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.hasPlugin = hasPlugin;
|
||||
exports.getPluginOption = getPluginOption;
|
||||
exports.validatePlugins = validatePlugins;
|
||||
exports.mixinPluginNames = exports.mixinPlugins = void 0;
|
||||
|
||||
var _estree = _interopRequireDefault(require("./plugins/estree"));
|
||||
|
||||
var _flow = _interopRequireDefault(require("./plugins/flow"));
|
||||
|
||||
var _jsx = _interopRequireDefault(require("./plugins/jsx"));
|
||||
|
||||
var _typescript = _interopRequireDefault(require("./plugins/typescript"));
|
||||
|
||||
var _placeholders = _interopRequireDefault(require("./plugins/placeholders"));
|
||||
|
||||
var _v8intrinsic = _interopRequireDefault(require("./plugins/v8intrinsic"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function hasPlugin(plugins, name) {
|
||||
return plugins.some(plugin => {
|
||||
if (Array.isArray(plugin)) {
|
||||
return plugin[0] === name;
|
||||
} else {
|
||||
return plugin === name;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getPluginOption(plugins, name, option) {
|
||||
const plugin = plugins.find(plugin => {
|
||||
if (Array.isArray(plugin)) {
|
||||
return plugin[0] === name;
|
||||
} else {
|
||||
return plugin === name;
|
||||
}
|
||||
});
|
||||
|
||||
if (plugin && Array.isArray(plugin)) {
|
||||
return plugin[1][option];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
const PIPELINE_PROPOSALS = ["minimal", "smart", "fsharp"];
|
||||
const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"];
|
||||
|
||||
function validatePlugins(plugins) {
|
||||
if (hasPlugin(plugins, "decorators")) {
|
||||
if (hasPlugin(plugins, "decorators-legacy")) {
|
||||
throw new Error("Cannot use the decorators and decorators-legacy plugin together");
|
||||
}
|
||||
|
||||
const decoratorsBeforeExport = getPluginOption(plugins, "decorators", "decoratorsBeforeExport");
|
||||
|
||||
if (decoratorsBeforeExport == null) {
|
||||
throw new Error("The 'decorators' plugin requires a 'decoratorsBeforeExport' option," + " whose value must be a boolean. If you are migrating from" + " Babylon/Babel 6 or want to use the old decorators proposal, you" + " should use the 'decorators-legacy' plugin instead of 'decorators'.");
|
||||
} else if (typeof decoratorsBeforeExport !== "boolean") {
|
||||
throw new Error("'decoratorsBeforeExport' must be a boolean.");
|
||||
}
|
||||
}
|
||||
|
||||
if (hasPlugin(plugins, "flow") && hasPlugin(plugins, "typescript")) {
|
||||
throw new Error("Cannot combine flow and typescript plugins.");
|
||||
}
|
||||
|
||||
if (hasPlugin(plugins, "placeholders") && hasPlugin(plugins, "v8intrinsic")) {
|
||||
throw new Error("Cannot combine placeholders and v8intrinsic plugins.");
|
||||
}
|
||||
|
||||
if (hasPlugin(plugins, "pipelineOperator") && !PIPELINE_PROPOSALS.includes(getPluginOption(plugins, "pipelineOperator", "proposal"))) {
|
||||
throw new Error("'pipelineOperator' requires 'proposal' option whose value should be one of: " + PIPELINE_PROPOSALS.map(p => `'${p}'`).join(", "));
|
||||
}
|
||||
|
||||
if (hasPlugin(plugins, "moduleAttributes")) {
|
||||
if (hasPlugin(plugins, "importAssertions")) {
|
||||
throw new Error("Cannot combine importAssertions and moduleAttributes plugins.");
|
||||
}
|
||||
|
||||
const moduleAttributesVerionPluginOption = getPluginOption(plugins, "moduleAttributes", "version");
|
||||
|
||||
if (moduleAttributesVerionPluginOption !== "may-2020") {
|
||||
throw new Error("The 'moduleAttributes' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is 'may-2020'.");
|
||||
}
|
||||
}
|
||||
|
||||
if (hasPlugin(plugins, "recordAndTuple") && !RECORD_AND_TUPLE_SYNTAX_TYPES.includes(getPluginOption(plugins, "recordAndTuple", "syntaxType"))) {
|
||||
throw new Error("'recordAndTuple' requires 'syntaxType' option whose value should be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(", "));
|
||||
}
|
||||
}
|
||||
|
||||
const mixinPlugins = {
|
||||
estree: _estree.default,
|
||||
jsx: _jsx.default,
|
||||
flow: _flow.default,
|
||||
typescript: _typescript.default,
|
||||
v8intrinsic: _v8intrinsic.default,
|
||||
placeholders: _placeholders.default
|
||||
};
|
||||
exports.mixinPlugins = mixinPlugins;
|
||||
const mixinPluginNames = Object.keys(mixinPlugins);
|
||||
exports.mixinPluginNames = mixinPluginNames;
|
297
node_modules/@babel/parser/lib/plugins/estree.js
generated
vendored
@ -1,297 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _types = require("../tokenizer/types");
|
||||
|
||||
var N = _interopRequireWildcard(require("../types"));
|
||||
|
||||
var _scopeflags = require("../util/scopeflags");
|
||||
|
||||
var _error = require("../parser/error");
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function isSimpleProperty(node) {
|
||||
return node != null && node.type === "Property" && node.kind === "init" && node.method === false;
|
||||
}
|
||||
|
||||
var _default = superClass => class extends superClass {
|
||||
estreeParseRegExpLiteral({
|
||||
pattern,
|
||||
flags
|
||||
}) {
|
||||
let regex = null;
|
||||
|
||||
try {
|
||||
regex = new RegExp(pattern, flags);
|
||||
} catch (e) {}
|
||||
|
||||
const node = this.estreeParseLiteral(regex);
|
||||
node.regex = {
|
||||
pattern,
|
||||
flags
|
||||
};
|
||||
return node;
|
||||
}
|
||||
|
||||
estreeParseBigIntLiteral(value) {
|
||||
const bigInt = typeof BigInt !== "undefined" ? BigInt(value) : null;
|
||||
const node = this.estreeParseLiteral(bigInt);
|
||||
node.bigint = String(node.value || value);
|
||||
return node;
|
||||
}
|
||||
|
||||
estreeParseDecimalLiteral(value) {
|
||||
const decimal = null;
|
||||
const node = this.estreeParseLiteral(decimal);
|
||||
node.decimal = String(node.value || value);
|
||||
return node;
|
||||
}
|
||||
|
||||
estreeParseLiteral(value) {
|
||||
return this.parseLiteral(value, "Literal");
|
||||
}
|
||||
|
||||
directiveToStmt(directive) {
|
||||
const directiveLiteral = directive.value;
|
||||
const stmt = this.startNodeAt(directive.start, directive.loc.start);
|
||||
const expression = this.startNodeAt(directiveLiteral.start, directiveLiteral.loc.start);
|
||||
expression.value = directiveLiteral.value;
|
||||
expression.raw = directiveLiteral.extra.raw;
|
||||
stmt.expression = this.finishNodeAt(expression, "Literal", directiveLiteral.end, directiveLiteral.loc.end);
|
||||
stmt.directive = directiveLiteral.extra.raw.slice(1, -1);
|
||||
return this.finishNodeAt(stmt, "ExpressionStatement", directive.end, directive.loc.end);
|
||||
}
|
||||
|
||||
initFunction(node, isAsync) {
|
||||
super.initFunction(node, isAsync);
|
||||
node.expression = false;
|
||||
}
|
||||
|
||||
checkDeclaration(node) {
|
||||
if (isSimpleProperty(node)) {
|
||||
this.checkDeclaration(node.value);
|
||||
} else {
|
||||
super.checkDeclaration(node);
|
||||
}
|
||||
}
|
||||
|
||||
getObjectOrClassMethodParams(method) {
|
||||
return method.value.params;
|
||||
}
|
||||
|
||||
checkLVal(expr, bindingType = _scopeflags.BIND_NONE, checkClashes, contextDescription, disallowLetBinding) {
|
||||
switch (expr.type) {
|
||||
case "ObjectPattern":
|
||||
expr.properties.forEach(prop => {
|
||||
this.checkLVal(prop.type === "Property" ? prop.value : prop, bindingType, checkClashes, "object destructuring pattern", disallowLetBinding);
|
||||
});
|
||||
break;
|
||||
|
||||
default:
|
||||
super.checkLVal(expr, bindingType, checkClashes, contextDescription, disallowLetBinding);
|
||||
}
|
||||
}
|
||||
|
||||
checkProto(prop, isRecord, protoRef, refExpressionErrors) {
|
||||
if (prop.method) {
|
||||
return;
|
||||
}
|
||||
|
||||
super.checkProto(prop, isRecord, protoRef, refExpressionErrors);
|
||||
}
|
||||
|
||||
isValidDirective(stmt) {
|
||||
return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !stmt.expression.extra?.parenthesized;
|
||||
}
|
||||
|
||||
stmtToDirective(stmt) {
|
||||
const directive = super.stmtToDirective(stmt);
|
||||
const value = stmt.expression.value;
|
||||
directive.value.value = value;
|
||||
return directive;
|
||||
}
|
||||
|
||||
parseBlockBody(node, allowDirectives, topLevel, end) {
|
||||
super.parseBlockBody(node, allowDirectives, topLevel, end);
|
||||
const directiveStatements = node.directives.map(d => this.directiveToStmt(d));
|
||||
node.body = directiveStatements.concat(node.body);
|
||||
delete node.directives;
|
||||
}
|
||||
|
||||
pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
|
||||
this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true);
|
||||
|
||||
if (method.typeParameters) {
|
||||
method.value.typeParameters = method.typeParameters;
|
||||
delete method.typeParameters;
|
||||
}
|
||||
|
||||
classBody.body.push(method);
|
||||
}
|
||||
|
||||
parseExprAtom(refExpressionErrors) {
|
||||
switch (this.state.type) {
|
||||
case _types.types.num:
|
||||
case _types.types.string:
|
||||
return this.estreeParseLiteral(this.state.value);
|
||||
|
||||
case _types.types.regexp:
|
||||
return this.estreeParseRegExpLiteral(this.state.value);
|
||||
|
||||
case _types.types.bigint:
|
||||
return this.estreeParseBigIntLiteral(this.state.value);
|
||||
|
||||
case _types.types.decimal:
|
||||
return this.estreeParseDecimalLiteral(this.state.value);
|
||||
|
||||
case _types.types._null:
|
||||
return this.estreeParseLiteral(null);
|
||||
|
||||
case _types.types._true:
|
||||
return this.estreeParseLiteral(true);
|
||||
|
||||
case _types.types._false:
|
||||
return this.estreeParseLiteral(false);
|
||||
|
||||
default:
|
||||
return super.parseExprAtom(refExpressionErrors);
|
||||
}
|
||||
}
|
||||
|
||||
parseLiteral(value, type, startPos, startLoc) {
|
||||
const node = super.parseLiteral(value, type, startPos, startLoc);
|
||||
node.raw = node.extra.raw;
|
||||
delete node.extra;
|
||||
return node;
|
||||
}
|
||||
|
||||
parseFunctionBody(node, allowExpression, isMethod = false) {
|
||||
super.parseFunctionBody(node, allowExpression, isMethod);
|
||||
node.expression = node.body.type !== "BlockStatement";
|
||||
}
|
||||
|
||||
parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {
|
||||
let funcNode = this.startNode();
|
||||
funcNode.kind = node.kind;
|
||||
funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
|
||||
funcNode.type = "FunctionExpression";
|
||||
delete funcNode.kind;
|
||||
node.value = funcNode;
|
||||
type = type === "ClassMethod" ? "MethodDefinition" : type;
|
||||
return this.finishNode(node, type);
|
||||
}
|
||||
|
||||
parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {
|
||||
const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor);
|
||||
|
||||
if (node) {
|
||||
node.type = "Property";
|
||||
if (node.kind === "method") node.kind = "init";
|
||||
node.shorthand = false;
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors) {
|
||||
const node = super.parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors);
|
||||
|
||||
if (node) {
|
||||
node.kind = "init";
|
||||
node.type = "Property";
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
toAssignable(node) {
|
||||
if (isSimpleProperty(node)) {
|
||||
this.toAssignable(node.value);
|
||||
return node;
|
||||
}
|
||||
|
||||
return super.toAssignable(node);
|
||||
}
|
||||
|
||||
toAssignableObjectExpressionProp(prop, isLast) {
|
||||
if (prop.kind === "get" || prop.kind === "set") {
|
||||
throw this.raise(prop.key.start, _error.Errors.PatternHasAccessor);
|
||||
} else if (prop.method) {
|
||||
throw this.raise(prop.key.start, _error.Errors.PatternHasMethod);
|
||||
} else {
|
||||
super.toAssignableObjectExpressionProp(prop, isLast);
|
||||
}
|
||||
}
|
||||
|
||||
finishCallExpression(node, optional) {
|
||||
super.finishCallExpression(node, optional);
|
||||
|
||||
if (node.callee.type === "Import") {
|
||||
node.type = "ImportExpression";
|
||||
node.source = node.arguments[0];
|
||||
delete node.arguments;
|
||||
delete node.callee;
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
toReferencedArguments(node) {
|
||||
if (node.type === "ImportExpression") {
|
||||
return;
|
||||
}
|
||||
|
||||
super.toReferencedArguments(node);
|
||||
}
|
||||
|
||||
parseExport(node) {
|
||||
super.parseExport(node);
|
||||
|
||||
switch (node.type) {
|
||||
case "ExportAllDeclaration":
|
||||
node.exported = null;
|
||||
break;
|
||||
|
||||
case "ExportNamedDeclaration":
|
||||
if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") {
|
||||
node.type = "ExportAllDeclaration";
|
||||
node.exported = node.specifiers[0].exported;
|
||||
delete node.specifiers;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
parseSubscript(base, startPos, startLoc, noCalls, state) {
|
||||
const node = super.parseSubscript(base, startPos, startLoc, noCalls, state);
|
||||
|
||||
if (state.optionalChainMember) {
|
||||
if (node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression") {
|
||||
node.type = node.type.substring(8);
|
||||
}
|
||||
|
||||
if (state.stop) {
|
||||
const chain = this.startNodeAtNode(node);
|
||||
chain.expression = node;
|
||||
return this.finishNode(chain, "ChainExpression");
|
||||
}
|
||||
} else if (node.type === "MemberExpression" || node.type === "CallExpression") {
|
||||
node.optional = false;
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
exports.default = _default;
|
2821
node_modules/@babel/parser/lib/plugins/flow.js
generated
vendored
526
node_modules/@babel/parser/lib/plugins/jsx/index.js
generated
vendored
@ -1,526 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _xhtml = _interopRequireDefault(require("./xhtml"));
|
||||
|
||||
var _types = require("../../tokenizer/types");
|
||||
|
||||
var _context = require("../../tokenizer/context");
|
||||
|
||||
var N = _interopRequireWildcard(require("../../types"));
|
||||
|
||||
var _identifier = require("../../util/identifier");
|
||||
|
||||
var _whitespace = require("../../util/whitespace");
|
||||
|
||||
var _error = require("../../parser/error");
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const HEX_NUMBER = /^[\da-fA-F]+$/;
|
||||
const DECIMAL_NUMBER = /^\d+$/;
|
||||
const JsxErrors = Object.freeze({
|
||||
AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression",
|
||||
MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>",
|
||||
MissingClosingTagElement: "Expected corresponding JSX closing tag for <%0>",
|
||||
UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text",
|
||||
UnterminatedJsxContent: "Unterminated JSX contents",
|
||||
UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"
|
||||
});
|
||||
_context.types.j_oTag = new _context.TokContext("<tag", false);
|
||||
_context.types.j_cTag = new _context.TokContext("</tag", false);
|
||||
_context.types.j_expr = new _context.TokContext("<tag>...</tag>", true, true);
|
||||
_types.types.jsxName = new _types.TokenType("jsxName");
|
||||
_types.types.jsxText = new _types.TokenType("jsxText", {
|
||||
beforeExpr: true
|
||||
});
|
||||
_types.types.jsxTagStart = new _types.TokenType("jsxTagStart", {
|
||||
startsExpr: true
|
||||
});
|
||||
_types.types.jsxTagEnd = new _types.TokenType("jsxTagEnd");
|
||||
|
||||
_types.types.jsxTagStart.updateContext = function () {
|
||||
this.state.context.push(_context.types.j_expr);
|
||||
this.state.context.push(_context.types.j_oTag);
|
||||
this.state.exprAllowed = false;
|
||||
};
|
||||
|
||||
_types.types.jsxTagEnd.updateContext = function (prevType) {
|
||||
const out = this.state.context.pop();
|
||||
|
||||
if (out === _context.types.j_oTag && prevType === _types.types.slash || out === _context.types.j_cTag) {
|
||||
this.state.context.pop();
|
||||
this.state.exprAllowed = this.curContext() === _context.types.j_expr;
|
||||
} else {
|
||||
this.state.exprAllowed = true;
|
||||
}
|
||||
};
|
||||
|
||||
function isFragment(object) {
|
||||
return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false;
|
||||
}
|
||||
|
||||
function getQualifiedJSXName(object) {
|
||||
if (object.type === "JSXIdentifier") {
|
||||
return object.name;
|
||||
}
|
||||
|
||||
if (object.type === "JSXNamespacedName") {
|
||||
return object.namespace.name + ":" + object.name.name;
|
||||
}
|
||||
|
||||
if (object.type === "JSXMemberExpression") {
|
||||
return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property);
|
||||
}
|
||||
|
||||
throw new Error("Node had unexpected type: " + object.type);
|
||||
}
|
||||
|
||||
var _default = superClass => class extends superClass {
|
||||
jsxReadToken() {
|
||||
let out = "";
|
||||
let chunkStart = this.state.pos;
|
||||
|
||||
for (;;) {
|
||||
if (this.state.pos >= this.length) {
|
||||
throw this.raise(this.state.start, JsxErrors.UnterminatedJsxContent);
|
||||
}
|
||||
|
||||
const ch = this.input.charCodeAt(this.state.pos);
|
||||
|
||||
switch (ch) {
|
||||
case 60:
|
||||
case 123:
|
||||
if (this.state.pos === this.state.start) {
|
||||
if (ch === 60 && this.state.exprAllowed) {
|
||||
++this.state.pos;
|
||||
return this.finishToken(_types.types.jsxTagStart);
|
||||
}
|
||||
|
||||
return super.getTokenFromCode(ch);
|
||||
}
|
||||
|
||||
out += this.input.slice(chunkStart, this.state.pos);
|
||||
return this.finishToken(_types.types.jsxText, out);
|
||||
|
||||
case 38:
|
||||
out += this.input.slice(chunkStart, this.state.pos);
|
||||
out += this.jsxReadEntity();
|
||||
chunkStart = this.state.pos;
|
||||
break;
|
||||
|
||||
default:
|
||||
if ((0, _whitespace.isNewLine)(ch)) {
|
||||
out += this.input.slice(chunkStart, this.state.pos);
|
||||
out += this.jsxReadNewLine(true);
|
||||
chunkStart = this.state.pos;
|
||||
} else {
|
||||
++this.state.pos;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jsxReadNewLine(normalizeCRLF) {
|
||||
const ch = this.input.charCodeAt(this.state.pos);
|
||||
let out;
|
||||
++this.state.pos;
|
||||
|
||||
if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) {
|
||||
++this.state.pos;
|
||||
out = normalizeCRLF ? "\n" : "\r\n";
|
||||
} else {
|
||||
out = String.fromCharCode(ch);
|
||||
}
|
||||
|
||||
++this.state.curLine;
|
||||
this.state.lineStart = this.state.pos;
|
||||
return out;
|
||||
}
|
||||
|
||||
jsxReadString(quote) {
|
||||
let out = "";
|
||||
let chunkStart = ++this.state.pos;
|
||||
|
||||
for (;;) {
|
||||
if (this.state.pos >= this.length) {
|
||||
throw this.raise(this.state.start, _error.Errors.UnterminatedString);
|
||||
}
|
||||
|
||||
const ch = this.input.charCodeAt(this.state.pos);
|
||||
if (ch === quote) break;
|
||||
|
||||
if (ch === 38) {
|
||||
out += this.input.slice(chunkStart, this.state.pos);
|
||||
out += this.jsxReadEntity();
|
||||
chunkStart = this.state.pos;
|
||||
} else if ((0, _whitespace.isNewLine)(ch)) {
|
||||
out += this.input.slice(chunkStart, this.state.pos);
|
||||
out += this.jsxReadNewLine(false);
|
||||
chunkStart = this.state.pos;
|
||||
} else {
|
||||
++this.state.pos;
|
||||
}
|
||||
}
|
||||
|
||||
out += this.input.slice(chunkStart, this.state.pos++);
|
||||
return this.finishToken(_types.types.string, out);
|
||||
}
|
||||
|
||||
jsxReadEntity() {
|
||||
let str = "";
|
||||
let count = 0;
|
||||
let entity;
|
||||
let ch = this.input[this.state.pos];
|
||||
const startPos = ++this.state.pos;
|
||||
|
||||
while (this.state.pos < this.length && count++ < 10) {
|
||||
ch = this.input[this.state.pos++];
|
||||
|
||||
if (ch === ";") {
|
||||
if (str[0] === "#") {
|
||||
if (str[1] === "x") {
|
||||
str = str.substr(2);
|
||||
|
||||
if (HEX_NUMBER.test(str)) {
|
||||
entity = String.fromCodePoint(parseInt(str, 16));
|
||||
}
|
||||
} else {
|
||||
str = str.substr(1);
|
||||
|
||||
if (DECIMAL_NUMBER.test(str)) {
|
||||
entity = String.fromCodePoint(parseInt(str, 10));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
entity = _xhtml.default[str];
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
str += ch;
|
||||
}
|
||||
|
||||
if (!entity) {
|
||||
this.state.pos = startPos;
|
||||
return "&";
|
||||
}
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
jsxReadWord() {
|
||||
let ch;
|
||||
const start = this.state.pos;
|
||||
|
||||
do {
|
||||
ch = this.input.charCodeAt(++this.state.pos);
|
||||
} while ((0, _identifier.isIdentifierChar)(ch) || ch === 45);
|
||||
|
||||
return this.finishToken(_types.types.jsxName, this.input.slice(start, this.state.pos));
|
||||
}
|
||||
|
||||
jsxParseIdentifier() {
|
||||
const node = this.startNode();
|
||||
|
||||
if (this.match(_types.types.jsxName)) {
|
||||
node.name = this.state.value;
|
||||
} else if (this.state.type.keyword) {
|
||||
node.name = this.state.type.keyword;
|
||||
} else {
|
||||
this.unexpected();
|
||||
}
|
||||
|
||||
this.next();
|
||||
return this.finishNode(node, "JSXIdentifier");
|
||||
}
|
||||
|
||||
jsxParseNamespacedName() {
|
||||
const startPos = this.state.start;
|
||||
const startLoc = this.state.startLoc;
|
||||
const name = this.jsxParseIdentifier();
|
||||
if (!this.eat(_types.types.colon)) return name;
|
||||
const node = this.startNodeAt(startPos, startLoc);
|
||||
node.namespace = name;
|
||||
node.name = this.jsxParseIdentifier();
|
||||
return this.finishNode(node, "JSXNamespacedName");
|
||||
}
|
||||
|
||||
jsxParseElementName() {
|
||||
const startPos = this.state.start;
|
||||
const startLoc = this.state.startLoc;
|
||||
let node = this.jsxParseNamespacedName();
|
||||
|
||||
if (node.type === "JSXNamespacedName") {
|
||||
return node;
|
||||
}
|
||||
|
||||
while (this.eat(_types.types.dot)) {
|
||||
const newNode = this.startNodeAt(startPos, startLoc);
|
||||
newNode.object = node;
|
||||
newNode.property = this.jsxParseIdentifier();
|
||||
node = this.finishNode(newNode, "JSXMemberExpression");
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
jsxParseAttributeValue() {
|
||||
let node;
|
||||
|
||||
switch (this.state.type) {
|
||||
case _types.types.braceL:
|
||||
node = this.startNode();
|
||||
this.next();
|
||||
node = this.jsxParseExpressionContainer(node);
|
||||
|
||||
if (node.expression.type === "JSXEmptyExpression") {
|
||||
this.raise(node.start, JsxErrors.AttributeIsEmpty);
|
||||
}
|
||||
|
||||
return node;
|
||||
|
||||
case _types.types.jsxTagStart:
|
||||
case _types.types.string:
|
||||
return this.parseExprAtom();
|
||||
|
||||
default:
|
||||
throw this.raise(this.state.start, JsxErrors.UnsupportedJsxValue);
|
||||
}
|
||||
}
|
||||
|
||||
jsxParseEmptyExpression() {
|
||||
const node = this.startNodeAt(this.state.lastTokEnd, this.state.lastTokEndLoc);
|
||||
return this.finishNodeAt(node, "JSXEmptyExpression", this.state.start, this.state.startLoc);
|
||||
}
|
||||
|
||||
jsxParseSpreadChild(node) {
|
||||
this.next();
|
||||
node.expression = this.parseExpression();
|
||||
this.expect(_types.types.braceR);
|
||||
return this.finishNode(node, "JSXSpreadChild");
|
||||
}
|
||||
|
||||
jsxParseExpressionContainer(node) {
|
||||
if (this.match(_types.types.braceR)) {
|
||||
node.expression = this.jsxParseEmptyExpression();
|
||||
} else {
|
||||
node.expression = this.parseExpression();
|
||||
}
|
||||
|
||||
this.expect(_types.types.braceR);
|
||||
return this.finishNode(node, "JSXExpressionContainer");
|
||||
}
|
||||
|
||||
jsxParseAttribute() {
|
||||
const node = this.startNode();
|
||||
|
||||
if (this.eat(_types.types.braceL)) {
|
||||
this.expect(_types.types.ellipsis);
|
||||
node.argument = this.parseMaybeAssignAllowIn();
|
||||
this.expect(_types.types.braceR);
|
||||
return this.finishNode(node, "JSXSpreadAttribute");
|
||||
}
|
||||
|
||||
node.name = this.jsxParseNamespacedName();
|
||||
node.value = this.eat(_types.types.eq) ? this.jsxParseAttributeValue() : null;
|
||||
return this.finishNode(node, "JSXAttribute");
|
||||
}
|
||||
|
||||
jsxParseOpeningElementAt(startPos, startLoc) {
|
||||
const node = this.startNodeAt(startPos, startLoc);
|
||||
|
||||
if (this.match(_types.types.jsxTagEnd)) {
|
||||
this.expect(_types.types.jsxTagEnd);
|
||||
return this.finishNode(node, "JSXOpeningFragment");
|
||||
}
|
||||
|
||||
node.name = this.jsxParseElementName();
|
||||
return this.jsxParseOpeningElementAfterName(node);
|
||||
}
|
||||
|
||||
jsxParseOpeningElementAfterName(node) {
|
||||
const attributes = [];
|
||||
|
||||
while (!this.match(_types.types.slash) && !this.match(_types.types.jsxTagEnd)) {
|
||||
attributes.push(this.jsxParseAttribute());
|
||||
}
|
||||
|
||||
node.attributes = attributes;
|
||||
node.selfClosing = this.eat(_types.types.slash);
|
||||
this.expect(_types.types.jsxTagEnd);
|
||||
return this.finishNode(node, "JSXOpeningElement");
|
||||
}
|
||||
|
||||
jsxParseClosingElementAt(startPos, startLoc) {
|
||||
const node = this.startNodeAt(startPos, startLoc);
|
||||
|
||||
if (this.match(_types.types.jsxTagEnd)) {
|
||||
this.expect(_types.types.jsxTagEnd);
|
||||
return this.finishNode(node, "JSXClosingFragment");
|
||||
}
|
||||
|
||||
node.name = this.jsxParseElementName();
|
||||
this.expect(_types.types.jsxTagEnd);
|
||||
return this.finishNode(node, "JSXClosingElement");
|
||||
}
|
||||
|
||||
jsxParseElementAt(startPos, startLoc) {
|
||||
const node = this.startNodeAt(startPos, startLoc);
|
||||
const children = [];
|
||||
const openingElement = this.jsxParseOpeningElementAt(startPos, startLoc);
|
||||
let closingElement = null;
|
||||
|
||||
if (!openingElement.selfClosing) {
|
||||
contents: for (;;) {
|
||||
switch (this.state.type) {
|
||||
case _types.types.jsxTagStart:
|
||||
startPos = this.state.start;
|
||||
startLoc = this.state.startLoc;
|
||||
this.next();
|
||||
|
||||
if (this.eat(_types.types.slash)) {
|
||||
closingElement = this.jsxParseClosingElementAt(startPos, startLoc);
|
||||
break contents;
|
||||
}
|
||||
|
||||
children.push(this.jsxParseElementAt(startPos, startLoc));
|
||||
break;
|
||||
|
||||
case _types.types.jsxText:
|
||||
children.push(this.parseExprAtom());
|
||||
break;
|
||||
|
||||
case _types.types.braceL:
|
||||
{
|
||||
const node = this.startNode();
|
||||
this.next();
|
||||
|
||||
if (this.match(_types.types.ellipsis)) {
|
||||
children.push(this.jsxParseSpreadChild(node));
|
||||
} else {
|
||||
children.push(this.jsxParseExpressionContainer(node));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
throw this.unexpected();
|
||||
}
|
||||
}
|
||||
|
||||
if (isFragment(openingElement) && !isFragment(closingElement)) {
|
||||
this.raise(closingElement.start, JsxErrors.MissingClosingTagFragment);
|
||||
} else if (!isFragment(openingElement) && isFragment(closingElement)) {
|
||||
this.raise(closingElement.start, JsxErrors.MissingClosingTagElement, getQualifiedJSXName(openingElement.name));
|
||||
} else if (!isFragment(openingElement) && !isFragment(closingElement)) {
|
||||
if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
|
||||
this.raise(closingElement.start, JsxErrors.MissingClosingTagElement, getQualifiedJSXName(openingElement.name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isFragment(openingElement)) {
|
||||
node.openingFragment = openingElement;
|
||||
node.closingFragment = closingElement;
|
||||
} else {
|
||||
node.openingElement = openingElement;
|
||||
node.closingElement = closingElement;
|
||||
}
|
||||
|
||||
node.children = children;
|
||||
|
||||
if (this.isRelational("<")) {
|
||||
throw this.raise(this.state.start, JsxErrors.UnwrappedAdjacentJSXElements);
|
||||
}
|
||||
|
||||
return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement");
|
||||
}
|
||||
|
||||
jsxParseElement() {
|
||||
const startPos = this.state.start;
|
||||
const startLoc = this.state.startLoc;
|
||||
this.next();
|
||||
return this.jsxParseElementAt(startPos, startLoc);
|
||||
}
|
||||
|
||||
parseExprAtom(refExpressionErrors) {
|
||||
if (this.match(_types.types.jsxText)) {
|
||||
return this.parseLiteral(this.state.value, "JSXText");
|
||||
} else if (this.match(_types.types.jsxTagStart)) {
|
||||
return this.jsxParseElement();
|
||||
} else if (this.isRelational("<") && this.input.charCodeAt(this.state.pos) !== 33) {
|
||||
this.finishToken(_types.types.jsxTagStart);
|
||||
return this.jsxParseElement();
|
||||
} else {
|
||||
return super.parseExprAtom(refExpressionErrors);
|
||||
}
|
||||
}
|
||||
|
||||
getTokenFromCode(code) {
|
||||
if (this.state.inPropertyName) return super.getTokenFromCode(code);
|
||||
const context = this.curContext();
|
||||
|
||||
if (context === _context.types.j_expr) {
|
||||
return this.jsxReadToken();
|
||||
}
|
||||
|
||||
if (context === _context.types.j_oTag || context === _context.types.j_cTag) {
|
||||
if ((0, _identifier.isIdentifierStart)(code)) {
|
||||
return this.jsxReadWord();
|
||||
}
|
||||
|
||||
if (code === 62) {
|
||||
++this.state.pos;
|
||||
return this.finishToken(_types.types.jsxTagEnd);
|
||||
}
|
||||
|
||||
if ((code === 34 || code === 39) && context === _context.types.j_oTag) {
|
||||
return this.jsxReadString(code);
|
||||
}
|
||||
}
|
||||
|
||||
if (code === 60 && this.state.exprAllowed && this.input.charCodeAt(this.state.pos + 1) !== 33) {
|
||||
++this.state.pos;
|
||||
return this.finishToken(_types.types.jsxTagStart);
|
||||
}
|
||||
|
||||
return super.getTokenFromCode(code);
|
||||
}
|
||||
|
||||
updateContext(prevType) {
|
||||
if (this.match(_types.types.braceL)) {
|
||||
const curContext = this.curContext();
|
||||
|
||||
if (curContext === _context.types.j_oTag) {
|
||||
this.state.context.push(_context.types.braceExpression);
|
||||
} else if (curContext === _context.types.j_expr) {
|
||||
this.state.context.push(_context.types.templateQuasi);
|
||||
} else {
|
||||
super.updateContext(prevType);
|
||||
}
|
||||
|
||||
this.state.exprAllowed = true;
|
||||
} else if (this.match(_types.types.slash) && prevType === _types.types.jsxTagStart) {
|
||||
this.state.context.length -= 2;
|
||||
this.state.context.push(_context.types.j_cTag);
|
||||
this.state.exprAllowed = false;
|
||||
} else {
|
||||
return super.updateContext(prevType);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
exports.default = _default;
|
263
node_modules/@babel/parser/lib/plugins/jsx/xhtml.js
generated
vendored
@ -1,263 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
const entities = {
|
||||
quot: "\u0022",
|
||||
amp: "&",
|
||||
apos: "\u0027",
|
||||
lt: "<",
|
||||
gt: ">",
|
||||
nbsp: "\u00A0",
|
||||
iexcl: "\u00A1",
|
||||
cent: "\u00A2",
|
||||
pound: "\u00A3",
|
||||
curren: "\u00A4",
|
||||
yen: "\u00A5",
|
||||
brvbar: "\u00A6",
|
||||
sect: "\u00A7",
|
||||
uml: "\u00A8",
|
||||
copy: "\u00A9",
|
||||
ordf: "\u00AA",
|
||||
laquo: "\u00AB",
|
||||
not: "\u00AC",
|
||||
shy: "\u00AD",
|
||||
reg: "\u00AE",
|
||||
macr: "\u00AF",
|
||||
deg: "\u00B0",
|
||||
plusmn: "\u00B1",
|
||||
sup2: "\u00B2",
|
||||
sup3: "\u00B3",
|
||||
acute: "\u00B4",
|
||||
micro: "\u00B5",
|
||||
para: "\u00B6",
|
||||
middot: "\u00B7",
|
||||
cedil: "\u00B8",
|
||||
sup1: "\u00B9",
|
||||
ordm: "\u00BA",
|
||||
raquo: "\u00BB",
|
||||
frac14: "\u00BC",
|
||||
frac12: "\u00BD",
|
||||
frac34: "\u00BE",
|
||||
iquest: "\u00BF",
|
||||
Agrave: "\u00C0",
|
||||
Aacute: "\u00C1",
|
||||
Acirc: "\u00C2",
|
||||
Atilde: "\u00C3",
|
||||
Auml: "\u00C4",
|
||||
Aring: "\u00C5",
|
||||
AElig: "\u00C6",
|
||||
Ccedil: "\u00C7",
|
||||
Egrave: "\u00C8",
|
||||
Eacute: "\u00C9",
|
||||
Ecirc: "\u00CA",
|
||||
Euml: "\u00CB",
|
||||
Igrave: "\u00CC",
|
||||
Iacute: "\u00CD",
|
||||
Icirc: "\u00CE",
|
||||
Iuml: "\u00CF",
|
||||
ETH: "\u00D0",
|
||||
Ntilde: "\u00D1",
|
||||
Ograve: "\u00D2",
|
||||
Oacute: "\u00D3",
|
||||
Ocirc: "\u00D4",
|
||||
Otilde: "\u00D5",
|
||||
Ouml: "\u00D6",
|
||||
times: "\u00D7",
|
||||
Oslash: "\u00D8",
|
||||
Ugrave: "\u00D9",
|
||||
Uacute: "\u00DA",
|
||||
Ucirc: "\u00DB",
|
||||
Uuml: "\u00DC",
|
||||
Yacute: "\u00DD",
|
||||
THORN: "\u00DE",
|
||||
szlig: "\u00DF",
|
||||
agrave: "\u00E0",
|
||||
aacute: "\u00E1",
|
||||
acirc: "\u00E2",
|
||||
atilde: "\u00E3",
|
||||
auml: "\u00E4",
|
||||
aring: "\u00E5",
|
||||
aelig: "\u00E6",
|
||||
ccedil: "\u00E7",
|
||||
egrave: "\u00E8",
|
||||
eacute: "\u00E9",
|
||||
ecirc: "\u00EA",
|
||||
euml: "\u00EB",
|
||||
igrave: "\u00EC",
|
||||
iacute: "\u00ED",
|
||||
icirc: "\u00EE",
|
||||
iuml: "\u00EF",
|
||||
eth: "\u00F0",
|
||||
ntilde: "\u00F1",
|
||||
ograve: "\u00F2",
|
||||
oacute: "\u00F3",
|
||||
ocirc: "\u00F4",
|
||||
otilde: "\u00F5",
|
||||
ouml: "\u00F6",
|
||||
divide: "\u00F7",
|
||||
oslash: "\u00F8",
|
||||
ugrave: "\u00F9",
|
||||
uacute: "\u00FA",
|
||||
ucirc: "\u00FB",
|
||||
uuml: "\u00FC",
|
||||
yacute: "\u00FD",
|
||||
thorn: "\u00FE",
|
||||
yuml: "\u00FF",
|
||||
OElig: "\u0152",
|
||||
oelig: "\u0153",
|
||||
Scaron: "\u0160",
|
||||
scaron: "\u0161",
|
||||
Yuml: "\u0178",
|
||||
fnof: "\u0192",
|
||||
circ: "\u02C6",
|
||||
tilde: "\u02DC",
|
||||
Alpha: "\u0391",
|
||||
Beta: "\u0392",
|
||||
Gamma: "\u0393",
|
||||
Delta: "\u0394",
|
||||
Epsilon: "\u0395",
|
||||
Zeta: "\u0396",
|
||||
Eta: "\u0397",
|
||||
Theta: "\u0398",
|
||||
Iota: "\u0399",
|
||||
Kappa: "\u039A",
|
||||
Lambda: "\u039B",
|
||||
Mu: "\u039C",
|
||||
Nu: "\u039D",
|
||||
Xi: "\u039E",
|
||||
Omicron: "\u039F",
|
||||
Pi: "\u03A0",
|
||||
Rho: "\u03A1",
|
||||
Sigma: "\u03A3",
|
||||
Tau: "\u03A4",
|
||||
Upsilon: "\u03A5",
|
||||
Phi: "\u03A6",
|
||||
Chi: "\u03A7",
|
||||
Psi: "\u03A8",
|
||||
Omega: "\u03A9",
|
||||
alpha: "\u03B1",
|
||||
beta: "\u03B2",
|
||||
gamma: "\u03B3",
|
||||
delta: "\u03B4",
|
||||
epsilon: "\u03B5",
|
||||
zeta: "\u03B6",
|
||||
eta: "\u03B7",
|
||||
theta: "\u03B8",
|
||||
iota: "\u03B9",
|
||||
kappa: "\u03BA",
|
||||
lambda: "\u03BB",
|
||||
mu: "\u03BC",
|
||||
nu: "\u03BD",
|
||||
xi: "\u03BE",
|
||||
omicron: "\u03BF",
|
||||
pi: "\u03C0",
|
||||
rho: "\u03C1",
|
||||
sigmaf: "\u03C2",
|
||||
sigma: "\u03C3",
|
||||
tau: "\u03C4",
|
||||
upsilon: "\u03C5",
|
||||
phi: "\u03C6",
|
||||
chi: "\u03C7",
|
||||
psi: "\u03C8",
|
||||
omega: "\u03C9",
|
||||
thetasym: "\u03D1",
|
||||
upsih: "\u03D2",
|
||||
piv: "\u03D6",
|
||||
ensp: "\u2002",
|
||||
emsp: "\u2003",
|
||||
thinsp: "\u2009",
|
||||
zwnj: "\u200C",
|
||||
zwj: "\u200D",
|
||||
lrm: "\u200E",
|
||||
rlm: "\u200F",
|
||||
ndash: "\u2013",
|
||||
mdash: "\u2014",
|
||||
lsquo: "\u2018",
|
||||
rsquo: "\u2019",
|
||||
sbquo: "\u201A",
|
||||
ldquo: "\u201C",
|
||||
rdquo: "\u201D",
|
||||
bdquo: "\u201E",
|
||||
dagger: "\u2020",
|
||||
Dagger: "\u2021",
|
||||
bull: "\u2022",
|
||||
hellip: "\u2026",
|
||||
permil: "\u2030",
|
||||
prime: "\u2032",
|
||||
Prime: "\u2033",
|
||||
lsaquo: "\u2039",
|
||||
rsaquo: "\u203A",
|
||||
oline: "\u203E",
|
||||
frasl: "\u2044",
|
||||
euro: "\u20AC",
|
||||
image: "\u2111",
|
||||
weierp: "\u2118",
|
||||
real: "\u211C",
|
||||
trade: "\u2122",
|
||||
alefsym: "\u2135",
|
||||
larr: "\u2190",
|
||||
uarr: "\u2191",
|
||||
rarr: "\u2192",
|
||||
darr: "\u2193",
|
||||
harr: "\u2194",
|
||||
crarr: "\u21B5",
|
||||
lArr: "\u21D0",
|
||||
uArr: "\u21D1",
|
||||
rArr: "\u21D2",
|
||||
dArr: "\u21D3",
|
||||
hArr: "\u21D4",
|
||||
forall: "\u2200",
|
||||
part: "\u2202",
|
||||
exist: "\u2203",
|
||||
empty: "\u2205",
|
||||
nabla: "\u2207",
|
||||
isin: "\u2208",
|
||||
notin: "\u2209",
|
||||
ni: "\u220B",
|
||||
prod: "\u220F",
|
||||
sum: "\u2211",
|
||||
minus: "\u2212",
|
||||
lowast: "\u2217",
|
||||
radic: "\u221A",
|
||||
prop: "\u221D",
|
||||
infin: "\u221E",
|
||||
ang: "\u2220",
|
||||
and: "\u2227",
|
||||
or: "\u2228",
|
||||
cap: "\u2229",
|
||||
cup: "\u222A",
|
||||
int: "\u222B",
|
||||
there4: "\u2234",
|
||||
sim: "\u223C",
|
||||
cong: "\u2245",
|
||||
asymp: "\u2248",
|
||||
ne: "\u2260",
|
||||
equiv: "\u2261",
|
||||
le: "\u2264",
|
||||
ge: "\u2265",
|
||||
sub: "\u2282",
|
||||
sup: "\u2283",
|
||||
nsub: "\u2284",
|
||||
sube: "\u2286",
|
||||
supe: "\u2287",
|
||||
oplus: "\u2295",
|
||||
otimes: "\u2297",
|
||||
perp: "\u22A5",
|
||||
sdot: "\u22C5",
|
||||
lceil: "\u2308",
|
||||
rceil: "\u2309",
|
||||
lfloor: "\u230A",
|
||||
rfloor: "\u230B",
|
||||
lang: "\u2329",
|
||||
rang: "\u232A",
|
||||
loz: "\u25CA",
|
||||
spades: "\u2660",
|
||||
clubs: "\u2663",
|
||||
hearts: "\u2665",
|
||||
diams: "\u2666"
|
||||
};
|
||||
var _default = entities;
|
||||
exports.default = _default;
|
219
node_modules/@babel/parser/lib/plugins/placeholders.js
generated
vendored
@ -1,219 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _types = require("../tokenizer/types");
|
||||
|
||||
var N = _interopRequireWildcard(require("../types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
_types.types.placeholder = new _types.TokenType("%%", {
|
||||
startsExpr: true
|
||||
});
|
||||
|
||||
var _default = superClass => class extends superClass {
|
||||
parsePlaceholder(expectedNode) {
|
||||
if (this.match(_types.types.placeholder)) {
|
||||
const node = this.startNode();
|
||||
this.next();
|
||||
this.assertNoSpace("Unexpected space in placeholder.");
|
||||
node.name = super.parseIdentifier(true);
|
||||
this.assertNoSpace("Unexpected space in placeholder.");
|
||||
this.expect(_types.types.placeholder);
|
||||
return this.finishPlaceholder(node, expectedNode);
|
||||
}
|
||||
}
|
||||
|
||||
finishPlaceholder(node, expectedNode) {
|
||||
const isFinished = !!(node.expectedNode && node.type === "Placeholder");
|
||||
node.expectedNode = expectedNode;
|
||||
return isFinished ? node : this.finishNode(node, "Placeholder");
|
||||
}
|
||||
|
||||
getTokenFromCode(code) {
|
||||
if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) {
|
||||
return this.finishOp(_types.types.placeholder, 2);
|
||||
}
|
||||
|
||||
return super.getTokenFromCode(...arguments);
|
||||
}
|
||||
|
||||
parseExprAtom() {
|
||||
return this.parsePlaceholder("Expression") || super.parseExprAtom(...arguments);
|
||||
}
|
||||
|
||||
parseIdentifier() {
|
||||
return this.parsePlaceholder("Identifier") || super.parseIdentifier(...arguments);
|
||||
}
|
||||
|
||||
checkReservedWord(word) {
|
||||
if (word !== undefined) super.checkReservedWord(...arguments);
|
||||
}
|
||||
|
||||
parseBindingAtom() {
|
||||
return this.parsePlaceholder("Pattern") || super.parseBindingAtom(...arguments);
|
||||
}
|
||||
|
||||
checkLVal(expr) {
|
||||
if (expr.type !== "Placeholder") super.checkLVal(...arguments);
|
||||
}
|
||||
|
||||
toAssignable(node) {
|
||||
if (node && node.type === "Placeholder" && node.expectedNode === "Expression") {
|
||||
node.expectedNode = "Pattern";
|
||||
return node;
|
||||
}
|
||||
|
||||
return super.toAssignable(...arguments);
|
||||
}
|
||||
|
||||
verifyBreakContinue(node) {
|
||||
if (node.label && node.label.type === "Placeholder") return;
|
||||
super.verifyBreakContinue(...arguments);
|
||||
}
|
||||
|
||||
parseExpressionStatement(node, expr) {
|
||||
if (expr.type !== "Placeholder" || expr.extra && expr.extra.parenthesized) {
|
||||
return super.parseExpressionStatement(...arguments);
|
||||
}
|
||||
|
||||
if (this.match(_types.types.colon)) {
|
||||
const stmt = node;
|
||||
stmt.label = this.finishPlaceholder(expr, "Identifier");
|
||||
this.next();
|
||||
stmt.body = this.parseStatement("label");
|
||||
return this.finishNode(stmt, "LabeledStatement");
|
||||
}
|
||||
|
||||
this.semicolon();
|
||||
node.name = expr.name;
|
||||
return this.finishPlaceholder(node, "Statement");
|
||||
}
|
||||
|
||||
parseBlock() {
|
||||
return this.parsePlaceholder("BlockStatement") || super.parseBlock(...arguments);
|
||||
}
|
||||
|
||||
parseFunctionId() {
|
||||
return this.parsePlaceholder("Identifier") || super.parseFunctionId(...arguments);
|
||||
}
|
||||
|
||||
parseClass(node, isStatement, optionalId) {
|
||||
const type = isStatement ? "ClassDeclaration" : "ClassExpression";
|
||||
this.next();
|
||||
this.takeDecorators(node);
|
||||
const oldStrict = this.state.strict;
|
||||
const placeholder = this.parsePlaceholder("Identifier");
|
||||
|
||||
if (placeholder) {
|
||||
if (this.match(_types.types._extends) || this.match(_types.types.placeholder) || this.match(_types.types.braceL)) {
|
||||
node.id = placeholder;
|
||||
} else if (optionalId || !isStatement) {
|
||||
node.id = null;
|
||||
node.body = this.finishPlaceholder(placeholder, "ClassBody");
|
||||
return this.finishNode(node, type);
|
||||
} else {
|
||||
this.unexpected(null, "A class name is required");
|
||||
}
|
||||
} else {
|
||||
this.parseClassId(node, isStatement, optionalId);
|
||||
}
|
||||
|
||||
this.parseClassSuper(node);
|
||||
node.body = this.parsePlaceholder("ClassBody") || this.parseClassBody(!!node.superClass, oldStrict);
|
||||
return this.finishNode(node, type);
|
||||
}
|
||||
|
||||
parseExport(node) {
|
||||
const placeholder = this.parsePlaceholder("Identifier");
|
||||
if (!placeholder) return super.parseExport(...arguments);
|
||||
|
||||
if (!this.isContextual("from") && !this.match(_types.types.comma)) {
|
||||
node.specifiers = [];
|
||||
node.source = null;
|
||||
node.declaration = this.finishPlaceholder(placeholder, "Declaration");
|
||||
return this.finishNode(node, "ExportNamedDeclaration");
|
||||
}
|
||||
|
||||
this.expectPlugin("exportDefaultFrom");
|
||||
const specifier = this.startNode();
|
||||
specifier.exported = placeholder;
|
||||
node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
|
||||
return super.parseExport(node);
|
||||
}
|
||||
|
||||
isExportDefaultSpecifier() {
|
||||
if (this.match(_types.types._default)) {
|
||||
const next = this.nextTokenStart();
|
||||
|
||||
if (this.isUnparsedContextual(next, "from")) {
|
||||
if (this.input.startsWith(_types.types.placeholder.label, this.nextTokenStartSince(next + 4))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return super.isExportDefaultSpecifier();
|
||||
}
|
||||
|
||||
maybeParseExportDefaultSpecifier(node) {
|
||||
if (node.specifiers && node.specifiers.length > 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.maybeParseExportDefaultSpecifier(...arguments);
|
||||
}
|
||||
|
||||
checkExport(node) {
|
||||
const {
|
||||
specifiers
|
||||
} = node;
|
||||
|
||||
if (specifiers?.length) {
|
||||
node.specifiers = specifiers.filter(node => node.exported.type === "Placeholder");
|
||||
}
|
||||
|
||||
super.checkExport(node);
|
||||
node.specifiers = specifiers;
|
||||
}
|
||||
|
||||
parseImport(node) {
|
||||
const placeholder = this.parsePlaceholder("Identifier");
|
||||
if (!placeholder) return super.parseImport(...arguments);
|
||||
node.specifiers = [];
|
||||
|
||||
if (!this.isContextual("from") && !this.match(_types.types.comma)) {
|
||||
node.source = this.finishPlaceholder(placeholder, "StringLiteral");
|
||||
this.semicolon();
|
||||
return this.finishNode(node, "ImportDeclaration");
|
||||
}
|
||||
|
||||
const specifier = this.startNodeAtNode(placeholder);
|
||||
specifier.local = placeholder;
|
||||
this.finishNode(specifier, "ImportDefaultSpecifier");
|
||||
node.specifiers.push(specifier);
|
||||
|
||||
if (this.eat(_types.types.comma)) {
|
||||
const hasStarImport = this.maybeParseStarImportSpecifier(node);
|
||||
if (!hasStarImport) this.parseNamedImportSpecifiers(node);
|
||||
}
|
||||
|
||||
this.expectContextual("from");
|
||||
node.source = this.parseImportSource();
|
||||
this.semicolon();
|
||||
return this.finishNode(node, "ImportDeclaration");
|
||||
}
|
||||
|
||||
parseImportSource() {
|
||||
return this.parsePlaceholder("StringLiteral") || super.parseImportSource(...arguments);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
exports.default = _default;
|
2283
node_modules/@babel/parser/lib/plugins/typescript/index.js
generated
vendored
94
node_modules/@babel/parser/lib/plugins/typescript/scope.js
generated
vendored
@ -1,94 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _scope = _interopRequireWildcard(require("../../util/scope"));
|
||||
|
||||
var _scopeflags = require("../../util/scopeflags");
|
||||
|
||||
var N = _interopRequireWildcard(require("../../types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
class TypeScriptScope extends _scope.Scope {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
this.types = [];
|
||||
this.enums = [];
|
||||
this.constEnums = [];
|
||||
this.classes = [];
|
||||
this.exportOnlyBindings = [];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class TypeScriptScopeHandler extends _scope.default {
|
||||
createScope(flags) {
|
||||
return new TypeScriptScope(flags);
|
||||
}
|
||||
|
||||
declareName(name, bindingType, pos) {
|
||||
const scope = this.currentScope();
|
||||
|
||||
if (bindingType & _scopeflags.BIND_FLAGS_TS_EXPORT_ONLY) {
|
||||
this.maybeExportDefined(scope, name);
|
||||
scope.exportOnlyBindings.push(name);
|
||||
return;
|
||||
}
|
||||
|
||||
super.declareName(...arguments);
|
||||
|
||||
if (bindingType & _scopeflags.BIND_KIND_TYPE) {
|
||||
if (!(bindingType & _scopeflags.BIND_KIND_VALUE)) {
|
||||
this.checkRedeclarationInScope(scope, name, bindingType, pos);
|
||||
this.maybeExportDefined(scope, name);
|
||||
}
|
||||
|
||||
scope.types.push(name);
|
||||
}
|
||||
|
||||
if (bindingType & _scopeflags.BIND_FLAGS_TS_ENUM) scope.enums.push(name);
|
||||
if (bindingType & _scopeflags.BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.push(name);
|
||||
if (bindingType & _scopeflags.BIND_FLAGS_CLASS) scope.classes.push(name);
|
||||
}
|
||||
|
||||
isRedeclaredInScope(scope, name, bindingType) {
|
||||
if (scope.enums.indexOf(name) > -1) {
|
||||
if (bindingType & _scopeflags.BIND_FLAGS_TS_ENUM) {
|
||||
const isConst = !!(bindingType & _scopeflags.BIND_FLAGS_TS_CONST_ENUM);
|
||||
const wasConst = scope.constEnums.indexOf(name) > -1;
|
||||
return isConst !== wasConst;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (bindingType & _scopeflags.BIND_FLAGS_CLASS && scope.classes.indexOf(name) > -1) {
|
||||
if (scope.lexical.indexOf(name) > -1) {
|
||||
return !!(bindingType & _scopeflags.BIND_KIND_VALUE);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (bindingType & _scopeflags.BIND_KIND_TYPE && scope.types.indexOf(name) > -1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.isRedeclaredInScope(...arguments);
|
||||
}
|
||||
|
||||
checkLocalExport(id) {
|
||||
if (this.scopeStack[0].types.indexOf(id.name) === -1 && this.scopeStack[0].exportOnlyBindings.indexOf(id.name) === -1) {
|
||||
super.checkLocalExport(id);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = TypeScriptScopeHandler;
|
43
node_modules/@babel/parser/lib/plugins/v8intrinsic.js
generated
vendored
@ -1,43 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _types = require("../tokenizer/types");
|
||||
|
||||
var N = _interopRequireWildcard(require("../types"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
var _default = superClass => class extends superClass {
|
||||
parseV8Intrinsic() {
|
||||
if (this.match(_types.types.modulo)) {
|
||||
const v8IntrinsicStart = this.state.start;
|
||||
const node = this.startNode();
|
||||
this.eat(_types.types.modulo);
|
||||
|
||||
if (this.match(_types.types.name)) {
|
||||
const name = this.parseIdentifierName(this.state.start);
|
||||
const identifier = this.createIdentifier(node, name);
|
||||
identifier.type = "V8IntrinsicIdentifier";
|
||||
|
||||
if (this.match(_types.types.parenL)) {
|
||||
return identifier;
|
||||
}
|
||||
}
|
||||
|
||||
this.unexpected(v8IntrinsicStart);
|
||||
}
|
||||
}
|
||||
|
||||
parseExprAtom() {
|
||||
return this.parseV8Intrinsic() || super.parseExprAtom(...arguments);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
exports.default = _default;
|
110
node_modules/@babel/parser/lib/tokenizer/context.js
generated
vendored
@ -1,110 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.types = exports.TokContext = void 0;
|
||||
|
||||
var _types = require("./types");
|
||||
|
||||
class TokContext {
|
||||
constructor(token, isExpr, preserveSpace, override) {
|
||||
this.token = void 0;
|
||||
this.isExpr = void 0;
|
||||
this.preserveSpace = void 0;
|
||||
this.override = void 0;
|
||||
this.token = token;
|
||||
this.isExpr = !!isExpr;
|
||||
this.preserveSpace = !!preserveSpace;
|
||||
this.override = override;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.TokContext = TokContext;
|
||||
const types = {
|
||||
braceStatement: new TokContext("{", false),
|
||||
braceExpression: new TokContext("{", true),
|
||||
recordExpression: new TokContext("#{", true),
|
||||
templateQuasi: new TokContext("${", false),
|
||||
parenStatement: new TokContext("(", false),
|
||||
parenExpression: new TokContext("(", true),
|
||||
template: new TokContext("`", true, true, p => p.readTmplToken()),
|
||||
functionExpression: new TokContext("function", true),
|
||||
functionStatement: new TokContext("function", false)
|
||||
};
|
||||
exports.types = types;
|
||||
|
||||
_types.types.parenR.updateContext = _types.types.braceR.updateContext = function () {
|
||||
if (this.state.context.length === 1) {
|
||||
this.state.exprAllowed = true;
|
||||
return;
|
||||
}
|
||||
|
||||
let out = this.state.context.pop();
|
||||
|
||||
if (out === types.braceStatement && this.curContext().token === "function") {
|
||||
out = this.state.context.pop();
|
||||
}
|
||||
|
||||
this.state.exprAllowed = !out.isExpr;
|
||||
};
|
||||
|
||||
_types.types.name.updateContext = function (prevType) {
|
||||
let allowed = false;
|
||||
|
||||
if (prevType !== _types.types.dot) {
|
||||
if (this.state.value === "of" && !this.state.exprAllowed && prevType !== _types.types._function && prevType !== _types.types._class) {
|
||||
allowed = true;
|
||||
}
|
||||
}
|
||||
|
||||
this.state.exprAllowed = allowed;
|
||||
|
||||
if (this.state.isIterator) {
|
||||
this.state.isIterator = false;
|
||||
}
|
||||
};
|
||||
|
||||
_types.types.braceL.updateContext = function (prevType) {
|
||||
this.state.context.push(this.braceIsBlock(prevType) ? types.braceStatement : types.braceExpression);
|
||||
this.state.exprAllowed = true;
|
||||
};
|
||||
|
||||
_types.types.dollarBraceL.updateContext = function () {
|
||||
this.state.context.push(types.templateQuasi);
|
||||
this.state.exprAllowed = true;
|
||||
};
|
||||
|
||||
_types.types.parenL.updateContext = function (prevType) {
|
||||
const statementParens = prevType === _types.types._if || prevType === _types.types._for || prevType === _types.types._with || prevType === _types.types._while;
|
||||
this.state.context.push(statementParens ? types.parenStatement : types.parenExpression);
|
||||
this.state.exprAllowed = true;
|
||||
};
|
||||
|
||||
_types.types.incDec.updateContext = function () {};
|
||||
|
||||
_types.types._function.updateContext = _types.types._class.updateContext = function (prevType) {
|
||||
if (prevType.beforeExpr && prevType !== _types.types.semi && prevType !== _types.types._else && !(prevType === _types.types._return && this.hasPrecedingLineBreak()) && !((prevType === _types.types.colon || prevType === _types.types.braceL) && this.curContext() === types.b_stat)) {
|
||||
this.state.context.push(types.functionExpression);
|
||||
} else {
|
||||
this.state.context.push(types.functionStatement);
|
||||
}
|
||||
|
||||
this.state.exprAllowed = false;
|
||||
};
|
||||
|
||||
_types.types.backQuote.updateContext = function () {
|
||||
if (this.curContext() === types.template) {
|
||||
this.state.context.pop();
|
||||
} else {
|
||||
this.state.context.push(types.template);
|
||||
}
|
||||
|
||||
this.state.exprAllowed = false;
|
||||
};
|
||||
|
||||
_types.types.braceHashL.updateContext = function () {
|
||||
this.state.context.push(types.recordExpression);
|
||||
this.state.exprAllowed = true;
|
||||
};
|
1302
node_modules/@babel/parser/lib/tokenizer/index.js
generated
vendored
99
node_modules/@babel/parser/lib/tokenizer/state.js
generated
vendored
@ -1,99 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var N = _interopRequireWildcard(require("../types"));
|
||||
|
||||
var _location = require("../util/location");
|
||||
|
||||
var _context = require("./context");
|
||||
|
||||
var _types2 = require("./types");
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
class State {
|
||||
constructor() {
|
||||
this.strict = void 0;
|
||||
this.curLine = void 0;
|
||||
this.startLoc = void 0;
|
||||
this.endLoc = void 0;
|
||||
this.errors = [];
|
||||
this.potentialArrowAt = -1;
|
||||
this.noArrowAt = [];
|
||||
this.noArrowParamsConversionAt = [];
|
||||
this.maybeInArrowParameters = false;
|
||||
this.inPipeline = false;
|
||||
this.inType = false;
|
||||
this.noAnonFunctionType = false;
|
||||
this.inPropertyName = false;
|
||||
this.hasFlowComment = false;
|
||||
this.isIterator = false;
|
||||
this.isDeclareContext = false;
|
||||
this.topicContext = {
|
||||
maxNumOfResolvableTopics: 0,
|
||||
maxTopicIndex: null
|
||||
};
|
||||
this.soloAwait = false;
|
||||
this.inFSharpPipelineDirectBody = false;
|
||||
this.labels = [];
|
||||
this.decoratorStack = [[]];
|
||||
this.comments = [];
|
||||
this.trailingComments = [];
|
||||
this.leadingComments = [];
|
||||
this.commentStack = [];
|
||||
this.commentPreviousNode = null;
|
||||
this.pos = 0;
|
||||
this.lineStart = 0;
|
||||
this.type = _types2.types.eof;
|
||||
this.value = null;
|
||||
this.start = 0;
|
||||
this.end = 0;
|
||||
this.lastTokEndLoc = null;
|
||||
this.lastTokStartLoc = null;
|
||||
this.lastTokStart = 0;
|
||||
this.lastTokEnd = 0;
|
||||
this.context = [_context.types.braceStatement];
|
||||
this.exprAllowed = true;
|
||||
this.containsEsc = false;
|
||||
this.octalPositions = [];
|
||||
this.exportedIdentifiers = [];
|
||||
this.tokensLength = 0;
|
||||
}
|
||||
|
||||
init(options) {
|
||||
this.strict = options.strictMode === false ? false : options.sourceType === "module";
|
||||
this.curLine = options.startLine;
|
||||
this.startLoc = this.endLoc = this.curPosition();
|
||||
}
|
||||
|
||||
curPosition() {
|
||||
return new _location.Position(this.curLine, this.pos - this.lineStart);
|
||||
}
|
||||
|
||||
clone(skipArrays) {
|
||||
const state = new State();
|
||||
const keys = Object.keys(this);
|
||||
|
||||
for (let i = 0, length = keys.length; i < length; i++) {
|
||||
const key = keys[i];
|
||||
let val = this[key];
|
||||
|
||||
if (!skipArrays && Array.isArray(val)) {
|
||||
val = val.slice();
|
||||
}
|
||||
|
||||
state[key] = val;
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = State;
|
296
node_modules/@babel/parser/lib/tokenizer/types.js
generated
vendored
@ -1,296 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.types = exports.keywords = exports.TokenType = void 0;
|
||||
const beforeExpr = true;
|
||||
const startsExpr = true;
|
||||
const isLoop = true;
|
||||
const isAssign = true;
|
||||
const prefix = true;
|
||||
const postfix = true;
|
||||
|
||||
class TokenType {
|
||||
constructor(label, conf = {}) {
|
||||
this.label = void 0;
|
||||
this.keyword = void 0;
|
||||
this.beforeExpr = void 0;
|
||||
this.startsExpr = void 0;
|
||||
this.rightAssociative = void 0;
|
||||
this.isLoop = void 0;
|
||||
this.isAssign = void 0;
|
||||
this.prefix = void 0;
|
||||
this.postfix = void 0;
|
||||
this.binop = void 0;
|
||||
this.updateContext = void 0;
|
||||
this.label = label;
|
||||
this.keyword = conf.keyword;
|
||||
this.beforeExpr = !!conf.beforeExpr;
|
||||
this.startsExpr = !!conf.startsExpr;
|
||||
this.rightAssociative = !!conf.rightAssociative;
|
||||
this.isLoop = !!conf.isLoop;
|
||||
this.isAssign = !!conf.isAssign;
|
||||
this.prefix = !!conf.prefix;
|
||||
this.postfix = !!conf.postfix;
|
||||
this.binop = conf.binop != null ? conf.binop : null;
|
||||
this.updateContext = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.TokenType = TokenType;
|
||||
const keywords = new Map();
|
||||
exports.keywords = keywords;
|
||||
|
||||
function createKeyword(name, options = {}) {
|
||||
options.keyword = name;
|
||||
const token = new TokenType(name, options);
|
||||
keywords.set(name, token);
|
||||
return token;
|
||||
}
|
||||
|
||||
function createBinop(name, binop) {
|
||||
return new TokenType(name, {
|
||||
beforeExpr,
|
||||
binop
|
||||
});
|
||||
}
|
||||
|
||||
const types = {
|
||||
num: new TokenType("num", {
|
||||
startsExpr
|
||||
}),
|
||||
bigint: new TokenType("bigint", {
|
||||
startsExpr
|
||||
}),
|
||||
decimal: new TokenType("decimal", {
|
||||
startsExpr
|
||||
}),
|
||||
regexp: new TokenType("regexp", {
|
||||
startsExpr
|
||||
}),
|
||||
string: new TokenType("string", {
|
||||
startsExpr
|
||||
}),
|
||||
name: new TokenType("name", {
|
||||
startsExpr
|
||||
}),
|
||||
eof: new TokenType("eof"),
|
||||
bracketL: new TokenType("[", {
|
||||
beforeExpr,
|
||||
startsExpr
|
||||
}),
|
||||
bracketHashL: new TokenType("#[", {
|
||||
beforeExpr,
|
||||
startsExpr
|
||||
}),
|
||||
bracketBarL: new TokenType("[|", {
|
||||
beforeExpr,
|
||||
startsExpr
|
||||
}),
|
||||
bracketR: new TokenType("]"),
|
||||
bracketBarR: new TokenType("|]"),
|
||||
braceL: new TokenType("{", {
|
||||
beforeExpr,
|
||||
startsExpr
|
||||
}),
|
||||
braceBarL: new TokenType("{|", {
|
||||
beforeExpr,
|
||||
startsExpr
|
||||
}),
|
||||
braceHashL: new TokenType("#{", {
|
||||
beforeExpr,
|
||||
startsExpr
|
||||
}),
|
||||
braceR: new TokenType("}"),
|
||||
braceBarR: new TokenType("|}"),
|
||||
parenL: new TokenType("(", {
|
||||
beforeExpr,
|
||||
startsExpr
|
||||
}),
|
||||
parenR: new TokenType(")"),
|
||||
comma: new TokenType(",", {
|
||||
beforeExpr
|
||||
}),
|
||||
semi: new TokenType(";", {
|
||||
beforeExpr
|
||||
}),
|
||||
colon: new TokenType(":", {
|
||||
beforeExpr
|
||||
}),
|
||||
doubleColon: new TokenType("::", {
|
||||
beforeExpr
|
||||
}),
|
||||
dot: new TokenType("."),
|
||||
question: new TokenType("?", {
|
||||
beforeExpr
|
||||
}),
|
||||
questionDot: new TokenType("?."),
|
||||
arrow: new TokenType("=>", {
|
||||
beforeExpr
|
||||
}),
|
||||
template: new TokenType("template"),
|
||||
ellipsis: new TokenType("...", {
|
||||
beforeExpr
|
||||
}),
|
||||
backQuote: new TokenType("`", {
|
||||
startsExpr
|
||||
}),
|
||||
dollarBraceL: new TokenType("${", {
|
||||
beforeExpr,
|
||||
startsExpr
|
||||
}),
|
||||
at: new TokenType("@"),
|
||||
hash: new TokenType("#", {
|
||||
startsExpr
|
||||
}),
|
||||
interpreterDirective: new TokenType("#!..."),
|
||||
eq: new TokenType("=", {
|
||||
beforeExpr,
|
||||
isAssign
|
||||
}),
|
||||
assign: new TokenType("_=", {
|
||||
beforeExpr,
|
||||
isAssign
|
||||
}),
|
||||
incDec: new TokenType("++/--", {
|
||||
prefix,
|
||||
postfix,
|
||||
startsExpr
|
||||
}),
|
||||
bang: new TokenType("!", {
|
||||
beforeExpr,
|
||||
prefix,
|
||||
startsExpr
|
||||
}),
|
||||
tilde: new TokenType("~", {
|
||||
beforeExpr,
|
||||
prefix,
|
||||
startsExpr
|
||||
}),
|
||||
pipeline: createBinop("|>", 0),
|
||||
nullishCoalescing: createBinop("??", 1),
|
||||
logicalOR: createBinop("||", 1),
|
||||
logicalAND: createBinop("&&", 2),
|
||||
bitwiseOR: createBinop("|", 3),
|
||||
bitwiseXOR: createBinop("^", 4),
|
||||
bitwiseAND: createBinop("&", 5),
|
||||
equality: createBinop("==/!=/===/!==", 6),
|
||||
relational: createBinop("</>/<=/>=", 7),
|
||||
bitShift: createBinop("<</>>/>>>", 8),
|
||||
plusMin: new TokenType("+/-", {
|
||||
beforeExpr,
|
||||
binop: 9,
|
||||
prefix,
|
||||
startsExpr
|
||||
}),
|
||||
modulo: new TokenType("%", {
|
||||
beforeExpr,
|
||||
binop: 10,
|
||||
startsExpr
|
||||
}),
|
||||
star: new TokenType("*", {
|
||||
binop: 10
|
||||
}),
|
||||
slash: createBinop("/", 10),
|
||||
exponent: new TokenType("**", {
|
||||
beforeExpr,
|
||||
binop: 11,
|
||||
rightAssociative: true
|
||||
}),
|
||||
_break: createKeyword("break"),
|
||||
_case: createKeyword("case", {
|
||||
beforeExpr
|
||||
}),
|
||||
_catch: createKeyword("catch"),
|
||||
_continue: createKeyword("continue"),
|
||||
_debugger: createKeyword("debugger"),
|
||||
_default: createKeyword("default", {
|
||||
beforeExpr
|
||||
}),
|
||||
_do: createKeyword("do", {
|
||||
isLoop,
|
||||
beforeExpr
|
||||
}),
|
||||
_else: createKeyword("else", {
|
||||
beforeExpr
|
||||
}),
|
||||
_finally: createKeyword("finally"),
|
||||
_for: createKeyword("for", {
|
||||
isLoop
|
||||
}),
|
||||
_function: createKeyword("function", {
|
||||
startsExpr
|
||||
}),
|
||||
_if: createKeyword("if"),
|
||||
_return: createKeyword("return", {
|
||||
beforeExpr
|
||||
}),
|
||||
_switch: createKeyword("switch"),
|
||||
_throw: createKeyword("throw", {
|
||||
beforeExpr,
|
||||
prefix,
|
||||
startsExpr
|
||||
}),
|
||||
_try: createKeyword("try"),
|
||||
_var: createKeyword("var"),
|
||||
_const: createKeyword("const"),
|
||||
_while: createKeyword("while", {
|
||||
isLoop
|
||||
}),
|
||||
_with: createKeyword("with"),
|
||||
_new: createKeyword("new", {
|
||||
beforeExpr,
|
||||
startsExpr
|
||||
}),
|
||||
_this: createKeyword("this", {
|
||||
startsExpr
|
||||
}),
|
||||
_super: createKeyword("super", {
|
||||
startsExpr
|
||||
}),
|
||||
_class: createKeyword("class", {
|
||||
startsExpr
|
||||
}),
|
||||
_extends: createKeyword("extends", {
|
||||
beforeExpr
|
||||
}),
|
||||
_export: createKeyword("export"),
|
||||
_import: createKeyword("import", {
|
||||
startsExpr
|
||||
}),
|
||||
_null: createKeyword("null", {
|
||||
startsExpr
|
||||
}),
|
||||
_true: createKeyword("true", {
|
||||
startsExpr
|
||||
}),
|
||||
_false: createKeyword("false", {
|
||||
startsExpr
|
||||
}),
|
||||
_in: createKeyword("in", {
|
||||
beforeExpr,
|
||||
binop: 7
|
||||
}),
|
||||
_instanceof: createKeyword("instanceof", {
|
||||
beforeExpr,
|
||||
binop: 7
|
||||
}),
|
||||
_typeof: createKeyword("typeof", {
|
||||
beforeExpr,
|
||||
prefix,
|
||||
startsExpr
|
||||
}),
|
||||
_void: createKeyword("void", {
|
||||
beforeExpr,
|
||||
prefix,
|
||||
startsExpr
|
||||
}),
|
||||
_delete: createKeyword("delete", {
|
||||
beforeExpr,
|
||||
prefix,
|
||||
startsExpr
|
||||
})
|
||||
};
|
||||
exports.types = types;
|
0
node_modules/@babel/parser/lib/types.js
generated
vendored
99
node_modules/@babel/parser/lib/util/class-scope.js
generated
vendored
@ -1,99 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = exports.ClassScope = void 0;
|
||||
|
||||
var _scopeflags = require("./scopeflags");
|
||||
|
||||
var _error = require("../parser/error");
|
||||
|
||||
class ClassScope {
|
||||
constructor() {
|
||||
this.privateNames = new Set();
|
||||
this.loneAccessors = new Map();
|
||||
this.undefinedPrivateNames = new Map();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.ClassScope = ClassScope;
|
||||
|
||||
class ClassScopeHandler {
|
||||
constructor(raise) {
|
||||
this.stack = [];
|
||||
this.undefinedPrivateNames = new Map();
|
||||
this.raise = raise;
|
||||
}
|
||||
|
||||
current() {
|
||||
return this.stack[this.stack.length - 1];
|
||||
}
|
||||
|
||||
enter() {
|
||||
this.stack.push(new ClassScope());
|
||||
}
|
||||
|
||||
exit() {
|
||||
const oldClassScope = this.stack.pop();
|
||||
const current = this.current();
|
||||
|
||||
for (let _i = 0, _Array$from = Array.from(oldClassScope.undefinedPrivateNames); _i < _Array$from.length; _i++) {
|
||||
const [name, pos] = _Array$from[_i];
|
||||
|
||||
if (current) {
|
||||
if (!current.undefinedPrivateNames.has(name)) {
|
||||
current.undefinedPrivateNames.set(name, pos);
|
||||
}
|
||||
} else {
|
||||
this.raise(pos, _error.Errors.InvalidPrivateFieldResolution, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
declarePrivateName(name, elementType, pos) {
|
||||
const classScope = this.current();
|
||||
let redefined = classScope.privateNames.has(name);
|
||||
|
||||
if (elementType & _scopeflags.CLASS_ELEMENT_KIND_ACCESSOR) {
|
||||
const accessor = redefined && classScope.loneAccessors.get(name);
|
||||
|
||||
if (accessor) {
|
||||
const oldStatic = accessor & _scopeflags.CLASS_ELEMENT_FLAG_STATIC;
|
||||
const newStatic = elementType & _scopeflags.CLASS_ELEMENT_FLAG_STATIC;
|
||||
const oldKind = accessor & _scopeflags.CLASS_ELEMENT_KIND_ACCESSOR;
|
||||
const newKind = elementType & _scopeflags.CLASS_ELEMENT_KIND_ACCESSOR;
|
||||
redefined = oldKind === newKind || oldStatic !== newStatic;
|
||||
if (!redefined) classScope.loneAccessors.delete(name);
|
||||
} else if (!redefined) {
|
||||
classScope.loneAccessors.set(name, elementType);
|
||||
}
|
||||
}
|
||||
|
||||
if (redefined) {
|
||||
this.raise(pos, _error.Errors.PrivateNameRedeclaration, name);
|
||||
}
|
||||
|
||||
classScope.privateNames.add(name);
|
||||
classScope.undefinedPrivateNames.delete(name);
|
||||
}
|
||||
|
||||
usePrivateName(name, pos) {
|
||||
let classScope;
|
||||
|
||||
for (let _i2 = 0, _this$stack = this.stack; _i2 < _this$stack.length; _i2++) {
|
||||
classScope = _this$stack[_i2];
|
||||
if (classScope.privateNames.has(name)) return;
|
||||
}
|
||||
|
||||
if (classScope) {
|
||||
classScope.undefinedPrivateNames.set(name, pos);
|
||||
} else {
|
||||
this.raise(pos, _error.Errors.InvalidPrivateFieldResolution, name);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = ClassScopeHandler;
|
138
node_modules/@babel/parser/lib/util/expression-scope.js
generated
vendored
@ -1,138 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.newParameterDeclarationScope = newParameterDeclarationScope;
|
||||
exports.newArrowHeadScope = newArrowHeadScope;
|
||||
exports.newAsyncArrowScope = newAsyncArrowScope;
|
||||
exports.newExpressionScope = newExpressionScope;
|
||||
exports.default = void 0;
|
||||
const kExpression = 0,
|
||||
kMaybeArrowParameterDeclaration = 1,
|
||||
kMaybeAsyncArrowParameterDeclaration = 2,
|
||||
kParameterDeclaration = 3;
|
||||
|
||||
class ExpressionScope {
|
||||
constructor(type = kExpression) {
|
||||
this.type = void 0;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
canBeArrowParameterDeclaration() {
|
||||
return this.type === kMaybeAsyncArrowParameterDeclaration || this.type === kMaybeArrowParameterDeclaration;
|
||||
}
|
||||
|
||||
isCertainlyParameterDeclaration() {
|
||||
return this.type === kParameterDeclaration;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class ArrowHeadParsingScope extends ExpressionScope {
|
||||
constructor(type) {
|
||||
super(type);
|
||||
this.errors = new Map();
|
||||
}
|
||||
|
||||
recordDeclarationError(pos, message) {
|
||||
this.errors.set(pos, message);
|
||||
}
|
||||
|
||||
clearDeclarationError(pos) {
|
||||
this.errors.delete(pos);
|
||||
}
|
||||
|
||||
iterateErrors(iterator) {
|
||||
this.errors.forEach(iterator);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class ExpressionScopeHandler {
|
||||
constructor(raise) {
|
||||
this.stack = [new ExpressionScope()];
|
||||
this.raise = raise;
|
||||
}
|
||||
|
||||
enter(scope) {
|
||||
this.stack.push(scope);
|
||||
}
|
||||
|
||||
exit() {
|
||||
this.stack.pop();
|
||||
}
|
||||
|
||||
recordParameterInitializerError(pos, message) {
|
||||
const {
|
||||
stack
|
||||
} = this;
|
||||
let i = stack.length - 1;
|
||||
let scope = stack[i];
|
||||
|
||||
while (!scope.isCertainlyParameterDeclaration()) {
|
||||
if (scope.canBeArrowParameterDeclaration()) {
|
||||
scope.recordDeclarationError(pos, message);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
scope = stack[--i];
|
||||
}
|
||||
|
||||
this.raise(pos, message);
|
||||
}
|
||||
|
||||
recordAsyncArrowParametersError(pos, message) {
|
||||
const {
|
||||
stack
|
||||
} = this;
|
||||
let i = stack.length - 1;
|
||||
let scope = stack[i];
|
||||
|
||||
while (scope.canBeArrowParameterDeclaration()) {
|
||||
if (scope.type === kMaybeAsyncArrowParameterDeclaration) {
|
||||
scope.recordDeclarationError(pos, message);
|
||||
}
|
||||
|
||||
scope = stack[--i];
|
||||
}
|
||||
}
|
||||
|
||||
validateAsPattern() {
|
||||
const {
|
||||
stack
|
||||
} = this;
|
||||
const currentScope = stack[stack.length - 1];
|
||||
if (!currentScope.canBeArrowParameterDeclaration()) return;
|
||||
currentScope.iterateErrors((message, pos) => {
|
||||
this.raise(pos, message);
|
||||
let i = stack.length - 2;
|
||||
let scope = stack[i];
|
||||
|
||||
while (scope.canBeArrowParameterDeclaration()) {
|
||||
scope.clearDeclarationError(pos);
|
||||
scope = stack[--i];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = ExpressionScopeHandler;
|
||||
|
||||
function newParameterDeclarationScope() {
|
||||
return new ExpressionScope(kParameterDeclaration);
|
||||
}
|
||||
|
||||
function newArrowHeadScope() {
|
||||
return new ArrowHeadParsingScope(kMaybeArrowParameterDeclaration);
|
||||
}
|
||||
|
||||
function newAsyncArrowScope() {
|
||||
return new ArrowHeadParsingScope(kMaybeAsyncArrowParameterDeclaration);
|
||||
}
|
||||
|
||||
function newExpressionScope() {
|
||||
return new ExpressionScope();
|
||||
}
|
58
node_modules/@babel/parser/lib/util/identifier.js
generated
vendored
@ -1,58 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.isIteratorStart = isIteratorStart;
|
||||
Object.defineProperty(exports, "isIdentifierStart", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _helperValidatorIdentifier.isIdentifierStart;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isIdentifierChar", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _helperValidatorIdentifier.isIdentifierChar;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isReservedWord", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _helperValidatorIdentifier.isReservedWord;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _helperValidatorIdentifier.isStrictBindOnlyReservedWord;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isStrictBindReservedWord", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _helperValidatorIdentifier.isStrictBindReservedWord;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isStrictReservedWord", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _helperValidatorIdentifier.isStrictReservedWord;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isKeyword", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _helperValidatorIdentifier.isKeyword;
|
||||
}
|
||||
});
|
||||
exports.keywordRelationalOperator = void 0;
|
||||
|
||||
var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
|
||||
|
||||
const keywordRelationalOperator = /^in(stanceof)?$/;
|
||||
exports.keywordRelationalOperator = keywordRelationalOperator;
|
||||
|
||||
function isIteratorStart(current, next) {
|
||||
return current === 64 && next === 64;
|
||||
}
|
49
node_modules/@babel/parser/lib/util/location.js
generated
vendored
@ -1,49 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getLineInfo = getLineInfo;
|
||||
exports.SourceLocation = exports.Position = void 0;
|
||||
|
||||
var _whitespace = require("./whitespace");
|
||||
|
||||
class Position {
|
||||
constructor(line, col) {
|
||||
this.line = void 0;
|
||||
this.column = void 0;
|
||||
this.line = line;
|
||||
this.column = col;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.Position = Position;
|
||||
|
||||
class SourceLocation {
|
||||
constructor(start, end) {
|
||||
this.start = void 0;
|
||||
this.end = void 0;
|
||||
this.filename = void 0;
|
||||
this.identifierName = void 0;
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.SourceLocation = SourceLocation;
|
||||
|
||||
function getLineInfo(input, offset) {
|
||||
let line = 1;
|
||||
let lineStart = 0;
|
||||
let match;
|
||||
_whitespace.lineBreakG.lastIndex = 0;
|
||||
|
||||
while ((match = _whitespace.lineBreakG.exec(input)) && match.index < offset) {
|
||||
line++;
|
||||
lineStart = _whitespace.lineBreakG.lastIndex;
|
||||
}
|
||||
|
||||
return new Position(line, offset - lineStart);
|
||||
}
|