├── .eslintignore
├── .eslintrc
├── .fatherrc.js
├── .gitignore
├── .npmignore
├── LICENSE
├── README.CN.md
├── README.md
├── coverage
├── clover.xml
├── coverage-final.json
├── lcov-report
│ ├── Plugin.js.html
│ ├── base.css
│ ├── block-navigation.js
│ ├── index.html
│ ├── index.js.html
│ ├── prettify.css
│ ├── prettify.js
│ ├── sort-arrow-sprite.png
│ └── sorter.js
└── lcov.info
├── package-lock.json
├── package.json
├── src
├── Plugin.js
├── index.js
├── index.mdx
└── index.module.less
├── test
├── fixtures
│ ├── array-expression
│ │ ├── actual.js
│ │ └── expected.js
│ ├── as-arguments-identifier
│ │ ├── actual.js
│ │ └── expected.js
│ ├── as-arguments
│ │ ├── actual.js
│ │ └── expected.js
│ ├── binary-expression
│ │ ├── actual.js
│ │ └── expected.js
│ ├── camel2-dash-name-lower
│ │ ├── actual.js
│ │ └── expected.js
│ ├── conditions
│ │ ├── actual.js
│ │ └── expected.js
│ ├── custom-name-source-file
│ │ ├── actual.js
│ │ ├── customName.js
│ │ └── expected.js
│ ├── custom-name
│ │ ├── actual.js
│ │ └── expected.js
│ ├── custom-style-name
│ │ ├── actual.js
│ │ └── expected.js
│ ├── custom-style-path-ignore
│ │ ├── actual.js
│ │ └── expected.js
│ ├── custom-style-path
│ │ ├── actual.js
│ │ └── expected.js
│ ├── execute-direct
│ │ ├── actual.js
│ │ └── expected.js
│ ├── execute-member
│ │ ├── actual.js
│ │ └── expected.js
│ ├── export-import
│ │ ├── actual.js
│ │ └── expected.js
│ ├── expression-statement
│ │ ├── actual.js
│ │ └── expected.js
│ ├── file-name
│ │ ├── actual.js
│ │ └── expected.js
│ ├── import-alias
│ │ ├── actual.js
│ │ └── expected.js
│ ├── import-css
│ │ ├── actual.js
│ │ └── expected.js
│ ├── keep-named-import
│ │ ├── actual.js
│ │ └── expected.js
│ ├── material-ui
│ │ ├── actual.js
│ │ └── expected.js
│ ├── member-expression
│ │ ├── actual.js
│ │ └── expected.js
│ ├── modules-false
│ │ ├── actual.js
│ │ └── expected.js
│ ├── multiple-libraries-hilojs
│ │ ├── actual.js
│ │ └── expected.js
│ ├── multiple-libraries
│ │ ├── actual.js
│ │ └── expected.js
│ ├── multiple-words
│ │ ├── actual.js
│ │ └── expected.js
│ ├── new-expression
│ │ ├── actual.js
│ │ └── expected.js
│ ├── object-shorthand
│ │ ├── actual.js
│ │ └── expected.js
│ ├── property
│ │ ├── actual.js
│ │ └── expected.js
│ ├── react-element
│ │ ├── actual.js
│ │ └── expected.js
│ ├── react-toolbox
│ │ ├── actual.js
│ │ └── expected.js
│ ├── return
│ │ ├── actual.js
│ │ └── expected.js
│ ├── specifier-alias
│ │ ├── actual.js
│ │ └── expected.js
│ ├── style-library-name
│ │ ├── actual.js
│ │ └── expected.js
│ ├── super-class
│ │ ├── actual.js
│ │ └── expected.js
│ ├── switch
│ │ ├── actual.js
│ │ └── expected.js
│ ├── transform-to-default-import-array
│ │ ├── actual.js
│ │ └── expected.js
│ ├── use-multiple-times
│ │ ├── actual.js
│ │ └── expected.js
│ ├── variable-declarator-renamed-import
│ │ ├── actual.js
│ │ └── expected.js
│ ├── variable-declarator
│ │ ├── actual.js
│ │ └── expected.js
│ └── variable-scope
│ │ ├── actual.js
│ │ └── expected.js
└── index.test.js
└── yarn.lock
/.eslintignore:
--------------------------------------------------------------------------------
1 | **/*/__tests__
2 | test
3 | .docz
4 | node_modules
5 | .eslintignore
6 | .eslintrc
7 | .fatherrc.js
8 | .gitgnore
9 | package.json
10 | package-lock.json
11 | yarn.lock
12 | .prettierrc
13 |
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "browser": true,
4 | "node": true,
5 | "es6": true
6 | },
7 | "parserOptions": {
8 | "ecmaVersion": 2020,
9 | "sourceType": "module"
10 | },
11 | "extends": ["eslint:recommended", "plugin:prettier/recommended"],
12 | "rules": {
13 | "no-console": [0],
14 | "prettier/prettier": 2,
15 | "global-require": 0,
16 | "func-names": 0
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/.fatherrc.js:
--------------------------------------------------------------------------------
1 | export default {
2 | entry: 'src/index.js',
3 | // ejs: 'rollup',
4 | esm: {
5 | type: 'rollup',
6 | },
7 | cjs: 'rollup',
8 | // umd: {
9 | // name: 'treasure',
10 | // },
11 | };
12 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | dist
3 | .docz
4 | yarn-error.log
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | .idea
2 | tmp
3 | node_modules
4 | coverage
5 | __tests__
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 袋鼠云
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.CN.md:
--------------------------------------------------------------------------------
1 | # babel-plugin-treasure
2 |
3 |    
4 | 基于 babel-plugin-import 致力于实现统一库的 AST 优化要求,应对各种 AST 节点修改操作的诉求。目前用于统一式便捷解决任何组件库的按需加载需求
5 |
6 | ---
7 |
8 | - [English Instruction](./README.md)
9 | - [中文说明](./README.CN.md)
10 |
11 | ## 与 babel-plugin-import 的区别
12 |
13 | ### 优化点
14 |
15 | - 无破坏性改动,兼容原本 babel-plugin-import 的所有 API
16 | - 支持组件名或者方法名大小驼峰名称转换
17 | - 支持以对象的形式输入自定义路径节点
18 | - 支持导出入口是部分 default 属性的组件
19 | - 支持 react17+ jsx 新转换
20 |
21 | ### 修复点
22 |
23 | - 修复 babel-plugin-import 未对 switch 相关 AST 树进行转换的错误
24 |
25 | ## 安装
26 |
27 | ```javascript
28 | // 使用 npm
29 | npm i babel-plugin-treasure --save-dev
30 |
31 | // 使用 yarn
32 | yarn add babel-plugin-treasure -D
33 | ```
34 |
35 | ## 使用说明
36 |
37 | 可通过以下两种途径进行使用
38 |
39 | - [babelrc](https://babeljs.io/docs/usage/babelrc/)
40 | - [babel-loader](https://github.com/babel/babel-loader)
41 |
42 | 添加到 `.babelrc` 或 babel-loader.
43 |
44 | ```js
45 | {
46 | "plugins": [["treasure", options]]
47 | }
48 | ```
49 |
50 | ### 配置
51 |
52 | `options` 可以是一个对象.
53 |
54 | ```javascript
55 | {
56 | "libraryName": "dt-react-component",
57 | "style": true, // or 'css'
58 | }
59 | ```
60 |
61 | `options` 可以是一个数组,但不支持在 babel@7+ 环境中设置
62 |
63 | ```javascript
64 | [
65 | {
66 | libraryName: 'dt-react-component',
67 | style: true, // or 'css'
68 | },
69 | ];
70 | ```
71 |
72 | `options` 在 babel@7+环境中不能是数组,但是你可以给插件添加一个名字来支持复用.
73 |
74 | 比如:
75 |
76 | ```javascrit
77 | // .babelrc
78 | "plugins": [
79 | ["treasure", { "libraryName": "dt-react-component", "libraryDirectory": "lib"}, "dtcomponent"],
80 | ["treasure", { "libraryName": "lodash", "libraryDirectory": "lib"}, "lodash"]
81 | ]
82 | ```
83 |
84 | ### 按需加载库
85 |
86 | 当你在项目中单纯引入库时,你只需要添加如下配置即可。 例如配置 dt-react-component:
87 |
88 | ```javascript
89 | "plugins": [
90 | [
91 | "treasure",
92 | {
93 | "libraryName": "dt-react-component",
94 | "libraryDirectory": "lib",
95 | "camel2DashComponentName": "lower",
96 | "style": "css"
97 | }
98 | ]
99 | ]
100 | ```
101 |
102 | 注意:当你开发的项目中有多个库均需要使用按需加载,可以加一个别名已进行区分,例如 dt-react-component 与 antd 一起使用:
103 |
104 | ```javascript
105 | "plugins": [
106 | [
107 | "treasure",
108 | {
109 | "libraryName": "antd",
110 | "libraryDirectory": "lib",
111 | "style": "css"
112 | },
113 | "antd"
114 | ],
115 | [
116 | "treasure",
117 | {
118 | "libraryName": "dt-react-component",
119 | "libraryDirectory": "lib",
120 | "camel2DashComponentName": "lower",
121 | "style": "css"
122 | },
123 | "dt-react-component"
124 | ]
125 | ]
126 | ```
127 |
128 | ## 插件 API 列表
129 |
130 | ### libraryName
131 |
132 | 需要按需引入 library 的名称,必填。
133 |
134 | #### `{ "libraryName": "dt-react-component" }`
135 |
136 | ### libraryDirectory
137 |
138 | 制定 library 的包格式目录,一般有 lib, es, esm, umd 等,由包开发者制定。此选项默认值为 lib
139 |
140 | #### `{ libraryDirectory: "lib" }`
141 |
142 | ### style
143 |
144 | 是否需要按需加载 css 文件,默认不开启
145 | Note : 当设置 style 为 true 的时候加载 css 预编译文件(less/scss),设置为 css 时加载 css 文件.
146 |
147 | 加载 css 预编译文件:
148 |
149 | #### `{ libraryDirectory: true }`
150 |
151 | 加载 css 文件:
152 |
153 | #### `{ libraryDirectory: "css" }`
154 |
155 | ### styleLibraryDirectory
156 |
157 | 制定 css 文件的 library 的包,一般不需要写
158 |
159 | #### `{ styleLibraryDirectory: "lib" }`
160 |
161 | ### camel2DashComponentName
162 |
163 | 制定组件名的转换,参数有四种,默认为 true。转换规则如下所示:
164 |
165 | ```js
166 | import { ChromeDownload } from 'dt-react-component'
167 |
168 | ↓ ↓ ↓ ↓ ↓ ↓
169 |
170 | // 当 camel2DashComponentName: true
171 | ChromeDownload → chrome-download
172 |
173 | // 当 camel2DashComponentName: false
174 | ChromeDownload → ChromeDownload // 不做改动
175 |
176 | // 当 camel2DashComponentName: "lower"
177 | ChromeDownload → chromeDownload // 转换小驼峰
178 |
179 | // 当 camel2DashComponentName: "upper"
180 | ChromeDownload → ChromeDownload // 转换大驼峰
181 | ```
182 |
183 | ### camel2UnderlineComponentName
184 |
185 | 处理多词构成的组件以\_进行单词分割
186 |
187 | ```js
188 | import { ChromeDownload } from 'dt-react-component'
189 |
190 | ↓ ↓ ↓ ↓ ↓ ↓
191 |
192 | ChromeDownload → chrome_download
193 | ```
194 |
195 | ### transformToDefaultImport
196 |
197 | 处理默认导入库的属性,默认为 true。你可以给予一个数组,在数组中的组件,最后不会以默认形式进行导出。
198 | 如果你的库完全没有默认导入,请把选项设置为 false
199 | 举例:
200 |
201 | ```js
202 | // 设置 transformToDefaultImport:[ChromeDownload]
203 | import { ChromeDownload, Circle } from 'dt-react-component'
204 |
205 | ↓ ↓ ↓ ↓ ↓ ↓
206 |
207 | import _Circle from "dt-react-component/lib/circle";
208 | import { ChromeDownload as _ChromeDownload } from "dt-react-component/lib/chromeDownload";
209 | ```
210 |
211 | ### customName
212 |
213 | 处理个别不统一规则的序列,支持函数,对象与路径导入
214 |
215 | ```js
216 | // 函数形式
217 | [
218 | 'treasure',
219 | {
220 | libraryName: 'dt-react-component',
221 | customName: (name: string) => {
222 | if (name === 'go-back') {
223 | return 'antd/lib/go-back';
224 | }
225 | return `antd/lib/${name}`;
226 | },
227 | },
228 | ];
229 | ```
230 |
231 | 通过处理后,会变成这样
232 |
233 | ```js
234 | import { GoBack } from "antd"
235 |
236 | ↓ ↓ ↓ ↓ ↓ ↓
237 |
238 | var _button = require('antd/lib/go-back');
239 | ```
240 |
241 | ```js
242 | // 对象形式
243 | [
244 | 'treasure',
245 | {
246 | libraryName: 'dt-react-component',
247 | customName: {
248 | GoBack: 'dt-react-component/lib/go-back',
249 | },
250 | },
251 | ];
252 | ```
253 |
254 | 说明:当你使用函数时,函数形参是经过 styleLibraryDirectory 或 camel2DashComponentName 转换后的的名称,当你使用对象作为参数时,对象的 key 不会经过特殊转换,customStyleName 同理。
255 | 除此之外,你还可以选择引用路径:
256 |
257 | ```js
258 | // 引用路径
259 | [
260 | 'treasure',
261 | {
262 | libraryName: 'dt-react-component',
263 | customName: {
264 | GoBack: require('path').resolve(__dirname, './customName.js'),
265 | },
266 | },
267 | ];
268 | ```
269 |
270 | `customName.js`类似:
271 |
272 | ```js
273 | module.exports = function customName(name) {
274 | return `dt-react-component/lib/${name}`;
275 | };
276 | ```
277 |
278 | #### customStyleName
279 |
280 | 与 customName 同理,只是用于处理 style 文件路径
281 |
282 | #### fileName
283 |
284 | 处理链接到具体的文件,例如:
285 |
286 | ```js
287 | // 对象形式
288 | [
289 | "treasure",
290 | {
291 | "libraryName": "dt-react-component",
292 | "fileName": "example"
293 | "customName": {
294 | "GoBack": "dt-react-component/lib/go-back",
295 | }
296 | }
297 | ]
298 | ```
299 |
300 | 转换后结果如下:
301 |
302 | ```js
303 | import { ChromeDownload } from 'dt-react-component'
304 |
305 | ↓ ↓ ↓ ↓ ↓ ↓
306 |
307 | import 'dt-react-component/lib/chrome-download/exmaple'
308 | ```
309 |
310 | ## 路线图
311 |
312 | - 随着各类库的变革做出及时更新
313 | - 支持更多的 AST 类型操作
314 | - 根据 treasure IDE 动态配置 AST 操作功能类型
315 |
316 | ## 执照
317 |
318 | [MIT](./LICENSE)
319 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # babel-plugin-treasure
2 |
3 |    
4 | Based on babel-plugin-import, we are committed to realizing the AST optimization requirements of the unified library and responding to the requirements of various AST node modification operations. Currently used in a unified and convenient way to solve the on-demand loading requirements of any component library
5 |
6 | ---
7 |
8 | - [English Instruction](./README.md)
9 | - [中文说明](./README.CN.md)
10 |
11 | ## Difference with babel-plugin-import
12 |
13 | ### Optimization points
14 |
15 | - No destructive changes, compatible with all APIs of the original babel-plugin-import
16 | - Support component name or method name size conversion
17 | - Support inputting custom path nodes in the form of objects
18 | - Support exporting components whose entry is part of the default attribute
19 | - Support react17+ jsx new conversion
20 |
21 | ### Fix point
22 |
23 | - Fixed the bug that babel-plugin-import did not convert the switch related AST tree
24 |
25 | ## Install
26 |
27 | ```javascript
28 | // use npm
29 | npm i babel-plugin-treasure --save-dev
30 |
31 | // use yarn
32 | yarn add babel-plugin-treasure -D
33 | ```
34 |
35 | ## Usage
36 |
37 | Can be used in the following two ways
38 |
39 | - [babelrc](https://babeljs.io/docs/usage/babelrc/)
40 | - [babel-loader](https://github.com/babel/babel-loader)
41 |
42 | Add to `.babelrc` or babel-loader.
43 |
44 | ```js
45 | {
46 | "plugins": [["treasure", options]]
47 | }
48 | ```
49 |
50 | ### Configuration
51 |
52 | ʻOptions` can be an object.
53 |
54 | ```javascript
55 | {
56 | "libraryName": "dt-react-component",
57 | "style": true, // or'css'
58 | }
59 | ```
60 |
61 | ʻOptions` can be an array, but it does not support setting in the babel@7+ environment
62 |
63 | ```javascript
64 | [
65 | {
66 | libraryName: 'dt-react-component',
67 | style: true, // or'css'
68 | },
69 | ];
70 | ```
71 |
72 | ʻOptions` cannot be an array in the babel@7+ environment, but you can add a name to the plugin to support reuse.
73 |
74 | such as:
75 |
76 | ```javascrit
77 | // .babelrc
78 | "plugins": [
79 | ["treasure", {"libraryName": "dt-react-component", "libraryDirectory": "lib"}, "dtcomponent"],
80 | ["treasure", {"libraryName": "lodash", "libraryDirectory": "lib"}, "lodash"]
81 | ]
82 | ```
83 |
84 | ### Load libraries on demand
85 |
86 | When you simply import the library in the project, you only need to add the following configuration. For example, configure dt-react-component:
87 |
88 | ```javascript
89 | "plugins": [
90 | [
91 | "treasure",
92 | {
93 | "libraryName": "dt-react-component",
94 | "libraryDirectory": "lib",
95 | "camel2DashComponentName": "lower",
96 | "style": "css"
97 | }
98 | ]
99 | ]
100 | ```
101 |
102 | Note: When you have multiple libraries in your development project that need to be loaded on demand, you can add an alias to distinguish it, for example, dt-react-component is used with antd:
103 |
104 | ```javascript
105 | "plugins": [
106 | [
107 | "treasure",
108 | {
109 | "libraryName": "antd",
110 | "libraryDirectory": "lib",
111 | "style": "css"
112 | },
113 | "antd"
114 | ],
115 | [
116 | "treasure",
117 | {
118 | "libraryName": "dt-react-component",
119 | "libraryDirectory": "lib",
120 | "camel2DashComponentName": "lower",
121 | "style": "css"
122 | },
123 | "dt-react-component"
124 | ]
125 | ]
126 | ```
127 |
128 | ## API
129 |
130 | ### libraryName
131 |
132 | The name of the library needs to be imported as required, which is required.
133 |
134 | #### `{ "libraryName": "dt-react-component" }`
135 |
136 | ### libraryDirectory
137 |
138 | Formulate the package format directory of the library, generally lib, es, esm, umd, etc., which are determined by the package developer. The default value of this option is lib
139 |
140 | #### `{ libraryDirectory: "lib" }`
141 |
142 | ### style
143 |
144 | Do you need to load css files on demand, not enabled by default Note: Load the css precompiled file (less/scss) when the style is set to true, and load the css file when it is set to css.
145 |
146 | Load the css precompiled file:
147 |
148 | #### `{ libraryDirectory: true }`
149 |
150 | Load the css file:
151 |
152 | #### `{ libraryDirectory: "css" }`
153 |
154 | ### styleLibraryDirectory
155 |
156 | The library package for making css files, generally does not need to be written
157 |
158 | #### `{ styleLibraryDirectory: "lib" }`
159 |
160 | ### camel2DashComponentName
161 |
162 | There are four parameters for the conversion of the component name, and the default is true. The conversion rules are as follows:
163 |
164 | ```js
165 | import {ChromeDownload} from'dt-react-component'
166 |
167 | ↓ ↓ ↓ ↓ ↓ ↓
168 |
169 | // When camel2DashComponentName: true
170 | ChromeDownload → chrome-download
171 |
172 | // When camel2DashComponentName: false
173 | ChromeDownload → ChromeDownload // No changes
174 |
175 | // When camel2DashComponentName: "lower"
176 | ChromeDownload → chromeDownload // convert lower camel
177 |
178 | // When camel2DashComponentName: "upper"
179 | ChromeDownload → ChromeDownload // convert upper camel
180 | ```
181 |
182 | ### camel2UnderlineComponentName
183 |
184 | Handle multi-word components with \_ for word segmentation
185 |
186 | ```js
187 | import { ChromeDownload } from'dt-react-component'
188 |
189 | ↓ ↓ ↓ ↓ ↓ ↓
190 |
191 | ChromeDownload → chrome_download
192 | ```
193 |
194 | ### transformToDefaultImport
195 |
196 | Process the attributes of the default import library, the default is true. You can give an array, and the components in the array will not be exported in the default form. If your library is not imported by default at all, please set the option to false For example:
197 |
198 | ```js
199 | // Set transformToDefaultImport: [ChromeDownload]
200 | import { ChromeDownload, Circle } from'dt-react-component'
201 |
202 | ↓ ↓ ↓ ↓ ↓ ↓
203 |
204 | import _Circle from "dt-react-component/lib/circle";
205 | import { ChromeDownload as _ChromeDownload } from "dt-react-component/lib/chromeDownload";
206 | ```
207 |
208 | ### customName
209 |
210 | Handle individual sequences with irregular rules, support function, object and path import
211 |
212 | ```js
213 | // Function form
214 | [
215 | 'treasure',
216 | {
217 | libraryName: 'dt-react-component',
218 | customName: (name: string) => {
219 | if (name === 'go-back') {
220 | return 'antd/lib/go-back';
221 | }
222 | return `antd/lib/${name}`;
223 | },
224 | },
225 | ];
226 | ```
227 |
228 | After processing, it will become like this
229 |
230 | ```js
231 | import {GoBack} from "antd"
232 |
233 | ↓ ↓ ↓ ↓ ↓ ↓
234 |
235 | var _button = require('antd/lib/go-back');
236 | ```
237 |
238 | ```js
239 | // Object form
240 | [
241 | 'treasure',
242 | {
243 | libraryName: 'dt-react-component',
244 | customName: {
245 | GoBack: 'dt-react-component/lib/go-back',
246 | },
247 | },
248 | ];
249 | ```
250 |
251 | Note: When you use a function, the function parameter is the name converted by styleLibraryDirectory or camel2DashComponentName. When you use an object as a parameter, the key of the object will not undergo a special conversion. The same is true for customStyleName. In addition, you can also choose the reference path:
252 |
253 | ```js
254 | // reference path
255 | [
256 | 'treasure',
257 | {
258 | libraryName: 'dt-react-component',
259 | customName: {
260 | GoBack: require('path').resolve(__dirname, './customName.js'),
261 | },
262 | },
263 | ];
264 | ```
265 |
266 | `customName.js` is similar:
267 |
268 | ```js
269 | module.exports = function customName(name) {
270 | return `dt-react-component/lib/${name}`;
271 | };
272 | ```
273 |
274 | #### customStyleName
275 |
276 | Same as customName, but used to process the style file path
277 |
278 | #### fileName
279 |
280 | Process links to specific files, such as:
281 |
282 | ```js
283 | // Object form
284 | [
285 | "treasure",
286 | {
287 | "libraryName": "dt-react-component",
288 | "fileName": "example"
289 | "customName": {
290 | "GoBack": "dt-react-component/lib/go-back",
291 | }
292 | }
293 | ]
294 | ```
295 |
296 | The result after conversion is as follows:
297 |
298 | ```js
299 | import {ChromeDownload} from'dt-react-component'
300 |
301 | ↓ ↓ ↓ ↓ ↓ ↓
302 |
303 | import'dt-react-component/lib/chrome-download/exmaple'
304 | ```
305 |
306 | ## Roadmap
307 |
308 | - Make timely updates with changes in various libraries
309 | - Support more AST type operations
310 | - Dynamic configuration of AST operation function type according to treasure IDE
311 |
312 | ## License
313 |
314 | [MIT](./LICENSE)
315 |
--------------------------------------------------------------------------------
/coverage/clover.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
--------------------------------------------------------------------------------
/coverage/coverage-final.json:
--------------------------------------------------------------------------------
1 | {"/Users/libowen/Desktop/Code/gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/babel-plugin-treasure/src/Plugin.js": {"path":"/Users/libowen/Desktop/Code/gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/babel-plugin-treasure/src/Plugin.js","statementMap":{"0":{"start":{"line":5,"column":2},"end":{"line":10,"column":3}},"1":{"start":{"line":6,"column":31},"end":{"line":6,"column":56}},"2":{"start":{"line":7,"column":4},"end":{"line":9,"column":35}},"3":{"start":{"line":11,"column":2},"end":{"line":11,"column":26}},"4":{"start":{"line":15,"column":2},"end":{"line":15,"column":35}},"5":{"start":{"line":19,"column":2},"end":{"line":23,"column":3}},"6":{"start":{"line":20,"column":4},"end":{"line":22,"column":47}},"7":{"start":{"line":24,"column":14},"end":{"line":24,"column":52}},"8":{"start":{"line":25,"column":2},"end":{"line":25,"column":72}},"9":{"start":{"line":25,"column":40},"end":{"line":25,"column":70}},"10":{"start":{"line":43,"column":4},"end":{"line":43,"column":35}},"11":{"start":{"line":44,"column":4},"end":{"line":44,"column":95}},"12":{"start":{"line":45,"column":4},"end":{"line":45,"column":32}},"13":{"start":{"line":46,"column":4},"end":{"line":46,"column":55}},"14":{"start":{"line":47,"column":4},"end":{"line":48,"column":86}},"15":{"start":{"line":49,"column":4},"end":{"line":50,"column":88}},"16":{"start":{"line":51,"column":4},"end":{"line":51,"column":54}},"17":{"start":{"line":52,"column":4},"end":{"line":52,"column":64}},"18":{"start":{"line":53,"column":4},"end":{"line":53,"column":69}},"19":{"start":{"line":54,"column":4},"end":{"line":54,"column":35}},"20":{"start":{"line":55,"column":4},"end":{"line":55,"column":23}},"21":{"start":{"line":56,"column":4},"end":{"line":56,"column":54}},"22":{"start":{"line":60,"column":4},"end":{"line":63,"column":5}},"23":{"start":{"line":62,"column":6},"end":{"line":62,"column":38}},"24":{"start":{"line":64,"column":4},"end":{"line":64,"column":38}},"25":{"start":{"line":68,"column":24},"end":{"line":68,"column":50}},"26":{"start":{"line":69,"column":4},"end":{"line":69,"column":48}},"27":{"start":{"line":70,"column":4},"end":{"line":70,"column":50}},"28":{"start":{"line":71,"column":4},"end":{"line":71,"column":54}},"29":{"start":{"line":72,"column":4},"end":{"line":72,"column":35}},"30":{"start":{"line":86,"column":4},"end":{"line":86,"column":84}},"31":{"start":{"line":86,"column":58},"end":{"line":86,"column":82}},"32":{"start":{"line":94,"column":21},"end":{"line":94,"column":25}},"33":{"start":{"line":97,"column":4},"end":{"line":97,"column":22}},"34":{"start":{"line":97,"column":15},"end":{"line":97,"column":22}},"35":{"start":{"line":101,"column":8},"end":{"line":101,"column":12}},"36":{"start":{"line":102,"column":35},"end":{"line":102,"column":39}},"37":{"start":{"line":103,"column":24},"end":{"line":103,"column":50}},"38":{"start":{"line":105,"column":4},"end":{"line":114,"column":5}},"39":{"start":{"line":106,"column":6},"end":{"line":112,"column":9}},"40":{"start":{"line":107,"column":8},"end":{"line":111,"column":9}},"41":{"start":{"line":108,"column":10},"end":{"line":108,"column":70}},"42":{"start":{"line":110,"column":10},"end":{"line":110,"column":58}},"43":{"start":{"line":113,"column":6},"end":{"line":113,"column":43}},"44":{"start":{"line":118,"column":21},"end":{"line":118,"column":25}},"45":{"start":{"line":119,"column":17},"end":{"line":119,"column":47}},"46":{"start":{"line":120,"column":21},"end":{"line":120,"column":32}},"47":{"start":{"line":121,"column":22},"end":{"line":121,"column":26}},"48":{"start":{"line":122,"column":24},"end":{"line":122,"column":50}},"49":{"start":{"line":123,"column":4},"end":{"line":128,"column":5}},"50":{"start":{"line":125,"column":6},"end":{"line":127,"column":7}},"51":{"start":{"line":126,"column":8},"end":{"line":126,"column":88}},"52":{"start":{"line":129,"column":4},"end":{"line":139,"column":7}},"53":{"start":{"line":130,"column":32},"end":{"line":130,"column":35}},"54":{"start":{"line":131,"column":6},"end":{"line":137,"column":7}},"55":{"start":{"line":136,"column":8},"end":{"line":136,"column":84}},"56":{"start":{"line":138,"column":6},"end":{"line":138,"column":17}},"57":{"start":{"line":144,"column":4},"end":{"line":201,"column":5}},"58":{"start":{"line":154,"column":10},"end":{"line":154,"column":14}},"59":{"start":{"line":155,"column":36},"end":{"line":161,"column":20}},"60":{"start":{"line":166,"column":19},"end":{"line":173,"column":7}},"61":{"start":{"line":177,"column":6},"end":{"line":182,"column":66}},"62":{"start":{"line":183,"column":6},"end":{"line":200,"column":7}},"63":{"start":{"line":184,"column":26},"end":{"line":184,"column":78}},"64":{"start":{"line":185,"column":8},"end":{"line":185,"column":49}},"65":{"start":{"line":186,"column":13},"end":{"line":200,"column":7}},"66":{"start":{"line":187,"column":26},"end":{"line":189,"column":9}},"67":{"start":{"line":190,"column":8},"end":{"line":190,"column":49}},"68":{"start":{"line":191,"column":13},"end":{"line":200,"column":7}},"69":{"start":{"line":192,"column":8},"end":{"line":192,"column":50}},"70":{"start":{"line":193,"column":13},"end":{"line":200,"column":7}},"71":{"start":{"line":194,"column":8},"end":{"line":194,"column":54}},"72":{"start":{"line":195,"column":13},"end":{"line":200,"column":7}},"73":{"start":{"line":196,"column":26},"end":{"line":196,"column":43}},"74":{"start":{"line":197,"column":8},"end":{"line":199,"column":9}},"75":{"start":{"line":198,"column":10},"end":{"line":198,"column":46}},"76":{"start":{"line":202,"column":4},"end":{"line":202,"column":58}},"77":{"start":{"line":206,"column":21},"end":{"line":206,"column":25}},"78":{"start":{"line":207,"column":4},"end":{"line":207,"column":62}},"79":{"start":{"line":214,"column":21},"end":{"line":214,"column":25}},"80":{"start":{"line":215,"column":17},"end":{"line":215,"column":47}},"81":{"start":{"line":216,"column":24},"end":{"line":216,"column":50}},"82":{"start":{"line":217,"column":4},"end":{"line":217,"column":36}},"83":{"start":{"line":217,"column":29},"end":{"line":217,"column":36}},"84":{"start":{"line":219,"column":4},"end":{"line":239,"column":5}},"85":{"start":{"line":220,"column":6},"end":{"line":220,"column":81}},"86":{"start":{"line":221,"column":11},"end":{"line":239,"column":5}},"87":{"start":{"line":222,"column":24},"end":{"line":222,"column":63}},"88":{"start":{"line":228,"column":6},"end":{"line":238,"column":7}},"89":{"start":{"line":230,"column":26},"end":{"line":230,"column":65}},"90":{"start":{"line":231,"column":8},"end":{"line":237,"column":9}},"91":{"start":{"line":232,"column":10},"end":{"line":236,"column":12}},"92":{"start":{"line":243,"column":21},"end":{"line":243,"column":25}},"93":{"start":{"line":244,"column":4},"end":{"line":244,"column":67}},"94":{"start":{"line":249,"column":21},"end":{"line":249,"column":25}},"95":{"start":{"line":250,"column":4},"end":{"line":250,"column":88}},"96":{"start":{"line":254,"column":21},"end":{"line":254,"column":25}},"97":{"start":{"line":255,"column":4},"end":{"line":255,"column":65}},"98":{"start":{"line":259,"column":21},"end":{"line":259,"column":25}},"99":{"start":{"line":260,"column":4},"end":{"line":260,"column":61}},"100":{"start":{"line":261,"column":4},"end":{"line":261,"column":75}},"101":{"start":{"line":265,"column":21},"end":{"line":265,"column":25}},"102":{"start":{"line":266,"column":4},"end":{"line":266,"column":70}},"103":{"start":{"line":270,"column":21},"end":{"line":270,"column":25}},"104":{"start":{"line":271,"column":4},"end":{"line":271,"column":61}},"105":{"start":{"line":275,"column":21},"end":{"line":275,"column":25}},"106":{"start":{"line":276,"column":18},"end":{"line":276,"column":57}},"107":{"start":{"line":276,"column":51},"end":{"line":276,"column":56}},"108":{"start":{"line":277,"column":4},"end":{"line":277,"column":67}},"109":{"start":{"line":281,"column":21},"end":{"line":281,"column":25}},"110":{"start":{"line":282,"column":4},"end":{"line":282,"column":76}},"111":{"start":{"line":286,"column":21},"end":{"line":286,"column":25}},"112":{"start":{"line":287,"column":22},"end":{"line":287,"column":26}},"113":{"start":{"line":288,"column":4},"end":{"line":290,"column":5}},"114":{"start":{"line":289,"column":6},"end":{"line":289,"column":75}},"115":{"start":{"line":294,"column":21},"end":{"line":294,"column":25}},"116":{"start":{"line":295,"column":4},"end":{"line":295,"column":68}},"117":{"start":{"line":299,"column":21},"end":{"line":299,"column":25}},"118":{"start":{"line":300,"column":4},"end":{"line":300,"column":70}},"119":{"start":{"line":304,"column":21},"end":{"line":304,"column":25}},"120":{"start":{"line":305,"column":4},"end":{"line":305,"column":69}},"121":{"start":{"line":309,"column":21},"end":{"line":309,"column":25}},"122":{"start":{"line":310,"column":4},"end":{"line":310,"column":61}},"123":{"start":{"line":315,"column":17},"end":{"line":315,"column":47}},"124":{"start":{"line":316,"column":22},"end":{"line":316,"column":26}},"125":{"start":{"line":317,"column":24},"end":{"line":317,"column":50}},"126":{"start":{"line":319,"column":4},"end":{"line":328,"column":7}},"127":{"start":{"line":320,"column":6},"end":{"line":320,"column":50}},"128":{"start":{"line":320,"column":43},"end":{"line":320,"column":50}},"129":{"start":{"line":321,"column":6},"end":{"line":327,"column":7}},"130":{"start":{"line":326,"column":8},"end":{"line":326,"column":98}}},"fnMap":{"0":{"name":"normalizeCustomName","decl":{"start":{"line":4,"column":9},"end":{"line":4,"column":28}},"loc":{"start":{"line":4,"column":47},"end":{"line":12,"column":1}},"line":4},"1":{"name":"winPath","decl":{"start":{"line":14,"column":9},"end":{"line":14,"column":16}},"loc":{"start":{"line":14,"column":23},"end":{"line":16,"column":1}},"line":14},"2":{"name":"transCamel","decl":{"start":{"line":18,"column":9},"end":{"line":18,"column":19}},"loc":{"start":{"line":18,"column":34},"end":{"line":26,"column":1}},"line":18},"3":{"name":"(anonymous_3)","decl":{"start":{"line":25,"column":34},"end":{"line":25,"column":35}},"loc":{"start":{"line":25,"column":40},"end":{"line":25,"column":70}},"line":25},"4":{"name":"(anonymous_4)","decl":{"start":{"line":29,"column":2},"end":{"line":29,"column":3}},"loc":{"start":{"line":42,"column":4},"end":{"line":57,"column":3}},"line":42},"5":{"name":"(anonymous_5)","decl":{"start":{"line":59,"column":2},"end":{"line":59,"column":3}},"loc":{"start":{"line":59,"column":24},"end":{"line":65,"column":3}},"line":59},"6":{"name":"(anonymous_6)","decl":{"start":{"line":67,"column":2},"end":{"line":67,"column":3}},"loc":{"start":{"line":67,"column":25},"end":{"line":83,"column":3}},"line":67},"7":{"name":"(anonymous_7)","decl":{"start":{"line":85,"column":2},"end":{"line":85,"column":3}},"loc":{"start":{"line":85,"column":24},"end":{"line":88,"column":3}},"line":85},"8":{"name":"(anonymous_8)","decl":{"start":{"line":86,"column":53},"end":{"line":86,"column":54}},"loc":{"start":{"line":86,"column":58},"end":{"line":86,"column":82}},"line":86},"9":{"name":"(anonymous_9)","decl":{"start":{"line":93,"column":2},"end":{"line":93,"column":3}},"loc":{"start":{"line":93,"column":33},"end":{"line":115,"column":3}},"line":93},"10":{"name":"(anonymous_10)","decl":{"start":{"line":106,"column":30},"end":{"line":106,"column":31}},"loc":{"start":{"line":106,"column":38},"end":{"line":112,"column":7}},"line":106},"11":{"name":"(anonymous_11)","decl":{"start":{"line":117,"column":2},"end":{"line":117,"column":3}},"loc":{"start":{"line":117,"column":30},"end":{"line":140,"column":3}},"line":117},"12":{"name":"(anonymous_12)","decl":{"start":{"line":129,"column":40},"end":{"line":129,"column":41}},"loc":{"start":{"line":129,"column":47},"end":{"line":139,"column":5}},"line":129},"13":{"name":"(anonymous_13)","decl":{"start":{"line":143,"column":2},"end":{"line":143,"column":3}},"loc":{"start":{"line":143,"column":46},"end":{"line":203,"column":3}},"line":143},"14":{"name":"(anonymous_14)","decl":{"start":{"line":205,"column":2},"end":{"line":205,"column":3}},"loc":{"start":{"line":205,"column":24},"end":{"line":208,"column":3}},"line":205},"15":{"name":"(anonymous_15)","decl":{"start":{"line":213,"column":2},"end":{"line":213,"column":3}},"loc":{"start":{"line":213,"column":32},"end":{"line":240,"column":3}},"line":213},"16":{"name":"(anonymous_16)","decl":{"start":{"line":242,"column":2},"end":{"line":242,"column":3}},"loc":{"start":{"line":242,"column":32},"end":{"line":245,"column":3}},"line":242},"17":{"name":"(anonymous_17)","decl":{"start":{"line":247,"column":2},"end":{"line":247,"column":3}},"loc":{"start":{"line":247,"column":37},"end":{"line":251,"column":3}},"line":247},"18":{"name":"(anonymous_18)","decl":{"start":{"line":253,"column":2},"end":{"line":253,"column":3}},"loc":{"start":{"line":253,"column":31},"end":{"line":256,"column":3}},"line":253},"19":{"name":"(anonymous_19)","decl":{"start":{"line":258,"column":2},"end":{"line":258,"column":3}},"loc":{"start":{"line":258,"column":27},"end":{"line":262,"column":3}},"line":258},"20":{"name":"(anonymous_20)","decl":{"start":{"line":264,"column":2},"end":{"line":264,"column":3}},"loc":{"start":{"line":264,"column":32},"end":{"line":267,"column":3}},"line":264},"21":{"name":"(anonymous_21)","decl":{"start":{"line":269,"column":2},"end":{"line":269,"column":3}},"loc":{"start":{"line":269,"column":34},"end":{"line":272,"column":3}},"line":269},"22":{"name":"(anonymous_22)","decl":{"start":{"line":274,"column":2},"end":{"line":274,"column":3}},"loc":{"start":{"line":274,"column":31},"end":{"line":278,"column":3}},"line":274},"23":{"name":"(anonymous_23)","decl":{"start":{"line":276,"column":37},"end":{"line":276,"column":38}},"loc":{"start":{"line":276,"column":51},"end":{"line":276,"column":56}},"line":276},"24":{"name":"(anonymous_24)","decl":{"start":{"line":280,"column":2},"end":{"line":280,"column":3}},"loc":{"start":{"line":280,"column":29},"end":{"line":283,"column":3}},"line":280},"25":{"name":"(anonymous_25)","decl":{"start":{"line":285,"column":2},"end":{"line":285,"column":3}},"loc":{"start":{"line":285,"column":35},"end":{"line":291,"column":3}},"line":285},"26":{"name":"(anonymous_26)","decl":{"start":{"line":293,"column":2},"end":{"line":293,"column":3}},"loc":{"start":{"line":293,"column":40},"end":{"line":296,"column":3}},"line":293},"27":{"name":"(anonymous_27)","decl":{"start":{"line":298,"column":2},"end":{"line":298,"column":3}},"loc":{"start":{"line":298,"column":33},"end":{"line":301,"column":3}},"line":298},"28":{"name":"(anonymous_28)","decl":{"start":{"line":303,"column":2},"end":{"line":303,"column":3}},"loc":{"start":{"line":303,"column":31},"end":{"line":306,"column":3}},"line":303},"29":{"name":"(anonymous_29)","decl":{"start":{"line":308,"column":2},"end":{"line":308,"column":3}},"loc":{"start":{"line":308,"column":26},"end":{"line":311,"column":3}},"line":308},"30":{"name":"(anonymous_30)","decl":{"start":{"line":314,"column":2},"end":{"line":314,"column":3}},"loc":{"start":{"line":314,"column":51},"end":{"line":329,"column":3}},"line":314},"31":{"name":"(anonymous_31)","decl":{"start":{"line":319,"column":18},"end":{"line":319,"column":19}},"loc":{"start":{"line":319,"column":26},"end":{"line":328,"column":5}},"line":319}},"branchMap":{"0":{"loc":{"start":{"line":5,"column":2},"end":{"line":10,"column":3}},"type":"if","locations":[{"start":{"line":5,"column":2},"end":{"line":10,"column":3}},{"start":{"line":5,"column":2},"end":{"line":10,"column":3}}],"line":5},"1":{"loc":{"start":{"line":7,"column":11},"end":{"line":9,"column":34}},"type":"cond-expr","locations":[{"start":{"line":8,"column":8},"end":{"line":8,"column":26}},{"start":{"line":9,"column":8},"end":{"line":9,"column":34}}],"line":7},"2":{"loc":{"start":{"line":19,"column":2},"end":{"line":23,"column":3}},"type":"if","locations":[{"start":{"line":19,"column":2},"end":{"line":23,"column":3}},{"start":{"line":19,"column":2},"end":{"line":23,"column":3}}],"line":19},"3":{"loc":{"start":{"line":19,"column":6},"end":{"line":19,"column":46}},"type":"binary-expr","locations":[{"start":{"line":19,"column":6},"end":{"line":19,"column":24}},{"start":{"line":19,"column":28},"end":{"line":19,"column":46}}],"line":19},"4":{"loc":{"start":{"line":20,"column":11},"end":{"line":22,"column":46}},"type":"cond-expr","locations":[{"start":{"line":21,"column":8},"end":{"line":21,"column":46}},{"start":{"line":22,"column":8},"end":{"line":22,"column":46}}],"line":20},"5":{"loc":{"start":{"line":41,"column":4},"end":{"line":41,"column":13}},"type":"default-arg","locations":[{"start":{"line":41,"column":12},"end":{"line":41,"column":13}}],"line":41},"6":{"loc":{"start":{"line":44,"column":28},"end":{"line":44,"column":94}},"type":"cond-expr","locations":[{"start":{"line":44,"column":70},"end":{"line":44,"column":75}},{"start":{"line":44,"column":78},"end":{"line":44,"column":94}}],"line":44},"7":{"loc":{"start":{"line":45,"column":17},"end":{"line":45,"column":31}},"type":"binary-expr","locations":[{"start":{"line":45,"column":17},"end":{"line":45,"column":22}},{"start":{"line":45,"column":26},"end":{"line":45,"column":31}}],"line":45},"8":{"loc":{"start":{"line":48,"column":6},"end":{"line":48,"column":85}},"type":"cond-expr","locations":[{"start":{"line":48,"column":55},"end":{"line":48,"column":59}},{"start":{"line":48,"column":62},"end":{"line":48,"column":85}}],"line":48},"9":{"loc":{"start":{"line":50,"column":6},"end":{"line":50,"column":87}},"type":"cond-expr","locations":[{"start":{"line":50,"column":56},"end":{"line":50,"column":60}},{"start":{"line":50,"column":63},"end":{"line":50,"column":87}}],"line":50},"10":{"loc":{"start":{"line":54,"column":20},"end":{"line":54,"column":34}},"type":"binary-expr","locations":[{"start":{"line":54,"column":20},"end":{"line":54,"column":28}},{"start":{"line":54,"column":32},"end":{"line":54,"column":34}}],"line":54},"11":{"loc":{"start":{"line":60,"column":4},"end":{"line":63,"column":5}},"type":"if","locations":[{"start":{"line":60,"column":4},"end":{"line":63,"column":5}},{"start":{"line":60,"column":4},"end":{"line":63,"column":5}}],"line":60},"12":{"loc":{"start":{"line":86,"column":58},"end":{"line":86,"column":82}},"type":"binary-expr","locations":[{"start":{"line":86,"column":58},"end":{"line":86,"column":68}},{"start":{"line":86,"column":72},"end":{"line":86,"column":82}}],"line":86},"13":{"loc":{"start":{"line":97,"column":4},"end":{"line":97,"column":22}},"type":"if","locations":[{"start":{"line":97,"column":4},"end":{"line":97,"column":22}},{"start":{"line":97,"column":4},"end":{"line":97,"column":22}}],"line":97},"14":{"loc":{"start":{"line":105,"column":4},"end":{"line":114,"column":5}},"type":"if","locations":[{"start":{"line":105,"column":4},"end":{"line":114,"column":5}},{"start":{"line":105,"column":4},"end":{"line":114,"column":5}}],"line":105},"15":{"loc":{"start":{"line":107,"column":8},"end":{"line":111,"column":9}},"type":"if","locations":[{"start":{"line":107,"column":8},"end":{"line":111,"column":9}},{"start":{"line":107,"column":8},"end":{"line":111,"column":9}}],"line":107},"16":{"loc":{"start":{"line":119,"column":17},"end":{"line":119,"column":47}},"type":"binary-expr","locations":[{"start":{"line":119,"column":17},"end":{"line":119,"column":32}},{"start":{"line":119,"column":36},"end":{"line":119,"column":47}}],"line":119},"17":{"loc":{"start":{"line":123,"column":4},"end":{"line":128,"column":5}},"type":"if","locations":[{"start":{"line":123,"column":4},"end":{"line":128,"column":5}},{"start":{"line":123,"column":4},"end":{"line":128,"column":5}}],"line":123},"18":{"loc":{"start":{"line":125,"column":6},"end":{"line":127,"column":7}},"type":"if","locations":[{"start":{"line":125,"column":6},"end":{"line":127,"column":7}},{"start":{"line":125,"column":6},"end":{"line":127,"column":7}}],"line":125},"19":{"loc":{"start":{"line":131,"column":6},"end":{"line":137,"column":7}},"type":"if","locations":[{"start":{"line":131,"column":6},"end":{"line":137,"column":7}},{"start":{"line":131,"column":6},"end":{"line":137,"column":7}}],"line":131},"20":{"loc":{"start":{"line":132,"column":8},"end":{"line":134,"column":68}},"type":"binary-expr","locations":[{"start":{"line":132,"column":8},"end":{"line":132,"column":38}},{"start":{"line":133,"column":8},"end":{"line":133,"column":38}},{"start":{"line":134,"column":8},"end":{"line":134,"column":68}}],"line":132},"21":{"loc":{"start":{"line":144,"column":4},"end":{"line":201,"column":5}},"type":"if","locations":[{"start":{"line":144,"column":4},"end":{"line":201,"column":5}},{"start":{"line":144,"column":4},"end":{"line":201,"column":5}}],"line":144},"22":{"loc":{"start":{"line":155,"column":36},"end":{"line":161,"column":20}},"type":"cond-expr","locations":[{"start":{"line":156,"column":10},"end":{"line":156,"column":37}},{"start":{"line":157,"column":10},"end":{"line":161,"column":20}}],"line":155},"23":{"loc":{"start":{"line":157,"column":10},"end":{"line":161,"column":20}},"type":"cond-expr","locations":[{"start":{"line":158,"column":10},"end":{"line":158,"column":37}},{"start":{"line":159,"column":10},"end":{"line":161,"column":20}}],"line":157},"24":{"loc":{"start":{"line":159,"column":10},"end":{"line":161,"column":20}},"type":"cond-expr","locations":[{"start":{"line":160,"column":10},"end":{"line":160,"column":57}},{"start":{"line":161,"column":10},"end":{"line":161,"column":20}}],"line":159},"25":{"loc":{"start":{"line":159,"column":10},"end":{"line":159,"column":84}},"type":"binary-expr","locations":[{"start":{"line":159,"column":10},"end":{"line":159,"column":45}},{"start":{"line":159,"column":49},"end":{"line":159,"column":84}}],"line":159},"26":{"loc":{"start":{"line":167,"column":8},"end":{"line":172,"column":80}},"type":"cond-expr","locations":[{"start":{"line":168,"column":12},"end":{"line":171,"column":53}},{"start":{"line":172,"column":12},"end":{"line":172,"column":80}}],"line":167},"27":{"loc":{"start":{"line":168,"column":12},"end":{"line":171,"column":53}},"type":"cond-expr","locations":[{"start":{"line":169,"column":14},"end":{"line":170,"column":82}},{"start":{"line":171,"column":14},"end":{"line":171,"column":53}}],"line":168},"28":{"loc":{"start":{"line":169,"column":14},"end":{"line":170,"column":82}},"type":"binary-expr","locations":[{"start":{"line":169,"column":14},"end":{"line":169,"column":36}},{"start":{"line":170,"column":14},"end":{"line":170,"column":82}}],"line":169},"29":{"loc":{"start":{"line":178,"column":8},"end":{"line":182,"column":65}},"type":"cond-expr","locations":[{"start":{"line":181,"column":12},"end":{"line":181,"column":49}},{"start":{"line":182,"column":12},"end":{"line":182,"column":65}}],"line":178},"30":{"loc":{"start":{"line":178,"column":8},"end":{"line":180,"column":62}},"type":"binary-expr","locations":[{"start":{"line":178,"column":8},"end":{"line":178,"column":42}},{"start":{"line":179,"column":9},"end":{"line":179,"column":48}},{"start":{"line":180,"column":10},"end":{"line":180,"column":61}}],"line":178},"31":{"loc":{"start":{"line":183,"column":6},"end":{"line":200,"column":7}},"type":"if","locations":[{"start":{"line":183,"column":6},"end":{"line":200,"column":7}},{"start":{"line":183,"column":6},"end":{"line":200,"column":7}}],"line":183},"32":{"loc":{"start":{"line":186,"column":13},"end":{"line":200,"column":7}},"type":"if","locations":[{"start":{"line":186,"column":13},"end":{"line":200,"column":7}},{"start":{"line":186,"column":13},"end":{"line":200,"column":7}}],"line":186},"33":{"loc":{"start":{"line":191,"column":13},"end":{"line":200,"column":7}},"type":"if","locations":[{"start":{"line":191,"column":13},"end":{"line":200,"column":7}},{"start":{"line":191,"column":13},"end":{"line":200,"column":7}}],"line":191},"34":{"loc":{"start":{"line":193,"column":13},"end":{"line":200,"column":7}},"type":"if","locations":[{"start":{"line":193,"column":13},"end":{"line":200,"column":7}},{"start":{"line":193,"column":13},"end":{"line":200,"column":7}}],"line":193},"35":{"loc":{"start":{"line":195,"column":13},"end":{"line":200,"column":7}},"type":"if","locations":[{"start":{"line":195,"column":13},"end":{"line":200,"column":7}},{"start":{"line":195,"column":13},"end":{"line":200,"column":7}}],"line":195},"36":{"loc":{"start":{"line":197,"column":8},"end":{"line":199,"column":9}},"type":"if","locations":[{"start":{"line":197,"column":8},"end":{"line":199,"column":9}},{"start":{"line":197,"column":8},"end":{"line":199,"column":9}}],"line":197},"37":{"loc":{"start":{"line":215,"column":17},"end":{"line":215,"column":47}},"type":"binary-expr","locations":[{"start":{"line":215,"column":17},"end":{"line":215,"column":32}},{"start":{"line":215,"column":36},"end":{"line":215,"column":47}}],"line":215},"38":{"loc":{"start":{"line":217,"column":4},"end":{"line":217,"column":36}},"type":"if","locations":[{"start":{"line":217,"column":4},"end":{"line":217,"column":36}},{"start":{"line":217,"column":4},"end":{"line":217,"column":36}}],"line":217},"39":{"loc":{"start":{"line":219,"column":4},"end":{"line":239,"column":5}},"type":"if","locations":[{"start":{"line":219,"column":4},"end":{"line":239,"column":5}},{"start":{"line":219,"column":4},"end":{"line":239,"column":5}}],"line":219},"40":{"loc":{"start":{"line":221,"column":11},"end":{"line":239,"column":5}},"type":"if","locations":[{"start":{"line":221,"column":11},"end":{"line":239,"column":5}},{"start":{"line":221,"column":11},"end":{"line":239,"column":5}}],"line":221},"41":{"loc":{"start":{"line":221,"column":15},"end":{"line":221,"column":97}},"type":"binary-expr","locations":[{"start":{"line":221,"column":15},"end":{"line":221,"column":54}},{"start":{"line":221,"column":58},"end":{"line":221,"column":97}}],"line":221},"42":{"loc":{"start":{"line":228,"column":6},"end":{"line":238,"column":7}},"type":"if","locations":[{"start":{"line":228,"column":6},"end":{"line":238,"column":7}},{"start":{"line":228,"column":6},"end":{"line":238,"column":7}}],"line":228},"43":{"loc":{"start":{"line":231,"column":8},"end":{"line":237,"column":9}},"type":"if","locations":[{"start":{"line":231,"column":8},"end":{"line":237,"column":9}},{"start":{"line":231,"column":8},"end":{"line":237,"column":9}}],"line":231},"44":{"loc":{"start":{"line":288,"column":4},"end":{"line":290,"column":5}},"type":"if","locations":[{"start":{"line":288,"column":4},"end":{"line":290,"column":5}},{"start":{"line":288,"column":4},"end":{"line":290,"column":5}}],"line":288},"45":{"loc":{"start":{"line":315,"column":17},"end":{"line":315,"column":47}},"type":"binary-expr","locations":[{"start":{"line":315,"column":17},"end":{"line":315,"column":32}},{"start":{"line":315,"column":36},"end":{"line":315,"column":47}}],"line":315},"46":{"loc":{"start":{"line":320,"column":6},"end":{"line":320,"column":50}},"type":"if","locations":[{"start":{"line":320,"column":6},"end":{"line":320,"column":50}},{"start":{"line":320,"column":6},"end":{"line":320,"column":50}}],"line":320},"47":{"loc":{"start":{"line":321,"column":6},"end":{"line":327,"column":7}},"type":"if","locations":[{"start":{"line":321,"column":6},"end":{"line":327,"column":7}},{"start":{"line":321,"column":6},"end":{"line":327,"column":7}}],"line":321},"48":{"loc":{"start":{"line":322,"column":8},"end":{"line":323,"column":76}},"type":"binary-expr","locations":[{"start":{"line":322,"column":8},"end":{"line":322,"column":46}},{"start":{"line":323,"column":8},"end":{"line":323,"column":76}}],"line":322}},"s":{"0":84,"1":1,"2":1,"3":83,"4":46,"5":43,"6":3,"7":40,"8":40,"9":3,"10":42,"11":42,"12":42,"13":42,"14":42,"15":42,"16":42,"17":42,"18":42,"19":42,"20":42,"21":42,"22":952,"23":42,"24":952,"25":42,"26":42,"27":42,"28":42,"29":42,"30":42,"31":40,"32":111,"33":111,"34":0,"35":111,"36":111,"37":111,"38":111,"39":40,"40":44,"41":43,"42":1,"43":40,"44":219,"45":219,"46":219,"47":219,"48":219,"49":219,"50":132,"51":8,"52":219,"53":321,"54":321,"55":17,"56":304,"57":63,"58":44,"59":44,"60":44,"61":44,"62":44,"63":1,"64":1,"65":43,"66":1,"67":1,"68":42,"69":4,"70":38,"71":2,"72":36,"73":3,"74":3,"75":2,"76":63,"77":57,"78":57,"79":210,"80":210,"81":210,"82":210,"83":2,"84":208,"85":1,"86":207,"87":8,"88":8,"89":4,"90":4,"91":4,"92":1,"93":1,"94":39,"95":39,"96":56,"97":56,"98":16,"99":16,"100":16,"101":6,"102":6,"103":84,"104":84,"105":3,"106":3,"107":3,"108":3,"109":1,"110":1,"111":57,"112":57,"113":57,"114":5,"115":1,"116":1,"117":40,"118":40,"119":1,"120":1,"121":2,"122":2,"123":328,"124":328,"125":328,"126":328,"127":469,"128":296,"129":173,"130":33},"f":{"0":84,"1":46,"2":43,"3":3,"4":42,"5":952,"6":42,"7":42,"8":40,"9":111,"10":44,"11":219,"12":321,"13":63,"14":57,"15":210,"16":1,"17":39,"18":56,"19":16,"20":6,"21":84,"22":3,"23":3,"24":1,"25":57,"26":1,"27":40,"28":1,"29":2,"30":328,"31":469},"b":{"0":[1,83],"1":[0,1],"2":[3,40],"3":[43,42],"4":[1,2],"5":[42],"6":[41,1],"7":[42,36],"8":[39,3],"9":[40,2],"10":[42,41],"11":[42,910],"12":[40,40],"13":[0,111],"14":[40,71],"15":[43,1],"16":[219,0],"17":[132,87],"18":[8,124],"19":[17,304],"20":[321,18,18],"21":[44,19],"22":[1,43],"23":[39,4],"24":[3,1],"25":[4,3],"26":[6,38],"27":[2,4],"28":[2,1],"29":[3,41],"30":[44,42,1],"31":[1,43],"32":[1,42],"33":[4,38],"34":[2,36],"35":[3,33],"36":[2,1],"37":[210,0],"38":[2,208],"39":[1,207],"40":[8,199],"41":[207,8],"42":[4,4],"43":[4,0],"44":[5,52],"45":[328,0],"46":[296,173],"47":[33,140],"48":[173,43]},"_coverageSchema":"43e27e138ebf9cfc5966b082cf9a028302ed4184","hash":"091e5cf83419d59b2170d033db452bdea1d9f539"}
2 | ,"/Users/libowen/Desktop/Code/gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/babel-plugin-treasure/src/index.js": {"path":"/Users/libowen/Desktop/Code/gitlab.prod.dtstack.cn/dt-insight-front/infrastructure/babel-plugin-treasure/src/index.js","statementMap":{"0":{"start":{"line":5,"column":16},"end":{"line":5,"column":20}},"1":{"start":{"line":11,"column":2},"end":{"line":13,"column":4}},"2":{"start":{"line":12,"column":4},"end":{"line":12,"column":19}},"3":{"start":{"line":20,"column":4},"end":{"line":24,"column":5}},"4":{"start":{"line":21,"column":6},"end":{"line":23,"column":7}},"5":{"start":{"line":22,"column":8},"end":{"line":22,"column":57}},"6":{"start":{"line":31,"column":18},"end":{"line":93,"column":3}},"7":{"start":{"line":33,"column":6},"end":{"line":86,"column":7}},"8":{"start":{"line":34,"column":8},"end":{"line":85,"column":9}},"9":{"start":{"line":35,"column":10},"end":{"line":67,"column":12}},"10":{"start":{"line":51,"column":14},"end":{"line":51,"column":68}},"11":{"start":{"line":52,"column":14},"end":{"line":65,"column":16}},"12":{"start":{"line":69,"column":10},"end":{"line":69,"column":69}},"13":{"start":{"line":70,"column":10},"end":{"line":84,"column":12}},"14":{"start":{"line":87,"column":6},"end":{"line":87,"column":53}},"15":{"start":{"line":91,"column":6},"end":{"line":91,"column":52}},"16":{"start":{"line":95,"column":18},"end":{"line":113,"column":3}},"17":{"start":{"line":115,"column":14},"end":{"line":117,"column":3}},"18":{"start":{"line":119,"column":2},"end":{"line":124,"column":3}},"19":{"start":{"line":120,"column":4},"end":{"line":123,"column":6}},"20":{"start":{"line":122,"column":6},"end":{"line":122,"column":52}},"21":{"start":{"line":126,"column":2},"end":{"line":126,"column":13}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":4,"column":15},"end":{"line":4,"column":16}},"loc":{"start":{"line":4,"column":35},"end":{"line":127,"column":1}},"line":4},"1":{"name":"(anonymous_1)","decl":{"start":{"line":11,"column":38},"end":{"line":11,"column":39}},"loc":{"start":{"line":11,"column":44},"end":{"line":13,"column":3}},"line":11},"2":{"name":"applyInstance","decl":{"start":{"line":18,"column":11},"end":{"line":18,"column":24}},"loc":{"start":{"line":18,"column":48},"end":{"line":25,"column":3}},"line":18},"3":{"name":"(anonymous_3)","decl":{"start":{"line":32,"column":4},"end":{"line":32,"column":5}},"loc":{"start":{"line":32,"column":31},"end":{"line":88,"column":5}},"line":32},"4":{"name":"(anonymous_4)","decl":{"start":{"line":36,"column":12},"end":{"line":36,"column":13}},"loc":{"start":{"line":50,"column":17},"end":{"line":66,"column":13}},"line":50},"5":{"name":"(anonymous_5)","decl":{"start":{"line":89,"column":4},"end":{"line":89,"column":5}},"loc":{"start":{"line":89,"column":11},"end":{"line":92,"column":5}},"line":89},"6":{"name":"(anonymous_6)","decl":{"start":{"line":120,"column":26},"end":{"line":120,"column":27}},"loc":{"start":{"line":120,"column":37},"end":{"line":123,"column":5}},"line":120}},"branchMap":{"0":{"loc":{"start":{"line":21,"column":6},"end":{"line":23,"column":7}},"type":"if","locations":[{"start":{"line":21,"column":6},"end":{"line":23,"column":7}},{"start":{"line":21,"column":6},"end":{"line":23,"column":7}}],"line":21},"1":{"loc":{"start":{"line":32,"column":18},"end":{"line":32,"column":27}},"type":"default-arg","locations":[{"start":{"line":32,"column":25},"end":{"line":32,"column":27}}],"line":32},"2":{"loc":{"start":{"line":33,"column":6},"end":{"line":86,"column":7}},"type":"if","locations":[{"start":{"line":33,"column":6},"end":{"line":86,"column":7}},{"start":{"line":33,"column":6},"end":{"line":86,"column":7}}],"line":33},"3":{"loc":{"start":{"line":34,"column":8},"end":{"line":85,"column":9}},"type":"if","locations":[{"start":{"line":34,"column":8},"end":{"line":85,"column":9}},{"start":{"line":34,"column":8},"end":{"line":85,"column":9}}],"line":34}},"s":{"0":42,"1":42,"2":40,"3":988,"4":988,"5":988,"6":42,"7":42,"8":42,"9":0,"10":0,"11":0,"12":42,"13":42,"14":42,"15":42,"16":42,"17":42,"18":42,"19":714,"20":904,"21":42},"f":{"0":42,"1":40,"2":988,"3":42,"4":0,"5":42,"6":904},"b":{"0":[988,0],"1":[0],"2":[42,0],"3":[0,42]},"_coverageSchema":"43e27e138ebf9cfc5966b082cf9a028302ed4184","hash":"b465d3625ffe4fda36b54b7ab0652a345b82d0a3"}
3 | }
4 |
--------------------------------------------------------------------------------
/coverage/lcov-report/base.css:
--------------------------------------------------------------------------------
1 | body, html {
2 | margin:0; padding: 0;
3 | height: 100%;
4 | }
5 | body {
6 | font-family: Helvetica Neue, Helvetica, Arial;
7 | font-size: 14px;
8 | color:#333;
9 | }
10 | .small { font-size: 12px; }
11 | *, *:after, *:before {
12 | -webkit-box-sizing:border-box;
13 | -moz-box-sizing:border-box;
14 | box-sizing:border-box;
15 | }
16 | h1 { font-size: 20px; margin: 0;}
17 | h2 { font-size: 14px; }
18 | pre {
19 | font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
20 | margin: 0;
21 | padding: 0;
22 | -moz-tab-size: 2;
23 | -o-tab-size: 2;
24 | tab-size: 2;
25 | }
26 | a { color:#0074D9; text-decoration:none; }
27 | a:hover { text-decoration:underline; }
28 | .strong { font-weight: bold; }
29 | .space-top1 { padding: 10px 0 0 0; }
30 | .pad2y { padding: 20px 0; }
31 | .pad1y { padding: 10px 0; }
32 | .pad2x { padding: 0 20px; }
33 | .pad2 { padding: 20px; }
34 | .pad1 { padding: 10px; }
35 | .space-left2 { padding-left:55px; }
36 | .space-right2 { padding-right:20px; }
37 | .center { text-align:center; }
38 | .clearfix { display:block; }
39 | .clearfix:after {
40 | content:'';
41 | display:block;
42 | height:0;
43 | clear:both;
44 | visibility:hidden;
45 | }
46 | .fl { float: left; }
47 | @media only screen and (max-width:640px) {
48 | .col3 { width:100%; max-width:100%; }
49 | .hide-mobile { display:none!important; }
50 | }
51 |
52 | .quiet {
53 | color: #7f7f7f;
54 | color: rgba(0,0,0,0.5);
55 | }
56 | .quiet a { opacity: 0.7; }
57 |
58 | .fraction {
59 | font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
60 | font-size: 10px;
61 | color: #555;
62 | background: #E8E8E8;
63 | padding: 4px 5px;
64 | border-radius: 3px;
65 | vertical-align: middle;
66 | }
67 |
68 | div.path a:link, div.path a:visited { color: #333; }
69 | table.coverage {
70 | border-collapse: collapse;
71 | margin: 10px 0 0 0;
72 | padding: 0;
73 | }
74 |
75 | table.coverage td {
76 | margin: 0;
77 | padding: 0;
78 | vertical-align: top;
79 | }
80 | table.coverage td.line-count {
81 | text-align: right;
82 | padding: 0 5px 0 20px;
83 | }
84 | table.coverage td.line-coverage {
85 | text-align: right;
86 | padding-right: 10px;
87 | min-width:20px;
88 | }
89 |
90 | table.coverage td span.cline-any {
91 | display: inline-block;
92 | padding: 0 5px;
93 | width: 100%;
94 | }
95 | .missing-if-branch {
96 | display: inline-block;
97 | margin-right: 5px;
98 | border-radius: 3px;
99 | position: relative;
100 | padding: 0 4px;
101 | background: #333;
102 | color: yellow;
103 | }
104 |
105 | .skip-if-branch {
106 | display: none;
107 | margin-right: 10px;
108 | position: relative;
109 | padding: 0 4px;
110 | background: #ccc;
111 | color: white;
112 | }
113 | .missing-if-branch .typ, .skip-if-branch .typ {
114 | color: inherit !important;
115 | }
116 | .coverage-summary {
117 | border-collapse: collapse;
118 | width: 100%;
119 | }
120 | .coverage-summary tr { border-bottom: 1px solid #bbb; }
121 | .keyline-all { border: 1px solid #ddd; }
122 | .coverage-summary td, .coverage-summary th { padding: 10px; }
123 | .coverage-summary tbody { border: 1px solid #bbb; }
124 | .coverage-summary td { border-right: 1px solid #bbb; }
125 | .coverage-summary td:last-child { border-right: none; }
126 | .coverage-summary th {
127 | text-align: left;
128 | font-weight: normal;
129 | white-space: nowrap;
130 | }
131 | .coverage-summary th.file { border-right: none !important; }
132 | .coverage-summary th.pct { }
133 | .coverage-summary th.pic,
134 | .coverage-summary th.abs,
135 | .coverage-summary td.pct,
136 | .coverage-summary td.abs { text-align: right; }
137 | .coverage-summary td.file { white-space: nowrap; }
138 | .coverage-summary td.pic { min-width: 120px !important; }
139 | .coverage-summary tfoot td { }
140 |
141 | .coverage-summary .sorter {
142 | height: 10px;
143 | width: 7px;
144 | display: inline-block;
145 | margin-left: 0.5em;
146 | background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
147 | }
148 | .coverage-summary .sorted .sorter {
149 | background-position: 0 -20px;
150 | }
151 | .coverage-summary .sorted-desc .sorter {
152 | background-position: 0 -10px;
153 | }
154 | .status-line { height: 10px; }
155 | /* yellow */
156 | .cbranch-no { background: yellow !important; color: #111; }
157 | /* dark red */
158 | .red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
159 | .low .chart { border:1px solid #C21F39 }
160 | .highlighted,
161 | .highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{
162 | background: #C21F39 !important;
163 | }
164 | /* medium red */
165 | .cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
166 | /* light red */
167 | .low, .cline-no { background:#FCE1E5 }
168 | /* light green */
169 | .high, .cline-yes { background:rgb(230,245,208) }
170 | /* medium green */
171 | .cstat-yes { background:rgb(161,215,106) }
172 | /* dark green */
173 | .status-line.high, .high .cover-fill { background:rgb(77,146,33) }
174 | .high .chart { border:1px solid rgb(77,146,33) }
175 | /* dark yellow (gold) */
176 | .status-line.medium, .medium .cover-fill { background: #f9cd0b; }
177 | .medium .chart { border:1px solid #f9cd0b; }
178 | /* light yellow */
179 | .medium { background: #fff4c2; }
180 |
181 | .cstat-skip { background: #ddd; color: #111; }
182 | .fstat-skip { background: #ddd; color: #111 !important; }
183 | .cbranch-skip { background: #ddd !important; color: #111; }
184 |
185 | span.cline-neutral { background: #eaeaea; }
186 |
187 | .coverage-summary td.empty {
188 | opacity: .5;
189 | padding-top: 4px;
190 | padding-bottom: 4px;
191 | line-height: 1;
192 | color: #888;
193 | }
194 |
195 | .cover-fill, .cover-empty {
196 | display:inline-block;
197 | height: 12px;
198 | }
199 | .chart {
200 | line-height: 0;
201 | }
202 | .cover-empty {
203 | background: white;
204 | }
205 | .cover-full {
206 | border-right: none !important;
207 | }
208 | pre.prettyprint {
209 | border: none !important;
210 | padding: 0 !important;
211 | margin: 0 !important;
212 | }
213 | .com { color: #999 !important; }
214 | .ignore-none { color: #999; font-weight: normal; }
215 |
216 | .wrapper {
217 | min-height: 100%;
218 | height: auto !important;
219 | height: 100%;
220 | margin: 0 auto -48px;
221 | }
222 | .footer, .push {
223 | height: 48px;
224 | }
225 |
--------------------------------------------------------------------------------
/coverage/lcov-report/block-navigation.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | var jumpToCode = (function init() {
3 | // Classes of code we would like to highlight in the file view
4 | var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
5 |
6 | // Elements to highlight in the file listing view
7 | var fileListingElements = ['td.pct.low'];
8 |
9 | // We don't want to select elements that are direct descendants of another match
10 | var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
11 |
12 | // Selecter that finds elements on the page to which we can jump
13 | var selector =
14 | fileListingElements.join(', ') +
15 | ', ' +
16 | notSelector +
17 | missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b`
18 |
19 | // The NodeList of matching elements
20 | var missingCoverageElements = document.querySelectorAll(selector);
21 |
22 | var currentIndex;
23 |
24 | function toggleClass(index) {
25 | missingCoverageElements
26 | .item(currentIndex)
27 | .classList.remove('highlighted');
28 | missingCoverageElements.item(index).classList.add('highlighted');
29 | }
30 |
31 | function makeCurrent(index) {
32 | toggleClass(index);
33 | currentIndex = index;
34 | missingCoverageElements.item(index).scrollIntoView({
35 | behavior: 'smooth',
36 | block: 'center',
37 | inline: 'center'
38 | });
39 | }
40 |
41 | function goToPrevious() {
42 | var nextIndex = 0;
43 | if (typeof currentIndex !== 'number' || currentIndex === 0) {
44 | nextIndex = missingCoverageElements.length - 1;
45 | } else if (missingCoverageElements.length > 1) {
46 | nextIndex = currentIndex - 1;
47 | }
48 |
49 | makeCurrent(nextIndex);
50 | }
51 |
52 | function goToNext() {
53 | var nextIndex = 0;
54 |
55 | if (
56 | typeof currentIndex === 'number' &&
57 | currentIndex < missingCoverageElements.length - 1
58 | ) {
59 | nextIndex = currentIndex + 1;
60 | }
61 |
62 | makeCurrent(nextIndex);
63 | }
64 |
65 | return function jump(event) {
66 | switch (event.which) {
67 | case 78: // n
68 | case 74: // j
69 | goToNext();
70 | break;
71 | case 66: // b
72 | case 75: // k
73 | case 80: // p
74 | goToPrevious();
75 | break;
76 | }
77 | };
78 | })();
79 | window.addEventListener('keydown', jumpToCode);
80 |
--------------------------------------------------------------------------------
/coverage/lcov-report/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Code coverage report for All files
7 |
8 |
9 |
10 |
11 |
16 |
17 |
18 |
19 |
20 |
21 |
All files
22 |
23 |
24 |
25 | 97.39%
26 | Statements
27 | 149/153
28 |
29 |
30 |
31 |
32 | 90.57%
33 | Branches
34 | 96/106
35 |
36 |
37 |
38 |
39 | 97.44%
40 | Functions
41 | 38/39
42 |
43 |
44 |
45 |
46 | 97.96%
47 | Lines
48 | 144/147
49 |
50 |
51 |
52 |
53 |
54 | Press n or j to go to the next uncovered block, b, p or k for the previous block.
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | File |
63 | |
64 | Statements |
65 | |
66 | Branches |
67 | |
68 | Functions |
69 | |
70 | Lines |
71 | |
72 |
73 |
74 |
75 | Plugin.js |
76 |
77 |
78 | |
79 | 99.24% |
80 | 130/131 |
81 | 93.94% |
82 | 93/99 |
83 | 100% |
84 | 32/32 |
85 | 100% |
86 | 125/125 |
87 |
88 |
89 |
90 | index.js |
91 |
92 |
93 | |
94 | 86.36% |
95 | 19/22 |
96 | 42.86% |
97 | 3/7 |
98 | 85.71% |
99 | 6/7 |
100 | 86.36% |
101 | 19/22 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
114 |
115 |
116 |
121 |
122 |
123 |
124 |
125 |
--------------------------------------------------------------------------------
/coverage/lcov-report/index.js.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Code coverage report for index.js
7 |
8 |
9 |
10 |
11 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | 86.36%
26 | Statements
27 | 19/22
28 |
29 |
30 |
31 |
32 | 42.86%
33 | Branches
34 | 3/7
35 |
36 |
37 |
38 |
39 | 85.71%
40 | Functions
41 | 6/7
42 |
43 |
44 |
45 |
46 | 86.36%
47 | Lines
48 | 19/22
49 |
50 |
51 |
52 |
53 |
54 | Press n or j to go to the next uncovered block, b, p or k for the previous block.
55 |
56 |
57 |
58 |
59 | 1
60 | 2
61 | 3
62 | 4
63 | 5
64 | 6
65 | 7
66 | 8
67 | 9
68 | 10
69 | 11
70 | 12
71 | 13
72 | 14
73 | 15
74 | 16
75 | 17
76 | 18
77 | 19
78 | 20
79 | 21
80 | 22
81 | 23
82 | 24
83 | 25
84 | 26
85 | 27
86 | 28
87 | 29
88 | 30
89 | 31
90 | 32
91 | 33
92 | 34
93 | 35
94 | 36
95 | 37
96 | 38
97 | 39
98 | 40
99 | 41
100 | 42
101 | 43
102 | 44
103 | 45
104 | 46
105 | 47
106 | 48
107 | 49
108 | 50
109 | 51
110 | 52
111 | 53
112 | 54
113 | 55
114 | 56
115 | 57
116 | 58
117 | 59
118 | 60
119 | 61
120 | 62
121 | 63
122 | 64
123 | 65
124 | 66
125 | 67
126 | 68
127 | 69
128 | 70
129 | 71
130 | 72
131 | 73
132 | 74
133 | 75
134 | 76
135 | 77
136 | 78
137 | 79
138 | 80
139 | 81
140 | 82
141 | 83
142 | 84
143 | 85
144 | 86
145 | 87
146 | 88
147 | 89
148 | 90
149 | 91
150 | 92
151 | 93
152 | 94
153 | 95
154 | 96
155 | 97
156 | 98
157 | 99
158 | 100
159 | 101
160 | 102
161 | 103
162 | 104
163 | 105
164 | 106
165 | 107
166 | 108
167 | 109
168 | 110
169 | 111
170 | 112
171 | 113
172 | 114
173 | 115
174 | 116
175 | 117
176 | 118
177 | 119
178 | 120
179 | 121
180 | 122
181 | 123
182 | 124
183 | 125
184 | 126
185 | 127
186 | 128 |
187 |
188 |
189 |
190 | 42x
191 |
192 |
193 |
194 |
195 |
196 | 42x
197 | 40x
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 | 988x
206 | 988x
207 | 988x
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 | 42x
217 |
218 | 42x
219 | 42x
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 | 42x
255 | 42x
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 | 42x
273 |
274 |
275 |
276 | 42x
277 |
278 |
279 |
280 | 42x
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 | 42x
301 |
302 |
303 |
304 | 42x
305 | 714x
306 |
307 | 904x
308 |
309 |
310 |
311 | 42x
312 |
313 | | import assert from 'assert';
314 | import Plugin from './Plugin';
315 |
316 | export default function({ types }) {
317 | let plugins = null;
318 |
319 | /**
320 | * 用于单测初始化插件
321 | */
322 | // eslint-disable-next-line no-underscore-dangle
323 | global.__clearBabelTreasurePlugin = () => {
324 | plugins = null;
325 | };
326 |
327 | /**
328 | * 从类中继承方法与参数
329 | */
330 | function applyInstance(method, args, context) {
331 | // eslint-disable-next-line no-restricted-syntax
332 | for (const plugin of plugins) {
333 | Eif (plugin[method]) {
334 | plugin[method].apply(plugin, [...args, context]);
335 | }
336 | }
337 | }
338 |
339 | /**
340 | * Program入口初始化数据结构
341 | * 出口删除处理完毕的标记节点
342 | */
343 | const Program = {
344 | enter(path, { opts = {} }) {
345 | Eif (!plugins) {
346 | Iif (Array.isArray(opts)) {
347 | plugins = opts.map(
348 | (
349 | {
350 | libraryName,
351 | libraryDirectory,
352 | style,
353 | styleLibraryDirectory,
354 | customStyleName,
355 | camel2DashComponentName,
356 | camel2UnderlineComponentName,
357 | fileName,
358 | customName,
359 | transformToDefaultImport,
360 | },
361 | index,
362 | ) => {
363 | assert(libraryName, 'libraryName should be provided');
364 | return new Plugin(
365 | libraryName,
366 | libraryDirectory,
367 | style,
368 | styleLibraryDirectory,
369 | customStyleName,
370 | camel2DashComponentName,
371 | camel2UnderlineComponentName,
372 | fileName,
373 | customName,
374 | transformToDefaultImport,
375 | types,
376 | index,
377 | );
378 | },
379 | );
380 | } else {
381 | assert(opts.libraryName, 'libraryName should be provided');
382 | plugins = [
383 | new Plugin(
384 | opts.libraryName,
385 | opts.libraryDirectory,
386 | opts.style,
387 | opts.styleLibraryDirectory,
388 | opts.customStyleName,
389 | opts.camel2DashComponentName,
390 | opts.camel2UnderlineComponentName,
391 | opts.fileName,
392 | opts.customName,
393 | opts.transformToDefaultImport,
394 | types,
395 | ),
396 | ];
397 | }
398 | }
399 | applyInstance('ProgramEnter', arguments, this); // eslint-disable-line
400 | },
401 | exit() {
402 | // eslint-disable-next-line prefer-rest-params
403 | applyInstance('ProgramExit', arguments, this);
404 | },
405 | };
406 |
407 | const methods = [
408 | 'ImportDeclaration',
409 | 'CallExpression',
410 | 'MemberExpression',
411 | 'ClassDeclaration',
412 | 'Property',
413 | 'ConditionalExpression',
414 | 'ReturnStatement',
415 | 'IfStatement',
416 | 'BinaryExpression',
417 | 'VariableDeclarator',
418 | 'ArrayExpression',
419 | 'NewExpression',
420 | 'ExportDefaultDeclaration',
421 | 'ExpressionStatement',
422 | 'LogicalExpression',
423 | 'SwitchStatement',
424 | 'SwitchCase',
425 | ];
426 |
427 | const ret = {
428 | visitor: { Program }, // 对整棵AST树的入口进行初始化操作
429 | };
430 | // eslint-disable-next-line no-restricted-syntax
431 | for (const method of methods) {
432 | ret.visitor[method] = function() {
433 | // eslint-disable-next-line prefer-rest-params
434 | applyInstance(method, arguments, ret.visitor);
435 | };
436 | }
437 |
438 | return ret;
439 | }
440 | |
441 |
442 |
443 |
444 |
449 |
450 |
451 |
456 |
457 |
458 |
459 |
460 |
--------------------------------------------------------------------------------
/coverage/lcov-report/prettify.css:
--------------------------------------------------------------------------------
1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
2 |
--------------------------------------------------------------------------------
/coverage/lcov-report/prettify.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^