first
This commit is contained in:
30
node_modules/@vue/babel-helper-vue-jsx-merge-props/README.md
generated
vendored
Normal file
30
node_modules/@vue/babel-helper-vue-jsx-merge-props/README.md
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
## @vue/babel-helper-vue-jsx-merge-props
|
||||
|
||||
A package used internally by vue jsx transformer to merge props spread. It is required to merge some prop trees like this:
|
||||
|
||||
```js
|
||||
import mergeProps from '@vue/babel-helper-vue-jsx-merge-props'
|
||||
|
||||
const MyComponent = {
|
||||
render(h) {
|
||||
// original: <button onClick={$event => console.log($event)} {...{ on: { click: $event => doSomething($event) } }} />
|
||||
return h(
|
||||
'button',
|
||||
mergeProps([
|
||||
{
|
||||
on: {
|
||||
click: $event => console.log($event),
|
||||
},
|
||||
},
|
||||
{
|
||||
on: {
|
||||
click: $event => doSomething($event),
|
||||
},
|
||||
},
|
||||
]),
|
||||
)
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
This tool is used internally and there is no reason for you to ever use it.
|
1
node_modules/@vue/babel-helper-vue-jsx-merge-props/dist/helper.js
generated
vendored
Normal file
1
node_modules/@vue/babel-helper-vue-jsx-merge-props/dist/helper.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
"use strict";function _extends(){return _extends=Object.assign?Object.assign.bind():function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_extends.apply(this,arguments)}var normalMerge=["attrs","props","domProps"],toArrayMerge=["class","style","directives"],functionalMerge=["on","nativeOn"],mergeJsxProps=function(a){return a.reduce(function(c,a){for(var b in a)if(!c[b])c[b]=a[b];else if(-1!==normalMerge.indexOf(b))c[b]=_extends({},c[b],a[b]);else if(-1!==toArrayMerge.indexOf(b)){var d=c[b]instanceof Array?c[b]:[c[b]],e=a[b]instanceof Array?a[b]:[a[b]];c[b]=[].concat(d,e)}else if(-1!==functionalMerge.indexOf(b)){for(var f in a[b])if(c[b][f]){var g=c[b][f]instanceof Array?c[b][f]:[c[b][f]],h=a[b][f]instanceof Array?a[b][f]:[a[b][f]];c[b][f]=[].concat(g,h)}else c[b][f]=a[b][f];}else if("hook"===b)for(var i in a[b])c[b][i]=c[b][i]?mergeFn(c[b][i],a[b][i]):a[b][i];else c[b]=a[b];return c},{})},mergeFn=function(a,b){return function(){a&&a.apply(this,arguments),b&&b.apply(this,arguments)}};module.exports=mergeJsxProps;
|
72
node_modules/@vue/babel-helper-vue-jsx-merge-props/package.json
generated
vendored
Normal file
72
node_modules/@vue/babel-helper-vue-jsx-merge-props/package.json
generated
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
{
|
||||
"_from": "@vue/babel-helper-vue-jsx-merge-props@1.4.0",
|
||||
"_id": "@vue/babel-helper-vue-jsx-merge-props@1.4.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-JkqXfCkUDp4PIlFdDQ0TdXoIejMtTHP67/pvxlgeY+u5k3LEdKuWZ3LK6xkxo52uDoABIVyRwqVkfLQJhk7VBA==",
|
||||
"_location": "/@vue/babel-helper-vue-jsx-merge-props",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@vue/babel-helper-vue-jsx-merge-props@1.4.0",
|
||||
"name": "@vue/babel-helper-vue-jsx-merge-props",
|
||||
"escapedName": "@vue%2fbabel-helper-vue-jsx-merge-props",
|
||||
"scope": "@vue",
|
||||
"rawSpec": "1.4.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.4.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@vue/babel-plugin-transform-vue-jsx",
|
||||
"/@vue/babel-preset-jsx",
|
||||
"/@vue/babel-sugar-v-model",
|
||||
"/vant"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.4.0.tgz",
|
||||
"_shasum": "8d53a1e21347db8edbe54d339902583176de09f2",
|
||||
"_spec": "@vue/babel-helper-vue-jsx-merge-props@1.4.0",
|
||||
"_where": "C:\\Users\\zhouxueli\\Desktop\\scheduling-app\\node_modules\\vant",
|
||||
"author": {
|
||||
"name": "Evan You"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Babel helper for Vue JSX spread",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.2.0",
|
||||
"@babel/preset-env": "^7.2.0",
|
||||
"ava": "^0.25.0",
|
||||
"nyc": "^13.1.0",
|
||||
"rollup": "^0.67.4",
|
||||
"rollup-plugin-babel": "4.0.3",
|
||||
"rollup-plugin-babel-minify": "^6.2.0",
|
||||
"rollup-plugin-istanbul": "^2.0.1"
|
||||
},
|
||||
"files": [],
|
||||
"gitHead": "6566e12067f5d6c02d3849b574a1b84de5634008",
|
||||
"license": "MIT",
|
||||
"main": "dist/helper.js",
|
||||
"name": "@vue/babel-helper-vue-jsx-merge-props",
|
||||
"nyc": {
|
||||
"exclude": [
|
||||
"dist",
|
||||
"test"
|
||||
]
|
||||
},
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vuejs/jsx/tree/master/packages/babel-helper-vue-jsx-merge-props"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"build:testing": "rollup -c rollup.config.testing.js",
|
||||
"prepublish": "yarn build",
|
||||
"pretest": "yarn build:testing",
|
||||
"test": "nyc --reporter=html --reporter=text-summary ava -v test/test.js"
|
||||
},
|
||||
"version": "1.4.0"
|
||||
}
|
21
node_modules/@vue/babel-helper-vue-transform-on/LICENSE
generated
vendored
Normal file
21
node_modules/@vue/babel-helper-vue-transform-on/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-present vuejs
|
||||
|
||||
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.
|
5
node_modules/@vue/babel-helper-vue-transform-on/README.md
generated
vendored
Normal file
5
node_modules/@vue/babel-helper-vue-transform-on/README.md
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
# @vue/babel-helper-vue-transform-on
|
||||
|
||||
A package used internally by vue jsx transformer to transform events.
|
||||
|
||||
on: { click: xx } --> onClick: xx
|
4
node_modules/@vue/babel-helper-vue-transform-on/index.d.ts
generated
vendored
Normal file
4
node_modules/@vue/babel-helper-vue-transform-on/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
declare function transformOn(
|
||||
obj: Record<string, any>
|
||||
): Record<`on${string}`, any>;
|
||||
export default transformOn;
|
9
node_modules/@vue/babel-helper-vue-transform-on/index.js
generated
vendored
Normal file
9
node_modules/@vue/babel-helper-vue-transform-on/index.js
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
const transformOn = (obj) => {
|
||||
const result = {};
|
||||
Object.keys(obj).forEach((evt) => {
|
||||
result[`on${evt[0].toUpperCase()}${evt.slice(1)}`] = obj[evt];
|
||||
});
|
||||
return result;
|
||||
};
|
||||
|
||||
module.exports = transformOn;
|
46
node_modules/@vue/babel-helper-vue-transform-on/package.json
generated
vendored
Normal file
46
node_modules/@vue/babel-helper-vue-transform-on/package.json
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
"_from": "@vue/babel-helper-vue-transform-on@^1.1.5",
|
||||
"_id": "@vue/babel-helper-vue-transform-on@1.1.5",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-SgUymFpMoAyWeYWLAY+MkCK3QEROsiUnfaw5zxOVD/M64KQs8D/4oK6Q5omVA2hnvEOE0SCkH2TZxs/jnnUj7w==",
|
||||
"_location": "/@vue/babel-helper-vue-transform-on",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@vue/babel-helper-vue-transform-on@^1.1.5",
|
||||
"name": "@vue/babel-helper-vue-transform-on",
|
||||
"escapedName": "@vue%2fbabel-helper-vue-transform-on",
|
||||
"scope": "@vue",
|
||||
"rawSpec": "^1.1.5",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.1.5"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@vue/babel-plugin-jsx"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@vue/babel-helper-vue-transform-on/-/babel-helper-vue-transform-on-1.1.5.tgz",
|
||||
"_shasum": "a976486b21e108e545524fe41ffe3fc9bbc28c7f",
|
||||
"_spec": "@vue/babel-helper-vue-transform-on@^1.1.5",
|
||||
"_where": "C:\\Users\\zhouxueli\\Desktop\\scheduling-app\\node_modules\\@vue\\babel-plugin-jsx",
|
||||
"author": {
|
||||
"name": "Amour1688",
|
||||
"email": "lcz_1996@foxmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/babel-plugin-jsx/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "to help transform on",
|
||||
"homepage": "https://github.com/vuejs/babel-plugin-jsx#readme",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "@vue/babel-helper-vue-transform-on",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/babel-plugin-jsx.git"
|
||||
},
|
||||
"types": "index.d.ts",
|
||||
"version": "1.1.5"
|
||||
}
|
21
node_modules/@vue/babel-plugin-jsx/LICENSE
generated
vendored
Normal file
21
node_modules/@vue/babel-plugin-jsx/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-present vuejs
|
||||
|
||||
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.
|
376
node_modules/@vue/babel-plugin-jsx/README.md
generated
vendored
Normal file
376
node_modules/@vue/babel-plugin-jsx/README.md
generated
vendored
Normal file
@ -0,0 +1,376 @@
|
||||
# Babel Plugin JSX for Vue 3
|
||||
|
||||
[](https://www.npmjs.com/package/@vue/babel-plugin-jsx)
|
||||
[](https://github.com/actions-cool/issues-helper)
|
||||
|
||||
To add Vue JSX support.
|
||||
|
||||
English | [简体中文](/packages/babel-plugin-jsx/README-zh_CN.md)
|
||||
|
||||
## Installation
|
||||
|
||||
Install the plugin with:
|
||||
|
||||
```bash
|
||||
npm install @vue/babel-plugin-jsx -D
|
||||
```
|
||||
|
||||
Then add the plugin to your babel config:
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["@vue/babel-plugin-jsx"]
|
||||
}
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### options
|
||||
|
||||
#### transformOn
|
||||
|
||||
Type: `boolean`
|
||||
|
||||
Default: `false`
|
||||
|
||||
transform `on: { click: xx }` to `onClick: xxx`
|
||||
|
||||
#### optimize
|
||||
|
||||
Type: `boolean`
|
||||
|
||||
Default: `false`
|
||||
|
||||
enable optimization or not. It's not recommended to enable it If you are not familiar with Vue 3.
|
||||
|
||||
#### isCustomElement
|
||||
|
||||
Type: `(tag: string) => boolean`
|
||||
|
||||
Default: `undefined`
|
||||
|
||||
configuring custom elements
|
||||
|
||||
#### mergeProps
|
||||
|
||||
Type: `boolean`
|
||||
|
||||
Default: `true`
|
||||
|
||||
merge static and dynamic class / style attributes / onXXX handlers
|
||||
|
||||
#### enableObjectSlots
|
||||
|
||||
Type: `boolean`
|
||||
|
||||
Default: `true`
|
||||
|
||||
Whether to enable `object slots` (mentioned below the document) syntax". It might be useful in JSX, but it will add a lot of `_isSlot` condition expressions which increase your bundle size. And `v-slots` is still available even if `enableObjectSlots` is turned off.
|
||||
|
||||
#### pragma
|
||||
|
||||
Type: `string`
|
||||
|
||||
Default: `createVNode`
|
||||
|
||||
Replace the function used when compiling JSX expressions.
|
||||
|
||||
## Syntax
|
||||
|
||||
### Content
|
||||
|
||||
functional component
|
||||
|
||||
```jsx
|
||||
const App = () => <div>Vue 3.0</div>;
|
||||
```
|
||||
|
||||
with render
|
||||
|
||||
```jsx
|
||||
const App = {
|
||||
render() {
|
||||
return <div>Vue 3.0</div>;
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
```jsx
|
||||
import { withModifiers, defineComponent } from 'vue';
|
||||
|
||||
const App = defineComponent({
|
||||
setup() {
|
||||
const count = ref(0);
|
||||
|
||||
const inc = () => {
|
||||
count.value++;
|
||||
};
|
||||
|
||||
return () => (
|
||||
<div onClick={withModifiers(inc, ['self'])}>{count.value}</div>
|
||||
);
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Fragment
|
||||
|
||||
```jsx
|
||||
const App = () => (
|
||||
<>
|
||||
<span>I'm</span>
|
||||
<span>Fragment</span>
|
||||
</>
|
||||
);
|
||||
```
|
||||
|
||||
### Attributes / Props
|
||||
|
||||
```jsx
|
||||
const App = () => <input type="email" />;
|
||||
```
|
||||
|
||||
with a dynamic binding:
|
||||
|
||||
```jsx
|
||||
const placeholderText = 'email';
|
||||
const App = () => <input type="email" placeholder={placeholderText} />;
|
||||
```
|
||||
|
||||
### Directives
|
||||
|
||||
#### v-show
|
||||
|
||||
```jsx
|
||||
const App = {
|
||||
data() {
|
||||
return { visible: true };
|
||||
},
|
||||
render() {
|
||||
return <input v-show={this.visible} />;
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
#### v-model
|
||||
|
||||
> Note: You should pass the second param as string for using `arg`.
|
||||
|
||||
```jsx
|
||||
<input v-model={val} />
|
||||
```
|
||||
|
||||
```jsx
|
||||
<input v-model:argument={val} />
|
||||
```
|
||||
|
||||
```jsx
|
||||
<input v-model={[val, ['modifier']]} />
|
||||
```
|
||||
|
||||
```jsx
|
||||
<A v-model={[val, 'argument', ['modifier']]} />
|
||||
```
|
||||
|
||||
Will compile to:
|
||||
|
||||
```js
|
||||
h(A, {
|
||||
argument: val,
|
||||
argumentModifiers: {
|
||||
modifier: true,
|
||||
},
|
||||
'onUpdate:argument': ($event) => (val = $event),
|
||||
});
|
||||
```
|
||||
|
||||
#### v-models (Not recommended since v1.1.0)
|
||||
|
||||
> Note: You should pass a Two-dimensional Arrays to v-models.
|
||||
|
||||
```jsx
|
||||
<A v-models={[[foo], [bar, 'bar']]} />
|
||||
```
|
||||
|
||||
```jsx
|
||||
<A
|
||||
v-models={[
|
||||
[foo, 'foo'],
|
||||
[bar, 'bar'],
|
||||
]}
|
||||
/>
|
||||
```
|
||||
|
||||
```jsx
|
||||
<A
|
||||
v-models={[
|
||||
[foo, ['modifier']],
|
||||
[bar, 'bar', ['modifier']],
|
||||
]}
|
||||
/>
|
||||
```
|
||||
|
||||
Will compile to:
|
||||
|
||||
```js
|
||||
h(A, {
|
||||
modelValue: foo,
|
||||
modelModifiers: {
|
||||
modifier: true,
|
||||
},
|
||||
'onUpdate:modelValue': ($event) => (foo = $event),
|
||||
bar: bar,
|
||||
barModifiers: {
|
||||
modifier: true,
|
||||
},
|
||||
'onUpdate:bar': ($event) => (bar = $event),
|
||||
});
|
||||
```
|
||||
|
||||
#### custom directive
|
||||
|
||||
Recommended when using string arguments
|
||||
|
||||
```jsx
|
||||
const App = {
|
||||
directives: { custom: customDirective },
|
||||
setup() {
|
||||
return () => <a v-custom:arg={val} />;
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
```jsx
|
||||
const App = {
|
||||
directives: { custom: customDirective },
|
||||
setup() {
|
||||
return () => <a v-custom={[val, 'arg', ['a', 'b']]} />;
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### Slot
|
||||
|
||||
> Note: In `jsx`, _`v-slot`_ should be replaced with **`v-slots`**
|
||||
|
||||
```jsx
|
||||
const A = (props, { slots }) => (
|
||||
<>
|
||||
<h1>{slots.default ? slots.default() : 'foo'}</h1>
|
||||
<h2>{slots.bar?.()}</h2>
|
||||
</>
|
||||
);
|
||||
|
||||
const App = {
|
||||
setup() {
|
||||
const slots = {
|
||||
bar: () => <span>B</span>,
|
||||
};
|
||||
return () => (
|
||||
<A v-slots={slots}>
|
||||
<div>A</div>
|
||||
</A>
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
// or
|
||||
|
||||
const App = {
|
||||
setup() {
|
||||
const slots = {
|
||||
default: () => <div>A</div>,
|
||||
bar: () => <span>B</span>,
|
||||
};
|
||||
return () => <A v-slots={slots} />;
|
||||
},
|
||||
};
|
||||
|
||||
// or you can use object slots when `enableObjectSlots` is not false.
|
||||
const App = {
|
||||
setup() {
|
||||
return () => (
|
||||
<>
|
||||
<A>
|
||||
{{
|
||||
default: () => <div>A</div>,
|
||||
bar: () => <span>B</span>,
|
||||
}}
|
||||
</A>
|
||||
<B>{() => 'foo'}</B>
|
||||
</>
|
||||
);
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### In TypeScript
|
||||
|
||||
`tsconfig.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"jsx": "preserve"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Who is using
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a target="_blank" href="https://www.antdv.com/">
|
||||
<img
|
||||
width="32"
|
||||
src="https://qn.antdv.com/logo.png"
|
||||
/>
|
||||
<br>
|
||||
<strong>Ant Design Vue</strong>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a target="_blank" href="https://youzan.github.io/vant/#/zh-CN/">
|
||||
<img
|
||||
width="32"
|
||||
style="vertical-align: -0.32em; margin-right: 8px;"
|
||||
src="https://img.yzcdn.cn/vant/logo.png"
|
||||
/>
|
||||
<br>
|
||||
<strong>Vant</strong>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a target="_blank" href="https://github.com/element-plus/element-plus">
|
||||
<img
|
||||
height="32"
|
||||
style="vertical-align: -0.32em; margin-right: 8px;"
|
||||
src="https://user-images.githubusercontent.com/10731096/91267529-259f3680-e7a6-11ea-9a60-3286f750de01.png"
|
||||
/>
|
||||
<br>
|
||||
<strong>Element Plus</strong>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a target="_blank" href="https://github.com/leezng/vue-json-pretty">
|
||||
<img
|
||||
height="32"
|
||||
style="vertical-align: -0.32em; margin-right: 8px;"
|
||||
src="https://raw.githubusercontent.com/leezng/vue-json-pretty/master/static/logo.svg"
|
||||
/>
|
||||
<br>
|
||||
<strong>Vue Json Pretty</strong>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## Compatibility
|
||||
|
||||
This repo is only compatible with:
|
||||
|
||||
- **Babel 7+**
|
||||
- **Vue 3+**
|
43
node_modules/@vue/babel-plugin-jsx/dist/index.d.mts
generated
vendored
Normal file
43
node_modules/@vue/babel-plugin-jsx/dist/index.d.mts
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
import * as t from '@babel/types';
|
||||
import * as BabelCore from '@babel/core';
|
||||
import { NodePath } from '@babel/traverse';
|
||||
|
||||
type State = {
|
||||
get: (name: string) => any;
|
||||
set: (name: string, value: any) => any;
|
||||
opts: VueJSXPluginOptions;
|
||||
file: BabelCore.BabelFile;
|
||||
};
|
||||
interface VueJSXPluginOptions {
|
||||
/** transform `on: { click: xx }` to `onClick: xxx` */
|
||||
transformOn?: boolean;
|
||||
/** enable optimization or not. */
|
||||
optimize?: boolean;
|
||||
/** merge static and dynamic class / style attributes / onXXX handlers */
|
||||
mergeProps?: boolean;
|
||||
/** configuring custom elements */
|
||||
isCustomElement?: (tag: string) => boolean;
|
||||
/** enable object slots syntax */
|
||||
enableObjectSlots?: boolean;
|
||||
/** Replace the function used when compiling JSX expressions */
|
||||
pragma?: string;
|
||||
}
|
||||
|
||||
declare const _default: ({ types }: typeof BabelCore) => {
|
||||
name: string;
|
||||
inherits: any;
|
||||
visitor: {
|
||||
Program: {
|
||||
enter(path: NodePath<t.Program>, state: State): void;
|
||||
exit(path: NodePath<t.Program>): void;
|
||||
};
|
||||
JSXFragment: {
|
||||
enter(path: BabelCore.NodePath<t.JSXElement>, state: State): void;
|
||||
};
|
||||
JSXElement: {
|
||||
exit(path: BabelCore.NodePath<t.JSXElement>, state: State): void;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
export { VueJSXPluginOptions, _default as default };
|
43
node_modules/@vue/babel-plugin-jsx/dist/index.d.ts
generated
vendored
Normal file
43
node_modules/@vue/babel-plugin-jsx/dist/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
import * as t from '@babel/types';
|
||||
import * as BabelCore from '@babel/core';
|
||||
import { NodePath } from '@babel/traverse';
|
||||
|
||||
type State = {
|
||||
get: (name: string) => any;
|
||||
set: (name: string, value: any) => any;
|
||||
opts: VueJSXPluginOptions;
|
||||
file: BabelCore.BabelFile;
|
||||
};
|
||||
interface VueJSXPluginOptions {
|
||||
/** transform `on: { click: xx }` to `onClick: xxx` */
|
||||
transformOn?: boolean;
|
||||
/** enable optimization or not. */
|
||||
optimize?: boolean;
|
||||
/** merge static and dynamic class / style attributes / onXXX handlers */
|
||||
mergeProps?: boolean;
|
||||
/** configuring custom elements */
|
||||
isCustomElement?: (tag: string) => boolean;
|
||||
/** enable object slots syntax */
|
||||
enableObjectSlots?: boolean;
|
||||
/** Replace the function used when compiling JSX expressions */
|
||||
pragma?: string;
|
||||
}
|
||||
|
||||
declare const _default: ({ types }: typeof BabelCore) => {
|
||||
name: string;
|
||||
inherits: any;
|
||||
visitor: {
|
||||
Program: {
|
||||
enter(path: NodePath<t.Program>, state: State): void;
|
||||
exit(path: NodePath<t.Program>): void;
|
||||
};
|
||||
JSXFragment: {
|
||||
enter(path: BabelCore.NodePath<t.JSXElement>, state: State): void;
|
||||
};
|
||||
JSXElement: {
|
||||
exit(path: BabelCore.NodePath<t.JSXElement>, state: State): void;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
export { VueJSXPluginOptions, _default as default };
|
1020
node_modules/@vue/babel-plugin-jsx/dist/index.js
generated
vendored
Normal file
1020
node_modules/@vue/babel-plugin-jsx/dist/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
992
node_modules/@vue/babel-plugin-jsx/dist/index.mjs
generated
vendored
Normal file
992
node_modules/@vue/babel-plugin-jsx/dist/index.mjs
generated
vendored
Normal file
@ -0,0 +1,992 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __defProps = Object.defineProperties;
|
||||
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
||||
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
||||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
||||
var __spreadValues = (a, b) => {
|
||||
for (var prop in b || (b = {}))
|
||||
if (__hasOwnProp.call(b, prop))
|
||||
__defNormalProp(a, prop, b[prop]);
|
||||
if (__getOwnPropSymbols)
|
||||
for (var prop of __getOwnPropSymbols(b)) {
|
||||
if (__propIsEnum.call(b, prop))
|
||||
__defNormalProp(a, prop, b[prop]);
|
||||
}
|
||||
return a;
|
||||
};
|
||||
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
||||
|
||||
// src/index.ts
|
||||
import * as t5 from "@babel/types";
|
||||
import template from "@babel/template";
|
||||
import syntaxJsx from "@babel/plugin-syntax-jsx";
|
||||
import { addNamed, addNamespace, isModule } from "@babel/helper-module-imports";
|
||||
|
||||
// src/transform-vue-jsx.ts
|
||||
import * as t3 from "@babel/types";
|
||||
import { addDefault } from "@babel/helper-module-imports";
|
||||
|
||||
// src/utils.ts
|
||||
import * as t from "@babel/types";
|
||||
import htmlTags from "html-tags";
|
||||
import svgTags from "svg-tags";
|
||||
|
||||
// src/slotFlags.ts
|
||||
var SlotFlags = /* @__PURE__ */ ((SlotFlags2) => {
|
||||
SlotFlags2[SlotFlags2["STABLE"] = 1] = "STABLE";
|
||||
SlotFlags2[SlotFlags2["DYNAMIC"] = 2] = "DYNAMIC";
|
||||
SlotFlags2[SlotFlags2["FORWARDED"] = 3] = "FORWARDED";
|
||||
return SlotFlags2;
|
||||
})(SlotFlags || {});
|
||||
var slotFlags_default = SlotFlags;
|
||||
|
||||
// src/utils.ts
|
||||
var FRAGMENT = "Fragment";
|
||||
var KEEP_ALIVE = "KeepAlive";
|
||||
var createIdentifier = (state, name) => state.get(name)();
|
||||
var isDirective = (src) => src.startsWith("v-") || src.startsWith("v") && src.length >= 2 && src[1] >= "A" && src[1] <= "Z";
|
||||
var shouldTransformedToSlots = (tag) => !(tag.match(RegExp(`^_?${FRAGMENT}\\d*$`)) || tag === KEEP_ALIVE);
|
||||
var checkIsComponent = (path, state) => {
|
||||
var _a, _b;
|
||||
const namePath = path.get("name");
|
||||
if (namePath.isJSXMemberExpression()) {
|
||||
return shouldTransformedToSlots(namePath.node.property.name);
|
||||
}
|
||||
const tag = namePath.node.name;
|
||||
return !((_b = (_a = state.opts).isCustomElement) == null ? void 0 : _b.call(_a, tag)) && shouldTransformedToSlots(tag) && !htmlTags.includes(tag) && !svgTags.includes(tag);
|
||||
};
|
||||
var transformJSXMemberExpression = (path) => {
|
||||
const objectPath = path.node.object;
|
||||
const propertyPath = path.node.property;
|
||||
const transformedObject = t.isJSXMemberExpression(objectPath) ? transformJSXMemberExpression(
|
||||
path.get("object")
|
||||
) : t.isJSXIdentifier(objectPath) ? t.identifier(objectPath.name) : t.nullLiteral();
|
||||
const transformedProperty = t.identifier(propertyPath.name);
|
||||
return t.memberExpression(transformedObject, transformedProperty);
|
||||
};
|
||||
var getTag = (path, state) => {
|
||||
var _a, _b;
|
||||
const namePath = path.get("openingElement").get("name");
|
||||
if (namePath.isJSXIdentifier()) {
|
||||
const { name } = namePath.node;
|
||||
if (!htmlTags.includes(name) && !svgTags.includes(name)) {
|
||||
return name === FRAGMENT ? createIdentifier(state, FRAGMENT) : path.scope.hasBinding(name) ? t.identifier(name) : ((_b = (_a = state.opts).isCustomElement) == null ? void 0 : _b.call(_a, name)) ? t.stringLiteral(name) : t.callExpression(createIdentifier(state, "resolveComponent"), [
|
||||
t.stringLiteral(name)
|
||||
]);
|
||||
}
|
||||
return t.stringLiteral(name);
|
||||
}
|
||||
if (namePath.isJSXMemberExpression()) {
|
||||
return transformJSXMemberExpression(namePath);
|
||||
}
|
||||
throw new Error(`getTag: ${namePath.type} is not supported`);
|
||||
};
|
||||
var getJSXAttributeName = (path) => {
|
||||
const nameNode = path.node.name;
|
||||
if (t.isJSXIdentifier(nameNode)) {
|
||||
return nameNode.name;
|
||||
}
|
||||
return `${nameNode.namespace.name}:${nameNode.name.name}`;
|
||||
};
|
||||
var transformJSXText = (path) => {
|
||||
const str = transformText(path.node.value);
|
||||
return str !== "" ? t.stringLiteral(str) : null;
|
||||
};
|
||||
var transformText = (text) => {
|
||||
const lines = text.split(/\r\n|\n|\r/);
|
||||
let lastNonEmptyLine = 0;
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
if (lines[i].match(/[^ \t]/)) {
|
||||
lastNonEmptyLine = i;
|
||||
}
|
||||
}
|
||||
let str = "";
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
const line = lines[i];
|
||||
const isFirstLine = i === 0;
|
||||
const isLastLine = i === lines.length - 1;
|
||||
const isLastNonEmptyLine = i === lastNonEmptyLine;
|
||||
let trimmedLine = line.replace(/\t/g, " ");
|
||||
if (!isFirstLine) {
|
||||
trimmedLine = trimmedLine.replace(/^[ ]+/, "");
|
||||
}
|
||||
if (!isLastLine) {
|
||||
trimmedLine = trimmedLine.replace(/[ ]+$/, "");
|
||||
}
|
||||
if (trimmedLine) {
|
||||
if (!isLastNonEmptyLine) {
|
||||
trimmedLine += " ";
|
||||
}
|
||||
str += trimmedLine;
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
var transformJSXExpressionContainer = (path) => path.get("expression").node;
|
||||
var transformJSXSpreadChild = (path) => t.spreadElement(path.get("expression").node);
|
||||
var walksScope = (path, name, slotFlag) => {
|
||||
if (path.scope.hasBinding(name) && path.parentPath) {
|
||||
if (t.isJSXElement(path.parentPath.node)) {
|
||||
path.parentPath.setData("slotFlag", slotFlag);
|
||||
}
|
||||
walksScope(path.parentPath, name, slotFlag);
|
||||
}
|
||||
};
|
||||
var buildIIFE = (path, children) => {
|
||||
const { parentPath } = path;
|
||||
if (parentPath.isAssignmentExpression()) {
|
||||
const { left } = parentPath.node;
|
||||
if (t.isIdentifier(left)) {
|
||||
return children.map((child) => {
|
||||
if (t.isIdentifier(child) && child.name === left.name) {
|
||||
const insertName = path.scope.generateUidIdentifier(child.name);
|
||||
parentPath.insertBefore(
|
||||
t.variableDeclaration("const", [
|
||||
t.variableDeclarator(
|
||||
insertName,
|
||||
t.callExpression(
|
||||
t.functionExpression(
|
||||
null,
|
||||
[],
|
||||
t.blockStatement([t.returnStatement(child)])
|
||||
),
|
||||
[]
|
||||
)
|
||||
)
|
||||
])
|
||||
);
|
||||
return insertName;
|
||||
}
|
||||
return child;
|
||||
});
|
||||
}
|
||||
}
|
||||
return children;
|
||||
};
|
||||
var onRE = /^on[^a-z]/;
|
||||
var isOn = (key) => onRE.test(key);
|
||||
var mergeAsArray = (existing, incoming) => {
|
||||
if (t.isArrayExpression(existing.value)) {
|
||||
existing.value.elements.push(incoming.value);
|
||||
} else {
|
||||
existing.value = t.arrayExpression([
|
||||
existing.value,
|
||||
incoming.value
|
||||
]);
|
||||
}
|
||||
};
|
||||
var dedupeProperties = (properties = [], mergeProps) => {
|
||||
if (!mergeProps) {
|
||||
return properties;
|
||||
}
|
||||
const knownProps = /* @__PURE__ */ new Map();
|
||||
const deduped = [];
|
||||
properties.forEach((prop) => {
|
||||
if (t.isStringLiteral(prop.key)) {
|
||||
const { value: name } = prop.key;
|
||||
const existing = knownProps.get(name);
|
||||
if (existing) {
|
||||
if (name === "style" || name === "class" || name.startsWith("on")) {
|
||||
mergeAsArray(existing, prop);
|
||||
}
|
||||
} else {
|
||||
knownProps.set(name, prop);
|
||||
deduped.push(prop);
|
||||
}
|
||||
} else {
|
||||
deduped.push(prop);
|
||||
}
|
||||
});
|
||||
return deduped;
|
||||
};
|
||||
var isConstant = (node) => {
|
||||
if (t.isIdentifier(node)) {
|
||||
return node.name === "undefined";
|
||||
}
|
||||
if (t.isArrayExpression(node)) {
|
||||
const { elements } = node;
|
||||
return elements.every((element) => element && isConstant(element));
|
||||
}
|
||||
if (t.isObjectExpression(node)) {
|
||||
return node.properties.every(
|
||||
(property) => isConstant(property.value)
|
||||
);
|
||||
}
|
||||
if (t.isLiteral(node)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
var transformJSXSpreadAttribute = (nodePath, path, mergeProps, args) => {
|
||||
const argument = path.get("argument");
|
||||
const properties = t.isObjectExpression(argument.node) ? argument.node.properties : void 0;
|
||||
if (!properties) {
|
||||
if (argument.isIdentifier()) {
|
||||
walksScope(
|
||||
nodePath,
|
||||
argument.node.name,
|
||||
slotFlags_default.DYNAMIC
|
||||
);
|
||||
}
|
||||
args.push(mergeProps ? argument.node : t.spreadElement(argument.node));
|
||||
} else if (mergeProps) {
|
||||
args.push(t.objectExpression(properties));
|
||||
} else {
|
||||
args.push(...properties);
|
||||
}
|
||||
};
|
||||
|
||||
// src/parseDirectives.ts
|
||||
import * as t2 from "@babel/types";
|
||||
var getType = (path) => {
|
||||
const typePath = path.get("attributes").find((attribute) => {
|
||||
if (!attribute.isJSXAttribute()) {
|
||||
return false;
|
||||
}
|
||||
return attribute.get("name").isJSXIdentifier() && attribute.get("name").node.name === "type";
|
||||
});
|
||||
return typePath ? typePath.get("value").node : null;
|
||||
};
|
||||
var parseModifiers = (value) => t2.isArrayExpression(value) ? value.elements.map((el) => t2.isStringLiteral(el) ? el.value : "").filter(Boolean) : [];
|
||||
var parseDirectives = (params) => {
|
||||
var _a, _b;
|
||||
const { path, value, state, tag, isComponent } = params;
|
||||
const args = [];
|
||||
const vals = [];
|
||||
const modifiersSet = [];
|
||||
let directiveName;
|
||||
let directiveArgument;
|
||||
let directiveModifiers;
|
||||
if ("namespace" in path.node.name) {
|
||||
[directiveName, directiveArgument] = params.name.split(":");
|
||||
directiveName = path.node.name.namespace.name;
|
||||
directiveArgument = path.node.name.name.name;
|
||||
directiveModifiers = directiveArgument.split("_").slice(1);
|
||||
} else {
|
||||
const underscoreModifiers = params.name.split("_");
|
||||
directiveName = underscoreModifiers.shift() || "";
|
||||
directiveModifiers = underscoreModifiers;
|
||||
}
|
||||
directiveName = directiveName.replace(/^v/, "").replace(/^-/, "").replace(/^\S/, (s) => s.toLowerCase());
|
||||
if (directiveArgument) {
|
||||
args.push(t2.stringLiteral(directiveArgument));
|
||||
}
|
||||
const isVModels = directiveName === "models";
|
||||
const isVModel = directiveName === "model";
|
||||
if (isVModel && !path.get("value").isJSXExpressionContainer()) {
|
||||
throw new Error("You have to use JSX Expression inside your v-model");
|
||||
}
|
||||
if (isVModels && !isComponent) {
|
||||
throw new Error("v-models can only use in custom components");
|
||||
}
|
||||
const shouldResolve = !["html", "text", "model", "models"].includes(directiveName) || isVModel && !isComponent;
|
||||
let modifiers = directiveModifiers;
|
||||
if (t2.isArrayExpression(value)) {
|
||||
const elementsList = isVModels ? value.elements : [value];
|
||||
elementsList.forEach((element) => {
|
||||
if (isVModels && !t2.isArrayExpression(element)) {
|
||||
throw new Error("You should pass a Two-dimensional Arrays to v-models");
|
||||
}
|
||||
const { elements } = element;
|
||||
const [first, second, third] = elements;
|
||||
if (second && !t2.isArrayExpression(second) && !t2.isSpreadElement(second)) {
|
||||
args.push(second);
|
||||
modifiers = parseModifiers(third);
|
||||
} else if (t2.isArrayExpression(second)) {
|
||||
if (!shouldResolve) {
|
||||
args.push(t2.nullLiteral());
|
||||
}
|
||||
modifiers = parseModifiers(second);
|
||||
} else if (!shouldResolve) {
|
||||
args.push(t2.nullLiteral());
|
||||
}
|
||||
modifiersSet.push(new Set(modifiers));
|
||||
vals.push(first);
|
||||
});
|
||||
} else if (isVModel && !shouldResolve) {
|
||||
args.push(t2.nullLiteral());
|
||||
modifiersSet.push(new Set(directiveModifiers));
|
||||
} else {
|
||||
modifiersSet.push(new Set(directiveModifiers));
|
||||
}
|
||||
return {
|
||||
directiveName,
|
||||
modifiers: modifiersSet,
|
||||
values: vals.length ? vals : [value],
|
||||
args,
|
||||
directive: shouldResolve ? [
|
||||
resolveDirective(path, state, tag, directiveName),
|
||||
vals[0] || value,
|
||||
((_a = modifiersSet[0]) == null ? void 0 : _a.size) ? args[0] || t2.unaryExpression("void", t2.numericLiteral(0), true) : args[0],
|
||||
!!((_b = modifiersSet[0]) == null ? void 0 : _b.size) && t2.objectExpression(
|
||||
[...modifiersSet[0]].map(
|
||||
(modifier) => t2.objectProperty(t2.identifier(modifier), t2.booleanLiteral(true))
|
||||
)
|
||||
)
|
||||
].filter(Boolean) : void 0
|
||||
};
|
||||
};
|
||||
var resolveDirective = (path, state, tag, directiveName) => {
|
||||
if (directiveName === "show") {
|
||||
return createIdentifier(state, "vShow");
|
||||
}
|
||||
if (directiveName === "model") {
|
||||
let modelToUse;
|
||||
const type = getType(path.parentPath);
|
||||
switch (tag.value) {
|
||||
case "select":
|
||||
modelToUse = createIdentifier(state, "vModelSelect");
|
||||
break;
|
||||
case "textarea":
|
||||
modelToUse = createIdentifier(state, "vModelText");
|
||||
break;
|
||||
default:
|
||||
if (t2.isStringLiteral(type) || !type) {
|
||||
switch (type == null ? void 0 : type.value) {
|
||||
case "checkbox":
|
||||
modelToUse = createIdentifier(state, "vModelCheckbox");
|
||||
break;
|
||||
case "radio":
|
||||
modelToUse = createIdentifier(state, "vModelRadio");
|
||||
break;
|
||||
default:
|
||||
modelToUse = createIdentifier(state, "vModelText");
|
||||
}
|
||||
} else {
|
||||
modelToUse = createIdentifier(state, "vModelDynamic");
|
||||
}
|
||||
}
|
||||
return modelToUse;
|
||||
}
|
||||
return t2.callExpression(createIdentifier(state, "resolveDirective"), [
|
||||
t2.stringLiteral(directiveName)
|
||||
]);
|
||||
};
|
||||
var parseDirectives_default = parseDirectives;
|
||||
|
||||
// src/transform-vue-jsx.ts
|
||||
var xlinkRE = /^xlink([A-Z])/;
|
||||
var getJSXAttributeValue = (path, state) => {
|
||||
const valuePath = path.get("value");
|
||||
if (valuePath.isJSXElement()) {
|
||||
return transformJSXElement(valuePath, state);
|
||||
}
|
||||
if (valuePath.isStringLiteral()) {
|
||||
return t3.stringLiteral(transformText(valuePath.node.value));
|
||||
}
|
||||
if (valuePath.isJSXExpressionContainer()) {
|
||||
return transformJSXExpressionContainer(valuePath);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
var buildProps = (path, state) => {
|
||||
const tag = getTag(path, state);
|
||||
const isComponent = checkIsComponent(path.get("openingElement"), state);
|
||||
const props = path.get("openingElement").get("attributes");
|
||||
const directives = [];
|
||||
const dynamicPropNames = /* @__PURE__ */ new Set();
|
||||
let slots = null;
|
||||
let patchFlag = 0;
|
||||
if (props.length === 0) {
|
||||
return {
|
||||
tag,
|
||||
isComponent,
|
||||
slots,
|
||||
props: t3.nullLiteral(),
|
||||
directives,
|
||||
patchFlag,
|
||||
dynamicPropNames
|
||||
};
|
||||
}
|
||||
let properties = [];
|
||||
let hasRef = false;
|
||||
let hasClassBinding = false;
|
||||
let hasStyleBinding = false;
|
||||
let hasHydrationEventBinding = false;
|
||||
let hasDynamicKeys = false;
|
||||
const mergeArgs = [];
|
||||
const { mergeProps = true } = state.opts;
|
||||
props.forEach((prop) => {
|
||||
if (prop.isJSXAttribute()) {
|
||||
let name = getJSXAttributeName(prop);
|
||||
const attributeValue = getJSXAttributeValue(prop, state);
|
||||
if (!isConstant(attributeValue) || name === "ref") {
|
||||
if (!isComponent && isOn(name) && // omit the flag for click handlers becaues hydration gives click
|
||||
// dedicated fast path.
|
||||
name.toLowerCase() !== "onclick" && // omit v-model handlers
|
||||
name !== "onUpdate:modelValue") {
|
||||
hasHydrationEventBinding = true;
|
||||
}
|
||||
if (name === "ref") {
|
||||
hasRef = true;
|
||||
} else if (name === "class" && !isComponent) {
|
||||
hasClassBinding = true;
|
||||
} else if (name === "style" && !isComponent) {
|
||||
hasStyleBinding = true;
|
||||
} else if (name !== "key" && !isDirective(name) && name !== "on") {
|
||||
dynamicPropNames.add(name);
|
||||
}
|
||||
}
|
||||
if (state.opts.transformOn && (name === "on" || name === "nativeOn")) {
|
||||
if (!state.get("transformOn")) {
|
||||
state.set(
|
||||
"transformOn",
|
||||
addDefault(path, "@vue/babel-helper-vue-transform-on", {
|
||||
nameHint: "_transformOn"
|
||||
})
|
||||
);
|
||||
}
|
||||
mergeArgs.push(
|
||||
t3.callExpression(state.get("transformOn"), [
|
||||
attributeValue || t3.booleanLiteral(true)
|
||||
])
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (isDirective(name)) {
|
||||
const { directive, modifiers, values, args, directiveName } = parseDirectives_default({
|
||||
tag,
|
||||
isComponent,
|
||||
name,
|
||||
path: prop,
|
||||
state,
|
||||
value: attributeValue
|
||||
});
|
||||
if (directiveName === "slots") {
|
||||
slots = attributeValue;
|
||||
return;
|
||||
}
|
||||
if (directive) {
|
||||
directives.push(t3.arrayExpression(directive));
|
||||
} else if (directiveName === "html") {
|
||||
properties.push(
|
||||
t3.objectProperty(t3.stringLiteral("innerHTML"), values[0])
|
||||
);
|
||||
dynamicPropNames.add("innerHTML");
|
||||
} else if (directiveName === "text") {
|
||||
properties.push(
|
||||
t3.objectProperty(t3.stringLiteral("textContent"), values[0])
|
||||
);
|
||||
dynamicPropNames.add("textContent");
|
||||
}
|
||||
if (["models", "model"].includes(directiveName)) {
|
||||
values.forEach((value, index) => {
|
||||
var _a;
|
||||
const propName = args[index];
|
||||
const isDynamic = propName && !t3.isStringLiteral(propName) && !t3.isNullLiteral(propName);
|
||||
if (!directive) {
|
||||
properties.push(
|
||||
t3.objectProperty(
|
||||
t3.isNullLiteral(propName) ? t3.stringLiteral("modelValue") : propName,
|
||||
value,
|
||||
isDynamic
|
||||
)
|
||||
);
|
||||
if (!isDynamic) {
|
||||
dynamicPropNames.add(
|
||||
(propName == null ? void 0 : propName.value) || "modelValue"
|
||||
);
|
||||
}
|
||||
if ((_a = modifiers[index]) == null ? void 0 : _a.size) {
|
||||
properties.push(
|
||||
t3.objectProperty(
|
||||
isDynamic ? t3.binaryExpression(
|
||||
"+",
|
||||
propName,
|
||||
t3.stringLiteral("Modifiers")
|
||||
) : t3.stringLiteral(
|
||||
`${(propName == null ? void 0 : propName.value) || "model"}Modifiers`
|
||||
),
|
||||
t3.objectExpression(
|
||||
[...modifiers[index]].map(
|
||||
(modifier) => t3.objectProperty(
|
||||
t3.stringLiteral(modifier),
|
||||
t3.booleanLiteral(true)
|
||||
)
|
||||
)
|
||||
),
|
||||
isDynamic
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
const updateName = isDynamic ? t3.binaryExpression("+", t3.stringLiteral("onUpdate"), propName) : t3.stringLiteral(
|
||||
`onUpdate:${(propName == null ? void 0 : propName.value) || "modelValue"}`
|
||||
);
|
||||
properties.push(
|
||||
t3.objectProperty(
|
||||
updateName,
|
||||
t3.arrowFunctionExpression(
|
||||
[t3.identifier("$event")],
|
||||
t3.assignmentExpression(
|
||||
"=",
|
||||
value,
|
||||
t3.identifier("$event")
|
||||
)
|
||||
),
|
||||
isDynamic
|
||||
)
|
||||
);
|
||||
if (!isDynamic) {
|
||||
dynamicPropNames.add(updateName.value);
|
||||
} else {
|
||||
hasDynamicKeys = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (name.match(xlinkRE)) {
|
||||
name = name.replace(
|
||||
xlinkRE,
|
||||
(_, firstCharacter) => `xlink:${firstCharacter.toLowerCase()}`
|
||||
);
|
||||
}
|
||||
properties.push(
|
||||
t3.objectProperty(
|
||||
t3.stringLiteral(name),
|
||||
attributeValue || t3.booleanLiteral(true)
|
||||
)
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (properties.length && mergeProps) {
|
||||
mergeArgs.push(
|
||||
t3.objectExpression(dedupeProperties(properties, mergeProps))
|
||||
);
|
||||
properties = [];
|
||||
}
|
||||
hasDynamicKeys = true;
|
||||
transformJSXSpreadAttribute(
|
||||
path,
|
||||
prop,
|
||||
mergeProps,
|
||||
mergeProps ? mergeArgs : properties
|
||||
);
|
||||
}
|
||||
});
|
||||
if (hasDynamicKeys) {
|
||||
patchFlag |= 16 /* FULL_PROPS */;
|
||||
} else {
|
||||
if (hasClassBinding) {
|
||||
patchFlag |= 2 /* CLASS */;
|
||||
}
|
||||
if (hasStyleBinding) {
|
||||
patchFlag |= 4 /* STYLE */;
|
||||
}
|
||||
if (dynamicPropNames.size) {
|
||||
patchFlag |= 8 /* PROPS */;
|
||||
}
|
||||
if (hasHydrationEventBinding) {
|
||||
patchFlag |= 32 /* HYDRATE_EVENTS */;
|
||||
}
|
||||
}
|
||||
if ((patchFlag === 0 || patchFlag === 32 /* HYDRATE_EVENTS */) && (hasRef || directives.length > 0)) {
|
||||
patchFlag |= 512 /* NEED_PATCH */;
|
||||
}
|
||||
let propsExpression = t3.nullLiteral();
|
||||
if (mergeArgs.length) {
|
||||
if (properties.length) {
|
||||
mergeArgs.push(
|
||||
t3.objectExpression(dedupeProperties(properties, mergeProps))
|
||||
);
|
||||
}
|
||||
if (mergeArgs.length > 1) {
|
||||
propsExpression = t3.callExpression(
|
||||
createIdentifier(state, "mergeProps"),
|
||||
mergeArgs
|
||||
);
|
||||
} else {
|
||||
propsExpression = mergeArgs[0];
|
||||
}
|
||||
} else if (properties.length) {
|
||||
if (properties.length === 1 && t3.isSpreadElement(properties[0])) {
|
||||
propsExpression = properties[0].argument;
|
||||
} else {
|
||||
propsExpression = t3.objectExpression(
|
||||
dedupeProperties(properties, mergeProps)
|
||||
);
|
||||
}
|
||||
}
|
||||
return {
|
||||
tag,
|
||||
props: propsExpression,
|
||||
isComponent,
|
||||
slots,
|
||||
directives,
|
||||
patchFlag,
|
||||
dynamicPropNames
|
||||
};
|
||||
};
|
||||
var getChildren = (paths, state) => paths.map((path) => {
|
||||
if (path.isJSXText()) {
|
||||
const transformedText = transformJSXText(path);
|
||||
if (transformedText) {
|
||||
return t3.callExpression(createIdentifier(state, "createTextVNode"), [
|
||||
transformedText
|
||||
]);
|
||||
}
|
||||
return transformedText;
|
||||
}
|
||||
if (path.isJSXExpressionContainer()) {
|
||||
const expression = transformJSXExpressionContainer(path);
|
||||
if (t3.isIdentifier(expression)) {
|
||||
const { name } = expression;
|
||||
const { referencePaths = [] } = path.scope.getBinding(name) || {};
|
||||
referencePaths.forEach((referencePath) => {
|
||||
walksScope(referencePath, name, slotFlags_default.DYNAMIC);
|
||||
});
|
||||
}
|
||||
return expression;
|
||||
}
|
||||
if (path.isJSXSpreadChild()) {
|
||||
return transformJSXSpreadChild(path);
|
||||
}
|
||||
if (path.isCallExpression()) {
|
||||
return path.node;
|
||||
}
|
||||
if (path.isJSXElement()) {
|
||||
return transformJSXElement(path, state);
|
||||
}
|
||||
throw new Error(`getChildren: ${path.type} is not supported`);
|
||||
}).filter(
|
||||
(value) => value != null && !t3.isJSXEmptyExpression(value)
|
||||
);
|
||||
var transformJSXElement = (path, state) => {
|
||||
const children = getChildren(path.get("children"), state);
|
||||
const {
|
||||
tag,
|
||||
props,
|
||||
isComponent,
|
||||
directives,
|
||||
patchFlag,
|
||||
dynamicPropNames,
|
||||
slots
|
||||
} = buildProps(path, state);
|
||||
const { optimize = false } = state.opts;
|
||||
const slotFlag = path.getData("slotFlag") || slotFlags_default.STABLE;
|
||||
let VNodeChild;
|
||||
if (children.length > 1 || slots) {
|
||||
VNodeChild = isComponent ? children.length ? t3.objectExpression(
|
||||
[
|
||||
!!children.length && t3.objectProperty(
|
||||
t3.identifier("default"),
|
||||
t3.arrowFunctionExpression(
|
||||
[],
|
||||
t3.arrayExpression(buildIIFE(path, children))
|
||||
)
|
||||
),
|
||||
...slots ? t3.isObjectExpression(slots) ? slots.properties : [t3.spreadElement(slots)] : [],
|
||||
optimize && t3.objectProperty(t3.identifier("_"), t3.numericLiteral(slotFlag))
|
||||
].filter(Boolean)
|
||||
) : slots : t3.arrayExpression(children);
|
||||
} else if (children.length === 1) {
|
||||
const { enableObjectSlots = true } = state.opts;
|
||||
const child = children[0];
|
||||
const objectExpression4 = t3.objectExpression(
|
||||
[
|
||||
t3.objectProperty(
|
||||
t3.identifier("default"),
|
||||
t3.arrowFunctionExpression(
|
||||
[],
|
||||
t3.arrayExpression(buildIIFE(path, [child]))
|
||||
)
|
||||
),
|
||||
optimize && t3.objectProperty(
|
||||
t3.identifier("_"),
|
||||
t3.numericLiteral(slotFlag)
|
||||
)
|
||||
].filter(Boolean)
|
||||
);
|
||||
if (t3.isIdentifier(child) && isComponent) {
|
||||
VNodeChild = enableObjectSlots ? t3.conditionalExpression(
|
||||
t3.callExpression(
|
||||
state.get("@vue/babel-plugin-jsx/runtimeIsSlot")(),
|
||||
[child]
|
||||
),
|
||||
child,
|
||||
objectExpression4
|
||||
) : objectExpression4;
|
||||
} else if (t3.isCallExpression(child) && child.loc && isComponent) {
|
||||
if (enableObjectSlots) {
|
||||
const { scope } = path;
|
||||
const slotId = scope.generateUidIdentifier("slot");
|
||||
if (scope) {
|
||||
scope.push({
|
||||
id: slotId,
|
||||
kind: "let"
|
||||
});
|
||||
}
|
||||
const alternate = t3.objectExpression(
|
||||
[
|
||||
t3.objectProperty(
|
||||
t3.identifier("default"),
|
||||
t3.arrowFunctionExpression(
|
||||
[],
|
||||
t3.arrayExpression(buildIIFE(path, [slotId]))
|
||||
)
|
||||
),
|
||||
optimize && t3.objectProperty(
|
||||
t3.identifier("_"),
|
||||
t3.numericLiteral(slotFlag)
|
||||
)
|
||||
].filter(Boolean)
|
||||
);
|
||||
const assignment = t3.assignmentExpression("=", slotId, child);
|
||||
const condition = t3.callExpression(
|
||||
state.get("@vue/babel-plugin-jsx/runtimeIsSlot")(),
|
||||
[assignment]
|
||||
);
|
||||
VNodeChild = t3.conditionalExpression(condition, slotId, alternate);
|
||||
} else {
|
||||
VNodeChild = objectExpression4;
|
||||
}
|
||||
} else if (t3.isFunctionExpression(child) || t3.isArrowFunctionExpression(child)) {
|
||||
VNodeChild = t3.objectExpression([
|
||||
t3.objectProperty(t3.identifier("default"), child)
|
||||
]);
|
||||
} else if (t3.isObjectExpression(child)) {
|
||||
VNodeChild = t3.objectExpression(
|
||||
[
|
||||
...child.properties,
|
||||
optimize && t3.objectProperty(t3.identifier("_"), t3.numericLiteral(slotFlag))
|
||||
].filter(Boolean)
|
||||
);
|
||||
} else {
|
||||
VNodeChild = isComponent ? t3.objectExpression([
|
||||
t3.objectProperty(
|
||||
t3.identifier("default"),
|
||||
t3.arrowFunctionExpression([], t3.arrayExpression([child]))
|
||||
)
|
||||
]) : t3.arrayExpression([child]);
|
||||
}
|
||||
}
|
||||
const createVNode = t3.callExpression(
|
||||
createIdentifier(state, "createVNode"),
|
||||
[
|
||||
tag,
|
||||
props,
|
||||
VNodeChild || t3.nullLiteral(),
|
||||
!!patchFlag && optimize && t3.numericLiteral(patchFlag),
|
||||
!!dynamicPropNames.size && optimize && t3.arrayExpression(
|
||||
[...dynamicPropNames.keys()].map((name) => t3.stringLiteral(name))
|
||||
)
|
||||
].filter(Boolean)
|
||||
);
|
||||
if (!directives.length) {
|
||||
return createVNode;
|
||||
}
|
||||
return t3.callExpression(createIdentifier(state, "withDirectives"), [
|
||||
createVNode,
|
||||
t3.arrayExpression(directives)
|
||||
]);
|
||||
};
|
||||
var transform_vue_jsx_default = {
|
||||
JSXElement: {
|
||||
exit(path, state) {
|
||||
path.replaceWith(transformJSXElement(path, state));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// src/sugar-fragment.ts
|
||||
import * as t4 from "@babel/types";
|
||||
var transformFragment = (path, Fragment) => {
|
||||
const children = path.get("children") || [];
|
||||
return t4.jsxElement(
|
||||
t4.jsxOpeningElement(Fragment, []),
|
||||
t4.jsxClosingElement(Fragment),
|
||||
children.map(({ node }) => node),
|
||||
false
|
||||
);
|
||||
};
|
||||
var sugar_fragment_default = {
|
||||
JSXFragment: {
|
||||
enter(path, state) {
|
||||
const fragmentCallee = createIdentifier(state, FRAGMENT);
|
||||
path.replaceWith(
|
||||
transformFragment(
|
||||
path,
|
||||
t4.isIdentifier(fragmentCallee) ? t4.jsxIdentifier(fragmentCallee.name) : t4.jsxMemberExpression(
|
||||
t4.jsxIdentifier(fragmentCallee.object.name),
|
||||
t4.jsxIdentifier(fragmentCallee.property.name)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// src/index.ts
|
||||
var hasJSX = (parentPath) => {
|
||||
let fileHasJSX = false;
|
||||
parentPath.traverse({
|
||||
JSXElement(path) {
|
||||
fileHasJSX = true;
|
||||
path.stop();
|
||||
},
|
||||
JSXFragment(path) {
|
||||
fileHasJSX = true;
|
||||
path.stop();
|
||||
}
|
||||
});
|
||||
return fileHasJSX;
|
||||
};
|
||||
var JSX_ANNOTATION_REGEX = /\*?\s*@jsx\s+([^\s]+)/;
|
||||
var src_default = ({ types }) => ({
|
||||
name: "babel-plugin-jsx",
|
||||
inherits: syntaxJsx,
|
||||
visitor: __spreadProps(__spreadValues(__spreadValues({}, transform_vue_jsx_default), sugar_fragment_default), {
|
||||
Program: {
|
||||
enter(path, state) {
|
||||
if (hasJSX(path)) {
|
||||
const importNames = [
|
||||
"createVNode",
|
||||
"Fragment",
|
||||
"resolveComponent",
|
||||
"withDirectives",
|
||||
"vShow",
|
||||
"vModelSelect",
|
||||
"vModelText",
|
||||
"vModelCheckbox",
|
||||
"vModelRadio",
|
||||
"vModelText",
|
||||
"vModelDynamic",
|
||||
"resolveDirective",
|
||||
"mergeProps",
|
||||
"createTextVNode",
|
||||
"isVNode"
|
||||
];
|
||||
if (isModule(path)) {
|
||||
const importMap = {};
|
||||
importNames.forEach((name) => {
|
||||
state.set(name, () => {
|
||||
if (importMap[name]) {
|
||||
return types.cloneNode(importMap[name]);
|
||||
}
|
||||
const identifier5 = addNamed(path, name, "vue", {
|
||||
ensureLiveReference: true
|
||||
});
|
||||
importMap[name] = identifier5;
|
||||
return identifier5;
|
||||
});
|
||||
});
|
||||
const { enableObjectSlots = true } = state.opts;
|
||||
if (enableObjectSlots) {
|
||||
state.set("@vue/babel-plugin-jsx/runtimeIsSlot", () => {
|
||||
if (importMap.runtimeIsSlot) {
|
||||
return importMap.runtimeIsSlot;
|
||||
}
|
||||
const { name: isVNodeName } = state.get(
|
||||
"isVNode"
|
||||
)();
|
||||
const isSlot = path.scope.generateUidIdentifier("isSlot");
|
||||
const ast = template.ast`
|
||||
function ${isSlot.name}(s) {
|
||||
return typeof s === 'function' || (Object.prototype.toString.call(s) === '[object Object]' && !${isVNodeName}(s));
|
||||
}
|
||||
`;
|
||||
const lastImport = path.get("body").filter((p) => p.isImportDeclaration()).pop();
|
||||
if (lastImport) {
|
||||
lastImport.insertAfter(ast);
|
||||
}
|
||||
importMap.runtimeIsSlot = isSlot;
|
||||
return isSlot;
|
||||
});
|
||||
}
|
||||
} else {
|
||||
let sourceName;
|
||||
importNames.forEach((name) => {
|
||||
state.set(name, () => {
|
||||
if (!sourceName) {
|
||||
sourceName = addNamespace(path, "vue", {
|
||||
ensureLiveReference: true
|
||||
});
|
||||
}
|
||||
return t5.memberExpression(sourceName, t5.identifier(name));
|
||||
});
|
||||
});
|
||||
const helpers = {};
|
||||
const { enableObjectSlots = true } = state.opts;
|
||||
if (enableObjectSlots) {
|
||||
state.set("@vue/babel-plugin-jsx/runtimeIsSlot", () => {
|
||||
if (helpers.runtimeIsSlot) {
|
||||
return helpers.runtimeIsSlot;
|
||||
}
|
||||
const isSlot = path.scope.generateUidIdentifier("isSlot");
|
||||
const { object: objectName } = state.get(
|
||||
"isVNode"
|
||||
)();
|
||||
const ast = template.ast`
|
||||
function ${isSlot.name}(s) {
|
||||
return typeof s === 'function' || (Object.prototype.toString.call(s) === '[object Object]' && !${objectName.name}.isVNode(s));
|
||||
}
|
||||
`;
|
||||
const nodePaths = path.get("body");
|
||||
const lastImport = nodePaths.filter(
|
||||
(p) => p.isVariableDeclaration() && p.node.declarations.some(
|
||||
(d) => {
|
||||
var _a;
|
||||
return ((_a = d.id) == null ? void 0 : _a.name) === sourceName.name;
|
||||
}
|
||||
)
|
||||
).pop();
|
||||
if (lastImport) {
|
||||
lastImport.insertAfter(ast);
|
||||
}
|
||||
return isSlot;
|
||||
});
|
||||
}
|
||||
}
|
||||
const {
|
||||
opts: { pragma = "" },
|
||||
file
|
||||
} = state;
|
||||
if (pragma) {
|
||||
state.set("createVNode", () => t5.identifier(pragma));
|
||||
}
|
||||
if (file.ast.comments) {
|
||||
for (const comment of file.ast.comments) {
|
||||
const jsxMatches = JSX_ANNOTATION_REGEX.exec(comment.value);
|
||||
if (jsxMatches) {
|
||||
state.set("createVNode", () => t5.identifier(jsxMatches[1]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
exit(path) {
|
||||
const body = path.get("body");
|
||||
const specifiersMap = /* @__PURE__ */ new Map();
|
||||
body.filter(
|
||||
(nodePath) => t5.isImportDeclaration(nodePath.node) && nodePath.node.source.value === "vue"
|
||||
).forEach((nodePath) => {
|
||||
const { specifiers: specifiers2 } = nodePath.node;
|
||||
let shouldRemove = false;
|
||||
specifiers2.forEach((specifier) => {
|
||||
if (!specifier.loc && t5.isImportSpecifier(specifier) && t5.isIdentifier(specifier.imported)) {
|
||||
specifiersMap.set(specifier.imported.name, specifier);
|
||||
shouldRemove = true;
|
||||
}
|
||||
});
|
||||
if (shouldRemove) {
|
||||
nodePath.remove();
|
||||
}
|
||||
});
|
||||
const specifiers = [...specifiersMap.keys()].map(
|
||||
(imported) => specifiersMap.get(imported)
|
||||
);
|
||||
if (specifiers.length) {
|
||||
path.unshiftContainer(
|
||||
"body",
|
||||
t5.importDeclaration(specifiers, t5.stringLiteral("vue"))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
export {
|
||||
src_default as default
|
||||
};
|
79
node_modules/@vue/babel-plugin-jsx/package.json
generated
vendored
Normal file
79
node_modules/@vue/babel-plugin-jsx/package.json
generated
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
{
|
||||
"_from": "@vue/babel-plugin-jsx@^1.0.3",
|
||||
"_id": "@vue/babel-plugin-jsx@1.1.5",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-nKs1/Bg9U1n3qSWnsHhCVQtAzI6aQXqua8j/bZrau8ywT1ilXQbK4FwEJGmU8fV7tcpuFvWmmN7TMmV1OBma1g==",
|
||||
"_location": "/@vue/babel-plugin-jsx",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@vue/babel-plugin-jsx@^1.0.3",
|
||||
"name": "@vue/babel-plugin-jsx",
|
||||
"escapedName": "@vue%2fbabel-plugin-jsx",
|
||||
"scope": "@vue",
|
||||
"rawSpec": "^1.0.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@vue/babel-preset-app"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@vue/babel-plugin-jsx/-/babel-plugin-jsx-1.1.5.tgz",
|
||||
"_shasum": "5088bae7dbb83531d94df3742ff650c12fd54973",
|
||||
"_spec": "@vue/babel-plugin-jsx@^1.0.3",
|
||||
"_where": "C:\\Users\\zhouxueli\\Desktop\\scheduling-app\\node_modules\\@vue\\babel-preset-app",
|
||||
"author": {
|
||||
"name": "Amour1688",
|
||||
"email": "lcz_1996@foxmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/babel-plugin-jsx/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@babel/helper-module-imports": "^7.22.5",
|
||||
"@babel/plugin-syntax-jsx": "^7.22.5",
|
||||
"@babel/template": "^7.22.5",
|
||||
"@babel/traverse": "^7.22.5",
|
||||
"@babel/types": "^7.22.5",
|
||||
"@vue/babel-helper-vue-transform-on": "^1.1.5",
|
||||
"camelcase": "^6.3.0",
|
||||
"html-tags": "^3.3.1",
|
||||
"svg-tags": "^1.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Babel plugin for Vue 3 JSX",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.22.5",
|
||||
"@babel/preset-env": "^7.22.5",
|
||||
"@types/babel__template": "^7.4.1",
|
||||
"@types/babel__traverse": "^7.20.1",
|
||||
"@types/svg-tags": "^1.0.0",
|
||||
"@vue/runtime-dom": "^3.3.4",
|
||||
"@vue/test-utils": "^2.4.0",
|
||||
"regenerator-runtime": "^0.13.11",
|
||||
"vue": "^3.3.4"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"homepage": "https://github.com/vuejs/babel-plugin-jsx/tree/dev/packages/babel-plugin-jsx#readme",
|
||||
"license": "MIT",
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"name": "@vue/babel-plugin-jsx",
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/babel-plugin-jsx.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsup",
|
||||
"watch": "tsup --watch"
|
||||
},
|
||||
"types": "dist/index.d.ts",
|
||||
"version": "1.1.5"
|
||||
}
|
184
node_modules/@vue/babel-plugin-transform-vue-jsx/README.md
generated
vendored
Normal file
184
node_modules/@vue/babel-plugin-transform-vue-jsx/README.md
generated
vendored
Normal file
@ -0,0 +1,184 @@
|
||||
## @vue/babel-plugin-transform-vue-jsx
|
||||
|
||||
> Babel plugin for Vue 2.0 JSX
|
||||
|
||||
### Babel Compatibility Notes
|
||||
|
||||
- This repo is only compatible with Babel 7.x, for 6.x please use [vuejs/babel-plugin-transform-vue-jsx](https://github.com/vuejs/babel-plugin-transform-vue-jsx)
|
||||
|
||||
### Requirements
|
||||
|
||||
- Assumes you are using Babel with a module bundler e.g. Webpack, because the spread merge helper is imported as a module to avoid duplication.
|
||||
|
||||
- This is mutually exclusive with `babel-plugin-transform-react-jsx`.
|
||||
|
||||
### Usage
|
||||
|
||||
```bash
|
||||
npm install @vue/babel-plugin-transform-vue-jsx --save-dev
|
||||
npm install @vue/babel-helper-vue-jsx-merge-props --save
|
||||
```
|
||||
|
||||
In your `.babelrc`:
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["transform-vue-jsx"]
|
||||
}
|
||||
```
|
||||
|
||||
However it is recommended to use the [configurable preset](../babel-preset-jsx/README.md) instead.
|
||||
|
||||
### Details
|
||||
|
||||
The plugin transpiles the following JSX:
|
||||
|
||||
```jsx
|
||||
<div id="foo">{this.text}</div>
|
||||
```
|
||||
|
||||
To the following JavaScript:
|
||||
|
||||
```js
|
||||
h(
|
||||
'div',
|
||||
{
|
||||
attrs: {
|
||||
id: 'foo',
|
||||
},
|
||||
},
|
||||
[this.text],
|
||||
)
|
||||
```
|
||||
|
||||
Note the `h` function, which is a shorthand for a Vue instance's `$createElement` method, must be in the scope where the JSX is. Since this method is passed to component render functions as the first argument, in most cases you'd do this:
|
||||
|
||||
```js
|
||||
Vue.component('jsx-example', {
|
||||
render(h) {
|
||||
// <-- h must be in scope
|
||||
return <div id="foo">bar</div>
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
### Difference from React JSX
|
||||
|
||||
First, Vue 2.0's vnode format is different from React's. The second argument to the `createElement` call is a "data object" that accepts nested objects. Each nested object will be then processed by corresponding modules:
|
||||
|
||||
```js
|
||||
render (h) {
|
||||
return h('div', {
|
||||
// Component props
|
||||
props: {
|
||||
msg: 'hi'
|
||||
},
|
||||
// Normal HTML attributes
|
||||
attrs: {
|
||||
id: 'foo'
|
||||
},
|
||||
// DOM props
|
||||
domProps: {
|
||||
innerHTML: 'bar'
|
||||
},
|
||||
// Event handlers are nested under "on", though
|
||||
// modifiers such as in v-on:keyup.enter are not
|
||||
// supported. You'll have to manually check the
|
||||
// keyCode in the handler instead.
|
||||
on: {
|
||||
click: this.clickHandler
|
||||
},
|
||||
// For components only. Allows you to listen to
|
||||
// native events, rather than events emitted from
|
||||
// the component using vm.$emit.
|
||||
nativeOn: {
|
||||
click: this.nativeClickHandler
|
||||
},
|
||||
// Class is a special module, same API as `v-bind:class`
|
||||
class: {
|
||||
foo: true,
|
||||
bar: false
|
||||
},
|
||||
// Style is also same as `v-bind:style`
|
||||
style: {
|
||||
color: 'red',
|
||||
fontSize: '14px'
|
||||
},
|
||||
// Other special top-level properties
|
||||
key: 'key',
|
||||
ref: 'ref',
|
||||
// Assign the `ref` is used on elements/components with v-for
|
||||
refInFor: true,
|
||||
slot: 'slot'
|
||||
})
|
||||
}
|
||||
```
|
||||
|
||||
The equivalent of the above in Vue 2.0 JSX is:
|
||||
|
||||
```jsx
|
||||
render (h) {
|
||||
return (
|
||||
<div
|
||||
// Component props
|
||||
propsMsg="hi"
|
||||
// Normal attributes or component props.
|
||||
id="foo"
|
||||
// DOM properties are prefixed with `domProps`
|
||||
domPropsInnerHTML="bar"
|
||||
// event listeners are prefixed with `on` or `nativeOn`
|
||||
onClick={this.clickHandler}
|
||||
nativeOnClick={this.nativeClickHandler}
|
||||
// other special top-level properties
|
||||
class={{ foo: true, bar: false }}
|
||||
style={{ color: 'red', fontSize: '14px' }}
|
||||
key="key"
|
||||
ref="ref"
|
||||
// assign the `ref` is used on elements/components with v-for
|
||||
refInFor
|
||||
slot="slot">
|
||||
</div>
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
### Component Tip
|
||||
|
||||
If a custom element starts with lowercase, it will be treated as a string id and used to lookup a registered component. If it starts with uppercase, it will be treated as an identifier, which allows you to do:
|
||||
|
||||
```js
|
||||
import Todo from './Todo.js'
|
||||
|
||||
export default {
|
||||
render(h) {
|
||||
return <Todo /> // no need to register Todo via components option
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
### JSX Spread
|
||||
|
||||
JSX spread is supported, and this plugin will intelligently merge nested data properties. For example:
|
||||
|
||||
```jsx
|
||||
const data = {
|
||||
class: ['b', 'c'],
|
||||
}
|
||||
const vnode = <div class="a" {...data} />
|
||||
```
|
||||
|
||||
The merged data will be:
|
||||
|
||||
```js
|
||||
{ class: ['a', 'b', 'c'] }
|
||||
```
|
||||
|
||||
### Vue directives
|
||||
|
||||
Vue directives are usable the same way as in template with a few key differences:
|
||||
|
||||
1. You can use directives camelCased instead of kebab-cased (vMyDirective is treated as `v-my-directive`)
|
||||
2. You have to use underscore sign instead of dots for modifiers because of JSXIdentifier limitation.
|
||||
3. Only runtime directives work (only v-show and custom directives), compile-time directives are out of this project's scope.
|
||||
|
||||
A full example would be: `<MyComponent vMyDirective:argument_modifier1_modifier2={someExpression} />`
|
1
node_modules/@vue/babel-plugin-transform-vue-jsx/dist/plugin.js
generated
vendored
Normal file
1
node_modules/@vue/babel-plugin-transform-vue-jsx/dist/plugin.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
17
node_modules/@vue/babel-plugin-transform-vue-jsx/node_modules/html-tags/html-tags-void.json
generated
vendored
Normal file
17
node_modules/@vue/babel-plugin-transform-vue-jsx/node_modules/html-tags/html-tags-void.json
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
[
|
||||
"area",
|
||||
"base",
|
||||
"br",
|
||||
"col",
|
||||
"embed",
|
||||
"hr",
|
||||
"img",
|
||||
"input",
|
||||
"link",
|
||||
"menuitem",
|
||||
"meta",
|
||||
"param",
|
||||
"source",
|
||||
"track",
|
||||
"wbr"
|
||||
]
|
120
node_modules/@vue/babel-plugin-transform-vue-jsx/node_modules/html-tags/html-tags.json
generated
vendored
Normal file
120
node_modules/@vue/babel-plugin-transform-vue-jsx/node_modules/html-tags/html-tags.json
generated
vendored
Normal file
@ -0,0 +1,120 @@
|
||||
[
|
||||
"a",
|
||||
"abbr",
|
||||
"address",
|
||||
"area",
|
||||
"article",
|
||||
"aside",
|
||||
"audio",
|
||||
"b",
|
||||
"base",
|
||||
"bdi",
|
||||
"bdo",
|
||||
"blockquote",
|
||||
"body",
|
||||
"br",
|
||||
"button",
|
||||
"canvas",
|
||||
"caption",
|
||||
"cite",
|
||||
"code",
|
||||
"col",
|
||||
"colgroup",
|
||||
"data",
|
||||
"datalist",
|
||||
"dd",
|
||||
"del",
|
||||
"details",
|
||||
"dfn",
|
||||
"dialog",
|
||||
"div",
|
||||
"dl",
|
||||
"dt",
|
||||
"em",
|
||||
"embed",
|
||||
"fieldset",
|
||||
"figcaption",
|
||||
"figure",
|
||||
"footer",
|
||||
"form",
|
||||
"h1",
|
||||
"h2",
|
||||
"h3",
|
||||
"h4",
|
||||
"h5",
|
||||
"h6",
|
||||
"head",
|
||||
"header",
|
||||
"hgroup",
|
||||
"hr",
|
||||
"html",
|
||||
"i",
|
||||
"iframe",
|
||||
"img",
|
||||
"input",
|
||||
"ins",
|
||||
"kbd",
|
||||
"keygen",
|
||||
"label",
|
||||
"legend",
|
||||
"li",
|
||||
"link",
|
||||
"main",
|
||||
"map",
|
||||
"mark",
|
||||
"math",
|
||||
"menu",
|
||||
"menuitem",
|
||||
"meta",
|
||||
"meter",
|
||||
"nav",
|
||||
"noscript",
|
||||
"object",
|
||||
"ol",
|
||||
"optgroup",
|
||||
"option",
|
||||
"output",
|
||||
"p",
|
||||
"param",
|
||||
"picture",
|
||||
"pre",
|
||||
"progress",
|
||||
"q",
|
||||
"rb",
|
||||
"rp",
|
||||
"rt",
|
||||
"rtc",
|
||||
"ruby",
|
||||
"s",
|
||||
"samp",
|
||||
"script",
|
||||
"section",
|
||||
"select",
|
||||
"slot",
|
||||
"small",
|
||||
"source",
|
||||
"span",
|
||||
"strong",
|
||||
"style",
|
||||
"sub",
|
||||
"summary",
|
||||
"sup",
|
||||
"svg",
|
||||
"table",
|
||||
"tbody",
|
||||
"td",
|
||||
"template",
|
||||
"textarea",
|
||||
"tfoot",
|
||||
"th",
|
||||
"thead",
|
||||
"time",
|
||||
"title",
|
||||
"tr",
|
||||
"track",
|
||||
"u",
|
||||
"ul",
|
||||
"var",
|
||||
"video",
|
||||
"wbr"
|
||||
]
|
2
node_modules/@vue/babel-plugin-transform-vue-jsx/node_modules/html-tags/index.js
generated
vendored
Normal file
2
node_modules/@vue/babel-plugin-transform-vue-jsx/node_modules/html-tags/index.js
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
'use strict';
|
||||
module.exports = require('./html-tags.json');
|
9
node_modules/@vue/babel-plugin-transform-vue-jsx/node_modules/html-tags/license
generated
vendored
Normal file
9
node_modules/@vue/babel-plugin-transform-vue-jsx/node_modules/html-tags/license
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
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.
|
71
node_modules/@vue/babel-plugin-transform-vue-jsx/node_modules/html-tags/package.json
generated
vendored
Normal file
71
node_modules/@vue/babel-plugin-transform-vue-jsx/node_modules/html-tags/package.json
generated
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
{
|
||||
"_from": "html-tags@^2.0.0",
|
||||
"_id": "html-tags@2.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-+Il6N8cCo2wB/Vd3gqy/8TZhTD3QvcVeQLCnZiGkGCH3JP28IgGAY41giccp2W4R3jfyJPAP318FQTa1yU7K7g==",
|
||||
"_location": "/@vue/babel-plugin-transform-vue-jsx/html-tags",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "html-tags@^2.0.0",
|
||||
"name": "html-tags",
|
||||
"escapedName": "html-tags",
|
||||
"rawSpec": "^2.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^2.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@vue/babel-plugin-transform-vue-jsx"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/html-tags/-/html-tags-2.0.0.tgz",
|
||||
"_shasum": "10b30a386085f43cede353cc8fa7cb0deeea668b",
|
||||
"_spec": "html-tags@^2.0.0",
|
||||
"_where": "C:\\Users\\zhouxueli\\Desktop\\scheduling-app\\node_modules\\@vue\\babel-plugin-transform-vue-jsx",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/html-tags/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "List of standard HTML tags",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"void.js",
|
||||
"html-tags.json",
|
||||
"html-tags-void.json"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/html-tags#readme",
|
||||
"keywords": [
|
||||
"html",
|
||||
"html5",
|
||||
"tags",
|
||||
"elements",
|
||||
"list",
|
||||
"whatwg",
|
||||
"w3c",
|
||||
"void",
|
||||
"self-closing"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "html-tags",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/html-tags.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "2.0.0"
|
||||
}
|
38
node_modules/@vue/babel-plugin-transform-vue-jsx/node_modules/html-tags/readme.md
generated
vendored
Normal file
38
node_modules/@vue/babel-plugin-transform-vue-jsx/node_modules/html-tags/readme.md
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
# html-tags [](https://travis-ci.org/sindresorhus/html-tags)
|
||||
|
||||
> List of standard HTML tags
|
||||
|
||||
It's just a couple of JSON files that can be used in any environment.
|
||||
|
||||
It intentionally leaves out obsolete tags.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install html-tags
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const htmlTags = require('html-tags');
|
||||
|
||||
console.log(htmlTags);
|
||||
//=> ['a', 'abbr', 'acronym', ...]
|
||||
```
|
||||
|
||||
And void (self-closing) tags:
|
||||
|
||||
```js
|
||||
const voidHtmlTags = require('html-tags/void');
|
||||
|
||||
console.log(voidHtmlTags);
|
||||
//=> ['area', 'base', 'br', ...]
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
2
node_modules/@vue/babel-plugin-transform-vue-jsx/node_modules/html-tags/void.js
generated
vendored
Normal file
2
node_modules/@vue/babel-plugin-transform-vue-jsx/node_modules/html-tags/void.js
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
'use strict';
|
||||
module.exports = require('./html-tags-void.json');
|
92
node_modules/@vue/babel-plugin-transform-vue-jsx/package.json
generated
vendored
Normal file
92
node_modules/@vue/babel-plugin-transform-vue-jsx/package.json
generated
vendored
Normal file
@ -0,0 +1,92 @@
|
||||
{
|
||||
"_from": "@vue/babel-plugin-transform-vue-jsx@^1.4.0",
|
||||
"_id": "@vue/babel-plugin-transform-vue-jsx@1.4.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-Fmastxw4MMx0vlgLS4XBX0XiBbUFzoMGeVXuMV08wyOfXdikAFqBTuYPR0tlk+XskL19EzHc39SgjrPGY23JnA==",
|
||||
"_location": "/@vue/babel-plugin-transform-vue-jsx",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@vue/babel-plugin-transform-vue-jsx@^1.4.0",
|
||||
"name": "@vue/babel-plugin-transform-vue-jsx",
|
||||
"escapedName": "@vue%2fbabel-plugin-transform-vue-jsx",
|
||||
"scope": "@vue",
|
||||
"rawSpec": "^1.4.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.4.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@vue/babel-preset-jsx",
|
||||
"/@vue/babel-sugar-v-model",
|
||||
"/@vue/babel-sugar-v-on"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@vue/babel-plugin-transform-vue-jsx/-/babel-plugin-transform-vue-jsx-1.4.0.tgz",
|
||||
"_shasum": "4d4b3d46a39ea62b7467dd6e26ce47f7ceafb2fe",
|
||||
"_spec": "@vue/babel-plugin-transform-vue-jsx@^1.4.0",
|
||||
"_where": "C:\\Users\\zhouxueli\\Desktop\\scheduling-app\\node_modules\\@vue\\babel-preset-jsx",
|
||||
"author": {
|
||||
"name": "Evan You"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@babel/helper-module-imports": "^7.0.0",
|
||||
"@babel/plugin-syntax-jsx": "^7.2.0",
|
||||
"@vue/babel-helper-vue-jsx-merge-props": "^1.4.0",
|
||||
"html-tags": "^2.0.0",
|
||||
"lodash.kebabcase": "^4.1.1",
|
||||
"svg-tags": "^1.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Babel plugin for Vue 2.0 JSX",
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.2.0",
|
||||
"@babel/core": "^7.2.0",
|
||||
"@babel/preset-env": "^7.2.0",
|
||||
"@vue/test-utils": "1.0.0-beta.26",
|
||||
"ava": "^0.25.0",
|
||||
"jsdom": "^13.0.0",
|
||||
"jsdom-global": "^3.0.2",
|
||||
"nyc": "^12.0.2",
|
||||
"rollup": "^0.67.4",
|
||||
"rollup-plugin-babel": "4.0.3",
|
||||
"rollup-plugin-babel-minify": "^6.2.0",
|
||||
"rollup-plugin-istanbul": "^2.0.1",
|
||||
"vue": "^2.5.17",
|
||||
"vue-template-compiler": "^2.5.17"
|
||||
},
|
||||
"files": [],
|
||||
"gitHead": "6566e12067f5d6c02d3849b574a1b84de5634008",
|
||||
"license": "MIT",
|
||||
"main": "dist/plugin.js",
|
||||
"name": "@vue/babel-plugin-transform-vue-jsx",
|
||||
"nyc": {
|
||||
"exclude": [
|
||||
"dist",
|
||||
"test"
|
||||
]
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vuejs/jsx/tree/master/packages/babel-plugin-transform-vue-jsx"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"build:dependency": "cd ../babel-helper-vue-jsx-merge-props && yarn build",
|
||||
"build:test": "rollup -c rollup.config.testing.js",
|
||||
"prepublish": "yarn build",
|
||||
"pretest:functional": "yarn build:dependency && yarn build:test && nyc --reporter=html --reporter=text-summary babel test/functional.js --plugins ./dist/plugin.testing.js --out-file test/functional-compiled.js",
|
||||
"pretest:snapshot": "yarn build:test",
|
||||
"test": "rm -rf coverage* && yarn test:snapshot && mv coverage coverage-snapshot && yarn test:functional && mv coverage coverage-functional",
|
||||
"test:functional": "ava -v test/functional-compiled.js",
|
||||
"test:snapshot": "nyc --reporter=html --reporter=text-summary ava -v test/snapshot.js"
|
||||
},
|
||||
"version": "1.4.0"
|
||||
}
|
21
node_modules/@vue/babel-preset-app/LICENSE
generated
vendored
Normal file
21
node_modules/@vue/babel-preset-app/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017-present, Yuxi (Evan) You
|
||||
|
||||
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.
|
103
node_modules/@vue/babel-preset-app/README.md
generated
vendored
Normal file
103
node_modules/@vue/babel-preset-app/README.md
generated
vendored
Normal file
@ -0,0 +1,103 @@
|
||||
# @vue/babel-preset-app
|
||||
|
||||
This is the default Babel preset used in all Vue CLI projects. **Note: this preset is meant to be used exclusively in projects created via Vue CLI and does not consider external use cases.**
|
||||
|
||||
## Included Features
|
||||
|
||||
### [@babel/preset-env](https://new.babeljs.io/docs/en/next/babel-preset-env.html)
|
||||
|
||||
`preset-env` automatically determines the transforms and polyfills to apply based on your browser target. See [Browser Compatibility](https://cli.vuejs.org/guide/browser-compatibility.html) section in docs for more details.
|
||||
|
||||
- `modules: false`
|
||||
- auto set to `'commonjs'` in Jest tests
|
||||
- [`useBuiltIns: 'usage'`](#usebuiltins)
|
||||
- `targets`:
|
||||
- by default `@babel/preset-env` will use [`browserslist config sources`](https://github.com/browserslist/browserslist#queries) (browserslist key in package.json file is recommend) unless either the [`targets`](https://babeljs.io/docs/en/babel-preset-env#targets) or [`ignoreBrowserslistConfig`](https://babeljs.io/docs/en/babel-preset-env#ignorebrowserslistconfig) options are set.
|
||||
- set to `{ node: 'current' }` when running unit tests in Node.js
|
||||
- Includes `Promise` polyfill by default so that they are usable even in non-transpiled dependencies (only for environments that need it)
|
||||
|
||||
### Stage 3 or Below
|
||||
|
||||
Only the following stage 3 or below features are supported (object rest spread is supported as part of `preset-env`):
|
||||
|
||||
- [Dynamic Import Syntax](https://github.com/tc39/proposal-dynamic-import)
|
||||
- [Proposal Class Properties](https://babeljs.io/docs/en/next/babel-plugin-proposal-class-properties.html)
|
||||
- [Proposal Decorators (legacy)](https://babeljs.io/docs/en/next/babel-plugin-proposal-decorators.html)
|
||||
|
||||
If you need additional stage 3 or below features, you need to install and configure it yourself.
|
||||
|
||||
### Vue JSX support
|
||||
|
||||
- [@babel/plugin-syntax-jsx](https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-jsx)
|
||||
- [@vue/babel-preset-jsx](https://github.com/vuejs/jsx)
|
||||
|
||||
### [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-runtime)
|
||||
|
||||
`transform-runtime` avoids inlining helpers in every file. This is enabled for helpers only, since polyfills are handled by `babel-preset-env`.
|
||||
|
||||
## Options
|
||||
|
||||
- All options from [@babel/preset-env](https://babeljs.io/docs/en/next/babel-preset-env.html) are supported, with some of them having smarter defaults.
|
||||
|
||||
### modules
|
||||
|
||||
- Default:
|
||||
- `false` when building with webpack
|
||||
- `'commonjs'` when running tests in Jest.
|
||||
|
||||
Explicitly set `modules` option for `babel-preset-env`. See [babel-preset-env docs](https://github.com/babel/babel/tree/master/packages/babel-preset-env#modules) for more details.
|
||||
|
||||
### targets
|
||||
|
||||
- Default:
|
||||
- `@vue/babel-preset-app` will use [`browserslist config sources`](https://github.com/browserslist/browserslist#queries) (browserslist key in package.json file is recommend) unless either the [`targets`](https://babeljs.io/docs/en/babel-preset-env#targets) or [`ignoreBrowserslistConfig`](https://babeljs.io/docs/en/babel-preset-env#ignorebrowserslistconfig) options are set.
|
||||
- set to `{ node: 'current' }` when running unit tests in Node.js
|
||||
|
||||
Explicitly set `targets` option for `babel-preset-env`. See [babel-preset-env docs](https://github.com/babel/babel/tree/master/packages/babel-preset-env#targets) for more details.
|
||||
|
||||
### useBuiltIns
|
||||
|
||||
- Default: `'usage'`
|
||||
- Allowed values: `'usage' | 'entry' | false`
|
||||
|
||||
Explicitly set `useBuiltIns` option for `babel-preset-env`.
|
||||
|
||||
The default value is `'usage'`, which adds imports to polyfills based on the usage in transpiled code. For example, if you use `Object.assign` in your code, the corresponding polyfill will be auto-imported if your target environment does not supports it.
|
||||
|
||||
If you are building a library or web component instead of an app, you probably want to set this to `false` and let the consuming app be responsible for the polyfills.
|
||||
|
||||
Note that the usage detection does not apply to your dependencies (which are excluded by `cli-plugin-babel` by default). If one of your dependencies need polyfills, you have a few options:
|
||||
|
||||
1. **If the dependency is written in an ES version that your target environments do not support:** Add that dependency to the `transpileDependencies` option in `vue.config.js`. This would enable both syntax transforms and usage-based polyfill detection for that dependency.
|
||||
|
||||
2. **If the dependency ships ES5 code and explicitly lists the polyfills needed:** you can pre-include the needed polyfills using the [polyfills](#polyfills) option for this preset.
|
||||
|
||||
3. **If the dependency ships ES5 code, but uses ES6+ features without explicitly listing polyfill requirements (e.g. Vuetify):** Use `useBuiltIns: 'entry'` and then add `import '@babel/polyfill'` to your entry file. This will import **ALL** polyfills based on your `browserslist` targets so that you don't need to worry about dependency polyfills anymore, but will likely increase your final bundle size with some unused polyfills.
|
||||
|
||||
See [@babel/preset-env docs](https://new.babeljs.io/docs/en/next/babel-preset-env.html#usebuiltins-usage) for more details.
|
||||
|
||||
### polyfills
|
||||
|
||||
- Default: `['es.array.iterator', 'es.promise', 'es.object.assign', 'es.promise.finally']`
|
||||
|
||||
A list of [core-js](https://github.com/zloirock/core-js) polyfills to pre-include when using `useBuiltIns: 'usage'`. **These polyfills are automatically excluded if they are not needed for your target environments**.
|
||||
|
||||
Use this option when you have 3rd party dependencies that are not processed by Babel but have specific polyfill requirements (e.g. Axios and Vuex require Promise support).
|
||||
|
||||
### jsx
|
||||
|
||||
- Default: `true`.
|
||||
|
||||
Set to `false` to disable JSX support. Or you can toggle [@vue/babel-preset-jsx](https://github.com/vuejs/jsx/tree/dev/packages/babel-preset-jsx) (or [@vue/babel-plugin-jsx](https://github.com/vuejs/jsx-next) for Vue 3 projects) features here.
|
||||
|
||||
### loose
|
||||
|
||||
- Default: `false`.
|
||||
|
||||
Setting this to `true` will generate code that is more performant but less spec-compliant.
|
||||
|
||||
### entryFiles
|
||||
|
||||
- Default: `[]`
|
||||
|
||||
Multi page repo use `entryFiles` to ensure inject polyfills to all entry file.
|
282
node_modules/@vue/babel-preset-app/index.js
generated
vendored
Normal file
282
node_modules/@vue/babel-preset-app/index.js
generated
vendored
Normal file
@ -0,0 +1,282 @@
|
||||
const path = require('path')
|
||||
const semver = require('semver')
|
||||
|
||||
const defaultPolyfills = [
|
||||
// promise polyfill alone doesn't work in IE,
|
||||
// needs this as well. see: #1642
|
||||
'es.array.iterator',
|
||||
// this is required for webpack code splitting, vuex etc.
|
||||
'es.promise',
|
||||
// this is needed for object rest spread support in templates
|
||||
// as vue-template-es2015-compiler 1.8+ compiles it to Object.assign() calls.
|
||||
'es.object.assign',
|
||||
// #2012 es.promise replaces native Promise in FF and causes missing finally
|
||||
'es.promise.finally'
|
||||
]
|
||||
|
||||
const {
|
||||
default: getTargets,
|
||||
isRequired
|
||||
} = require('@babel/helper-compilation-targets')
|
||||
|
||||
// We'll no longer need this logic in Babel 8 as it's the default behavior
|
||||
// See discussions at:
|
||||
// https://github.com/babel/rfcs/pull/2#issuecomment-714785228
|
||||
// https://github.com/babel/babel/pull/12189
|
||||
function getIntersectionTargets (targets, constraintTargets) {
|
||||
const intersection = Object.keys(constraintTargets).reduce(
|
||||
(results, browser) => {
|
||||
// exclude the browsers that the user does not need
|
||||
if (!targets[browser]) {
|
||||
return results
|
||||
}
|
||||
|
||||
// if the user-specified version is higher the minimum version that supports esmodule, than use it
|
||||
results[browser] = semver.gt(
|
||||
semver.coerce(constraintTargets[browser]),
|
||||
semver.coerce(targets[browser])
|
||||
)
|
||||
? constraintTargets[browser]
|
||||
: targets[browser]
|
||||
|
||||
return results
|
||||
},
|
||||
{}
|
||||
)
|
||||
|
||||
return intersection
|
||||
}
|
||||
|
||||
function getModuleTargets (targets) {
|
||||
const allModuleTargets = getTargets(
|
||||
{ esmodules: true },
|
||||
{ ignoreBrowserslistConfig: true }
|
||||
)
|
||||
|
||||
// use the intersection of modern mode browsers and user defined targets config
|
||||
return getIntersectionTargets(targets, allModuleTargets)
|
||||
}
|
||||
|
||||
function getWCTargets (targets) {
|
||||
// targeting browsers that at least support ES2015 classes
|
||||
// https://github.com/babel/babel/blob/v7.9.6/packages/babel-compat-data/data/plugins.json#L194-L204
|
||||
const allWCTargets = getTargets(
|
||||
{
|
||||
browsers: [
|
||||
'Chrome >= 46',
|
||||
'Firefox >= 45',
|
||||
'Safari >= 10',
|
||||
'Edge >= 13',
|
||||
'iOS >= 10',
|
||||
'Electron >= 0.36'
|
||||
]
|
||||
},
|
||||
{ ignoreBrowserslistConfig: true }
|
||||
)
|
||||
|
||||
// use the intersection of browsers supporting Web Components and user defined targets config
|
||||
return getIntersectionTargets(targets, allWCTargets)
|
||||
}
|
||||
|
||||
function getPolyfills (targets, includes) {
|
||||
// if no targets specified, include all default polyfills
|
||||
if (!targets || !Object.keys(targets).length) {
|
||||
return includes
|
||||
}
|
||||
|
||||
const compatData = require('core-js-compat').data
|
||||
return includes.filter(item => {
|
||||
if (!compatData[item]) {
|
||||
throw new Error(`Cannot find polyfill ${item}, please refer to 'core-js-compat' for a complete list of available modules`)
|
||||
}
|
||||
|
||||
return isRequired(item, targets, { compatData })
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = (context, options = {}) => {
|
||||
const presets = []
|
||||
const plugins = []
|
||||
const defaultEntryFiles = JSON.parse(process.env.VUE_CLI_ENTRY_FILES || '[]')
|
||||
|
||||
// Though in the vue-cli repo, we only use the two environment variables
|
||||
// for tests, users may have relied on them for some features,
|
||||
// dropping them may break some projects.
|
||||
// So in the following blocks we don't directly test the `NODE_ENV`.
|
||||
// Rather, we turn it into the two commonly used feature flags.
|
||||
if (!process.env.VUE_CLI_TEST && process.env.NODE_ENV === 'test') {
|
||||
// Both Jest & Mocha set NODE_ENV to 'test'.
|
||||
// And both requires the `node` target.
|
||||
process.env.VUE_CLI_BABEL_TARGET_NODE = 'true'
|
||||
// Jest runs without bundling so it needs this.
|
||||
// With the node target, tree shaking is not a necessity,
|
||||
// so we set it for maximum compatibility.
|
||||
process.env.VUE_CLI_BABEL_TRANSPILE_MODULES = 'true'
|
||||
}
|
||||
|
||||
// JSX
|
||||
if (options.jsx !== false) {
|
||||
let jsxOptions = {}
|
||||
if (typeof options.jsx === 'object') {
|
||||
jsxOptions = options.jsx
|
||||
}
|
||||
|
||||
let vueVersion = 2
|
||||
try {
|
||||
const Vue = require('vue')
|
||||
vueVersion = semver.major(Vue.version)
|
||||
} catch (e) {}
|
||||
|
||||
if (vueVersion === 2) {
|
||||
presets.push([require('@vue/babel-preset-jsx'), jsxOptions])
|
||||
} else if (vueVersion === 3) {
|
||||
plugins.push([require('@vue/babel-plugin-jsx'), jsxOptions])
|
||||
}
|
||||
}
|
||||
|
||||
const runtimePath = path.dirname(require.resolve('@babel/runtime/package.json'))
|
||||
const runtimeVersion = require('@babel/runtime/package.json').version
|
||||
const {
|
||||
polyfills: userPolyfills,
|
||||
loose = false,
|
||||
debug = false,
|
||||
useBuiltIns = 'usage',
|
||||
modules = false,
|
||||
bugfixes = true,
|
||||
targets: rawTargets,
|
||||
spec,
|
||||
ignoreBrowserslistConfig,
|
||||
configPath,
|
||||
include,
|
||||
exclude,
|
||||
shippedProposals,
|
||||
forceAllTransforms,
|
||||
decoratorsBeforeExport,
|
||||
decoratorsLegacy,
|
||||
// entry file list
|
||||
entryFiles = defaultEntryFiles,
|
||||
|
||||
// Undocumented option of @babel/plugin-transform-runtime.
|
||||
// When enabled, an absolute path is used when importing a runtime helper after transforming.
|
||||
// This ensures the transpiled file always use the runtime version required in this package.
|
||||
// However, this may cause hash inconsistency if the project is moved to another directory.
|
||||
// So here we allow user to explicit disable this option if hash consistency is a requirement
|
||||
// and the runtime version is sure to be correct.
|
||||
absoluteRuntime = runtimePath,
|
||||
|
||||
// https://babeljs.io/docs/en/babel-plugin-transform-runtime#version
|
||||
// By default transform-runtime assumes that @babel/runtime@7.0.0-beta.0 is installed, which means helpers introduced later than 7.0.0-beta.0 will be inlined instead of imported.
|
||||
// See https://github.com/babel/babel/issues/10261
|
||||
// And https://github.com/facebook/docusaurus/pull/2111
|
||||
version = runtimeVersion
|
||||
} = options
|
||||
|
||||
// resolve targets for preset-env
|
||||
let targets = getTargets(rawTargets, { ignoreBrowserslistConfig, configPath })
|
||||
if (process.env.VUE_CLI_BABEL_TARGET_NODE) {
|
||||
// running tests in Node.js
|
||||
targets = { node: 'current' }
|
||||
} else if (process.env.VUE_CLI_BUILD_TARGET === 'wc' || process.env.VUE_CLI_BUILD_TARGET === 'wc-async') {
|
||||
// targeting browsers that at least support ES2015 classes
|
||||
targets = getWCTargets(targets)
|
||||
} else if (process.env.VUE_CLI_MODERN_BUILD) {
|
||||
// targeting browsers that at least support <script type="module">
|
||||
targets = getModuleTargets(targets)
|
||||
}
|
||||
|
||||
// included-by-default polyfills. These are common polyfills that 3rd party
|
||||
// dependencies may rely on (e.g. Vuex relies on Promise), but since with
|
||||
// useBuiltIns: 'usage' we won't be running Babel on these deps, they need to
|
||||
// be force-included.
|
||||
let polyfills
|
||||
const buildTarget = process.env.VUE_CLI_BUILD_TARGET || 'app'
|
||||
if (
|
||||
buildTarget === 'app' &&
|
||||
useBuiltIns === 'usage' &&
|
||||
!process.env.VUE_CLI_BABEL_TARGET_NODE
|
||||
) {
|
||||
polyfills = getPolyfills(targets, userPolyfills || defaultPolyfills)
|
||||
plugins.push([
|
||||
require('./polyfillsPlugin'),
|
||||
{ polyfills, entryFiles, useAbsolutePath: !!absoluteRuntime }
|
||||
])
|
||||
} else {
|
||||
polyfills = []
|
||||
}
|
||||
|
||||
const envOptions = {
|
||||
bugfixes,
|
||||
corejs: useBuiltIns ? require('core-js/package.json').version : false,
|
||||
spec,
|
||||
loose,
|
||||
debug,
|
||||
modules,
|
||||
targets,
|
||||
useBuiltIns,
|
||||
ignoreBrowserslistConfig,
|
||||
configPath,
|
||||
include,
|
||||
exclude: polyfills.concat(exclude || []),
|
||||
shippedProposals,
|
||||
forceAllTransforms
|
||||
}
|
||||
|
||||
// cli-plugin-jest sets this to true because Jest runs without bundling
|
||||
if (process.env.VUE_CLI_BABEL_TRANSPILE_MODULES) {
|
||||
envOptions.modules = 'commonjs'
|
||||
if (process.env.VUE_CLI_BABEL_TARGET_NODE) {
|
||||
// necessary for dynamic import to work in tests
|
||||
plugins.push(require('babel-plugin-dynamic-import-node'))
|
||||
}
|
||||
}
|
||||
|
||||
// pass options along to babel-preset-env
|
||||
presets.unshift([require('@babel/preset-env'), envOptions])
|
||||
|
||||
// additional <= stage-3 plugins
|
||||
// Babel 7 is removing stage presets altogether because people are using
|
||||
// too many unstable proposals. Let's be conservative in the defaults here.
|
||||
plugins.push(
|
||||
require('@babel/plugin-syntax-dynamic-import'),
|
||||
[require('@babel/plugin-proposal-decorators'), {
|
||||
decoratorsBeforeExport,
|
||||
legacy: decoratorsLegacy !== false
|
||||
}],
|
||||
[require('@babel/plugin-proposal-class-properties'), { loose }]
|
||||
)
|
||||
|
||||
// transform runtime, but only for helpers
|
||||
plugins.push([require('@babel/plugin-transform-runtime'), {
|
||||
regenerator: useBuiltIns !== 'usage',
|
||||
|
||||
// polyfills are injected by preset-env & polyfillsPlugin, so no need to add them again
|
||||
corejs: false,
|
||||
|
||||
helpers: useBuiltIns === 'usage',
|
||||
useESModules: !process.env.VUE_CLI_BABEL_TRANSPILE_MODULES,
|
||||
|
||||
absoluteRuntime,
|
||||
|
||||
version
|
||||
}])
|
||||
|
||||
return {
|
||||
sourceType: 'unambiguous',
|
||||
overrides: [{
|
||||
exclude: [/@babel[/|\\\\]runtime/, /core-js/],
|
||||
presets,
|
||||
plugins
|
||||
}, {
|
||||
// there are some untranspiled code in @babel/runtime
|
||||
// https://github.com/babel/babel/issues/9903
|
||||
include: [/@babel[/|\\\\]runtime/],
|
||||
presets: [
|
||||
[require('@babel/preset-env'), envOptions]
|
||||
]
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
||||
// a special flag to tell @vue/cli-plugin-babel to include @babel/runtime for transpilation
|
||||
// otherwise the above `include` option won't take effect
|
||||
process.env.VUE_CLI_TRANSPILE_BABEL_RUNTIME = true
|
15
node_modules/@vue/babel-preset-app/node_modules/.bin/semver
generated
vendored
Normal file
15
node_modules/@vue/babel-preset-app/node_modules/.bin/semver
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
#!/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/../semver/bin/semver.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../semver/bin/semver.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
17
node_modules/@vue/babel-preset-app/node_modules/.bin/semver.cmd
generated
vendored
Normal file
17
node_modules/@vue/babel-preset-app/node_modules/.bin/semver.cmd
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
@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%\..\semver\bin\semver.js" %*
|
||||
ENDLOCAL
|
||||
EXIT /b %errorlevel%
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
18
node_modules/@vue/babel-preset-app/node_modules/.bin/semver.ps1
generated
vendored
Normal file
18
node_modules/@vue/babel-preset-app/node_modules/.bin/semver.ps1
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
#!/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/../semver/bin/semver.js" $args
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
& "node$exe" "$basedir/../semver/bin/semver.js" $args
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
15
node_modules/@vue/babel-preset-app/node_modules/lru-cache/LICENSE
generated
vendored
Normal file
15
node_modules/@vue/babel-preset-app/node_modules/lru-cache/LICENSE
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
166
node_modules/@vue/babel-preset-app/node_modules/lru-cache/README.md
generated
vendored
Normal file
166
node_modules/@vue/babel-preset-app/node_modules/lru-cache/README.md
generated
vendored
Normal file
@ -0,0 +1,166 @@
|
||||
# lru cache
|
||||
|
||||
A cache object that deletes the least-recently-used items.
|
||||
|
||||
[](https://travis-ci.org/isaacs/node-lru-cache) [](https://coveralls.io/github/isaacs/node-lru-cache)
|
||||
|
||||
## Installation:
|
||||
|
||||
```javascript
|
||||
npm install lru-cache --save
|
||||
```
|
||||
|
||||
## Usage:
|
||||
|
||||
```javascript
|
||||
var LRU = require("lru-cache")
|
||||
, options = { max: 500
|
||||
, length: function (n, key) { return n * 2 + key.length }
|
||||
, dispose: function (key, n) { n.close() }
|
||||
, maxAge: 1000 * 60 * 60 }
|
||||
, cache = new LRU(options)
|
||||
, otherCache = new LRU(50) // sets just the max size
|
||||
|
||||
cache.set("key", "value")
|
||||
cache.get("key") // "value"
|
||||
|
||||
// non-string keys ARE fully supported
|
||||
// but note that it must be THE SAME object, not
|
||||
// just a JSON-equivalent object.
|
||||
var someObject = { a: 1 }
|
||||
cache.set(someObject, 'a value')
|
||||
// Object keys are not toString()-ed
|
||||
cache.set('[object Object]', 'a different value')
|
||||
assert.equal(cache.get(someObject), 'a value')
|
||||
// A similar object with same keys/values won't work,
|
||||
// because it's a different object identity
|
||||
assert.equal(cache.get({ a: 1 }), undefined)
|
||||
|
||||
cache.reset() // empty the cache
|
||||
```
|
||||
|
||||
If you put more stuff in it, then items will fall out.
|
||||
|
||||
If you try to put an oversized thing in it, then it'll fall out right
|
||||
away.
|
||||
|
||||
## Options
|
||||
|
||||
* `max` The maximum size of the cache, checked by applying the length
|
||||
function to all values in the cache. Not setting this is kind of
|
||||
silly, since that's the whole purpose of this lib, but it defaults
|
||||
to `Infinity`. Setting it to a non-number or negative number will
|
||||
throw a `TypeError`. Setting it to 0 makes it be `Infinity`.
|
||||
* `maxAge` Maximum age in ms. Items are not pro-actively pruned out
|
||||
as they age, but if you try to get an item that is too old, it'll
|
||||
drop it and return undefined instead of giving it to you.
|
||||
Setting this to a negative value will make everything seem old!
|
||||
Setting it to a non-number will throw a `TypeError`.
|
||||
* `length` Function that is used to calculate the length of stored
|
||||
items. If you're storing strings or buffers, then you probably want
|
||||
to do something like `function(n, key){return n.length}`. The default is
|
||||
`function(){return 1}`, which is fine if you want to store `max`
|
||||
like-sized things. The item is passed as the first argument, and
|
||||
the key is passed as the second argumnet.
|
||||
* `dispose` Function that is called on items when they are dropped
|
||||
from the cache. This can be handy if you want to close file
|
||||
descriptors or do other cleanup tasks when items are no longer
|
||||
accessible. Called with `key, value`. It's called *before*
|
||||
actually removing the item from the internal cache, so if you want
|
||||
to immediately put it back in, you'll have to do that in a
|
||||
`nextTick` or `setTimeout` callback or it won't do anything.
|
||||
* `stale` By default, if you set a `maxAge`, it'll only actually pull
|
||||
stale items out of the cache when you `get(key)`. (That is, it's
|
||||
not pre-emptively doing a `setTimeout` or anything.) If you set
|
||||
`stale:true`, it'll return the stale value before deleting it. If
|
||||
you don't set this, then it'll return `undefined` when you try to
|
||||
get a stale entry, as if it had already been deleted.
|
||||
* `noDisposeOnSet` By default, if you set a `dispose()` method, then
|
||||
it'll be called whenever a `set()` operation overwrites an existing
|
||||
key. If you set this option, `dispose()` will only be called when a
|
||||
key falls out of the cache, not when it is overwritten.
|
||||
* `updateAgeOnGet` When using time-expiring entries with `maxAge`,
|
||||
setting this to `true` will make each item's effective time update
|
||||
to the current time whenever it is retrieved from cache, causing it
|
||||
to not expire. (It can still fall out of cache based on recency of
|
||||
use, of course.)
|
||||
|
||||
## API
|
||||
|
||||
* `set(key, value, maxAge)`
|
||||
* `get(key) => value`
|
||||
|
||||
Both of these will update the "recently used"-ness of the key.
|
||||
They do what you think. `maxAge` is optional and overrides the
|
||||
cache `maxAge` option if provided.
|
||||
|
||||
If the key is not found, `get()` will return `undefined`.
|
||||
|
||||
The key and val can be any value.
|
||||
|
||||
* `peek(key)`
|
||||
|
||||
Returns the key value (or `undefined` if not found) without
|
||||
updating the "recently used"-ness of the key.
|
||||
|
||||
(If you find yourself using this a lot, you *might* be using the
|
||||
wrong sort of data structure, but there are some use cases where
|
||||
it's handy.)
|
||||
|
||||
* `del(key)`
|
||||
|
||||
Deletes a key out of the cache.
|
||||
|
||||
* `reset()`
|
||||
|
||||
Clear the cache entirely, throwing away all values.
|
||||
|
||||
* `has(key)`
|
||||
|
||||
Check if a key is in the cache, without updating the recent-ness
|
||||
or deleting it for being stale.
|
||||
|
||||
* `forEach(function(value,key,cache), [thisp])`
|
||||
|
||||
Just like `Array.prototype.forEach`. Iterates over all the keys
|
||||
in the cache, in order of recent-ness. (Ie, more recently used
|
||||
items are iterated over first.)
|
||||
|
||||
* `rforEach(function(value,key,cache), [thisp])`
|
||||
|
||||
The same as `cache.forEach(...)` but items are iterated over in
|
||||
reverse order. (ie, less recently used items are iterated over
|
||||
first.)
|
||||
|
||||
* `keys()`
|
||||
|
||||
Return an array of the keys in the cache.
|
||||
|
||||
* `values()`
|
||||
|
||||
Return an array of the values in the cache.
|
||||
|
||||
* `length`
|
||||
|
||||
Return total length of objects in cache taking into account
|
||||
`length` options function.
|
||||
|
||||
* `itemCount`
|
||||
|
||||
Return total quantity of objects currently in cache. Note, that
|
||||
`stale` (see options) items are returned as part of this item
|
||||
count.
|
||||
|
||||
* `dump()`
|
||||
|
||||
Return an array of the cache entries ready for serialization and usage
|
||||
with 'destinationCache.load(arr)`.
|
||||
|
||||
* `load(cacheEntriesArray)`
|
||||
|
||||
Loads another cache entries array, obtained with `sourceCache.dump()`,
|
||||
into the cache. The destination cache is reset before loading new entries
|
||||
|
||||
* `prune()`
|
||||
|
||||
Manually iterates over the entire cache proactively pruning old entries
|
334
node_modules/@vue/babel-preset-app/node_modules/lru-cache/index.js
generated
vendored
Normal file
334
node_modules/@vue/babel-preset-app/node_modules/lru-cache/index.js
generated
vendored
Normal file
@ -0,0 +1,334 @@
|
||||
'use strict'
|
||||
|
||||
// A linked list to keep track of recently-used-ness
|
||||
const Yallist = require('yallist')
|
||||
|
||||
const MAX = Symbol('max')
|
||||
const LENGTH = Symbol('length')
|
||||
const LENGTH_CALCULATOR = Symbol('lengthCalculator')
|
||||
const ALLOW_STALE = Symbol('allowStale')
|
||||
const MAX_AGE = Symbol('maxAge')
|
||||
const DISPOSE = Symbol('dispose')
|
||||
const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet')
|
||||
const LRU_LIST = Symbol('lruList')
|
||||
const CACHE = Symbol('cache')
|
||||
const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet')
|
||||
|
||||
const naiveLength = () => 1
|
||||
|
||||
// lruList is a yallist where the head is the youngest
|
||||
// item, and the tail is the oldest. the list contains the Hit
|
||||
// objects as the entries.
|
||||
// Each Hit object has a reference to its Yallist.Node. This
|
||||
// never changes.
|
||||
//
|
||||
// cache is a Map (or PseudoMap) that matches the keys to
|
||||
// the Yallist.Node object.
|
||||
class LRUCache {
|
||||
constructor (options) {
|
||||
if (typeof options === 'number')
|
||||
options = { max: options }
|
||||
|
||||
if (!options)
|
||||
options = {}
|
||||
|
||||
if (options.max && (typeof options.max !== 'number' || options.max < 0))
|
||||
throw new TypeError('max must be a non-negative number')
|
||||
// Kind of weird to have a default max of Infinity, but oh well.
|
||||
const max = this[MAX] = options.max || Infinity
|
||||
|
||||
const lc = options.length || naiveLength
|
||||
this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc
|
||||
this[ALLOW_STALE] = options.stale || false
|
||||
if (options.maxAge && typeof options.maxAge !== 'number')
|
||||
throw new TypeError('maxAge must be a number')
|
||||
this[MAX_AGE] = options.maxAge || 0
|
||||
this[DISPOSE] = options.dispose
|
||||
this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false
|
||||
this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false
|
||||
this.reset()
|
||||
}
|
||||
|
||||
// resize the cache when the max changes.
|
||||
set max (mL) {
|
||||
if (typeof mL !== 'number' || mL < 0)
|
||||
throw new TypeError('max must be a non-negative number')
|
||||
|
||||
this[MAX] = mL || Infinity
|
||||
trim(this)
|
||||
}
|
||||
get max () {
|
||||
return this[MAX]
|
||||
}
|
||||
|
||||
set allowStale (allowStale) {
|
||||
this[ALLOW_STALE] = !!allowStale
|
||||
}
|
||||
get allowStale () {
|
||||
return this[ALLOW_STALE]
|
||||
}
|
||||
|
||||
set maxAge (mA) {
|
||||
if (typeof mA !== 'number')
|
||||
throw new TypeError('maxAge must be a non-negative number')
|
||||
|
||||
this[MAX_AGE] = mA
|
||||
trim(this)
|
||||
}
|
||||
get maxAge () {
|
||||
return this[MAX_AGE]
|
||||
}
|
||||
|
||||
// resize the cache when the lengthCalculator changes.
|
||||
set lengthCalculator (lC) {
|
||||
if (typeof lC !== 'function')
|
||||
lC = naiveLength
|
||||
|
||||
if (lC !== this[LENGTH_CALCULATOR]) {
|
||||
this[LENGTH_CALCULATOR] = lC
|
||||
this[LENGTH] = 0
|
||||
this[LRU_LIST].forEach(hit => {
|
||||
hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key)
|
||||
this[LENGTH] += hit.length
|
||||
})
|
||||
}
|
||||
trim(this)
|
||||
}
|
||||
get lengthCalculator () { return this[LENGTH_CALCULATOR] }
|
||||
|
||||
get length () { return this[LENGTH] }
|
||||
get itemCount () { return this[LRU_LIST].length }
|
||||
|
||||
rforEach (fn, thisp) {
|
||||
thisp = thisp || this
|
||||
for (let walker = this[LRU_LIST].tail; walker !== null;) {
|
||||
const prev = walker.prev
|
||||
forEachStep(this, fn, walker, thisp)
|
||||
walker = prev
|
||||
}
|
||||
}
|
||||
|
||||
forEach (fn, thisp) {
|
||||
thisp = thisp || this
|
||||
for (let walker = this[LRU_LIST].head; walker !== null;) {
|
||||
const next = walker.next
|
||||
forEachStep(this, fn, walker, thisp)
|
||||
walker = next
|
||||
}
|
||||
}
|
||||
|
||||
keys () {
|
||||
return this[LRU_LIST].toArray().map(k => k.key)
|
||||
}
|
||||
|
||||
values () {
|
||||
return this[LRU_LIST].toArray().map(k => k.value)
|
||||
}
|
||||
|
||||
reset () {
|
||||
if (this[DISPOSE] &&
|
||||
this[LRU_LIST] &&
|
||||
this[LRU_LIST].length) {
|
||||
this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value))
|
||||
}
|
||||
|
||||
this[CACHE] = new Map() // hash of items by key
|
||||
this[LRU_LIST] = new Yallist() // list of items in order of use recency
|
||||
this[LENGTH] = 0 // length of items in the list
|
||||
}
|
||||
|
||||
dump () {
|
||||
return this[LRU_LIST].map(hit =>
|
||||
isStale(this, hit) ? false : {
|
||||
k: hit.key,
|
||||
v: hit.value,
|
||||
e: hit.now + (hit.maxAge || 0)
|
||||
}).toArray().filter(h => h)
|
||||
}
|
||||
|
||||
dumpLru () {
|
||||
return this[LRU_LIST]
|
||||
}
|
||||
|
||||
set (key, value, maxAge) {
|
||||
maxAge = maxAge || this[MAX_AGE]
|
||||
|
||||
if (maxAge && typeof maxAge !== 'number')
|
||||
throw new TypeError('maxAge must be a number')
|
||||
|
||||
const now = maxAge ? Date.now() : 0
|
||||
const len = this[LENGTH_CALCULATOR](value, key)
|
||||
|
||||
if (this[CACHE].has(key)) {
|
||||
if (len > this[MAX]) {
|
||||
del(this, this[CACHE].get(key))
|
||||
return false
|
||||
}
|
||||
|
||||
const node = this[CACHE].get(key)
|
||||
const item = node.value
|
||||
|
||||
// dispose of the old one before overwriting
|
||||
// split out into 2 ifs for better coverage tracking
|
||||
if (this[DISPOSE]) {
|
||||
if (!this[NO_DISPOSE_ON_SET])
|
||||
this[DISPOSE](key, item.value)
|
||||
}
|
||||
|
||||
item.now = now
|
||||
item.maxAge = maxAge
|
||||
item.value = value
|
||||
this[LENGTH] += len - item.length
|
||||
item.length = len
|
||||
this.get(key)
|
||||
trim(this)
|
||||
return true
|
||||
}
|
||||
|
||||
const hit = new Entry(key, value, len, now, maxAge)
|
||||
|
||||
// oversized objects fall out of cache automatically.
|
||||
if (hit.length > this[MAX]) {
|
||||
if (this[DISPOSE])
|
||||
this[DISPOSE](key, value)
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
this[LENGTH] += hit.length
|
||||
this[LRU_LIST].unshift(hit)
|
||||
this[CACHE].set(key, this[LRU_LIST].head)
|
||||
trim(this)
|
||||
return true
|
||||
}
|
||||
|
||||
has (key) {
|
||||
if (!this[CACHE].has(key)) return false
|
||||
const hit = this[CACHE].get(key).value
|
||||
return !isStale(this, hit)
|
||||
}
|
||||
|
||||
get (key) {
|
||||
return get(this, key, true)
|
||||
}
|
||||
|
||||
peek (key) {
|
||||
return get(this, key, false)
|
||||
}
|
||||
|
||||
pop () {
|
||||
const node = this[LRU_LIST].tail
|
||||
if (!node)
|
||||
return null
|
||||
|
||||
del(this, node)
|
||||
return node.value
|
||||
}
|
||||
|
||||
del (key) {
|
||||
del(this, this[CACHE].get(key))
|
||||
}
|
||||
|
||||
load (arr) {
|
||||
// reset the cache
|
||||
this.reset()
|
||||
|
||||
const now = Date.now()
|
||||
// A previous serialized cache has the most recent items first
|
||||
for (let l = arr.length - 1; l >= 0; l--) {
|
||||
const hit = arr[l]
|
||||
const expiresAt = hit.e || 0
|
||||
if (expiresAt === 0)
|
||||
// the item was created without expiration in a non aged cache
|
||||
this.set(hit.k, hit.v)
|
||||
else {
|
||||
const maxAge = expiresAt - now
|
||||
// dont add already expired items
|
||||
if (maxAge > 0) {
|
||||
this.set(hit.k, hit.v, maxAge)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
prune () {
|
||||
this[CACHE].forEach((value, key) => get(this, key, false))
|
||||
}
|
||||
}
|
||||
|
||||
const get = (self, key, doUse) => {
|
||||
const node = self[CACHE].get(key)
|
||||
if (node) {
|
||||
const hit = node.value
|
||||
if (isStale(self, hit)) {
|
||||
del(self, node)
|
||||
if (!self[ALLOW_STALE])
|
||||
return undefined
|
||||
} else {
|
||||
if (doUse) {
|
||||
if (self[UPDATE_AGE_ON_GET])
|
||||
node.value.now = Date.now()
|
||||
self[LRU_LIST].unshiftNode(node)
|
||||
}
|
||||
}
|
||||
return hit.value
|
||||
}
|
||||
}
|
||||
|
||||
const isStale = (self, hit) => {
|
||||
if (!hit || (!hit.maxAge && !self[MAX_AGE]))
|
||||
return false
|
||||
|
||||
const diff = Date.now() - hit.now
|
||||
return hit.maxAge ? diff > hit.maxAge
|
||||
: self[MAX_AGE] && (diff > self[MAX_AGE])
|
||||
}
|
||||
|
||||
const trim = self => {
|
||||
if (self[LENGTH] > self[MAX]) {
|
||||
for (let walker = self[LRU_LIST].tail;
|
||||
self[LENGTH] > self[MAX] && walker !== null;) {
|
||||
// We know that we're about to delete this one, and also
|
||||
// what the next least recently used key will be, so just
|
||||
// go ahead and set it now.
|
||||
const prev = walker.prev
|
||||
del(self, walker)
|
||||
walker = prev
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const del = (self, node) => {
|
||||
if (node) {
|
||||
const hit = node.value
|
||||
if (self[DISPOSE])
|
||||
self[DISPOSE](hit.key, hit.value)
|
||||
|
||||
self[LENGTH] -= hit.length
|
||||
self[CACHE].delete(hit.key)
|
||||
self[LRU_LIST].removeNode(node)
|
||||
}
|
||||
}
|
||||
|
||||
class Entry {
|
||||
constructor (key, value, length, now, maxAge) {
|
||||
this.key = key
|
||||
this.value = value
|
||||
this.length = length
|
||||
this.now = now
|
||||
this.maxAge = maxAge || 0
|
||||
}
|
||||
}
|
||||
|
||||
const forEachStep = (self, fn, node, thisp) => {
|
||||
let hit = node.value
|
||||
if (isStale(self, hit)) {
|
||||
del(self, node)
|
||||
if (!self[ALLOW_STALE])
|
||||
hit = undefined
|
||||
}
|
||||
if (hit)
|
||||
fn.call(thisp, hit.value, hit.key, self)
|
||||
}
|
||||
|
||||
module.exports = LRUCache
|
69
node_modules/@vue/babel-preset-app/node_modules/lru-cache/package.json
generated
vendored
Normal file
69
node_modules/@vue/babel-preset-app/node_modules/lru-cache/package.json
generated
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
{
|
||||
"_from": "lru-cache@^6.0.0",
|
||||
"_id": "lru-cache@6.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
|
||||
"_location": "/@vue/babel-preset-app/lru-cache",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "lru-cache@^6.0.0",
|
||||
"name": "lru-cache",
|
||||
"escapedName": "lru-cache",
|
||||
"rawSpec": "^6.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^6.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@vue/babel-preset-app/semver"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
|
||||
"_shasum": "6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94",
|
||||
"_spec": "lru-cache@^6.0.0",
|
||||
"_where": "C:\\Users\\zhouxueli\\Desktop\\scheduling-app\\node_modules\\@vue\\babel-preset-app\\node_modules\\semver",
|
||||
"author": {
|
||||
"name": "Isaac Z. Schlueter",
|
||||
"email": "i@izs.me"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/isaacs/node-lru-cache/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"yallist": "^4.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "A cache object that deletes the least-recently-used items.",
|
||||
"devDependencies": {
|
||||
"benchmark": "^2.1.4",
|
||||
"tap": "^14.10.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/isaacs/node-lru-cache#readme",
|
||||
"keywords": [
|
||||
"mru",
|
||||
"lru",
|
||||
"cache"
|
||||
],
|
||||
"license": "ISC",
|
||||
"main": "index.js",
|
||||
"name": "lru-cache",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/isaacs/node-lru-cache.git"
|
||||
},
|
||||
"scripts": {
|
||||
"postversion": "npm publish",
|
||||
"prepublishOnly": "git push origin --follow-tags",
|
||||
"preversion": "npm test",
|
||||
"snap": "tap",
|
||||
"test": "tap"
|
||||
},
|
||||
"version": "6.0.0"
|
||||
}
|
15
node_modules/@vue/babel-preset-app/node_modules/semver/LICENSE
generated
vendored
Normal file
15
node_modules/@vue/babel-preset-app/node_modules/semver/LICENSE
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
637
node_modules/@vue/babel-preset-app/node_modules/semver/README.md
generated
vendored
Normal file
637
node_modules/@vue/babel-preset-app/node_modules/semver/README.md
generated
vendored
Normal file
@ -0,0 +1,637 @@
|
||||
semver(1) -- The semantic versioner for npm
|
||||
===========================================
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
npm install semver
|
||||
````
|
||||
|
||||
## Usage
|
||||
|
||||
As a node module:
|
||||
|
||||
```js
|
||||
const semver = require('semver')
|
||||
|
||||
semver.valid('1.2.3') // '1.2.3'
|
||||
semver.valid('a.b.c') // null
|
||||
semver.clean(' =v1.2.3 ') // '1.2.3'
|
||||
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
|
||||
semver.gt('1.2.3', '9.8.7') // false
|
||||
semver.lt('1.2.3', '9.8.7') // true
|
||||
semver.minVersion('>=1.0.0') // '1.0.0'
|
||||
semver.valid(semver.coerce('v2')) // '2.0.0'
|
||||
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
|
||||
```
|
||||
|
||||
You can also just load the module for the function that you care about, if
|
||||
you'd like to minimize your footprint.
|
||||
|
||||
```js
|
||||
// load the whole API at once in a single object
|
||||
const semver = require('semver')
|
||||
|
||||
// or just load the bits you need
|
||||
// all of them listed here, just pick and choose what you want
|
||||
|
||||
// classes
|
||||
const SemVer = require('semver/classes/semver')
|
||||
const Comparator = require('semver/classes/comparator')
|
||||
const Range = require('semver/classes/range')
|
||||
|
||||
// functions for working with versions
|
||||
const semverParse = require('semver/functions/parse')
|
||||
const semverValid = require('semver/functions/valid')
|
||||
const semverClean = require('semver/functions/clean')
|
||||
const semverInc = require('semver/functions/inc')
|
||||
const semverDiff = require('semver/functions/diff')
|
||||
const semverMajor = require('semver/functions/major')
|
||||
const semverMinor = require('semver/functions/minor')
|
||||
const semverPatch = require('semver/functions/patch')
|
||||
const semverPrerelease = require('semver/functions/prerelease')
|
||||
const semverCompare = require('semver/functions/compare')
|
||||
const semverRcompare = require('semver/functions/rcompare')
|
||||
const semverCompareLoose = require('semver/functions/compare-loose')
|
||||
const semverCompareBuild = require('semver/functions/compare-build')
|
||||
const semverSort = require('semver/functions/sort')
|
||||
const semverRsort = require('semver/functions/rsort')
|
||||
|
||||
// low-level comparators between versions
|
||||
const semverGt = require('semver/functions/gt')
|
||||
const semverLt = require('semver/functions/lt')
|
||||
const semverEq = require('semver/functions/eq')
|
||||
const semverNeq = require('semver/functions/neq')
|
||||
const semverGte = require('semver/functions/gte')
|
||||
const semverLte = require('semver/functions/lte')
|
||||
const semverCmp = require('semver/functions/cmp')
|
||||
const semverCoerce = require('semver/functions/coerce')
|
||||
|
||||
// working with ranges
|
||||
const semverSatisfies = require('semver/functions/satisfies')
|
||||
const semverMaxSatisfying = require('semver/ranges/max-satisfying')
|
||||
const semverMinSatisfying = require('semver/ranges/min-satisfying')
|
||||
const semverToComparators = require('semver/ranges/to-comparators')
|
||||
const semverMinVersion = require('semver/ranges/min-version')
|
||||
const semverValidRange = require('semver/ranges/valid')
|
||||
const semverOutside = require('semver/ranges/outside')
|
||||
const semverGtr = require('semver/ranges/gtr')
|
||||
const semverLtr = require('semver/ranges/ltr')
|
||||
const semverIntersects = require('semver/ranges/intersects')
|
||||
const simplifyRange = require('semver/ranges/simplify')
|
||||
const rangeSubset = require('semver/ranges/subset')
|
||||
```
|
||||
|
||||
As a command-line utility:
|
||||
|
||||
```
|
||||
$ semver -h
|
||||
|
||||
A JavaScript implementation of the https://semver.org/ specification
|
||||
Copyright Isaac Z. Schlueter
|
||||
|
||||
Usage: semver [options] <version> [<version> [...]]
|
||||
Prints valid versions sorted by SemVer precedence
|
||||
|
||||
Options:
|
||||
-r --range <range>
|
||||
Print versions that match the specified range.
|
||||
|
||||
-i --increment [<level>]
|
||||
Increment a version by the specified level. Level can
|
||||
be one of: major, minor, patch, premajor, preminor,
|
||||
prepatch, or prerelease. Default level is 'patch'.
|
||||
Only one version may be specified.
|
||||
|
||||
--preid <identifier>
|
||||
Identifier to be used to prefix premajor, preminor,
|
||||
prepatch or prerelease version increments.
|
||||
|
||||
-l --loose
|
||||
Interpret versions and ranges loosely
|
||||
|
||||
-n <0|1>
|
||||
This is the base to be used for the prerelease identifier.
|
||||
|
||||
-p --include-prerelease
|
||||
Always include prerelease versions in range matching
|
||||
|
||||
-c --coerce
|
||||
Coerce a string into SemVer if possible
|
||||
(does not imply --loose)
|
||||
|
||||
--rtl
|
||||
Coerce version strings right to left
|
||||
|
||||
--ltr
|
||||
Coerce version strings left to right (default)
|
||||
|
||||
Program exits successfully if any valid version satisfies
|
||||
all supplied ranges, and prints all satisfying versions.
|
||||
|
||||
If no satisfying versions are found, then exits failure.
|
||||
|
||||
Versions are printed in ascending order, so supplying
|
||||
multiple versions to the utility will just sort them.
|
||||
```
|
||||
|
||||
## Versions
|
||||
|
||||
A "version" is described by the `v2.0.0` specification found at
|
||||
<https://semver.org/>.
|
||||
|
||||
A leading `"="` or `"v"` character is stripped off and ignored.
|
||||
|
||||
## Ranges
|
||||
|
||||
A `version range` is a set of `comparators` which specify versions
|
||||
that satisfy the range.
|
||||
|
||||
A `comparator` is composed of an `operator` and a `version`. The set
|
||||
of primitive `operators` is:
|
||||
|
||||
* `<` Less than
|
||||
* `<=` Less than or equal to
|
||||
* `>` Greater than
|
||||
* `>=` Greater than or equal to
|
||||
* `=` Equal. If no operator is specified, then equality is assumed,
|
||||
so this operator is optional, but MAY be included.
|
||||
|
||||
For example, the comparator `>=1.2.7` would match the versions
|
||||
`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
|
||||
or `1.1.0`. The comparator `>1` is equivalent to `>=2.0.0` and
|
||||
would match the versions `2.0.0` and `3.1.0`, but not the versions
|
||||
`1.0.1` or `1.1.0`.
|
||||
|
||||
Comparators can be joined by whitespace to form a `comparator set`,
|
||||
which is satisfied by the **intersection** of all of the comparators
|
||||
it includes.
|
||||
|
||||
A range is composed of one or more comparator sets, joined by `||`. A
|
||||
version matches a range if and only if every comparator in at least
|
||||
one of the `||`-separated comparator sets is satisfied by the version.
|
||||
|
||||
For example, the range `>=1.2.7 <1.3.0` would match the versions
|
||||
`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
|
||||
or `1.1.0`.
|
||||
|
||||
The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
|
||||
`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
|
||||
|
||||
### Prerelease Tags
|
||||
|
||||
If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
|
||||
it will only be allowed to satisfy comparator sets if at least one
|
||||
comparator with the same `[major, minor, patch]` tuple also has a
|
||||
prerelease tag.
|
||||
|
||||
For example, the range `>1.2.3-alpha.3` would be allowed to match the
|
||||
version `1.2.3-alpha.7`, but it would *not* be satisfied by
|
||||
`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
|
||||
than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
|
||||
range only accepts prerelease tags on the `1.2.3` version. The
|
||||
version `3.4.5` *would* satisfy the range, because it does not have a
|
||||
prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
|
||||
|
||||
The purpose for this behavior is twofold. First, prerelease versions
|
||||
frequently are updated very quickly, and contain many breaking changes
|
||||
that are (by the author's design) not yet fit for public consumption.
|
||||
Therefore, by default, they are excluded from range matching
|
||||
semantics.
|
||||
|
||||
Second, a user who has opted into using a prerelease version has
|
||||
clearly indicated the intent to use *that specific* set of
|
||||
alpha/beta/rc versions. By including a prerelease tag in the range,
|
||||
the user is indicating that they are aware of the risk. However, it
|
||||
is still not appropriate to assume that they have opted into taking a
|
||||
similar risk on the *next* set of prerelease versions.
|
||||
|
||||
Note that this behavior can be suppressed (treating all prerelease
|
||||
versions as if they were normal versions, for the purpose of range
|
||||
matching) by setting the `includePrerelease` flag on the options
|
||||
object to any
|
||||
[functions](https://github.com/npm/node-semver#functions) that do
|
||||
range matching.
|
||||
|
||||
#### Prerelease Identifiers
|
||||
|
||||
The method `.inc` takes an additional `identifier` string argument that
|
||||
will append the value of the string as a prerelease identifier:
|
||||
|
||||
```javascript
|
||||
semver.inc('1.2.3', 'prerelease', 'beta')
|
||||
// '1.2.4-beta.0'
|
||||
```
|
||||
|
||||
command-line example:
|
||||
|
||||
```bash
|
||||
$ semver 1.2.3 -i prerelease --preid beta
|
||||
1.2.4-beta.0
|
||||
```
|
||||
|
||||
Which then can be used to increment further:
|
||||
|
||||
```bash
|
||||
$ semver 1.2.4-beta.0 -i prerelease
|
||||
1.2.4-beta.1
|
||||
```
|
||||
|
||||
#### Prerelease Identifier Base
|
||||
|
||||
The method `.inc` takes an optional parameter 'identifierBase' string
|
||||
that will let you let your prerelease number as zero-based or one-based.
|
||||
Set to `false` to omit the prerelease number altogether.
|
||||
If you do not specify this parameter, it will default to zero-based.
|
||||
|
||||
```javascript
|
||||
semver.inc('1.2.3', 'prerelease', 'beta', '1')
|
||||
// '1.2.4-beta.1'
|
||||
```
|
||||
|
||||
```javascript
|
||||
semver.inc('1.2.3', 'prerelease', 'beta', false)
|
||||
// '1.2.4-beta'
|
||||
```
|
||||
|
||||
command-line example:
|
||||
|
||||
```bash
|
||||
$ semver 1.2.3 -i prerelease --preid beta -n 1
|
||||
1.2.4-beta.1
|
||||
```
|
||||
|
||||
```bash
|
||||
$ semver 1.2.3 -i prerelease --preid beta -n false
|
||||
1.2.4-beta
|
||||
```
|
||||
|
||||
### Advanced Range Syntax
|
||||
|
||||
Advanced range syntax desugars to primitive comparators in
|
||||
deterministic ways.
|
||||
|
||||
Advanced ranges may be combined in the same way as primitive
|
||||
comparators using white space or `||`.
|
||||
|
||||
#### Hyphen Ranges `X.Y.Z - A.B.C`
|
||||
|
||||
Specifies an inclusive set.
|
||||
|
||||
* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
|
||||
|
||||
If a partial version is provided as the first version in the inclusive
|
||||
range, then the missing pieces are replaced with zeroes.
|
||||
|
||||
* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
|
||||
|
||||
If a partial version is provided as the second version in the
|
||||
inclusive range, then all versions that start with the supplied parts
|
||||
of the tuple are accepted, but nothing that would be greater than the
|
||||
provided tuple parts.
|
||||
|
||||
* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0`
|
||||
* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0`
|
||||
|
||||
#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
|
||||
|
||||
Any of `X`, `x`, or `*` may be used to "stand in" for one of the
|
||||
numeric values in the `[major, minor, patch]` tuple.
|
||||
|
||||
* `*` := `>=0.0.0` (Any non-prerelease version satisfies, unless
|
||||
`includePrerelease` is specified, in which case any version at all
|
||||
satisfies)
|
||||
* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version)
|
||||
* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions)
|
||||
|
||||
A partial version range is treated as an X-Range, so the special
|
||||
character is in fact optional.
|
||||
|
||||
* `""` (empty string) := `*` := `>=0.0.0`
|
||||
* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0`
|
||||
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0`
|
||||
|
||||
#### Tilde Ranges `~1.2.3` `~1.2` `~1`
|
||||
|
||||
Allows patch-level changes if a minor version is specified on the
|
||||
comparator. Allows minor-level changes if not.
|
||||
|
||||
* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0`
|
||||
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`)
|
||||
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`)
|
||||
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0`
|
||||
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`)
|
||||
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`)
|
||||
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in
|
||||
the `1.2.3` version will be allowed, if they are greater than or
|
||||
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
||||
`1.2.4-beta.2` would not, because it is a prerelease of a
|
||||
different `[major, minor, patch]` tuple.
|
||||
|
||||
#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
|
||||
|
||||
Allows changes that do not modify the left-most non-zero element in the
|
||||
`[major, minor, patch]` tuple. In other words, this allows patch and
|
||||
minor updates for versions `1.0.0` and above, patch updates for
|
||||
versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
|
||||
|
||||
Many authors treat a `0.x` version as if the `x` were the major
|
||||
"breaking-change" indicator.
|
||||
|
||||
Caret ranges are ideal when an author may make breaking changes
|
||||
between `0.2.4` and `0.3.0` releases, which is a common practice.
|
||||
However, it presumes that there will *not* be breaking changes between
|
||||
`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
|
||||
additive (but non-breaking), according to commonly observed practices.
|
||||
|
||||
* `^1.2.3` := `>=1.2.3 <2.0.0-0`
|
||||
* `^0.2.3` := `>=0.2.3 <0.3.0-0`
|
||||
* `^0.0.3` := `>=0.0.3 <0.0.4-0`
|
||||
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in
|
||||
the `1.2.3` version will be allowed, if they are greater than or
|
||||
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
||||
`1.2.4-beta.2` would not, because it is a prerelease of a
|
||||
different `[major, minor, patch]` tuple.
|
||||
* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the
|
||||
`0.0.3` version *only* will be allowed, if they are greater than or
|
||||
equal to `beta`. So, `0.0.3-pr.2` would be allowed.
|
||||
|
||||
When parsing caret ranges, a missing `patch` value desugars to the
|
||||
number `0`, but will allow flexibility within that value, even if the
|
||||
major and minor versions are both `0`.
|
||||
|
||||
* `^1.2.x` := `>=1.2.0 <2.0.0-0`
|
||||
* `^0.0.x` := `>=0.0.0 <0.1.0-0`
|
||||
* `^0.0` := `>=0.0.0 <0.1.0-0`
|
||||
|
||||
A missing `minor` and `patch` values will desugar to zero, but also
|
||||
allow flexibility within those values, even if the major version is
|
||||
zero.
|
||||
|
||||
* `^1.x` := `>=1.0.0 <2.0.0-0`
|
||||
* `^0.x` := `>=0.0.0 <1.0.0-0`
|
||||
|
||||
### Range Grammar
|
||||
|
||||
Putting all this together, here is a Backus-Naur grammar for ranges,
|
||||
for the benefit of parser authors:
|
||||
|
||||
```bnf
|
||||
range-set ::= range ( logical-or range ) *
|
||||
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
|
||||
range ::= hyphen | simple ( ' ' simple ) * | ''
|
||||
hyphen ::= partial ' - ' partial
|
||||
simple ::= primitive | partial | tilde | caret
|
||||
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
|
||||
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
|
||||
xr ::= 'x' | 'X' | '*' | nr
|
||||
nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
|
||||
tilde ::= '~' partial
|
||||
caret ::= '^' partial
|
||||
qualifier ::= ( '-' pre )? ( '+' build )?
|
||||
pre ::= parts
|
||||
build ::= parts
|
||||
parts ::= part ( '.' part ) *
|
||||
part ::= nr | [-0-9A-Za-z]+
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
||||
All methods and classes take a final `options` object argument. All
|
||||
options in this object are `false` by default. The options supported
|
||||
are:
|
||||
|
||||
- `loose` Be more forgiving about not-quite-valid semver strings.
|
||||
(Any resulting output will always be 100% strict compliant, of
|
||||
course.) For backwards compatibility reasons, if the `options`
|
||||
argument is a boolean value instead of an object, it is interpreted
|
||||
to be the `loose` param.
|
||||
- `includePrerelease` Set to suppress the [default
|
||||
behavior](https://github.com/npm/node-semver#prerelease-tags) of
|
||||
excluding prerelease tagged versions from ranges unless they are
|
||||
explicitly opted into.
|
||||
|
||||
Strict-mode Comparators and Ranges will be strict about the SemVer
|
||||
strings that they parse.
|
||||
|
||||
* `valid(v)`: Return the parsed version, or null if it's not valid.
|
||||
* `inc(v, release)`: Return the version incremented by the release
|
||||
type (`major`, `premajor`, `minor`, `preminor`, `patch`,
|
||||
`prepatch`, or `prerelease`), or null if it's not valid
|
||||
* `premajor` in one call will bump the version up to the next major
|
||||
version and down to a prerelease of that major version.
|
||||
`preminor`, and `prepatch` work the same way.
|
||||
* If called from a non-prerelease version, the `prerelease` will work the
|
||||
same as `prepatch`. It increments the patch version, then makes a
|
||||
prerelease. If the input version is already a prerelease it simply
|
||||
increments it.
|
||||
* `prerelease(v)`: Returns an array of prerelease components, or null
|
||||
if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
|
||||
* `major(v)`: Return the major version number.
|
||||
* `minor(v)`: Return the minor version number.
|
||||
* `patch(v)`: Return the patch version number.
|
||||
* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
|
||||
or comparators intersect.
|
||||
* `parse(v)`: Attempt to parse a string as a semantic version, returning either
|
||||
a `SemVer` object or `null`.
|
||||
|
||||
### Comparison
|
||||
|
||||
* `gt(v1, v2)`: `v1 > v2`
|
||||
* `gte(v1, v2)`: `v1 >= v2`
|
||||
* `lt(v1, v2)`: `v1 < v2`
|
||||
* `lte(v1, v2)`: `v1 <= v2`
|
||||
* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
|
||||
even if they're not the exact same string. You already know how to
|
||||
compare strings.
|
||||
* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
|
||||
* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
|
||||
the corresponding function above. `"==="` and `"!=="` do simple
|
||||
string comparison, but are included for completeness. Throws if an
|
||||
invalid comparison string is provided.
|
||||
* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
|
||||
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
|
||||
* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions
|
||||
in descending order when passed to `Array.sort()`.
|
||||
* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions
|
||||
are equal. Sorts in ascending order if passed to `Array.sort()`.
|
||||
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
|
||||
* `diff(v1, v2)`: Returns difference between two versions by the release type
|
||||
(`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
|
||||
or null if the versions are the same.
|
||||
|
||||
### Comparators
|
||||
|
||||
* `intersects(comparator)`: Return true if the comparators intersect
|
||||
|
||||
### Ranges
|
||||
|
||||
* `validRange(range)`: Return the valid range or null if it's not valid
|
||||
* `satisfies(version, range)`: Return true if the version satisfies the
|
||||
range.
|
||||
* `maxSatisfying(versions, range)`: Return the highest version in the list
|
||||
that satisfies the range, or `null` if none of them do.
|
||||
* `minSatisfying(versions, range)`: Return the lowest version in the list
|
||||
that satisfies the range, or `null` if none of them do.
|
||||
* `minVersion(range)`: Return the lowest version that can possibly match
|
||||
the given range.
|
||||
* `gtr(version, range)`: Return `true` if version is greater than all the
|
||||
versions possible in the range.
|
||||
* `ltr(version, range)`: Return `true` if version is less than all the
|
||||
versions possible in the range.
|
||||
* `outside(version, range, hilo)`: Return true if the version is outside
|
||||
the bounds of the range in either the high or low direction. The
|
||||
`hilo` argument must be either the string `'>'` or `'<'`. (This is
|
||||
the function called by `gtr` and `ltr`.)
|
||||
* `intersects(range)`: Return true if any of the ranges comparators intersect
|
||||
* `simplifyRange(versions, range)`: Return a "simplified" range that
|
||||
matches the same items in `versions` list as the range specified. Note
|
||||
that it does *not* guarantee that it would match the same versions in all
|
||||
cases, only for the set of versions provided. This is useful when
|
||||
generating ranges by joining together multiple versions with `||`
|
||||
programmatically, to provide the user with something a bit more
|
||||
ergonomic. If the provided range is shorter in string-length than the
|
||||
generated range, then that is returned.
|
||||
* `subset(subRange, superRange)`: Return `true` if the `subRange` range is
|
||||
entirely contained by the `superRange` range.
|
||||
|
||||
Note that, since ranges may be non-contiguous, a version might not be
|
||||
greater than a range, less than a range, *or* satisfy a range! For
|
||||
example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
|
||||
until `2.0.0`, so the version `1.2.10` would not be greater than the
|
||||
range (because `2.0.1` satisfies, which is higher), nor less than the
|
||||
range (since `1.2.8` satisfies, which is lower), and it also does not
|
||||
satisfy the range.
|
||||
|
||||
If you want to know if a version satisfies or does not satisfy a
|
||||
range, use the `satisfies(version, range)` function.
|
||||
|
||||
### Coercion
|
||||
|
||||
* `coerce(version, options)`: Coerces a string to semver if possible
|
||||
|
||||
This aims to provide a very forgiving translation of a non-semver string to
|
||||
semver. It looks for the first digit in a string, and consumes all
|
||||
remaining characters which satisfy at least a partial semver (e.g., `1`,
|
||||
`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer
|
||||
versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All
|
||||
surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
|
||||
`3.4.0`). Only text which lacks digits will fail coercion (`version one`
|
||||
is not valid). The maximum length for any semver component considered for
|
||||
coercion is 16 characters; longer components will be ignored
|
||||
(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
|
||||
semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
|
||||
components are invalid (`9999999999999999.4.7.4` is likely invalid).
|
||||
|
||||
If the `options.rtl` flag is set, then `coerce` will return the right-most
|
||||
coercible tuple that does not share an ending index with a longer coercible
|
||||
tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not
|
||||
`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of
|
||||
any other overlapping SemVer tuple.
|
||||
|
||||
### Clean
|
||||
|
||||
* `clean(version)`: Clean a string to be a valid semver if possible
|
||||
|
||||
This will return a cleaned and trimmed semver version. If the provided
|
||||
version is not valid a null will be returned. This does not work for
|
||||
ranges.
|
||||
|
||||
ex.
|
||||
* `s.clean(' = v 2.1.5foo')`: `null`
|
||||
* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'`
|
||||
* `s.clean(' = v 2.1.5-foo')`: `null`
|
||||
* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'`
|
||||
* `s.clean('=v2.1.5')`: `'2.1.5'`
|
||||
* `s.clean(' =v2.1.5')`: `2.1.5`
|
||||
* `s.clean(' 2.1.5 ')`: `'2.1.5'`
|
||||
* `s.clean('~1.0.0')`: `null`
|
||||
|
||||
## Constants
|
||||
|
||||
As a convenience, helper constants are exported to provide information about what `node-semver` supports:
|
||||
|
||||
### `RELEASE_TYPES`
|
||||
|
||||
- major
|
||||
- premajor
|
||||
- minor
|
||||
- preminor
|
||||
- patch
|
||||
- prepatch
|
||||
- prerelease
|
||||
|
||||
```
|
||||
const semver = require('semver');
|
||||
|
||||
if (semver.RELEASE_TYPES.includes(arbitraryUserInput)) {
|
||||
console.log('This is a valid release type!');
|
||||
} else {
|
||||
console.warn('This is NOT a valid release type!');
|
||||
}
|
||||
```
|
||||
|
||||
### `SEMVER_SPEC_VERSION`
|
||||
|
||||
2.0.0
|
||||
|
||||
```
|
||||
const semver = require('semver');
|
||||
|
||||
console.log('We are currently using the semver specification version:', semver.SEMVER_SPEC_VERSION);
|
||||
```
|
||||
|
||||
## Exported Modules
|
||||
|
||||
<!--
|
||||
TODO: Make sure that all of these items are documented (classes aren't,
|
||||
eg), and then pull the module name into the documentation for that specific
|
||||
thing.
|
||||
-->
|
||||
|
||||
You may pull in just the part of this semver utility that you need, if you
|
||||
are sensitive to packing and tree-shaking concerns. The main
|
||||
`require('semver')` export uses getter functions to lazily load the parts
|
||||
of the API that are used.
|
||||
|
||||
The following modules are available:
|
||||
|
||||
* `require('semver')`
|
||||
* `require('semver/classes')`
|
||||
* `require('semver/classes/comparator')`
|
||||
* `require('semver/classes/range')`
|
||||
* `require('semver/classes/semver')`
|
||||
* `require('semver/functions/clean')`
|
||||
* `require('semver/functions/cmp')`
|
||||
* `require('semver/functions/coerce')`
|
||||
* `require('semver/functions/compare')`
|
||||
* `require('semver/functions/compare-build')`
|
||||
* `require('semver/functions/compare-loose')`
|
||||
* `require('semver/functions/diff')`
|
||||
* `require('semver/functions/eq')`
|
||||
* `require('semver/functions/gt')`
|
||||
* `require('semver/functions/gte')`
|
||||
* `require('semver/functions/inc')`
|
||||
* `require('semver/functions/lt')`
|
||||
* `require('semver/functions/lte')`
|
||||
* `require('semver/functions/major')`
|
||||
* `require('semver/functions/minor')`
|
||||
* `require('semver/functions/neq')`
|
||||
* `require('semver/functions/parse')`
|
||||
* `require('semver/functions/patch')`
|
||||
* `require('semver/functions/prerelease')`
|
||||
* `require('semver/functions/rcompare')`
|
||||
* `require('semver/functions/rsort')`
|
||||
* `require('semver/functions/satisfies')`
|
||||
* `require('semver/functions/sort')`
|
||||
* `require('semver/functions/valid')`
|
||||
* `require('semver/ranges/gtr')`
|
||||
* `require('semver/ranges/intersects')`
|
||||
* `require('semver/ranges/ltr')`
|
||||
* `require('semver/ranges/max-satisfying')`
|
||||
* `require('semver/ranges/min-satisfying')`
|
||||
* `require('semver/ranges/min-version')`
|
||||
* `require('semver/ranges/outside')`
|
||||
* `require('semver/ranges/to-comparators')`
|
||||
* `require('semver/ranges/valid')`
|
||||
|
197
node_modules/@vue/babel-preset-app/node_modules/semver/bin/semver.js
generated
vendored
Normal file
197
node_modules/@vue/babel-preset-app/node_modules/semver/bin/semver.js
generated
vendored
Normal file
@ -0,0 +1,197 @@
|
||||
#!/usr/bin/env node
|
||||
// Standalone semver comparison program.
|
||||
// Exits successfully and prints matching version(s) if
|
||||
// any supplied version is valid and passes all tests.
|
||||
|
||||
const argv = process.argv.slice(2)
|
||||
|
||||
let versions = []
|
||||
|
||||
const range = []
|
||||
|
||||
let inc = null
|
||||
|
||||
const version = require('../package.json').version
|
||||
|
||||
let loose = false
|
||||
|
||||
let includePrerelease = false
|
||||
|
||||
let coerce = false
|
||||
|
||||
let rtl = false
|
||||
|
||||
let identifier
|
||||
|
||||
let identifierBase
|
||||
|
||||
const semver = require('../')
|
||||
const parseOptions = require('../internal/parse-options')
|
||||
|
||||
let reverse = false
|
||||
|
||||
let options = {}
|
||||
|
||||
const main = () => {
|
||||
if (!argv.length) {
|
||||
return help()
|
||||
}
|
||||
while (argv.length) {
|
||||
let a = argv.shift()
|
||||
const indexOfEqualSign = a.indexOf('=')
|
||||
if (indexOfEqualSign !== -1) {
|
||||
const value = a.slice(indexOfEqualSign + 1)
|
||||
a = a.slice(0, indexOfEqualSign)
|
||||
argv.unshift(value)
|
||||
}
|
||||
switch (a) {
|
||||
case '-rv': case '-rev': case '--rev': case '--reverse':
|
||||
reverse = true
|
||||
break
|
||||
case '-l': case '--loose':
|
||||
loose = true
|
||||
break
|
||||
case '-p': case '--include-prerelease':
|
||||
includePrerelease = true
|
||||
break
|
||||
case '-v': case '--version':
|
||||
versions.push(argv.shift())
|
||||
break
|
||||
case '-i': case '--inc': case '--increment':
|
||||
switch (argv[0]) {
|
||||
case 'major': case 'minor': case 'patch': case 'prerelease':
|
||||
case 'premajor': case 'preminor': case 'prepatch':
|
||||
inc = argv.shift()
|
||||
break
|
||||
default:
|
||||
inc = 'patch'
|
||||
break
|
||||
}
|
||||
break
|
||||
case '--preid':
|
||||
identifier = argv.shift()
|
||||
break
|
||||
case '-r': case '--range':
|
||||
range.push(argv.shift())
|
||||
break
|
||||
case '-n':
|
||||
identifierBase = argv.shift()
|
||||
if (identifierBase === 'false') {
|
||||
identifierBase = false
|
||||
}
|
||||
break
|
||||
case '-c': case '--coerce':
|
||||
coerce = true
|
||||
break
|
||||
case '--rtl':
|
||||
rtl = true
|
||||
break
|
||||
case '--ltr':
|
||||
rtl = false
|
||||
break
|
||||
case '-h': case '--help': case '-?':
|
||||
return help()
|
||||
default:
|
||||
versions.push(a)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
options = parseOptions({ loose, includePrerelease, rtl })
|
||||
|
||||
versions = versions.map((v) => {
|
||||
return coerce ? (semver.coerce(v, options) || { version: v }).version : v
|
||||
}).filter((v) => {
|
||||
return semver.valid(v)
|
||||
})
|
||||
if (!versions.length) {
|
||||
return fail()
|
||||
}
|
||||
if (inc && (versions.length !== 1 || range.length)) {
|
||||
return failInc()
|
||||
}
|
||||
|
||||
for (let i = 0, l = range.length; i < l; i++) {
|
||||
versions = versions.filter((v) => {
|
||||
return semver.satisfies(v, range[i], options)
|
||||
})
|
||||
if (!versions.length) {
|
||||
return fail()
|
||||
}
|
||||
}
|
||||
return success(versions)
|
||||
}
|
||||
|
||||
const failInc = () => {
|
||||
console.error('--inc can only be used on a single version with no range')
|
||||
fail()
|
||||
}
|
||||
|
||||
const fail = () => process.exit(1)
|
||||
|
||||
const success = () => {
|
||||
const compare = reverse ? 'rcompare' : 'compare'
|
||||
versions.sort((a, b) => {
|
||||
return semver[compare](a, b, options)
|
||||
}).map((v) => {
|
||||
return semver.clean(v, options)
|
||||
}).map((v) => {
|
||||
return inc ? semver.inc(v, inc, options, identifier, identifierBase) : v
|
||||
}).forEach((v, i, _) => {
|
||||
console.log(v)
|
||||
})
|
||||
}
|
||||
|
||||
const help = () => console.log(
|
||||
`SemVer ${version}
|
||||
|
||||
A JavaScript implementation of the https://semver.org/ specification
|
||||
Copyright Isaac Z. Schlueter
|
||||
|
||||
Usage: semver [options] <version> [<version> [...]]
|
||||
Prints valid versions sorted by SemVer precedence
|
||||
|
||||
Options:
|
||||
-r --range <range>
|
||||
Print versions that match the specified range.
|
||||
|
||||
-i --increment [<level>]
|
||||
Increment a version by the specified level. Level can
|
||||
be one of: major, minor, patch, premajor, preminor,
|
||||
prepatch, or prerelease. Default level is 'patch'.
|
||||
Only one version may be specified.
|
||||
|
||||
--preid <identifier>
|
||||
Identifier to be used to prefix premajor, preminor,
|
||||
prepatch or prerelease version increments.
|
||||
|
||||
-l --loose
|
||||
Interpret versions and ranges loosely
|
||||
|
||||
-p --include-prerelease
|
||||
Always include prerelease versions in range matching
|
||||
|
||||
-c --coerce
|
||||
Coerce a string into SemVer if possible
|
||||
(does not imply --loose)
|
||||
|
||||
--rtl
|
||||
Coerce version strings right to left
|
||||
|
||||
--ltr
|
||||
Coerce version strings left to right (default)
|
||||
|
||||
-n <base>
|
||||
Base number to be used for the prerelease identifier.
|
||||
Can be either 0 or 1, or false to omit the number altogether.
|
||||
Defaults to 0.
|
||||
|
||||
Program exits successfully if any valid version satisfies
|
||||
all supplied ranges, and prints all satisfying versions.
|
||||
|
||||
If no satisfying versions are found, then exits failure.
|
||||
|
||||
Versions are printed in ascending order, so supplying
|
||||
multiple versions to the utility will just sort them.`)
|
||||
|
||||
main()
|
141
node_modules/@vue/babel-preset-app/node_modules/semver/classes/comparator.js
generated
vendored
Normal file
141
node_modules/@vue/babel-preset-app/node_modules/semver/classes/comparator.js
generated
vendored
Normal file
@ -0,0 +1,141 @@
|
||||
const ANY = Symbol('SemVer ANY')
|
||||
// hoisted class for cyclic dependency
|
||||
class Comparator {
|
||||
static get ANY () {
|
||||
return ANY
|
||||
}
|
||||
|
||||
constructor (comp, options) {
|
||||
options = parseOptions(options)
|
||||
|
||||
if (comp instanceof Comparator) {
|
||||
if (comp.loose === !!options.loose) {
|
||||
return comp
|
||||
} else {
|
||||
comp = comp.value
|
||||
}
|
||||
}
|
||||
|
||||
comp = comp.trim().split(/\s+/).join(' ')
|
||||
debug('comparator', comp, options)
|
||||
this.options = options
|
||||
this.loose = !!options.loose
|
||||
this.parse(comp)
|
||||
|
||||
if (this.semver === ANY) {
|
||||
this.value = ''
|
||||
} else {
|
||||
this.value = this.operator + this.semver.version
|
||||
}
|
||||
|
||||
debug('comp', this)
|
||||
}
|
||||
|
||||
parse (comp) {
|
||||
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
|
||||
const m = comp.match(r)
|
||||
|
||||
if (!m) {
|
||||
throw new TypeError(`Invalid comparator: ${comp}`)
|
||||
}
|
||||
|
||||
this.operator = m[1] !== undefined ? m[1] : ''
|
||||
if (this.operator === '=') {
|
||||
this.operator = ''
|
||||
}
|
||||
|
||||
// if it literally is just '>' or '' then allow anything.
|
||||
if (!m[2]) {
|
||||
this.semver = ANY
|
||||
} else {
|
||||
this.semver = new SemVer(m[2], this.options.loose)
|
||||
}
|
||||
}
|
||||
|
||||
toString () {
|
||||
return this.value
|
||||
}
|
||||
|
||||
test (version) {
|
||||
debug('Comparator.test', version, this.options.loose)
|
||||
|
||||
if (this.semver === ANY || version === ANY) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (typeof version === 'string') {
|
||||
try {
|
||||
version = new SemVer(version, this.options)
|
||||
} catch (er) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return cmp(version, this.operator, this.semver, this.options)
|
||||
}
|
||||
|
||||
intersects (comp, options) {
|
||||
if (!(comp instanceof Comparator)) {
|
||||
throw new TypeError('a Comparator is required')
|
||||
}
|
||||
|
||||
if (this.operator === '') {
|
||||
if (this.value === '') {
|
||||
return true
|
||||
}
|
||||
return new Range(comp.value, options).test(this.value)
|
||||
} else if (comp.operator === '') {
|
||||
if (comp.value === '') {
|
||||
return true
|
||||
}
|
||||
return new Range(this.value, options).test(comp.semver)
|
||||
}
|
||||
|
||||
options = parseOptions(options)
|
||||
|
||||
// Special cases where nothing can possibly be lower
|
||||
if (options.includePrerelease &&
|
||||
(this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {
|
||||
return false
|
||||
}
|
||||
if (!options.includePrerelease &&
|
||||
(this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {
|
||||
return false
|
||||
}
|
||||
|
||||
// Same direction increasing (> or >=)
|
||||
if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {
|
||||
return true
|
||||
}
|
||||
// Same direction decreasing (< or <=)
|
||||
if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {
|
||||
return true
|
||||
}
|
||||
// same SemVer and both sides are inclusive (<= or >=)
|
||||
if (
|
||||
(this.semver.version === comp.semver.version) &&
|
||||
this.operator.includes('=') && comp.operator.includes('=')) {
|
||||
return true
|
||||
}
|
||||
// opposite directions less than
|
||||
if (cmp(this.semver, '<', comp.semver, options) &&
|
||||
this.operator.startsWith('>') && comp.operator.startsWith('<')) {
|
||||
return true
|
||||
}
|
||||
// opposite directions greater than
|
||||
if (cmp(this.semver, '>', comp.semver, options) &&
|
||||
this.operator.startsWith('<') && comp.operator.startsWith('>')) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Comparator
|
||||
|
||||
const parseOptions = require('../internal/parse-options')
|
||||
const { safeRe: re, t } = require('../internal/re')
|
||||
const cmp = require('../functions/cmp')
|
||||
const debug = require('../internal/debug')
|
||||
const SemVer = require('./semver')
|
||||
const Range = require('./range')
|
5
node_modules/@vue/babel-preset-app/node_modules/semver/classes/index.js
generated
vendored
Normal file
5
node_modules/@vue/babel-preset-app/node_modules/semver/classes/index.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
SemVer: require('./semver.js'),
|
||||
Range: require('./range.js'),
|
||||
Comparator: require('./comparator.js'),
|
||||
}
|
539
node_modules/@vue/babel-preset-app/node_modules/semver/classes/range.js
generated
vendored
Normal file
539
node_modules/@vue/babel-preset-app/node_modules/semver/classes/range.js
generated
vendored
Normal file
@ -0,0 +1,539 @@
|
||||
// hoisted class for cyclic dependency
|
||||
class Range {
|
||||
constructor (range, options) {
|
||||
options = parseOptions(options)
|
||||
|
||||
if (range instanceof Range) {
|
||||
if (
|
||||
range.loose === !!options.loose &&
|
||||
range.includePrerelease === !!options.includePrerelease
|
||||
) {
|
||||
return range
|
||||
} else {
|
||||
return new Range(range.raw, options)
|
||||
}
|
||||
}
|
||||
|
||||
if (range instanceof Comparator) {
|
||||
// just put it in the set and return
|
||||
this.raw = range.value
|
||||
this.set = [[range]]
|
||||
this.format()
|
||||
return this
|
||||
}
|
||||
|
||||
this.options = options
|
||||
this.loose = !!options.loose
|
||||
this.includePrerelease = !!options.includePrerelease
|
||||
|
||||
// First reduce all whitespace as much as possible so we do not have to rely
|
||||
// on potentially slow regexes like \s*. This is then stored and used for
|
||||
// future error messages as well.
|
||||
this.raw = range
|
||||
.trim()
|
||||
.split(/\s+/)
|
||||
.join(' ')
|
||||
|
||||
// First, split on ||
|
||||
this.set = this.raw
|
||||
.split('||')
|
||||
// map the range to a 2d array of comparators
|
||||
.map(r => this.parseRange(r.trim()))
|
||||
// throw out any comparator lists that are empty
|
||||
// this generally means that it was not a valid range, which is allowed
|
||||
// in loose mode, but will still throw if the WHOLE range is invalid.
|
||||
.filter(c => c.length)
|
||||
|
||||
if (!this.set.length) {
|
||||
throw new TypeError(`Invalid SemVer Range: ${this.raw}`)
|
||||
}
|
||||
|
||||
// if we have any that are not the null set, throw out null sets.
|
||||
if (this.set.length > 1) {
|
||||
// keep the first one, in case they're all null sets
|
||||
const first = this.set[0]
|
||||
this.set = this.set.filter(c => !isNullSet(c[0]))
|
||||
if (this.set.length === 0) {
|
||||
this.set = [first]
|
||||
} else if (this.set.length > 1) {
|
||||
// if we have any that are *, then the range is just *
|
||||
for (const c of this.set) {
|
||||
if (c.length === 1 && isAny(c[0])) {
|
||||
this.set = [c]
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.format()
|
||||
}
|
||||
|
||||
format () {
|
||||
this.range = this.set
|
||||
.map((comps) => comps.join(' ').trim())
|
||||
.join('||')
|
||||
.trim()
|
||||
return this.range
|
||||
}
|
||||
|
||||
toString () {
|
||||
return this.range
|
||||
}
|
||||
|
||||
parseRange (range) {
|
||||
// memoize range parsing for performance.
|
||||
// this is a very hot path, and fully deterministic.
|
||||
const memoOpts =
|
||||
(this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |
|
||||
(this.options.loose && FLAG_LOOSE)
|
||||
const memoKey = memoOpts + ':' + range
|
||||
const cached = cache.get(memoKey)
|
||||
if (cached) {
|
||||
return cached
|
||||
}
|
||||
|
||||
const loose = this.options.loose
|
||||
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
|
||||
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
|
||||
range = range.replace(hr, hyphenReplace(this.options.includePrerelease))
|
||||
debug('hyphen replace', range)
|
||||
|
||||
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
|
||||
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
|
||||
debug('comparator trim', range)
|
||||
|
||||
// `~ 1.2.3` => `~1.2.3`
|
||||
range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
|
||||
debug('tilde trim', range)
|
||||
|
||||
// `^ 1.2.3` => `^1.2.3`
|
||||
range = range.replace(re[t.CARETTRIM], caretTrimReplace)
|
||||
debug('caret trim', range)
|
||||
|
||||
// At this point, the range is completely trimmed and
|
||||
// ready to be split into comparators.
|
||||
|
||||
let rangeList = range
|
||||
.split(' ')
|
||||
.map(comp => parseComparator(comp, this.options))
|
||||
.join(' ')
|
||||
.split(/\s+/)
|
||||
// >=0.0.0 is equivalent to *
|
||||
.map(comp => replaceGTE0(comp, this.options))
|
||||
|
||||
if (loose) {
|
||||
// in loose mode, throw out any that are not valid comparators
|
||||
rangeList = rangeList.filter(comp => {
|
||||
debug('loose invalid filter', comp, this.options)
|
||||
return !!comp.match(re[t.COMPARATORLOOSE])
|
||||
})
|
||||
}
|
||||
debug('range list', rangeList)
|
||||
|
||||
// if any comparators are the null set, then replace with JUST null set
|
||||
// if more than one comparator, remove any * comparators
|
||||
// also, don't include the same comparator more than once
|
||||
const rangeMap = new Map()
|
||||
const comparators = rangeList.map(comp => new Comparator(comp, this.options))
|
||||
for (const comp of comparators) {
|
||||
if (isNullSet(comp)) {
|
||||
return [comp]
|
||||
}
|
||||
rangeMap.set(comp.value, comp)
|
||||
}
|
||||
if (rangeMap.size > 1 && rangeMap.has('')) {
|
||||
rangeMap.delete('')
|
||||
}
|
||||
|
||||
const result = [...rangeMap.values()]
|
||||
cache.set(memoKey, result)
|
||||
return result
|
||||
}
|
||||
|
||||
intersects (range, options) {
|
||||
if (!(range instanceof Range)) {
|
||||
throw new TypeError('a Range is required')
|
||||
}
|
||||
|
||||
return this.set.some((thisComparators) => {
|
||||
return (
|
||||
isSatisfiable(thisComparators, options) &&
|
||||
range.set.some((rangeComparators) => {
|
||||
return (
|
||||
isSatisfiable(rangeComparators, options) &&
|
||||
thisComparators.every((thisComparator) => {
|
||||
return rangeComparators.every((rangeComparator) => {
|
||||
return thisComparator.intersects(rangeComparator, options)
|
||||
})
|
||||
})
|
||||
)
|
||||
})
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
// if ANY of the sets match ALL of its comparators, then pass
|
||||
test (version) {
|
||||
if (!version) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (typeof version === 'string') {
|
||||
try {
|
||||
version = new SemVer(version, this.options)
|
||||
} catch (er) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.set.length; i++) {
|
||||
if (testSet(this.set[i], version, this.options)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Range
|
||||
|
||||
const LRU = require('lru-cache')
|
||||
const cache = new LRU({ max: 1000 })
|
||||
|
||||
const parseOptions = require('../internal/parse-options')
|
||||
const Comparator = require('./comparator')
|
||||
const debug = require('../internal/debug')
|
||||
const SemVer = require('./semver')
|
||||
const {
|
||||
safeRe: re,
|
||||
t,
|
||||
comparatorTrimReplace,
|
||||
tildeTrimReplace,
|
||||
caretTrimReplace,
|
||||
} = require('../internal/re')
|
||||
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')
|
||||
|
||||
const isNullSet = c => c.value === '<0.0.0-0'
|
||||
const isAny = c => c.value === ''
|
||||
|
||||
// take a set of comparators and determine whether there
|
||||
// exists a version which can satisfy it
|
||||
const isSatisfiable = (comparators, options) => {
|
||||
let result = true
|
||||
const remainingComparators = comparators.slice()
|
||||
let testComparator = remainingComparators.pop()
|
||||
|
||||
while (result && remainingComparators.length) {
|
||||
result = remainingComparators.every((otherComparator) => {
|
||||
return testComparator.intersects(otherComparator, options)
|
||||
})
|
||||
|
||||
testComparator = remainingComparators.pop()
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
// comprised of xranges, tildes, stars, and gtlt's at this point.
|
||||
// already replaced the hyphen ranges
|
||||
// turn into a set of JUST comparators.
|
||||
const parseComparator = (comp, options) => {
|
||||
debug('comp', comp, options)
|
||||
comp = replaceCarets(comp, options)
|
||||
debug('caret', comp)
|
||||
comp = replaceTildes(comp, options)
|
||||
debug('tildes', comp)
|
||||
comp = replaceXRanges(comp, options)
|
||||
debug('xrange', comp)
|
||||
comp = replaceStars(comp, options)
|
||||
debug('stars', comp)
|
||||
return comp
|
||||
}
|
||||
|
||||
const isX = id => !id || id.toLowerCase() === 'x' || id === '*'
|
||||
|
||||
// ~, ~> --> * (any, kinda silly)
|
||||
// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
|
||||
// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
|
||||
// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0
|
||||
// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
|
||||
// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
|
||||
// ~0.0.1 --> >=0.0.1 <0.1.0-0
|
||||
const replaceTildes = (comp, options) => {
|
||||
return comp
|
||||
.trim()
|
||||
.split(/\s+/)
|
||||
.map((c) => replaceTilde(c, options))
|
||||
.join(' ')
|
||||
}
|
||||
|
||||
const replaceTilde = (comp, options) => {
|
||||
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
|
||||
return comp.replace(r, (_, M, m, p, pr) => {
|
||||
debug('tilde', comp, _, M, m, p, pr)
|
||||
let ret
|
||||
|
||||
if (isX(M)) {
|
||||
ret = ''
|
||||
} else if (isX(m)) {
|
||||
ret = `>=${M}.0.0 <${+M + 1}.0.0-0`
|
||||
} else if (isX(p)) {
|
||||
// ~1.2 == >=1.2.0 <1.3.0-0
|
||||
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`
|
||||
} else if (pr) {
|
||||
debug('replaceTilde pr', pr)
|
||||
ret = `>=${M}.${m}.${p}-${pr
|
||||
} <${M}.${+m + 1}.0-0`
|
||||
} else {
|
||||
// ~1.2.3 == >=1.2.3 <1.3.0-0
|
||||
ret = `>=${M}.${m}.${p
|
||||
} <${M}.${+m + 1}.0-0`
|
||||
}
|
||||
|
||||
debug('tilde return', ret)
|
||||
return ret
|
||||
})
|
||||
}
|
||||
|
||||
// ^ --> * (any, kinda silly)
|
||||
// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0
|
||||
// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0
|
||||
// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0
|
||||
// ^1.2.3 --> >=1.2.3 <2.0.0-0
|
||||
// ^1.2.0 --> >=1.2.0 <2.0.0-0
|
||||
// ^0.0.1 --> >=0.0.1 <0.0.2-0
|
||||
// ^0.1.0 --> >=0.1.0 <0.2.0-0
|
||||
const replaceCarets = (comp, options) => {
|
||||
return comp
|
||||
.trim()
|
||||
.split(/\s+/)
|
||||
.map((c) => replaceCaret(c, options))
|
||||
.join(' ')
|
||||
}
|
||||
|
||||
const replaceCaret = (comp, options) => {
|
||||
debug('caret', comp, options)
|
||||
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
|
||||
const z = options.includePrerelease ? '-0' : ''
|
||||
return comp.replace(r, (_, M, m, p, pr) => {
|
||||
debug('caret', comp, _, M, m, p, pr)
|
||||
let ret
|
||||
|
||||
if (isX(M)) {
|
||||
ret = ''
|
||||
} else if (isX(m)) {
|
||||
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`
|
||||
} else if (isX(p)) {
|
||||
if (M === '0') {
|
||||
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`
|
||||
} else {
|
||||
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`
|
||||
}
|
||||
} else if (pr) {
|
||||
debug('replaceCaret pr', pr)
|
||||
if (M === '0') {
|
||||
if (m === '0') {
|
||||
ret = `>=${M}.${m}.${p}-${pr
|
||||
} <${M}.${m}.${+p + 1}-0`
|
||||
} else {
|
||||
ret = `>=${M}.${m}.${p}-${pr
|
||||
} <${M}.${+m + 1}.0-0`
|
||||
}
|
||||
} else {
|
||||
ret = `>=${M}.${m}.${p}-${pr
|
||||
} <${+M + 1}.0.0-0`
|
||||
}
|
||||
} else {
|
||||
debug('no pr')
|
||||
if (M === '0') {
|
||||
if (m === '0') {
|
||||
ret = `>=${M}.${m}.${p
|
||||
}${z} <${M}.${m}.${+p + 1}-0`
|
||||
} else {
|
||||
ret = `>=${M}.${m}.${p
|
||||
}${z} <${M}.${+m + 1}.0-0`
|
||||
}
|
||||
} else {
|
||||
ret = `>=${M}.${m}.${p
|
||||
} <${+M + 1}.0.0-0`
|
||||
}
|
||||
}
|
||||
|
||||
debug('caret return', ret)
|
||||
return ret
|
||||
})
|
||||
}
|
||||
|
||||
const replaceXRanges = (comp, options) => {
|
||||
debug('replaceXRanges', comp, options)
|
||||
return comp
|
||||
.split(/\s+/)
|
||||
.map((c) => replaceXRange(c, options))
|
||||
.join(' ')
|
||||
}
|
||||
|
||||
const replaceXRange = (comp, options) => {
|
||||
comp = comp.trim()
|
||||
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
|
||||
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
||||
debug('xRange', comp, ret, gtlt, M, m, p, pr)
|
||||
const xM = isX(M)
|
||||
const xm = xM || isX(m)
|
||||
const xp = xm || isX(p)
|
||||
const anyX = xp
|
||||
|
||||
if (gtlt === '=' && anyX) {
|
||||
gtlt = ''
|
||||
}
|
||||
|
||||
// if we're including prereleases in the match, then we need
|
||||
// to fix this to -0, the lowest possible prerelease value
|
||||
pr = options.includePrerelease ? '-0' : ''
|
||||
|
||||
if (xM) {
|
||||
if (gtlt === '>' || gtlt === '<') {
|
||||
// nothing is allowed
|
||||
ret = '<0.0.0-0'
|
||||
} else {
|
||||
// nothing is forbidden
|
||||
ret = '*'
|
||||
}
|
||||
} else if (gtlt && anyX) {
|
||||
// we know patch is an x, because we have any x at all.
|
||||
// replace X with 0
|
||||
if (xm) {
|
||||
m = 0
|
||||
}
|
||||
p = 0
|
||||
|
||||
if (gtlt === '>') {
|
||||
// >1 => >=2.0.0
|
||||
// >1.2 => >=1.3.0
|
||||
gtlt = '>='
|
||||
if (xm) {
|
||||
M = +M + 1
|
||||
m = 0
|
||||
p = 0
|
||||
} else {
|
||||
m = +m + 1
|
||||
p = 0
|
||||
}
|
||||
} else if (gtlt === '<=') {
|
||||
// <=0.7.x is actually <0.8.0, since any 0.7.x should
|
||||
// pass. Similarly, <=7.x is actually <8.0.0, etc.
|
||||
gtlt = '<'
|
||||
if (xm) {
|
||||
M = +M + 1
|
||||
} else {
|
||||
m = +m + 1
|
||||
}
|
||||
}
|
||||
|
||||
if (gtlt === '<') {
|
||||
pr = '-0'
|
||||
}
|
||||
|
||||
ret = `${gtlt + M}.${m}.${p}${pr}`
|
||||
} else if (xm) {
|
||||
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`
|
||||
} else if (xp) {
|
||||
ret = `>=${M}.${m}.0${pr
|
||||
} <${M}.${+m + 1}.0-0`
|
||||
}
|
||||
|
||||
debug('xRange return', ret)
|
||||
|
||||
return ret
|
||||
})
|
||||
}
|
||||
|
||||
// Because * is AND-ed with everything else in the comparator,
|
||||
// and '' means "any version", just remove the *s entirely.
|
||||
const replaceStars = (comp, options) => {
|
||||
debug('replaceStars', comp, options)
|
||||
// Looseness is ignored here. star is always as loose as it gets!
|
||||
return comp
|
||||
.trim()
|
||||
.replace(re[t.STAR], '')
|
||||
}
|
||||
|
||||
const replaceGTE0 = (comp, options) => {
|
||||
debug('replaceGTE0', comp, options)
|
||||
return comp
|
||||
.trim()
|
||||
.replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')
|
||||
}
|
||||
|
||||
// This function is passed to string.replace(re[t.HYPHENRANGE])
|
||||
// M, m, patch, prerelease, build
|
||||
// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
|
||||
// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
|
||||
// 1.2 - 3.4 => >=1.2.0 <3.5.0-0
|
||||
const hyphenReplace = incPr => ($0,
|
||||
from, fM, fm, fp, fpr, fb,
|
||||
to, tM, tm, tp, tpr, tb) => {
|
||||
if (isX(fM)) {
|
||||
from = ''
|
||||
} else if (isX(fm)) {
|
||||
from = `>=${fM}.0.0${incPr ? '-0' : ''}`
|
||||
} else if (isX(fp)) {
|
||||
from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`
|
||||
} else if (fpr) {
|
||||
from = `>=${from}`
|
||||
} else {
|
||||
from = `>=${from}${incPr ? '-0' : ''}`
|
||||
}
|
||||
|
||||
if (isX(tM)) {
|
||||
to = ''
|
||||
} else if (isX(tm)) {
|
||||
to = `<${+tM + 1}.0.0-0`
|
||||
} else if (isX(tp)) {
|
||||
to = `<${tM}.${+tm + 1}.0-0`
|
||||
} else if (tpr) {
|
||||
to = `<=${tM}.${tm}.${tp}-${tpr}`
|
||||
} else if (incPr) {
|
||||
to = `<${tM}.${tm}.${+tp + 1}-0`
|
||||
} else {
|
||||
to = `<=${to}`
|
||||
}
|
||||
|
||||
return `${from} ${to}`.trim()
|
||||
}
|
||||
|
||||
const testSet = (set, version, options) => {
|
||||
for (let i = 0; i < set.length; i++) {
|
||||
if (!set[i].test(version)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
if (version.prerelease.length && !options.includePrerelease) {
|
||||
// Find the set of versions that are allowed to have prereleases
|
||||
// For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
|
||||
// That should allow `1.2.3-pr.2` to pass.
|
||||
// However, `1.2.4-alpha.notready` should NOT be allowed,
|
||||
// even though it's within the range set by the comparators.
|
||||
for (let i = 0; i < set.length; i++) {
|
||||
debug(set[i].semver)
|
||||
if (set[i].semver === Comparator.ANY) {
|
||||
continue
|
||||
}
|
||||
|
||||
if (set[i].semver.prerelease.length > 0) {
|
||||
const allowed = set[i].semver
|
||||
if (allowed.major === version.major &&
|
||||
allowed.minor === version.minor &&
|
||||
allowed.patch === version.patch) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Version has a -pre, but it's not one of the ones we like.
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
302
node_modules/@vue/babel-preset-app/node_modules/semver/classes/semver.js
generated
vendored
Normal file
302
node_modules/@vue/babel-preset-app/node_modules/semver/classes/semver.js
generated
vendored
Normal file
@ -0,0 +1,302 @@
|
||||
const debug = require('../internal/debug')
|
||||
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')
|
||||
const { safeRe: re, t } = require('../internal/re')
|
||||
|
||||
const parseOptions = require('../internal/parse-options')
|
||||
const { compareIdentifiers } = require('../internal/identifiers')
|
||||
class SemVer {
|
||||
constructor (version, options) {
|
||||
options = parseOptions(options)
|
||||
|
||||
if (version instanceof SemVer) {
|
||||
if (version.loose === !!options.loose &&
|
||||
version.includePrerelease === !!options.includePrerelease) {
|
||||
return version
|
||||
} else {
|
||||
version = version.version
|
||||
}
|
||||
} else if (typeof version !== 'string') {
|
||||
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
|
||||
}
|
||||
|
||||
if (version.length > MAX_LENGTH) {
|
||||
throw new TypeError(
|
||||
`version is longer than ${MAX_LENGTH} characters`
|
||||
)
|
||||
}
|
||||
|
||||
debug('SemVer', version, options)
|
||||
this.options = options
|
||||
this.loose = !!options.loose
|
||||
// this isn't actually relevant for versions, but keep it so that we
|
||||
// don't run into trouble passing this.options around.
|
||||
this.includePrerelease = !!options.includePrerelease
|
||||
|
||||
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
|
||||
|
||||
if (!m) {
|
||||
throw new TypeError(`Invalid Version: ${version}`)
|
||||
}
|
||||
|
||||
this.raw = version
|
||||
|
||||
// these are actually numbers
|
||||
this.major = +m[1]
|
||||
this.minor = +m[2]
|
||||
this.patch = +m[3]
|
||||
|
||||
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
||||
throw new TypeError('Invalid major version')
|
||||
}
|
||||
|
||||
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
||||
throw new TypeError('Invalid minor version')
|
||||
}
|
||||
|
||||
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
||||
throw new TypeError('Invalid patch version')
|
||||
}
|
||||
|
||||
// numberify any prerelease numeric ids
|
||||
if (!m[4]) {
|
||||
this.prerelease = []
|
||||
} else {
|
||||
this.prerelease = m[4].split('.').map((id) => {
|
||||
if (/^[0-9]+$/.test(id)) {
|
||||
const num = +id
|
||||
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
||||
return num
|
||||
}
|
||||
}
|
||||
return id
|
||||
})
|
||||
}
|
||||
|
||||
this.build = m[5] ? m[5].split('.') : []
|
||||
this.format()
|
||||
}
|
||||
|
||||
format () {
|
||||
this.version = `${this.major}.${this.minor}.${this.patch}`
|
||||
if (this.prerelease.length) {
|
||||
this.version += `-${this.prerelease.join('.')}`
|
||||
}
|
||||
return this.version
|
||||
}
|
||||
|
||||
toString () {
|
||||
return this.version
|
||||
}
|
||||
|
||||
compare (other) {
|
||||
debug('SemVer.compare', this.version, this.options, other)
|
||||
if (!(other instanceof SemVer)) {
|
||||
if (typeof other === 'string' && other === this.version) {
|
||||
return 0
|
||||
}
|
||||
other = new SemVer(other, this.options)
|
||||
}
|
||||
|
||||
if (other.version === this.version) {
|
||||
return 0
|
||||
}
|
||||
|
||||
return this.compareMain(other) || this.comparePre(other)
|
||||
}
|
||||
|
||||
compareMain (other) {
|
||||
if (!(other instanceof SemVer)) {
|
||||
other = new SemVer(other, this.options)
|
||||
}
|
||||
|
||||
return (
|
||||
compareIdentifiers(this.major, other.major) ||
|
||||
compareIdentifiers(this.minor, other.minor) ||
|
||||
compareIdentifiers(this.patch, other.patch)
|
||||
)
|
||||
}
|
||||
|
||||
comparePre (other) {
|
||||
if (!(other instanceof SemVer)) {
|
||||
other = new SemVer(other, this.options)
|
||||
}
|
||||
|
||||
// NOT having a prerelease is > having one
|
||||
if (this.prerelease.length && !other.prerelease.length) {
|
||||
return -1
|
||||
} else if (!this.prerelease.length && other.prerelease.length) {
|
||||
return 1
|
||||
} else if (!this.prerelease.length && !other.prerelease.length) {
|
||||
return 0
|
||||
}
|
||||
|
||||
let i = 0
|
||||
do {
|
||||
const a = this.prerelease[i]
|
||||
const b = other.prerelease[i]
|
||||
debug('prerelease compare', i, a, b)
|
||||
if (a === undefined && b === undefined) {
|
||||
return 0
|
||||
} else if (b === undefined) {
|
||||
return 1
|
||||
} else if (a === undefined) {
|
||||
return -1
|
||||
} else if (a === b) {
|
||||
continue
|
||||
} else {
|
||||
return compareIdentifiers(a, b)
|
||||
}
|
||||
} while (++i)
|
||||
}
|
||||
|
||||
compareBuild (other) {
|
||||
if (!(other instanceof SemVer)) {
|
||||
other = new SemVer(other, this.options)
|
||||
}
|
||||
|
||||
let i = 0
|
||||
do {
|
||||
const a = this.build[i]
|
||||
const b = other.build[i]
|
||||
debug('prerelease compare', i, a, b)
|
||||
if (a === undefined && b === undefined) {
|
||||
return 0
|
||||
} else if (b === undefined) {
|
||||
return 1
|
||||
} else if (a === undefined) {
|
||||
return -1
|
||||
} else if (a === b) {
|
||||
continue
|
||||
} else {
|
||||
return compareIdentifiers(a, b)
|
||||
}
|
||||
} while (++i)
|
||||
}
|
||||
|
||||
// preminor will bump the version up to the next minor release, and immediately
|
||||
// down to pre-release. premajor and prepatch work the same way.
|
||||
inc (release, identifier, identifierBase) {
|
||||
switch (release) {
|
||||
case 'premajor':
|
||||
this.prerelease.length = 0
|
||||
this.patch = 0
|
||||
this.minor = 0
|
||||
this.major++
|
||||
this.inc('pre', identifier, identifierBase)
|
||||
break
|
||||
case 'preminor':
|
||||
this.prerelease.length = 0
|
||||
this.patch = 0
|
||||
this.minor++
|
||||
this.inc('pre', identifier, identifierBase)
|
||||
break
|
||||
case 'prepatch':
|
||||
// If this is already a prerelease, it will bump to the next version
|
||||
// drop any prereleases that might already exist, since they are not
|
||||
// relevant at this point.
|
||||
this.prerelease.length = 0
|
||||
this.inc('patch', identifier, identifierBase)
|
||||
this.inc('pre', identifier, identifierBase)
|
||||
break
|
||||
// If the input is a non-prerelease version, this acts the same as
|
||||
// prepatch.
|
||||
case 'prerelease':
|
||||
if (this.prerelease.length === 0) {
|
||||
this.inc('patch', identifier, identifierBase)
|
||||
}
|
||||
this.inc('pre', identifier, identifierBase)
|
||||
break
|
||||
|
||||
case 'major':
|
||||
// If this is a pre-major version, bump up to the same major version.
|
||||
// Otherwise increment major.
|
||||
// 1.0.0-5 bumps to 1.0.0
|
||||
// 1.1.0 bumps to 2.0.0
|
||||
if (
|
||||
this.minor !== 0 ||
|
||||
this.patch !== 0 ||
|
||||
this.prerelease.length === 0
|
||||
) {
|
||||
this.major++
|
||||
}
|
||||
this.minor = 0
|
||||
this.patch = 0
|
||||
this.prerelease = []
|
||||
break
|
||||
case 'minor':
|
||||
// If this is a pre-minor version, bump up to the same minor version.
|
||||
// Otherwise increment minor.
|
||||
// 1.2.0-5 bumps to 1.2.0
|
||||
// 1.2.1 bumps to 1.3.0
|
||||
if (this.patch !== 0 || this.prerelease.length === 0) {
|
||||
this.minor++
|
||||
}
|
||||
this.patch = 0
|
||||
this.prerelease = []
|
||||
break
|
||||
case 'patch':
|
||||
// If this is not a pre-release version, it will increment the patch.
|
||||
// If it is a pre-release it will bump up to the same patch version.
|
||||
// 1.2.0-5 patches to 1.2.0
|
||||
// 1.2.0 patches to 1.2.1
|
||||
if (this.prerelease.length === 0) {
|
||||
this.patch++
|
||||
}
|
||||
this.prerelease = []
|
||||
break
|
||||
// This probably shouldn't be used publicly.
|
||||
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
||||
case 'pre': {
|
||||
const base = Number(identifierBase) ? 1 : 0
|
||||
|
||||
if (!identifier && identifierBase === false) {
|
||||
throw new Error('invalid increment argument: identifier is empty')
|
||||
}
|
||||
|
||||
if (this.prerelease.length === 0) {
|
||||
this.prerelease = [base]
|
||||
} else {
|
||||
let i = this.prerelease.length
|
||||
while (--i >= 0) {
|
||||
if (typeof this.prerelease[i] === 'number') {
|
||||
this.prerelease[i]++
|
||||
i = -2
|
||||
}
|
||||
}
|
||||
if (i === -1) {
|
||||
// didn't increment anything
|
||||
if (identifier === this.prerelease.join('.') && identifierBase === false) {
|
||||
throw new Error('invalid increment argument: identifier already exists')
|
||||
}
|
||||
this.prerelease.push(base)
|
||||
}
|
||||
}
|
||||
if (identifier) {
|
||||
// 1.2.0-beta.1 bumps to 1.2.0-beta.2,
|
||||
// 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
|
||||
let prerelease = [identifier, base]
|
||||
if (identifierBase === false) {
|
||||
prerelease = [identifier]
|
||||
}
|
||||
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
||||
if (isNaN(this.prerelease[1])) {
|
||||
this.prerelease = prerelease
|
||||
}
|
||||
} else {
|
||||
this.prerelease = prerelease
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
default:
|
||||
throw new Error(`invalid increment argument: ${release}`)
|
||||
}
|
||||
this.raw = this.format()
|
||||
if (this.build.length) {
|
||||
this.raw += `+${this.build.join('.')}`
|
||||
}
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = SemVer
|
6
node_modules/@vue/babel-preset-app/node_modules/semver/functions/clean.js
generated
vendored
Normal file
6
node_modules/@vue/babel-preset-app/node_modules/semver/functions/clean.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
const parse = require('./parse')
|
||||
const clean = (version, options) => {
|
||||
const s = parse(version.trim().replace(/^[=v]+/, ''), options)
|
||||
return s ? s.version : null
|
||||
}
|
||||
module.exports = clean
|
52
node_modules/@vue/babel-preset-app/node_modules/semver/functions/cmp.js
generated
vendored
Normal file
52
node_modules/@vue/babel-preset-app/node_modules/semver/functions/cmp.js
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
const eq = require('./eq')
|
||||
const neq = require('./neq')
|
||||
const gt = require('./gt')
|
||||
const gte = require('./gte')
|
||||
const lt = require('./lt')
|
||||
const lte = require('./lte')
|
||||
|
||||
const cmp = (a, op, b, loose) => {
|
||||
switch (op) {
|
||||
case '===':
|
||||
if (typeof a === 'object') {
|
||||
a = a.version
|
||||
}
|
||||
if (typeof b === 'object') {
|
||||
b = b.version
|
||||
}
|
||||
return a === b
|
||||
|
||||
case '!==':
|
||||
if (typeof a === 'object') {
|
||||
a = a.version
|
||||
}
|
||||
if (typeof b === 'object') {
|
||||
b = b.version
|
||||
}
|
||||
return a !== b
|
||||
|
||||
case '':
|
||||
case '=':
|
||||
case '==':
|
||||
return eq(a, b, loose)
|
||||
|
||||
case '!=':
|
||||
return neq(a, b, loose)
|
||||
|
||||
case '>':
|
||||
return gt(a, b, loose)
|
||||
|
||||
case '>=':
|
||||
return gte(a, b, loose)
|
||||
|
||||
case '<':
|
||||
return lt(a, b, loose)
|
||||
|
||||
case '<=':
|
||||
return lte(a, b, loose)
|
||||
|
||||
default:
|
||||
throw new TypeError(`Invalid operator: ${op}`)
|
||||
}
|
||||
}
|
||||
module.exports = cmp
|
52
node_modules/@vue/babel-preset-app/node_modules/semver/functions/coerce.js
generated
vendored
Normal file
52
node_modules/@vue/babel-preset-app/node_modules/semver/functions/coerce.js
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const parse = require('./parse')
|
||||
const { safeRe: re, t } = require('../internal/re')
|
||||
|
||||
const coerce = (version, options) => {
|
||||
if (version instanceof SemVer) {
|
||||
return version
|
||||
}
|
||||
|
||||
if (typeof version === 'number') {
|
||||
version = String(version)
|
||||
}
|
||||
|
||||
if (typeof version !== 'string') {
|
||||
return null
|
||||
}
|
||||
|
||||
options = options || {}
|
||||
|
||||
let match = null
|
||||
if (!options.rtl) {
|
||||
match = version.match(re[t.COERCE])
|
||||
} else {
|
||||
// Find the right-most coercible string that does not share
|
||||
// a terminus with a more left-ward coercible string.
|
||||
// Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
|
||||
//
|
||||
// Walk through the string checking with a /g regexp
|
||||
// Manually set the index so as to pick up overlapping matches.
|
||||
// Stop when we get a match that ends at the string end, since no
|
||||
// coercible string can be more right-ward without the same terminus.
|
||||
let next
|
||||
while ((next = re[t.COERCERTL].exec(version)) &&
|
||||
(!match || match.index + match[0].length !== version.length)
|
||||
) {
|
||||
if (!match ||
|
||||
next.index + next[0].length !== match.index + match[0].length) {
|
||||
match = next
|
||||
}
|
||||
re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
|
||||
}
|
||||
// leave it in a clean state
|
||||
re[t.COERCERTL].lastIndex = -1
|
||||
}
|
||||
|
||||
if (match === null) {
|
||||
return null
|
||||
}
|
||||
|
||||
return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)
|
||||
}
|
||||
module.exports = coerce
|
7
node_modules/@vue/babel-preset-app/node_modules/semver/functions/compare-build.js
generated
vendored
Normal file
7
node_modules/@vue/babel-preset-app/node_modules/semver/functions/compare-build.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const compareBuild = (a, b, loose) => {
|
||||
const versionA = new SemVer(a, loose)
|
||||
const versionB = new SemVer(b, loose)
|
||||
return versionA.compare(versionB) || versionA.compareBuild(versionB)
|
||||
}
|
||||
module.exports = compareBuild
|
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/compare-loose.js
generated
vendored
Normal file
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/compare-loose.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
const compare = require('./compare')
|
||||
const compareLoose = (a, b) => compare(a, b, true)
|
||||
module.exports = compareLoose
|
5
node_modules/@vue/babel-preset-app/node_modules/semver/functions/compare.js
generated
vendored
Normal file
5
node_modules/@vue/babel-preset-app/node_modules/semver/functions/compare.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const compare = (a, b, loose) =>
|
||||
new SemVer(a, loose).compare(new SemVer(b, loose))
|
||||
|
||||
module.exports = compare
|
65
node_modules/@vue/babel-preset-app/node_modules/semver/functions/diff.js
generated
vendored
Normal file
65
node_modules/@vue/babel-preset-app/node_modules/semver/functions/diff.js
generated
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
const parse = require('./parse.js')
|
||||
|
||||
const diff = (version1, version2) => {
|
||||
const v1 = parse(version1, null, true)
|
||||
const v2 = parse(version2, null, true)
|
||||
const comparison = v1.compare(v2)
|
||||
|
||||
if (comparison === 0) {
|
||||
return null
|
||||
}
|
||||
|
||||
const v1Higher = comparison > 0
|
||||
const highVersion = v1Higher ? v1 : v2
|
||||
const lowVersion = v1Higher ? v2 : v1
|
||||
const highHasPre = !!highVersion.prerelease.length
|
||||
const lowHasPre = !!lowVersion.prerelease.length
|
||||
|
||||
if (lowHasPre && !highHasPre) {
|
||||
// Going from prerelease -> no prerelease requires some special casing
|
||||
|
||||
// If the low version has only a major, then it will always be a major
|
||||
// Some examples:
|
||||
// 1.0.0-1 -> 1.0.0
|
||||
// 1.0.0-1 -> 1.1.1
|
||||
// 1.0.0-1 -> 2.0.0
|
||||
if (!lowVersion.patch && !lowVersion.minor) {
|
||||
return 'major'
|
||||
}
|
||||
|
||||
// Otherwise it can be determined by checking the high version
|
||||
|
||||
if (highVersion.patch) {
|
||||
// anything higher than a patch bump would result in the wrong version
|
||||
return 'patch'
|
||||
}
|
||||
|
||||
if (highVersion.minor) {
|
||||
// anything higher than a minor bump would result in the wrong version
|
||||
return 'minor'
|
||||
}
|
||||
|
||||
// bumping major/minor/patch all have same result
|
||||
return 'major'
|
||||
}
|
||||
|
||||
// add the `pre` prefix if we are going to a prerelease version
|
||||
const prefix = highHasPre ? 'pre' : ''
|
||||
|
||||
if (v1.major !== v2.major) {
|
||||
return prefix + 'major'
|
||||
}
|
||||
|
||||
if (v1.minor !== v2.minor) {
|
||||
return prefix + 'minor'
|
||||
}
|
||||
|
||||
if (v1.patch !== v2.patch) {
|
||||
return prefix + 'patch'
|
||||
}
|
||||
|
||||
// high and low are preleases
|
||||
return 'prerelease'
|
||||
}
|
||||
|
||||
module.exports = diff
|
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/eq.js
generated
vendored
Normal file
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/eq.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
const compare = require('./compare')
|
||||
const eq = (a, b, loose) => compare(a, b, loose) === 0
|
||||
module.exports = eq
|
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/gt.js
generated
vendored
Normal file
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/gt.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
const compare = require('./compare')
|
||||
const gt = (a, b, loose) => compare(a, b, loose) > 0
|
||||
module.exports = gt
|
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/gte.js
generated
vendored
Normal file
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/gte.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
const compare = require('./compare')
|
||||
const gte = (a, b, loose) => compare(a, b, loose) >= 0
|
||||
module.exports = gte
|
19
node_modules/@vue/babel-preset-app/node_modules/semver/functions/inc.js
generated
vendored
Normal file
19
node_modules/@vue/babel-preset-app/node_modules/semver/functions/inc.js
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
|
||||
const inc = (version, release, options, identifier, identifierBase) => {
|
||||
if (typeof (options) === 'string') {
|
||||
identifierBase = identifier
|
||||
identifier = options
|
||||
options = undefined
|
||||
}
|
||||
|
||||
try {
|
||||
return new SemVer(
|
||||
version instanceof SemVer ? version.version : version,
|
||||
options
|
||||
).inc(release, identifier, identifierBase).version
|
||||
} catch (er) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
module.exports = inc
|
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/lt.js
generated
vendored
Normal file
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/lt.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
const compare = require('./compare')
|
||||
const lt = (a, b, loose) => compare(a, b, loose) < 0
|
||||
module.exports = lt
|
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/lte.js
generated
vendored
Normal file
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/lte.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
const compare = require('./compare')
|
||||
const lte = (a, b, loose) => compare(a, b, loose) <= 0
|
||||
module.exports = lte
|
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/major.js
generated
vendored
Normal file
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/major.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const major = (a, loose) => new SemVer(a, loose).major
|
||||
module.exports = major
|
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/minor.js
generated
vendored
Normal file
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/minor.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const minor = (a, loose) => new SemVer(a, loose).minor
|
||||
module.exports = minor
|
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/neq.js
generated
vendored
Normal file
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/neq.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
const compare = require('./compare')
|
||||
const neq = (a, b, loose) => compare(a, b, loose) !== 0
|
||||
module.exports = neq
|
16
node_modules/@vue/babel-preset-app/node_modules/semver/functions/parse.js
generated
vendored
Normal file
16
node_modules/@vue/babel-preset-app/node_modules/semver/functions/parse.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const parse = (version, options, throwErrors = false) => {
|
||||
if (version instanceof SemVer) {
|
||||
return version
|
||||
}
|
||||
try {
|
||||
return new SemVer(version, options)
|
||||
} catch (er) {
|
||||
if (!throwErrors) {
|
||||
return null
|
||||
}
|
||||
throw er
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = parse
|
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/patch.js
generated
vendored
Normal file
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/patch.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const patch = (a, loose) => new SemVer(a, loose).patch
|
||||
module.exports = patch
|
6
node_modules/@vue/babel-preset-app/node_modules/semver/functions/prerelease.js
generated
vendored
Normal file
6
node_modules/@vue/babel-preset-app/node_modules/semver/functions/prerelease.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
const parse = require('./parse')
|
||||
const prerelease = (version, options) => {
|
||||
const parsed = parse(version, options)
|
||||
return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
|
||||
}
|
||||
module.exports = prerelease
|
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/rcompare.js
generated
vendored
Normal file
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/rcompare.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
const compare = require('./compare')
|
||||
const rcompare = (a, b, loose) => compare(b, a, loose)
|
||||
module.exports = rcompare
|
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/rsort.js
generated
vendored
Normal file
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/rsort.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
const compareBuild = require('./compare-build')
|
||||
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))
|
||||
module.exports = rsort
|
10
node_modules/@vue/babel-preset-app/node_modules/semver/functions/satisfies.js
generated
vendored
Normal file
10
node_modules/@vue/babel-preset-app/node_modules/semver/functions/satisfies.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
const Range = require('../classes/range')
|
||||
const satisfies = (version, range, options) => {
|
||||
try {
|
||||
range = new Range(range, options)
|
||||
} catch (er) {
|
||||
return false
|
||||
}
|
||||
return range.test(version)
|
||||
}
|
||||
module.exports = satisfies
|
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/sort.js
generated
vendored
Normal file
3
node_modules/@vue/babel-preset-app/node_modules/semver/functions/sort.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
const compareBuild = require('./compare-build')
|
||||
const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))
|
||||
module.exports = sort
|
6
node_modules/@vue/babel-preset-app/node_modules/semver/functions/valid.js
generated
vendored
Normal file
6
node_modules/@vue/babel-preset-app/node_modules/semver/functions/valid.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
const parse = require('./parse')
|
||||
const valid = (version, options) => {
|
||||
const v = parse(version, options)
|
||||
return v ? v.version : null
|
||||
}
|
||||
module.exports = valid
|
89
node_modules/@vue/babel-preset-app/node_modules/semver/index.js
generated
vendored
Normal file
89
node_modules/@vue/babel-preset-app/node_modules/semver/index.js
generated
vendored
Normal file
@ -0,0 +1,89 @@
|
||||
// just pre-load all the stuff that index.js lazily exports
|
||||
const internalRe = require('./internal/re')
|
||||
const constants = require('./internal/constants')
|
||||
const SemVer = require('./classes/semver')
|
||||
const identifiers = require('./internal/identifiers')
|
||||
const parse = require('./functions/parse')
|
||||
const valid = require('./functions/valid')
|
||||
const clean = require('./functions/clean')
|
||||
const inc = require('./functions/inc')
|
||||
const diff = require('./functions/diff')
|
||||
const major = require('./functions/major')
|
||||
const minor = require('./functions/minor')
|
||||
const patch = require('./functions/patch')
|
||||
const prerelease = require('./functions/prerelease')
|
||||
const compare = require('./functions/compare')
|
||||
const rcompare = require('./functions/rcompare')
|
||||
const compareLoose = require('./functions/compare-loose')
|
||||
const compareBuild = require('./functions/compare-build')
|
||||
const sort = require('./functions/sort')
|
||||
const rsort = require('./functions/rsort')
|
||||
const gt = require('./functions/gt')
|
||||
const lt = require('./functions/lt')
|
||||
const eq = require('./functions/eq')
|
||||
const neq = require('./functions/neq')
|
||||
const gte = require('./functions/gte')
|
||||
const lte = require('./functions/lte')
|
||||
const cmp = require('./functions/cmp')
|
||||
const coerce = require('./functions/coerce')
|
||||
const Comparator = require('./classes/comparator')
|
||||
const Range = require('./classes/range')
|
||||
const satisfies = require('./functions/satisfies')
|
||||
const toComparators = require('./ranges/to-comparators')
|
||||
const maxSatisfying = require('./ranges/max-satisfying')
|
||||
const minSatisfying = require('./ranges/min-satisfying')
|
||||
const minVersion = require('./ranges/min-version')
|
||||
const validRange = require('./ranges/valid')
|
||||
const outside = require('./ranges/outside')
|
||||
const gtr = require('./ranges/gtr')
|
||||
const ltr = require('./ranges/ltr')
|
||||
const intersects = require('./ranges/intersects')
|
||||
const simplifyRange = require('./ranges/simplify')
|
||||
const subset = require('./ranges/subset')
|
||||
module.exports = {
|
||||
parse,
|
||||
valid,
|
||||
clean,
|
||||
inc,
|
||||
diff,
|
||||
major,
|
||||
minor,
|
||||
patch,
|
||||
prerelease,
|
||||
compare,
|
||||
rcompare,
|
||||
compareLoose,
|
||||
compareBuild,
|
||||
sort,
|
||||
rsort,
|
||||
gt,
|
||||
lt,
|
||||
eq,
|
||||
neq,
|
||||
gte,
|
||||
lte,
|
||||
cmp,
|
||||
coerce,
|
||||
Comparator,
|
||||
Range,
|
||||
satisfies,
|
||||
toComparators,
|
||||
maxSatisfying,
|
||||
minSatisfying,
|
||||
minVersion,
|
||||
validRange,
|
||||
outside,
|
||||
gtr,
|
||||
ltr,
|
||||
intersects,
|
||||
simplifyRange,
|
||||
subset,
|
||||
SemVer,
|
||||
re: internalRe.re,
|
||||
src: internalRe.src,
|
||||
tokens: internalRe.t,
|
||||
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
||||
RELEASE_TYPES: constants.RELEASE_TYPES,
|
||||
compareIdentifiers: identifiers.compareIdentifiers,
|
||||
rcompareIdentifiers: identifiers.rcompareIdentifiers,
|
||||
}
|
35
node_modules/@vue/babel-preset-app/node_modules/semver/internal/constants.js
generated
vendored
Normal file
35
node_modules/@vue/babel-preset-app/node_modules/semver/internal/constants.js
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
// Note: this is the semver.org version of the spec that it implements
|
||||
// Not necessarily the package version of this code.
|
||||
const SEMVER_SPEC_VERSION = '2.0.0'
|
||||
|
||||
const MAX_LENGTH = 256
|
||||
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
|
||||
/* istanbul ignore next */ 9007199254740991
|
||||
|
||||
// Max safe segment length for coercion.
|
||||
const MAX_SAFE_COMPONENT_LENGTH = 16
|
||||
|
||||
// Max safe length for a build identifier. The max length minus 6 characters for
|
||||
// the shortest version with a build 0.0.0+BUILD.
|
||||
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
|
||||
|
||||
const RELEASE_TYPES = [
|
||||
'major',
|
||||
'premajor',
|
||||
'minor',
|
||||
'preminor',
|
||||
'patch',
|
||||
'prepatch',
|
||||
'prerelease',
|
||||
]
|
||||
|
||||
module.exports = {
|
||||
MAX_LENGTH,
|
||||
MAX_SAFE_COMPONENT_LENGTH,
|
||||
MAX_SAFE_BUILD_LENGTH,
|
||||
MAX_SAFE_INTEGER,
|
||||
RELEASE_TYPES,
|
||||
SEMVER_SPEC_VERSION,
|
||||
FLAG_INCLUDE_PRERELEASE: 0b001,
|
||||
FLAG_LOOSE: 0b010,
|
||||
}
|
9
node_modules/@vue/babel-preset-app/node_modules/semver/internal/debug.js
generated
vendored
Normal file
9
node_modules/@vue/babel-preset-app/node_modules/semver/internal/debug.js
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
const debug = (
|
||||
typeof process === 'object' &&
|
||||
process.env &&
|
||||
process.env.NODE_DEBUG &&
|
||||
/\bsemver\b/i.test(process.env.NODE_DEBUG)
|
||||
) ? (...args) => console.error('SEMVER', ...args)
|
||||
: () => {}
|
||||
|
||||
module.exports = debug
|
23
node_modules/@vue/babel-preset-app/node_modules/semver/internal/identifiers.js
generated
vendored
Normal file
23
node_modules/@vue/babel-preset-app/node_modules/semver/internal/identifiers.js
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
const numeric = /^[0-9]+$/
|
||||
const compareIdentifiers = (a, b) => {
|
||||
const anum = numeric.test(a)
|
||||
const bnum = numeric.test(b)
|
||||
|
||||
if (anum && bnum) {
|
||||
a = +a
|
||||
b = +b
|
||||
}
|
||||
|
||||
return a === b ? 0
|
||||
: (anum && !bnum) ? -1
|
||||
: (bnum && !anum) ? 1
|
||||
: a < b ? -1
|
||||
: 1
|
||||
}
|
||||
|
||||
const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)
|
||||
|
||||
module.exports = {
|
||||
compareIdentifiers,
|
||||
rcompareIdentifiers,
|
||||
}
|
15
node_modules/@vue/babel-preset-app/node_modules/semver/internal/parse-options.js
generated
vendored
Normal file
15
node_modules/@vue/babel-preset-app/node_modules/semver/internal/parse-options.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
// parse out just the options we care about
|
||||
const looseOption = Object.freeze({ loose: true })
|
||||
const emptyOpts = Object.freeze({ })
|
||||
const parseOptions = options => {
|
||||
if (!options) {
|
||||
return emptyOpts
|
||||
}
|
||||
|
||||
if (typeof options !== 'object') {
|
||||
return looseOption
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
module.exports = parseOptions
|
212
node_modules/@vue/babel-preset-app/node_modules/semver/internal/re.js
generated
vendored
Normal file
212
node_modules/@vue/babel-preset-app/node_modules/semver/internal/re.js
generated
vendored
Normal file
@ -0,0 +1,212 @@
|
||||
const {
|
||||
MAX_SAFE_COMPONENT_LENGTH,
|
||||
MAX_SAFE_BUILD_LENGTH,
|
||||
MAX_LENGTH,
|
||||
} = require('./constants')
|
||||
const debug = require('./debug')
|
||||
exports = module.exports = {}
|
||||
|
||||
// The actual regexps go on exports.re
|
||||
const re = exports.re = []
|
||||
const safeRe = exports.safeRe = []
|
||||
const src = exports.src = []
|
||||
const t = exports.t = {}
|
||||
let R = 0
|
||||
|
||||
const LETTERDASHNUMBER = '[a-zA-Z0-9-]'
|
||||
|
||||
// Replace some greedy regex tokens to prevent regex dos issues. These regex are
|
||||
// used internally via the safeRe object since all inputs in this library get
|
||||
// normalized first to trim and collapse all extra whitespace. The original
|
||||
// regexes are exported for userland consumption and lower level usage. A
|
||||
// future breaking change could export the safer regex only with a note that
|
||||
// all input should have extra whitespace removed.
|
||||
const safeRegexReplacements = [
|
||||
['\\s', 1],
|
||||
['\\d', MAX_LENGTH],
|
||||
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
|
||||
]
|
||||
|
||||
const makeSafeRegex = (value) => {
|
||||
for (const [token, max] of safeRegexReplacements) {
|
||||
value = value
|
||||
.split(`${token}*`).join(`${token}{0,${max}}`)
|
||||
.split(`${token}+`).join(`${token}{1,${max}}`)
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
const createToken = (name, value, isGlobal) => {
|
||||
const safe = makeSafeRegex(value)
|
||||
const index = R++
|
||||
debug(name, index, value)
|
||||
t[name] = index
|
||||
src[index] = value
|
||||
re[index] = new RegExp(value, isGlobal ? 'g' : undefined)
|
||||
safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)
|
||||
}
|
||||
|
||||
// The following Regular Expressions can be used for tokenizing,
|
||||
// validating, and parsing SemVer version strings.
|
||||
|
||||
// ## Numeric Identifier
|
||||
// A single `0`, or a non-zero digit followed by zero or more digits.
|
||||
|
||||
createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*')
|
||||
createToken('NUMERICIDENTIFIERLOOSE', '\\d+')
|
||||
|
||||
// ## Non-numeric Identifier
|
||||
// Zero or more digits, followed by a letter or hyphen, and then zero or
|
||||
// more letters, digits, or hyphens.
|
||||
|
||||
createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)
|
||||
|
||||
// ## Main Version
|
||||
// Three dot-separated numeric identifiers.
|
||||
|
||||
createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
|
||||
`(${src[t.NUMERICIDENTIFIER]})\\.` +
|
||||
`(${src[t.NUMERICIDENTIFIER]})`)
|
||||
|
||||
createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
|
||||
`(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
|
||||
`(${src[t.NUMERICIDENTIFIERLOOSE]})`)
|
||||
|
||||
// ## Pre-release Version Identifier
|
||||
// A numeric identifier, or a non-numeric identifier.
|
||||
|
||||
createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]
|
||||
}|${src[t.NONNUMERICIDENTIFIER]})`)
|
||||
|
||||
createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]
|
||||
}|${src[t.NONNUMERICIDENTIFIER]})`)
|
||||
|
||||
// ## Pre-release Version
|
||||
// Hyphen, followed by one or more dot-separated pre-release version
|
||||
// identifiers.
|
||||
|
||||
createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
|
||||
}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`)
|
||||
|
||||
createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
|
||||
}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)
|
||||
|
||||
// ## Build Metadata Identifier
|
||||
// Any combination of digits, letters, or hyphens.
|
||||
|
||||
createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)
|
||||
|
||||
// ## Build Metadata
|
||||
// Plus sign, followed by one or more period-separated build metadata
|
||||
// identifiers.
|
||||
|
||||
createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]
|
||||
}(?:\\.${src[t.BUILDIDENTIFIER]})*))`)
|
||||
|
||||
// ## Full Version String
|
||||
// A main version, followed optionally by a pre-release version and
|
||||
// build metadata.
|
||||
|
||||
// Note that the only major, minor, patch, and pre-release sections of
|
||||
// the version string are capturing groups. The build metadata is not a
|
||||
// capturing group, because it should not ever be used in version
|
||||
// comparison.
|
||||
|
||||
createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
|
||||
}${src[t.PRERELEASE]}?${
|
||||
src[t.BUILD]}?`)
|
||||
|
||||
createToken('FULL', `^${src[t.FULLPLAIN]}$`)
|
||||
|
||||
// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
|
||||
// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
|
||||
// common in the npm registry.
|
||||
createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
|
||||
}${src[t.PRERELEASELOOSE]}?${
|
||||
src[t.BUILD]}?`)
|
||||
|
||||
createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)
|
||||
|
||||
createToken('GTLT', '((?:<|>)?=?)')
|
||||
|
||||
// Something like "2.*" or "1.2.x".
|
||||
// Note that "x.x" is a valid xRange identifer, meaning "any version"
|
||||
// Only the first item is strictly required.
|
||||
createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`)
|
||||
createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`)
|
||||
|
||||
createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
|
||||
`(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
|
||||
`(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
|
||||
`(?:${src[t.PRERELEASE]})?${
|
||||
src[t.BUILD]}?` +
|
||||
`)?)?`)
|
||||
|
||||
createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
|
||||
`(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
|
||||
`(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
|
||||
`(?:${src[t.PRERELEASELOOSE]})?${
|
||||
src[t.BUILD]}?` +
|
||||
`)?)?`)
|
||||
|
||||
createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`)
|
||||
createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`)
|
||||
|
||||
// Coercion.
|
||||
// Extract anything that could conceivably be a part of a valid semver
|
||||
createToken('COERCE', `${'(^|[^\\d])' +
|
||||
'(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
|
||||
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
|
||||
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
|
||||
`(?:$|[^\\d])`)
|
||||
createToken('COERCERTL', src[t.COERCE], true)
|
||||
|
||||
// Tilde ranges.
|
||||
// Meaning is "reasonably at or greater than"
|
||||
createToken('LONETILDE', '(?:~>?)')
|
||||
|
||||
createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true)
|
||||
exports.tildeTrimReplace = '$1~'
|
||||
|
||||
createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)
|
||||
createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)
|
||||
|
||||
// Caret ranges.
|
||||
// Meaning is "at least and backwards compatible with"
|
||||
createToken('LONECARET', '(?:\\^)')
|
||||
|
||||
createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true)
|
||||
exports.caretTrimReplace = '$1^'
|
||||
|
||||
createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)
|
||||
createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)
|
||||
|
||||
// A simple gt/lt/eq thing, or just "" to indicate "any version"
|
||||
createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`)
|
||||
createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`)
|
||||
|
||||
// An expression to strip any whitespace between the gtlt and the thing
|
||||
// it modifies, so that `> 1.2.3` ==> `>1.2.3`
|
||||
createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
|
||||
}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)
|
||||
exports.comparatorTrimReplace = '$1$2$3'
|
||||
|
||||
// Something like `1.2.3 - 1.2.4`
|
||||
// Note that these all use the loose form, because they'll be
|
||||
// checked against either the strict or loose comparator form
|
||||
// later.
|
||||
createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
|
||||
`\\s+-\\s+` +
|
||||
`(${src[t.XRANGEPLAIN]})` +
|
||||
`\\s*$`)
|
||||
|
||||
createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
|
||||
`\\s+-\\s+` +
|
||||
`(${src[t.XRANGEPLAINLOOSE]})` +
|
||||
`\\s*$`)
|
||||
|
||||
// Star ranges basically just allow anything at all.
|
||||
createToken('STAR', '(<|>)?=?\\s*\\*')
|
||||
// >=0.0.0 is like a star
|
||||
createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$')
|
||||
createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$')
|
118
node_modules/@vue/babel-preset-app/node_modules/semver/package.json
generated
vendored
Normal file
118
node_modules/@vue/babel-preset-app/node_modules/semver/package.json
generated
vendored
Normal file
@ -0,0 +1,118 @@
|
||||
{
|
||||
"_from": "semver@^7.3.4",
|
||||
"_id": "semver@7.5.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
|
||||
"_location": "/@vue/babel-preset-app/semver",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "semver@^7.3.4",
|
||||
"name": "semver",
|
||||
"escapedName": "semver",
|
||||
"rawSpec": "^7.3.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^7.3.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@vue/babel-preset-app"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
|
||||
"_shasum": "483986ec4ed38e1c6c48c34894a9182dbff68a6e",
|
||||
"_spec": "semver@^7.3.4",
|
||||
"_where": "C:\\Users\\zhouxueli\\Desktop\\scheduling-app\\node_modules\\@vue\\babel-preset-app",
|
||||
"author": {
|
||||
"name": "GitHub Inc."
|
||||
},
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/npm/node-semver/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "The semantic version parser used by npm.",
|
||||
"devDependencies": {
|
||||
"@npmcli/eslint-config": "^4.0.0",
|
||||
"@npmcli/template-oss": "4.17.0",
|
||||
"tap": "^16.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"files": [
|
||||
"bin/",
|
||||
"lib/",
|
||||
"classes/",
|
||||
"functions/",
|
||||
"internal/",
|
||||
"ranges/",
|
||||
"index.js",
|
||||
"preload.js",
|
||||
"range.bnf"
|
||||
],
|
||||
"homepage": "https://github.com/npm/node-semver#readme",
|
||||
"license": "ISC",
|
||||
"main": "index.js",
|
||||
"name": "semver",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/npm/node-semver.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint \"**/*.js\"",
|
||||
"lintfix": "npm run lint -- --fix",
|
||||
"postlint": "template-oss-check",
|
||||
"posttest": "npm run lint",
|
||||
"snap": "tap",
|
||||
"template-oss-apply": "template-oss-apply --force",
|
||||
"test": "tap"
|
||||
},
|
||||
"tap": {
|
||||
"timeout": 30,
|
||||
"coverage-map": "map.js",
|
||||
"nyc-arg": [
|
||||
"--exclude",
|
||||
"tap-snapshots/**"
|
||||
]
|
||||
},
|
||||
"templateOSS": {
|
||||
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
||||
"version": "4.17.0",
|
||||
"engines": ">=10",
|
||||
"ciVersions": [
|
||||
"10.0.0",
|
||||
"10.x",
|
||||
"12.x",
|
||||
"14.x",
|
||||
"16.x",
|
||||
"18.x"
|
||||
],
|
||||
"npmSpec": "8",
|
||||
"distPaths": [
|
||||
"classes/",
|
||||
"functions/",
|
||||
"internal/",
|
||||
"ranges/",
|
||||
"index.js",
|
||||
"preload.js",
|
||||
"range.bnf"
|
||||
],
|
||||
"allowPaths": [
|
||||
"/classes/",
|
||||
"/functions/",
|
||||
"/internal/",
|
||||
"/ranges/",
|
||||
"/index.js",
|
||||
"/preload.js",
|
||||
"/range.bnf"
|
||||
],
|
||||
"publish": "true"
|
||||
},
|
||||
"version": "7.5.4"
|
||||
}
|
2
node_modules/@vue/babel-preset-app/node_modules/semver/preload.js
generated
vendored
Normal file
2
node_modules/@vue/babel-preset-app/node_modules/semver/preload.js
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
// XXX remove in v8 or beyond
|
||||
module.exports = require('./index.js')
|
16
node_modules/@vue/babel-preset-app/node_modules/semver/range.bnf
generated
vendored
Normal file
16
node_modules/@vue/babel-preset-app/node_modules/semver/range.bnf
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
range-set ::= range ( logical-or range ) *
|
||||
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
|
||||
range ::= hyphen | simple ( ' ' simple ) * | ''
|
||||
hyphen ::= partial ' - ' partial
|
||||
simple ::= primitive | partial | tilde | caret
|
||||
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
|
||||
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
|
||||
xr ::= 'x' | 'X' | '*' | nr
|
||||
nr ::= '0' | [1-9] ( [0-9] ) *
|
||||
tilde ::= '~' partial
|
||||
caret ::= '^' partial
|
||||
qualifier ::= ( '-' pre )? ( '+' build )?
|
||||
pre ::= parts
|
||||
build ::= parts
|
||||
parts ::= part ( '.' part ) *
|
||||
part ::= nr | [-0-9A-Za-z]+
|
4
node_modules/@vue/babel-preset-app/node_modules/semver/ranges/gtr.js
generated
vendored
Normal file
4
node_modules/@vue/babel-preset-app/node_modules/semver/ranges/gtr.js
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
// Determine if version is greater than all the versions possible in the range.
|
||||
const outside = require('./outside')
|
||||
const gtr = (version, range, options) => outside(version, range, '>', options)
|
||||
module.exports = gtr
|
7
node_modules/@vue/babel-preset-app/node_modules/semver/ranges/intersects.js
generated
vendored
Normal file
7
node_modules/@vue/babel-preset-app/node_modules/semver/ranges/intersects.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
const Range = require('../classes/range')
|
||||
const intersects = (r1, r2, options) => {
|
||||
r1 = new Range(r1, options)
|
||||
r2 = new Range(r2, options)
|
||||
return r1.intersects(r2, options)
|
||||
}
|
||||
module.exports = intersects
|
4
node_modules/@vue/babel-preset-app/node_modules/semver/ranges/ltr.js
generated
vendored
Normal file
4
node_modules/@vue/babel-preset-app/node_modules/semver/ranges/ltr.js
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
const outside = require('./outside')
|
||||
// Determine if version is less than all the versions possible in the range
|
||||
const ltr = (version, range, options) => outside(version, range, '<', options)
|
||||
module.exports = ltr
|
25
node_modules/@vue/babel-preset-app/node_modules/semver/ranges/max-satisfying.js
generated
vendored
Normal file
25
node_modules/@vue/babel-preset-app/node_modules/semver/ranges/max-satisfying.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const Range = require('../classes/range')
|
||||
|
||||
const maxSatisfying = (versions, range, options) => {
|
||||
let max = null
|
||||
let maxSV = null
|
||||
let rangeObj = null
|
||||
try {
|
||||
rangeObj = new Range(range, options)
|
||||
} catch (er) {
|
||||
return null
|
||||
}
|
||||
versions.forEach((v) => {
|
||||
if (rangeObj.test(v)) {
|
||||
// satisfies(v, range, options)
|
||||
if (!max || maxSV.compare(v) === -1) {
|
||||
// compare(max, v, true)
|
||||
max = v
|
||||
maxSV = new SemVer(max, options)
|
||||
}
|
||||
}
|
||||
})
|
||||
return max
|
||||
}
|
||||
module.exports = maxSatisfying
|
24
node_modules/@vue/babel-preset-app/node_modules/semver/ranges/min-satisfying.js
generated
vendored
Normal file
24
node_modules/@vue/babel-preset-app/node_modules/semver/ranges/min-satisfying.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const Range = require('../classes/range')
|
||||
const minSatisfying = (versions, range, options) => {
|
||||
let min = null
|
||||
let minSV = null
|
||||
let rangeObj = null
|
||||
try {
|
||||
rangeObj = new Range(range, options)
|
||||
} catch (er) {
|
||||
return null
|
||||
}
|
||||
versions.forEach((v) => {
|
||||
if (rangeObj.test(v)) {
|
||||
// satisfies(v, range, options)
|
||||
if (!min || minSV.compare(v) === 1) {
|
||||
// compare(min, v, true)
|
||||
min = v
|
||||
minSV = new SemVer(min, options)
|
||||
}
|
||||
}
|
||||
})
|
||||
return min
|
||||
}
|
||||
module.exports = minSatisfying
|
61
node_modules/@vue/babel-preset-app/node_modules/semver/ranges/min-version.js
generated
vendored
Normal file
61
node_modules/@vue/babel-preset-app/node_modules/semver/ranges/min-version.js
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const Range = require('../classes/range')
|
||||
const gt = require('../functions/gt')
|
||||
|
||||
const minVersion = (range, loose) => {
|
||||
range = new Range(range, loose)
|
||||
|
||||
let minver = new SemVer('0.0.0')
|
||||
if (range.test(minver)) {
|
||||
return minver
|
||||
}
|
||||
|
||||
minver = new SemVer('0.0.0-0')
|
||||
if (range.test(minver)) {
|
||||
return minver
|
||||
}
|
||||
|
||||
minver = null
|
||||
for (let i = 0; i < range.set.length; ++i) {
|
||||
const comparators = range.set[i]
|
||||
|
||||
let setMin = null
|
||||
comparators.forEach((comparator) => {
|
||||
// Clone to avoid manipulating the comparator's semver object.
|
||||
const compver = new SemVer(comparator.semver.version)
|
||||
switch (comparator.operator) {
|
||||
case '>':
|
||||
if (compver.prerelease.length === 0) {
|
||||
compver.patch++
|
||||
} else {
|
||||
compver.prerelease.push(0)
|
||||
}
|
||||
compver.raw = compver.format()
|
||||
/* fallthrough */
|
||||
case '':
|
||||
case '>=':
|
||||
if (!setMin || gt(compver, setMin)) {
|
||||
setMin = compver
|
||||
}
|
||||
break
|
||||
case '<':
|
||||
case '<=':
|
||||
/* Ignore maximum versions */
|
||||
break
|
||||
/* istanbul ignore next */
|
||||
default:
|
||||
throw new Error(`Unexpected operation: ${comparator.operator}`)
|
||||
}
|
||||
})
|
||||
if (setMin && (!minver || gt(minver, setMin))) {
|
||||
minver = setMin
|
||||
}
|
||||
}
|
||||
|
||||
if (minver && range.test(minver)) {
|
||||
return minver
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
module.exports = minVersion
|
80
node_modules/@vue/babel-preset-app/node_modules/semver/ranges/outside.js
generated
vendored
Normal file
80
node_modules/@vue/babel-preset-app/node_modules/semver/ranges/outside.js
generated
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
const Comparator = require('../classes/comparator')
|
||||
const { ANY } = Comparator
|
||||
const Range = require('../classes/range')
|
||||
const satisfies = require('../functions/satisfies')
|
||||
const gt = require('../functions/gt')
|
||||
const lt = require('../functions/lt')
|
||||
const lte = require('../functions/lte')
|
||||
const gte = require('../functions/gte')
|
||||
|
||||
const outside = (version, range, hilo, options) => {
|
||||
version = new SemVer(version, options)
|
||||
range = new Range(range, options)
|
||||
|
||||
let gtfn, ltefn, ltfn, comp, ecomp
|
||||
switch (hilo) {
|
||||
case '>':
|
||||
gtfn = gt
|
||||
ltefn = lte
|
||||
ltfn = lt
|
||||
comp = '>'
|
||||
ecomp = '>='
|
||||
break
|
||||
case '<':
|
||||
gtfn = lt
|
||||
ltefn = gte
|
||||
ltfn = gt
|
||||
comp = '<'
|
||||
ecomp = '<='
|
||||
break
|
||||
default:
|
||||
throw new TypeError('Must provide a hilo val of "<" or ">"')
|
||||
}
|
||||
|
||||
// If it satisfies the range it is not outside
|
||||
if (satisfies(version, range, options)) {
|
||||
return false
|
||||
}
|
||||
|
||||
// From now on, variable terms are as if we're in "gtr" mode.
|
||||
// but note that everything is flipped for the "ltr" function.
|
||||
|
||||
for (let i = 0; i < range.set.length; ++i) {
|
||||
const comparators = range.set[i]
|
||||
|
||||
let high = null
|
||||
let low = null
|
||||
|
||||
comparators.forEach((comparator) => {
|
||||
if (comparator.semver === ANY) {
|
||||
comparator = new Comparator('>=0.0.0')
|
||||
}
|
||||
high = high || comparator
|
||||
low = low || comparator
|
||||
if (gtfn(comparator.semver, high.semver, options)) {
|
||||
high = comparator
|
||||
} else if (ltfn(comparator.semver, low.semver, options)) {
|
||||
low = comparator
|
||||
}
|
||||
})
|
||||
|
||||
// If the edge version comparator has a operator then our version
|
||||
// isn't outside it
|
||||
if (high.operator === comp || high.operator === ecomp) {
|
||||
return false
|
||||
}
|
||||
|
||||
// If the lowest version comparator has an operator and our version
|
||||
// is less than it then it isn't higher than the range
|
||||
if ((!low.operator || low.operator === comp) &&
|
||||
ltefn(version, low.semver)) {
|
||||
return false
|
||||
} else if (low.operator === ecomp && ltfn(version, low.semver)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
module.exports = outside
|
47
node_modules/@vue/babel-preset-app/node_modules/semver/ranges/simplify.js
generated
vendored
Normal file
47
node_modules/@vue/babel-preset-app/node_modules/semver/ranges/simplify.js
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
// given a set of versions and a range, create a "simplified" range
|
||||
// that includes the same versions that the original range does
|
||||
// If the original range is shorter than the simplified one, return that.
|
||||
const satisfies = require('../functions/satisfies.js')
|
||||
const compare = require('../functions/compare.js')
|
||||
module.exports = (versions, range, options) => {
|
||||
const set = []
|
||||
let first = null
|
||||
let prev = null
|
||||
const v = versions.sort((a, b) => compare(a, b, options))
|
||||
for (const version of v) {
|
||||
const included = satisfies(version, range, options)
|
||||
if (included) {
|
||||
prev = version
|
||||
if (!first) {
|
||||
first = version
|
||||
}
|
||||
} else {
|
||||
if (prev) {
|
||||
set.push([first, prev])
|
||||
}
|
||||
prev = null
|
||||
first = null
|
||||
}
|
||||
}
|
||||
if (first) {
|
||||
set.push([first, null])
|
||||
}
|
||||
|
||||
const ranges = []
|
||||
for (const [min, max] of set) {
|
||||
if (min === max) {
|
||||
ranges.push(min)
|
||||
} else if (!max && min === v[0]) {
|
||||
ranges.push('*')
|
||||
} else if (!max) {
|
||||
ranges.push(`>=${min}`)
|
||||
} else if (min === v[0]) {
|
||||
ranges.push(`<=${max}`)
|
||||
} else {
|
||||
ranges.push(`${min} - ${max}`)
|
||||
}
|
||||
}
|
||||
const simplified = ranges.join(' || ')
|
||||
const original = typeof range.raw === 'string' ? range.raw : String(range)
|
||||
return simplified.length < original.length ? simplified : range
|
||||
}
|
247
node_modules/@vue/babel-preset-app/node_modules/semver/ranges/subset.js
generated
vendored
Normal file
247
node_modules/@vue/babel-preset-app/node_modules/semver/ranges/subset.js
generated
vendored
Normal file
@ -0,0 +1,247 @@
|
||||
const Range = require('../classes/range.js')
|
||||
const Comparator = require('../classes/comparator.js')
|
||||
const { ANY } = Comparator
|
||||
const satisfies = require('../functions/satisfies.js')
|
||||
const compare = require('../functions/compare.js')
|
||||
|
||||
// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:
|
||||
// - Every simple range `r1, r2, ...` is a null set, OR
|
||||
// - Every simple range `r1, r2, ...` which is not a null set is a subset of
|
||||
// some `R1, R2, ...`
|
||||
//
|
||||
// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:
|
||||
// - If c is only the ANY comparator
|
||||
// - If C is only the ANY comparator, return true
|
||||
// - Else if in prerelease mode, return false
|
||||
// - else replace c with `[>=0.0.0]`
|
||||
// - If C is only the ANY comparator
|
||||
// - if in prerelease mode, return true
|
||||
// - else replace C with `[>=0.0.0]`
|
||||
// - Let EQ be the set of = comparators in c
|
||||
// - If EQ is more than one, return true (null set)
|
||||
// - Let GT be the highest > or >= comparator in c
|
||||
// - Let LT be the lowest < or <= comparator in c
|
||||
// - If GT and LT, and GT.semver > LT.semver, return true (null set)
|
||||
// - If any C is a = range, and GT or LT are set, return false
|
||||
// - If EQ
|
||||
// - If GT, and EQ does not satisfy GT, return true (null set)
|
||||
// - If LT, and EQ does not satisfy LT, return true (null set)
|
||||
// - If EQ satisfies every C, return true
|
||||
// - Else return false
|
||||
// - If GT
|
||||
// - If GT.semver is lower than any > or >= comp in C, return false
|
||||
// - If GT is >=, and GT.semver does not satisfy every C, return false
|
||||
// - If GT.semver has a prerelease, and not in prerelease mode
|
||||
// - If no C has a prerelease and the GT.semver tuple, return false
|
||||
// - If LT
|
||||
// - If LT.semver is greater than any < or <= comp in C, return false
|
||||
// - If LT is <=, and LT.semver does not satisfy every C, return false
|
||||
// - If GT.semver has a prerelease, and not in prerelease mode
|
||||
// - If no C has a prerelease and the LT.semver tuple, return false
|
||||
// - Else return true
|
||||
|
||||
const subset = (sub, dom, options = {}) => {
|
||||
if (sub === dom) {
|
||||
return true
|
||||
}
|
||||
|
||||
sub = new Range(sub, options)
|
||||
dom = new Range(dom, options)
|
||||
let sawNonNull = false
|
||||
|
||||
OUTER: for (const simpleSub of sub.set) {
|
||||
for (const simpleDom of dom.set) {
|
||||
const isSub = simpleSubset(simpleSub, simpleDom, options)
|
||||
sawNonNull = sawNonNull || isSub !== null
|
||||
if (isSub) {
|
||||
continue OUTER
|
||||
}
|
||||
}
|
||||
// the null set is a subset of everything, but null simple ranges in
|
||||
// a complex range should be ignored. so if we saw a non-null range,
|
||||
// then we know this isn't a subset, but if EVERY simple range was null,
|
||||
// then it is a subset.
|
||||
if (sawNonNull) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')]
|
||||
const minimumVersion = [new Comparator('>=0.0.0')]
|
||||
|
||||
const simpleSubset = (sub, dom, options) => {
|
||||
if (sub === dom) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (sub.length === 1 && sub[0].semver === ANY) {
|
||||
if (dom.length === 1 && dom[0].semver === ANY) {
|
||||
return true
|
||||
} else if (options.includePrerelease) {
|
||||
sub = minimumVersionWithPreRelease
|
||||
} else {
|
||||
sub = minimumVersion
|
||||
}
|
||||
}
|
||||
|
||||
if (dom.length === 1 && dom[0].semver === ANY) {
|
||||
if (options.includePrerelease) {
|
||||
return true
|
||||
} else {
|
||||
dom = minimumVersion
|
||||
}
|
||||
}
|
||||
|
||||
const eqSet = new Set()
|
||||
let gt, lt
|
||||
for (const c of sub) {
|
||||
if (c.operator === '>' || c.operator === '>=') {
|
||||
gt = higherGT(gt, c, options)
|
||||
} else if (c.operator === '<' || c.operator === '<=') {
|
||||
lt = lowerLT(lt, c, options)
|
||||
} else {
|
||||
eqSet.add(c.semver)
|
||||
}
|
||||
}
|
||||
|
||||
if (eqSet.size > 1) {
|
||||
return null
|
||||
}
|
||||
|
||||
let gtltComp
|
||||
if (gt && lt) {
|
||||
gtltComp = compare(gt.semver, lt.semver, options)
|
||||
if (gtltComp > 0) {
|
||||
return null
|
||||
} else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
// will iterate one or zero times
|
||||
for (const eq of eqSet) {
|
||||
if (gt && !satisfies(eq, String(gt), options)) {
|
||||
return null
|
||||
}
|
||||
|
||||
if (lt && !satisfies(eq, String(lt), options)) {
|
||||
return null
|
||||
}
|
||||
|
||||
for (const c of dom) {
|
||||
if (!satisfies(eq, String(c), options)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
let higher, lower
|
||||
let hasDomLT, hasDomGT
|
||||
// if the subset has a prerelease, we need a comparator in the superset
|
||||
// with the same tuple and a prerelease, or it's not a subset
|
||||
let needDomLTPre = lt &&
|
||||
!options.includePrerelease &&
|
||||
lt.semver.prerelease.length ? lt.semver : false
|
||||
let needDomGTPre = gt &&
|
||||
!options.includePrerelease &&
|
||||
gt.semver.prerelease.length ? gt.semver : false
|
||||
// exception: <1.2.3-0 is the same as <1.2.3
|
||||
if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&
|
||||
lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {
|
||||
needDomLTPre = false
|
||||
}
|
||||
|
||||
for (const c of dom) {
|
||||
hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='
|
||||
hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='
|
||||
if (gt) {
|
||||
if (needDomGTPre) {
|
||||
if (c.semver.prerelease && c.semver.prerelease.length &&
|
||||
c.semver.major === needDomGTPre.major &&
|
||||
c.semver.minor === needDomGTPre.minor &&
|
||||
c.semver.patch === needDomGTPre.patch) {
|
||||
needDomGTPre = false
|
||||
}
|
||||
}
|
||||
if (c.operator === '>' || c.operator === '>=') {
|
||||
higher = higherGT(gt, c, options)
|
||||
if (higher === c && higher !== gt) {
|
||||
return false
|
||||
}
|
||||
} else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if (lt) {
|
||||
if (needDomLTPre) {
|
||||
if (c.semver.prerelease && c.semver.prerelease.length &&
|
||||
c.semver.major === needDomLTPre.major &&
|
||||
c.semver.minor === needDomLTPre.minor &&
|
||||
c.semver.patch === needDomLTPre.patch) {
|
||||
needDomLTPre = false
|
||||
}
|
||||
}
|
||||
if (c.operator === '<' || c.operator === '<=') {
|
||||
lower = lowerLT(lt, c, options)
|
||||
if (lower === c && lower !== lt) {
|
||||
return false
|
||||
}
|
||||
} else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if (!c.operator && (lt || gt) && gtltComp !== 0) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// if there was a < or >, and nothing in the dom, then must be false
|
||||
// UNLESS it was limited by another range in the other direction.
|
||||
// Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0
|
||||
if (gt && hasDomLT && !lt && gtltComp !== 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (lt && hasDomGT && !gt && gtltComp !== 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
// we needed a prerelease range in a specific tuple, but didn't get one
|
||||
// then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,
|
||||
// because it includes prereleases in the 1.2.3 tuple
|
||||
if (needDomGTPre || needDomLTPre) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// >=1.2.3 is lower than >1.2.3
|
||||
const higherGT = (a, b, options) => {
|
||||
if (!a) {
|
||||
return b
|
||||
}
|
||||
const comp = compare(a.semver, b.semver, options)
|
||||
return comp > 0 ? a
|
||||
: comp < 0 ? b
|
||||
: b.operator === '>' && a.operator === '>=' ? b
|
||||
: a
|
||||
}
|
||||
|
||||
// <=1.2.3 is higher than <1.2.3
|
||||
const lowerLT = (a, b, options) => {
|
||||
if (!a) {
|
||||
return b
|
||||
}
|
||||
const comp = compare(a.semver, b.semver, options)
|
||||
return comp < 0 ? a
|
||||
: comp > 0 ? b
|
||||
: b.operator === '<' && a.operator === '<=' ? b
|
||||
: a
|
||||
}
|
||||
|
||||
module.exports = subset
|
8
node_modules/@vue/babel-preset-app/node_modules/semver/ranges/to-comparators.js
generated
vendored
Normal file
8
node_modules/@vue/babel-preset-app/node_modules/semver/ranges/to-comparators.js
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
const Range = require('../classes/range')
|
||||
|
||||
// Mostly just for testing and legacy API reasons
|
||||
const toComparators = (range, options) =>
|
||||
new Range(range, options).set
|
||||
.map(comp => comp.map(c => c.value).join(' ').trim().split(' '))
|
||||
|
||||
module.exports = toComparators
|
11
node_modules/@vue/babel-preset-app/node_modules/semver/ranges/valid.js
generated
vendored
Normal file
11
node_modules/@vue/babel-preset-app/node_modules/semver/ranges/valid.js
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
const Range = require('../classes/range')
|
||||
const validRange = (range, options) => {
|
||||
try {
|
||||
// Return '*' instead of '' so that truthiness works.
|
||||
// This will throw if it's invalid anyway
|
||||
return new Range(range, options).range || '*'
|
||||
} catch (er) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
module.exports = validRange
|
15
node_modules/@vue/babel-preset-app/node_modules/yallist/LICENSE
generated
vendored
Normal file
15
node_modules/@vue/babel-preset-app/node_modules/yallist/LICENSE
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
204
node_modules/@vue/babel-preset-app/node_modules/yallist/README.md
generated
vendored
Normal file
204
node_modules/@vue/babel-preset-app/node_modules/yallist/README.md
generated
vendored
Normal file
@ -0,0 +1,204 @@
|
||||
# yallist
|
||||
|
||||
Yet Another Linked List
|
||||
|
||||
There are many doubly-linked list implementations like it, but this
|
||||
one is mine.
|
||||
|
||||
For when an array would be too big, and a Map can't be iterated in
|
||||
reverse order.
|
||||
|
||||
|
||||
[](https://travis-ci.org/isaacs/yallist) [](https://coveralls.io/github/isaacs/yallist)
|
||||
|
||||
## basic usage
|
||||
|
||||
```javascript
|
||||
var yallist = require('yallist')
|
||||
var myList = yallist.create([1, 2, 3])
|
||||
myList.push('foo')
|
||||
myList.unshift('bar')
|
||||
// of course pop() and shift() are there, too
|
||||
console.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo']
|
||||
myList.forEach(function (k) {
|
||||
// walk the list head to tail
|
||||
})
|
||||
myList.forEachReverse(function (k, index, list) {
|
||||
// walk the list tail to head
|
||||
})
|
||||
var myDoubledList = myList.map(function (k) {
|
||||
return k + k
|
||||
})
|
||||
// now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo']
|
||||
// mapReverse is also a thing
|
||||
var myDoubledListReverse = myList.mapReverse(function (k) {
|
||||
return k + k
|
||||
}) // ['foofoo', 6, 4, 2, 'barbar']
|
||||
|
||||
var reduced = myList.reduce(function (set, entry) {
|
||||
set += entry
|
||||
return set
|
||||
}, 'start')
|
||||
console.log(reduced) // 'startfoo123bar'
|
||||
```
|
||||
|
||||
## api
|
||||
|
||||
The whole API is considered "public".
|
||||
|
||||
Functions with the same name as an Array method work more or less the
|
||||
same way.
|
||||
|
||||
There's reverse versions of most things because that's the point.
|
||||
|
||||
### Yallist
|
||||
|
||||
Default export, the class that holds and manages a list.
|
||||
|
||||
Call it with either a forEach-able (like an array) or a set of
|
||||
arguments, to initialize the list.
|
||||
|
||||
The Array-ish methods all act like you'd expect. No magic length,
|
||||
though, so if you change that it won't automatically prune or add
|
||||
empty spots.
|
||||
|
||||
### Yallist.create(..)
|
||||
|
||||
Alias for Yallist function. Some people like factories.
|
||||
|
||||
#### yallist.head
|
||||
|
||||
The first node in the list
|
||||
|
||||
#### yallist.tail
|
||||
|
||||
The last node in the list
|
||||
|
||||
#### yallist.length
|
||||
|
||||
The number of nodes in the list. (Change this at your peril. It is
|
||||
not magic like Array length.)
|
||||
|
||||
#### yallist.toArray()
|
||||
|
||||
Convert the list to an array.
|
||||
|
||||
#### yallist.forEach(fn, [thisp])
|
||||
|
||||
Call a function on each item in the list.
|
||||
|
||||
#### yallist.forEachReverse(fn, [thisp])
|
||||
|
||||
Call a function on each item in the list, in reverse order.
|
||||
|
||||
#### yallist.get(n)
|
||||
|
||||
Get the data at position `n` in the list. If you use this a lot,
|
||||
probably better off just using an Array.
|
||||
|
||||
#### yallist.getReverse(n)
|
||||
|
||||
Get the data at position `n`, counting from the tail.
|
||||
|
||||
#### yallist.map(fn, thisp)
|
||||
|
||||
Create a new Yallist with the result of calling the function on each
|
||||
item.
|
||||
|
||||
#### yallist.mapReverse(fn, thisp)
|
||||
|
||||
Same as `map`, but in reverse.
|
||||
|
||||
#### yallist.pop()
|
||||
|
||||
Get the data from the list tail, and remove the tail from the list.
|
||||
|
||||
#### yallist.push(item, ...)
|
||||
|
||||
Insert one or more items to the tail of the list.
|
||||
|
||||
#### yallist.reduce(fn, initialValue)
|
||||
|
||||
Like Array.reduce.
|
||||
|
||||
#### yallist.reduceReverse
|
||||
|
||||
Like Array.reduce, but in reverse.
|
||||
|
||||
#### yallist.reverse
|
||||
|
||||
Reverse the list in place.
|
||||
|
||||
#### yallist.shift()
|
||||
|
||||
Get the data from the list head, and remove the head from the list.
|
||||
|
||||
#### yallist.slice([from], [to])
|
||||
|
||||
Just like Array.slice, but returns a new Yallist.
|
||||
|
||||
#### yallist.sliceReverse([from], [to])
|
||||
|
||||
Just like yallist.slice, but the result is returned in reverse.
|
||||
|
||||
#### yallist.toArray()
|
||||
|
||||
Create an array representation of the list.
|
||||
|
||||
#### yallist.toArrayReverse()
|
||||
|
||||
Create a reversed array representation of the list.
|
||||
|
||||
#### yallist.unshift(item, ...)
|
||||
|
||||
Insert one or more items to the head of the list.
|
||||
|
||||
#### yallist.unshiftNode(node)
|
||||
|
||||
Move a Node object to the front of the list. (That is, pull it out of
|
||||
wherever it lives, and make it the new head.)
|
||||
|
||||
If the node belongs to a different list, then that list will remove it
|
||||
first.
|
||||
|
||||
#### yallist.pushNode(node)
|
||||
|
||||
Move a Node object to the end of the list. (That is, pull it out of
|
||||
wherever it lives, and make it the new tail.)
|
||||
|
||||
If the node belongs to a list already, then that list will remove it
|
||||
first.
|
||||
|
||||
#### yallist.removeNode(node)
|
||||
|
||||
Remove a node from the list, preserving referential integrity of head
|
||||
and tail and other nodes.
|
||||
|
||||
Will throw an error if you try to have a list remove a node that
|
||||
doesn't belong to it.
|
||||
|
||||
### Yallist.Node
|
||||
|
||||
The class that holds the data and is actually the list.
|
||||
|
||||
Call with `var n = new Node(value, previousNode, nextNode)`
|
||||
|
||||
Note that if you do direct operations on Nodes themselves, it's very
|
||||
easy to get into weird states where the list is broken. Be careful :)
|
||||
|
||||
#### node.next
|
||||
|
||||
The next node in the list.
|
||||
|
||||
#### node.prev
|
||||
|
||||
The previous node in the list.
|
||||
|
||||
#### node.value
|
||||
|
||||
The data the node contains.
|
||||
|
||||
#### node.list
|
||||
|
||||
The list to which this node belongs. (Null if it does not belong to
|
||||
any list.)
|
8
node_modules/@vue/babel-preset-app/node_modules/yallist/iterator.js
generated
vendored
Normal file
8
node_modules/@vue/babel-preset-app/node_modules/yallist/iterator.js
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
'use strict'
|
||||
module.exports = function (Yallist) {
|
||||
Yallist.prototype[Symbol.iterator] = function* () {
|
||||
for (let walker = this.head; walker; walker = walker.next) {
|
||||
yield walker.value
|
||||
}
|
||||
}
|
||||
}
|
62
node_modules/@vue/babel-preset-app/node_modules/yallist/package.json
generated
vendored
Normal file
62
node_modules/@vue/babel-preset-app/node_modules/yallist/package.json
generated
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
{
|
||||
"_from": "yallist@^4.0.0",
|
||||
"_id": "yallist@4.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
||||
"_location": "/@vue/babel-preset-app/yallist",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "yallist@^4.0.0",
|
||||
"name": "yallist",
|
||||
"escapedName": "yallist",
|
||||
"rawSpec": "^4.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^4.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@vue/babel-preset-app/lru-cache"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"_shasum": "9bb92790d9c0effec63be73519e11a35019a3a72",
|
||||
"_spec": "yallist@^4.0.0",
|
||||
"_where": "C:\\Users\\zhouxueli\\Desktop\\scheduling-app\\node_modules\\@vue\\babel-preset-app\\node_modules\\lru-cache",
|
||||
"author": {
|
||||
"name": "Isaac Z. Schlueter",
|
||||
"email": "i@izs.me",
|
||||
"url": "http://blog.izs.me/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/isaacs/yallist/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {},
|
||||
"deprecated": false,
|
||||
"description": "Yet Another Linked List",
|
||||
"devDependencies": {
|
||||
"tap": "^12.1.0"
|
||||
},
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"files": [
|
||||
"yallist.js",
|
||||
"iterator.js"
|
||||
],
|
||||
"homepage": "https://github.com/isaacs/yallist#readme",
|
||||
"license": "ISC",
|
||||
"main": "yallist.js",
|
||||
"name": "yallist",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/isaacs/yallist.git"
|
||||
},
|
||||
"scripts": {
|
||||
"postpublish": "git push origin --all; git push origin --tags",
|
||||
"postversion": "npm publish",
|
||||
"preversion": "npm test",
|
||||
"test": "tap test/*.js --100"
|
||||
},
|
||||
"version": "4.0.0"
|
||||
}
|
426
node_modules/@vue/babel-preset-app/node_modules/yallist/yallist.js
generated
vendored
Normal file
426
node_modules/@vue/babel-preset-app/node_modules/yallist/yallist.js
generated
vendored
Normal file
@ -0,0 +1,426 @@
|
||||
'use strict'
|
||||
module.exports = Yallist
|
||||
|
||||
Yallist.Node = Node
|
||||
Yallist.create = Yallist
|
||||
|
||||
function Yallist (list) {
|
||||
var self = this
|
||||
if (!(self instanceof Yallist)) {
|
||||
self = new Yallist()
|
||||
}
|
||||
|
||||
self.tail = null
|
||||
self.head = null
|
||||
self.length = 0
|
||||
|
||||
if (list && typeof list.forEach === 'function') {
|
||||
list.forEach(function (item) {
|
||||
self.push(item)
|
||||
})
|
||||
} else if (arguments.length > 0) {
|
||||
for (var i = 0, l = arguments.length; i < l; i++) {
|
||||
self.push(arguments[i])
|
||||
}
|
||||
}
|
||||
|
||||
return self
|
||||
}
|
||||
|
||||
Yallist.prototype.removeNode = function (node) {
|
||||
if (node.list !== this) {
|
||||
throw new Error('removing node which does not belong to this list')
|
||||
}
|
||||
|
||||
var next = node.next
|
||||
var prev = node.prev
|
||||
|
||||
if (next) {
|
||||
next.prev = prev
|
||||
}
|
||||
|
||||
if (prev) {
|
||||
prev.next = next
|
||||
}
|
||||
|
||||
if (node === this.head) {
|
||||
this.head = next
|
||||
}
|
||||
if (node === this.tail) {
|
||||
this.tail = prev
|
||||
}
|
||||
|
||||
node.list.length--
|
||||
node.next = null
|
||||
node.prev = null
|
||||
node.list = null
|
||||
|
||||
return next
|
||||
}
|
||||
|
||||
Yallist.prototype.unshiftNode = function (node) {
|
||||
if (node === this.head) {
|
||||
return
|
||||
}
|
||||
|
||||
if (node.list) {
|
||||
node.list.removeNode(node)
|
||||
}
|
||||
|
||||
var head = this.head
|
||||
node.list = this
|
||||
node.next = head
|
||||
if (head) {
|
||||
head.prev = node
|
||||
}
|
||||
|
||||
this.head = node
|
||||
if (!this.tail) {
|
||||
this.tail = node
|
||||
}
|
||||
this.length++
|
||||
}
|
||||
|
||||
Yallist.prototype.pushNode = function (node) {
|
||||
if (node === this.tail) {
|
||||
return
|
||||
}
|
||||
|
||||
if (node.list) {
|
||||
node.list.removeNode(node)
|
||||
}
|
||||
|
||||
var tail = this.tail
|
||||
node.list = this
|
||||
node.prev = tail
|
||||
if (tail) {
|
||||
tail.next = node
|
||||
}
|
||||
|
||||
this.tail = node
|
||||
if (!this.head) {
|
||||
this.head = node
|
||||
}
|
||||
this.length++
|
||||
}
|
||||
|
||||
Yallist.prototype.push = function () {
|
||||
for (var i = 0, l = arguments.length; i < l; i++) {
|
||||
push(this, arguments[i])
|
||||
}
|
||||
return this.length
|
||||
}
|
||||
|
||||
Yallist.prototype.unshift = function () {
|
||||
for (var i = 0, l = arguments.length; i < l; i++) {
|
||||
unshift(this, arguments[i])
|
||||
}
|
||||
return this.length
|
||||
}
|
||||
|
||||
Yallist.prototype.pop = function () {
|
||||
if (!this.tail) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
var res = this.tail.value
|
||||
this.tail = this.tail.prev
|
||||
if (this.tail) {
|
||||
this.tail.next = null
|
||||
} else {
|
||||
this.head = null
|
||||
}
|
||||
this.length--
|
||||
return res
|
||||
}
|
||||
|
||||
Yallist.prototype.shift = function () {
|
||||
if (!this.head) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
var res = this.head.value
|
||||
this.head = this.head.next
|
||||
if (this.head) {
|
||||
this.head.prev = null
|
||||
} else {
|
||||
this.tail = null
|
||||
}
|
||||
this.length--
|
||||
return res
|
||||
}
|
||||
|
||||
Yallist.prototype.forEach = function (fn, thisp) {
|
||||
thisp = thisp || this
|
||||
for (var walker = this.head, i = 0; walker !== null; i++) {
|
||||
fn.call(thisp, walker.value, i, this)
|
||||
walker = walker.next
|
||||
}
|
||||
}
|
||||
|
||||
Yallist.prototype.forEachReverse = function (fn, thisp) {
|
||||
thisp = thisp || this
|
||||
for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
|
||||
fn.call(thisp, walker.value, i, this)
|
||||
walker = walker.prev
|
||||
}
|
||||
}
|
||||
|
||||
Yallist.prototype.get = function (n) {
|
||||
for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
|
||||
// abort out of the list early if we hit a cycle
|
||||
walker = walker.next
|
||||
}
|
||||
if (i === n && walker !== null) {
|
||||
return walker.value
|
||||
}
|
||||
}
|
||||
|
||||
Yallist.prototype.getReverse = function (n) {
|
||||
for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
|
||||
// abort out of the list early if we hit a cycle
|
||||
walker = walker.prev
|
||||
}
|
||||
if (i === n && walker !== null) {
|
||||
return walker.value
|
||||
}
|
||||
}
|
||||
|
||||
Yallist.prototype.map = function (fn, thisp) {
|
||||
thisp = thisp || this
|
||||
var res = new Yallist()
|
||||
for (var walker = this.head; walker !== null;) {
|
||||
res.push(fn.call(thisp, walker.value, this))
|
||||
walker = walker.next
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
Yallist.prototype.mapReverse = function (fn, thisp) {
|
||||
thisp = thisp || this
|
||||
var res = new Yallist()
|
||||
for (var walker = this.tail; walker !== null;) {
|
||||
res.push(fn.call(thisp, walker.value, this))
|
||||
walker = walker.prev
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
Yallist.prototype.reduce = function (fn, initial) {
|
||||
var acc
|
||||
var walker = this.head
|
||||
if (arguments.length > 1) {
|
||||
acc = initial
|
||||
} else if (this.head) {
|
||||
walker = this.head.next
|
||||
acc = this.head.value
|
||||
} else {
|
||||
throw new TypeError('Reduce of empty list with no initial value')
|
||||
}
|
||||
|
||||
for (var i = 0; walker !== null; i++) {
|
||||
acc = fn(acc, walker.value, i)
|
||||
walker = walker.next
|
||||
}
|
||||
|
||||
return acc
|
||||
}
|
||||
|
||||
Yallist.prototype.reduceReverse = function (fn, initial) {
|
||||
var acc
|
||||
var walker = this.tail
|
||||
if (arguments.length > 1) {
|
||||
acc = initial
|
||||
} else if (this.tail) {
|
||||
walker = this.tail.prev
|
||||
acc = this.tail.value
|
||||
} else {
|
||||
throw new TypeError('Reduce of empty list with no initial value')
|
||||
}
|
||||
|
||||
for (var i = this.length - 1; walker !== null; i--) {
|
||||
acc = fn(acc, walker.value, i)
|
||||
walker = walker.prev
|
||||
}
|
||||
|
||||
return acc
|
||||
}
|
||||
|
||||
Yallist.prototype.toArray = function () {
|
||||
var arr = new Array(this.length)
|
||||
for (var i = 0, walker = this.head; walker !== null; i++) {
|
||||
arr[i] = walker.value
|
||||
walker = walker.next
|
||||
}
|
||||
return arr
|
||||
}
|
||||
|
||||
Yallist.prototype.toArrayReverse = function () {
|
||||
var arr = new Array(this.length)
|
||||
for (var i = 0, walker = this.tail; walker !== null; i++) {
|
||||
arr[i] = walker.value
|
||||
walker = walker.prev
|
||||
}
|
||||
return arr
|
||||
}
|
||||
|
||||
Yallist.prototype.slice = function (from, to) {
|
||||
to = to || this.length
|
||||
if (to < 0) {
|
||||
to += this.length
|
||||
}
|
||||
from = from || 0
|
||||
if (from < 0) {
|
||||
from += this.length
|
||||
}
|
||||
var ret = new Yallist()
|
||||
if (to < from || to < 0) {
|
||||
return ret
|
||||
}
|
||||
if (from < 0) {
|
||||
from = 0
|
||||
}
|
||||
if (to > this.length) {
|
||||
to = this.length
|
||||
}
|
||||
for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
|
||||
walker = walker.next
|
||||
}
|
||||
for (; walker !== null && i < to; i++, walker = walker.next) {
|
||||
ret.push(walker.value)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
Yallist.prototype.sliceReverse = function (from, to) {
|
||||
to = to || this.length
|
||||
if (to < 0) {
|
||||
to += this.length
|
||||
}
|
||||
from = from || 0
|
||||
if (from < 0) {
|
||||
from += this.length
|
||||
}
|
||||
var ret = new Yallist()
|
||||
if (to < from || to < 0) {
|
||||
return ret
|
||||
}
|
||||
if (from < 0) {
|
||||
from = 0
|
||||
}
|
||||
if (to > this.length) {
|
||||
to = this.length
|
||||
}
|
||||
for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
|
||||
walker = walker.prev
|
||||
}
|
||||
for (; walker !== null && i > from; i--, walker = walker.prev) {
|
||||
ret.push(walker.value)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
Yallist.prototype.splice = function (start, deleteCount, ...nodes) {
|
||||
if (start > this.length) {
|
||||
start = this.length - 1
|
||||
}
|
||||
if (start < 0) {
|
||||
start = this.length + start;
|
||||
}
|
||||
|
||||
for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
|
||||
walker = walker.next
|
||||
}
|
||||
|
||||
var ret = []
|
||||
for (var i = 0; walker && i < deleteCount; i++) {
|
||||
ret.push(walker.value)
|
||||
walker = this.removeNode(walker)
|
||||
}
|
||||
if (walker === null) {
|
||||
walker = this.tail
|
||||
}
|
||||
|
||||
if (walker !== this.head && walker !== this.tail) {
|
||||
walker = walker.prev
|
||||
}
|
||||
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
walker = insert(this, walker, nodes[i])
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Yallist.prototype.reverse = function () {
|
||||
var head = this.head
|
||||
var tail = this.tail
|
||||
for (var walker = head; walker !== null; walker = walker.prev) {
|
||||
var p = walker.prev
|
||||
walker.prev = walker.next
|
||||
walker.next = p
|
||||
}
|
||||
this.head = tail
|
||||
this.tail = head
|
||||
return this
|
||||
}
|
||||
|
||||
function insert (self, node, value) {
|
||||
var inserted = node === self.head ?
|
||||
new Node(value, null, node, self) :
|
||||
new Node(value, node, node.next, self)
|
||||
|
||||
if (inserted.next === null) {
|
||||
self.tail = inserted
|
||||
}
|
||||
if (inserted.prev === null) {
|
||||
self.head = inserted
|
||||
}
|
||||
|
||||
self.length++
|
||||
|
||||
return inserted
|
||||
}
|
||||
|
||||
function push (self, item) {
|
||||
self.tail = new Node(item, self.tail, null, self)
|
||||
if (!self.head) {
|
||||
self.head = self.tail
|
||||
}
|
||||
self.length++
|
||||
}
|
||||
|
||||
function unshift (self, item) {
|
||||
self.head = new Node(item, null, self.head, self)
|
||||
if (!self.tail) {
|
||||
self.tail = self.head
|
||||
}
|
||||
self.length++
|
||||
}
|
||||
|
||||
function Node (value, prev, next, list) {
|
||||
if (!(this instanceof Node)) {
|
||||
return new Node(value, prev, next, list)
|
||||
}
|
||||
|
||||
this.list = list
|
||||
this.value = value
|
||||
|
||||
if (prev) {
|
||||
prev.next = this
|
||||
this.prev = prev
|
||||
} else {
|
||||
this.prev = null
|
||||
}
|
||||
|
||||
if (next) {
|
||||
next.prev = this
|
||||
this.next = next
|
||||
} else {
|
||||
this.next = null
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
// add if support for Symbol.iterator is present
|
||||
require('./iterator.js')(Yallist)
|
||||
} catch (er) {}
|
84
node_modules/@vue/babel-preset-app/package.json
generated
vendored
Normal file
84
node_modules/@vue/babel-preset-app/package.json
generated
vendored
Normal file
@ -0,0 +1,84 @@
|
||||
{
|
||||
"_from": "@vue/babel-preset-app@^5.0.8",
|
||||
"_id": "@vue/babel-preset-app@5.0.8",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-yl+5qhpjd8e1G4cMXfORkkBlvtPCIgmRf3IYCWYDKIQ7m+PPa5iTm4feiNmCMD6yGqQWMhhK/7M3oWGL9boKwg==",
|
||||
"_location": "/@vue/babel-preset-app",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@vue/babel-preset-app@^5.0.8",
|
||||
"name": "@vue/babel-preset-app",
|
||||
"escapedName": "@vue%2fbabel-preset-app",
|
||||
"scope": "@vue",
|
||||
"rawSpec": "^5.0.8",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^5.0.8"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@vue/cli-plugin-babel"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@vue/babel-preset-app/-/babel-preset-app-5.0.8.tgz",
|
||||
"_shasum": "ce38f76314f5265d62a89756ef264c21f1d351a1",
|
||||
"_spec": "@vue/babel-preset-app@^5.0.8",
|
||||
"_where": "C:\\Users\\zhouxueli\\Desktop\\scheduling-app\\node_modules\\@vue\\cli-plugin-babel",
|
||||
"author": {
|
||||
"name": "Evan You"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/vue-cli/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.12.16",
|
||||
"@babel/helper-compilation-targets": "^7.12.16",
|
||||
"@babel/helper-module-imports": "^7.12.13",
|
||||
"@babel/plugin-proposal-class-properties": "^7.12.13",
|
||||
"@babel/plugin-proposal-decorators": "^7.12.13",
|
||||
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
||||
"@babel/plugin-syntax-jsx": "^7.12.13",
|
||||
"@babel/plugin-transform-runtime": "^7.12.15",
|
||||
"@babel/preset-env": "^7.12.16",
|
||||
"@babel/runtime": "^7.12.13",
|
||||
"@vue/babel-plugin-jsx": "^1.0.3",
|
||||
"@vue/babel-preset-jsx": "^1.1.2",
|
||||
"babel-plugin-dynamic-import-node": "^2.3.3",
|
||||
"core-js": "^3.8.3",
|
||||
"core-js-compat": "^3.8.3",
|
||||
"semver": "^7.3.4"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "babel-preset-app for vue-cli",
|
||||
"gitHead": "b154dbd7aca4b4538e6c483b1d4b817499d7b8eb",
|
||||
"homepage": "https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/babel-preset-app#readme",
|
||||
"keywords": [
|
||||
"vue",
|
||||
"cli"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "@vue/babel-preset-app",
|
||||
"peerDependencies": {
|
||||
"@babel/core": "*",
|
||||
"core-js": "^3",
|
||||
"vue": "^2 || ^3.2.13"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"core-js": {
|
||||
"optional": true
|
||||
},
|
||||
"vue": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/vue-cli.git",
|
||||
"directory": "packages/@vue/babel-preset-app"
|
||||
},
|
||||
"version": "5.0.8"
|
||||
}
|
43
node_modules/@vue/babel-preset-app/polyfillsPlugin.js
generated
vendored
Normal file
43
node_modules/@vue/babel-preset-app/polyfillsPlugin.js
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
const { addSideEffect } = require('@babel/helper-module-imports')
|
||||
|
||||
// slightly modifiled from @babel/preset-env/src/utils
|
||||
// use an absolute path for core-js modules, to fix conflicts of different core-js versions
|
||||
// TODO: remove the `useAbsolutePath` option in v5,
|
||||
// because `core-js` is sure to be present in newer projects;
|
||||
// we only need absolute path for babel runtime helpers, not for polyfills
|
||||
function getModulePath (mod, useAbsolutePath) {
|
||||
const modPath =
|
||||
mod === 'regenerator-runtime'
|
||||
? 'regenerator-runtime/runtime'
|
||||
: `core-js/modules/${mod}`
|
||||
return useAbsolutePath ? require.resolve(modPath) : modPath
|
||||
}
|
||||
|
||||
function createImport (path, mod, useAbsolutePath) {
|
||||
return addSideEffect(path, getModulePath(mod, useAbsolutePath))
|
||||
}
|
||||
|
||||
// add polyfill imports to the first file encountered.
|
||||
module.exports = (
|
||||
{ types },
|
||||
{ polyfills, entryFiles = [], useAbsolutePath }
|
||||
) => {
|
||||
return {
|
||||
name: 'vue-cli-inject-polyfills',
|
||||
visitor: {
|
||||
Program (path, state) {
|
||||
if (!entryFiles.includes(state.filename)) {
|
||||
return
|
||||
}
|
||||
|
||||
// imports are injected in reverse order
|
||||
polyfills
|
||||
.slice()
|
||||
.reverse()
|
||||
.forEach(p => {
|
||||
createImport(path, p, useAbsolutePath)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
56
node_modules/@vue/babel-preset-jsx/README.md
generated
vendored
Normal file
56
node_modules/@vue/babel-preset-jsx/README.md
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
## @vue/babel-preset-jsx
|
||||
|
||||
Configurable preset for Vue JSX plugins.
|
||||
|
||||
### Babel Compatibility Notes
|
||||
|
||||
- This repo is only compatible with Babel 7.x, for 6.x please use [vuejs/babel-plugin-transform-vue-jsx](https://github.com/vuejs/babel-plugin-transform-vue-jsx)
|
||||
|
||||
### Usage
|
||||
|
||||
Install the dependencies:
|
||||
|
||||
```sh
|
||||
# for yarn:
|
||||
yarn add @vue/babel-preset-jsx @vue/babel-helper-vue-jsx-merge-props
|
||||
# for npm:
|
||||
npm install @vue/babel-preset-jsx @vue/babel-helper-vue-jsx-merge-props --save
|
||||
```
|
||||
|
||||
In your `babel.config.js`:
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
presets: ['@vue/babel-preset-jsx'],
|
||||
}
|
||||
```
|
||||
|
||||
You can toggle specific features, by default all features (except `compositionAPI`) are enabled, e.g.:
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
presets: [
|
||||
[
|
||||
'@vue/babel-preset-jsx',
|
||||
{
|
||||
vModel: false,
|
||||
compositionAPI: true,
|
||||
},
|
||||
],
|
||||
],
|
||||
}
|
||||
```
|
||||
|
||||
Options are:
|
||||
|
||||
- `compositionAPI` - Enables [@vue/babel-sugar-composition-api-inject-h](../babel-sugar-composition-api-inject-h) and [@vue/babel-sugar-composition-api-render-instance](../babel-sugar-composition-api-render-instance), support returning render function in `setup`.
|
||||
- The default value is `false`;
|
||||
- When set to `'auto'` (or `true`), it will detect the Vue version in the project. If it's >= 2.7, it will import the composition utilities from `vue`, otherwise from `@vue/composition-api`;
|
||||
- When set to `'native'` (or `'naruto'`), it will always import the composition utilities from `vue`
|
||||
- When set to `plugin`, it will always import the composition utilities from `@vue/composition-api`, but it will redirect to `'vue'` itself when the vue version is `2.7.x`
|
||||
- When set to `vue-demi`, it will always import the composition utilities from `vue-demi`
|
||||
- When set to an object like `{ importSource: string; }`, it will always import the composition utilities from the importSource you set
|
||||
- `functional` [@vue/babel-sugar-functional-vue](../babel-sugar-functional-vue/README.md) - Functional components syntactic sugar
|
||||
- `injectH` [@vue/babel-sugar-inject-h](../babel-sugar-inject-h/README.md) - Automatic `h` injection syntactic sugar
|
||||
- `vModel` [@vue/babel-sugar-v-model](../babel-sugar-v-model/README.md) - `vModel` syntactic sugar
|
||||
- `vOn` [@vue/babel-sugar-v-on](../babel-sugar-v-on/README.md) - `vOn` syntactic sugar
|
1
node_modules/@vue/babel-preset-jsx/dist/plugin.cjs.js
generated
vendored
Normal file
1
node_modules/@vue/babel-preset-jsx/dist/plugin.cjs.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
"use strict";function _interopDefault(a){return a&&"object"==typeof a&&"default"in a?a["default"]:a}var babelPluginTransformVueJsx=_interopDefault(require("@vue/babel-plugin-transform-vue-jsx")),babelSugarFunctionalVue=_interopDefault(require("@vue/babel-sugar-functional-vue")),babelSugarInjectH=_interopDefault(require("@vue/babel-sugar-inject-h")),babelSugarCompositionApiInjectH=_interopDefault(require("@vue/babel-sugar-composition-api-inject-h")),babelSugarCompositionApiRenderInstance=_interopDefault(require("@vue/babel-sugar-composition-api-render-instance")),babelSugarVModel=_interopDefault(require("@vue/babel-sugar-v-model")),babelSugarVOn=_interopDefault(require("@vue/babel-sugar-v-on")),index=(a,{functional:b=!0,injectH:c=!0,vModel:d=!0,vOn:e=!0,compositionAPI:f=!1}={})=>{let g=babelSugarInjectH,h="@vue/composition-api";if(f){if(["native","naruto"].includes(f)&&(h="vue"),"vue-demi"===f&&(h="vue-demi"),["auto",!0].includes(f))try{const a=require("vue/package.json").version;a.startsWith("2.7")&&(h="vue")}catch(a){}"object"==typeof f&&f.importSource&&(h=f.importSource),g=[babelSugarCompositionApiInjectH,{importSource:h}]}return{plugins:[b&&babelSugarFunctionalVue,c&&g,d&&babelSugarVModel,e&&babelSugarVOn,f&&[babelSugarCompositionApiRenderInstance,{importSource:h}],babelPluginTransformVueJsx].filter(Boolean)}};module.exports=index;
|
74
node_modules/@vue/babel-preset-jsx/package.json
generated
vendored
Normal file
74
node_modules/@vue/babel-preset-jsx/package.json
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
{
|
||||
"_from": "@vue/babel-preset-jsx@^1.1.2",
|
||||
"_id": "@vue/babel-preset-jsx@1.4.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-QmfRpssBOPZWL5xw7fOuHNifCQcNQC1PrOo/4fu6xlhlKJJKSA3HqX92Nvgyx8fqHZTUGMPHmFA+IDqwXlqkSA==",
|
||||
"_location": "/@vue/babel-preset-jsx",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@vue/babel-preset-jsx@^1.1.2",
|
||||
"name": "@vue/babel-preset-jsx",
|
||||
"escapedName": "@vue%2fbabel-preset-jsx",
|
||||
"scope": "@vue",
|
||||
"rawSpec": "^1.1.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.1.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@vue/babel-preset-app"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@vue/babel-preset-jsx/-/babel-preset-jsx-1.4.0.tgz",
|
||||
"_shasum": "f4914ba314235ab097bc4372ed67473c0780bfcc",
|
||||
"_spec": "@vue/babel-preset-jsx@^1.1.2",
|
||||
"_where": "C:\\Users\\zhouxueli\\Desktop\\scheduling-app\\node_modules\\@vue\\babel-preset-app",
|
||||
"author": {
|
||||
"name": "Nick Messing",
|
||||
"email": "dot.nick.dot.messing@gmail.com"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@vue/babel-helper-vue-jsx-merge-props": "^1.4.0",
|
||||
"@vue/babel-plugin-transform-vue-jsx": "^1.4.0",
|
||||
"@vue/babel-sugar-composition-api-inject-h": "^1.4.0",
|
||||
"@vue/babel-sugar-composition-api-render-instance": "^1.4.0",
|
||||
"@vue/babel-sugar-functional-vue": "^1.4.0",
|
||||
"@vue/babel-sugar-inject-h": "^1.4.0",
|
||||
"@vue/babel-sugar-v-model": "^1.4.0",
|
||||
"@vue/babel-sugar-v-on": "^1.4.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Babel preset for Vue JSX",
|
||||
"devDependencies": {
|
||||
"rollup": "^0.67.4",
|
||||
"rollup-plugin-babel-minify": "^6.2.0"
|
||||
},
|
||||
"files": [],
|
||||
"gitHead": "6566e12067f5d6c02d3849b574a1b84de5634008",
|
||||
"license": "MIT",
|
||||
"main": "dist/plugin.cjs.js",
|
||||
"name": "@vue/babel-preset-jsx",
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0",
|
||||
"vue": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"vue": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vuejs/jsx/tree/master/packages/babel-preset-jsx"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"prerelease": "yarn build"
|
||||
},
|
||||
"version": "1.4.0"
|
||||
}
|
54
node_modules/@vue/babel-sugar-composition-api-inject-h/README.md
generated
vendored
Normal file
54
node_modules/@vue/babel-sugar-composition-api-inject-h/README.md
generated
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
## @vue/babel-sugar-composition-api-inject-h
|
||||
|
||||
> Ported from [luwanquan/babel-preset-vca-jsx](https://github.com/luwanquan/babel-preset-vca-jsx) by [@luwanquan](https://github.com/luwanquan)
|
||||
|
||||
Syntactic sugar for automatic `h` inject in JSX with @vue/composition-api.
|
||||
|
||||
### Babel Compatibility Notes
|
||||
|
||||
- This repo is only compatible with Babel 7.x
|
||||
|
||||
### Usage
|
||||
|
||||
Install the dependencies:
|
||||
|
||||
```sh
|
||||
# for yarn:
|
||||
yarn add @vue/babel-sugar-composition-api-inject-h
|
||||
# for npm:
|
||||
npm install @vue/babel-sugar-composition-api-inject-h --save
|
||||
```
|
||||
|
||||
In your `.babelrc`:
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["@vue/babel-sugar-composition-api-inject-h"]
|
||||
}
|
||||
```
|
||||
|
||||
However it is recommended to use the [configurable preset](../babel-preset-jsx/README.md) instead.
|
||||
|
||||
### Details
|
||||
|
||||
This plugin automatically injects `h` in every method that has JSX. By using this plugin you don't have to always import `h` from `@vue/composition-api`.
|
||||
|
||||
```js
|
||||
// Without @vue/babel-sugar-inject-h
|
||||
import { h } from '@vue/composition-api'
|
||||
|
||||
export default {
|
||||
setup() {
|
||||
return () => <button />
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
```js
|
||||
// With @vue/babel-sugar-inject-h
|
||||
export default {
|
||||
setup() {
|
||||
return () => <button />
|
||||
},
|
||||
}
|
||||
```
|
1
node_modules/@vue/babel-sugar-composition-api-inject-h/dist/plugin.js
generated
vendored
Normal file
1
node_modules/@vue/babel-sugar-composition-api-inject-h/dist/plugin.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var syntaxJsx=_interopDefault(require("@babel/plugin-syntax-jsx"));const hasJSX=(e,t)=>{const n={hasJSX:!1};t.traverse({JSXElement(){this.hasJSX=!0}},n);return n.hasJSX},remove$createElement=(e,t)=>{t.traverse({ObjectMethod(t){"setup"===t.node.key.name&&t.traverse({VariableDeclaration(t){t.traverse({MemberExpression(n){e.isThisExpression(n.node.object)&&e.isIdentifier(n.node.property)&&"$createElement"===n.node.property.name&&t.remove()}})}})}})},autoImportH=(e,t,n)=>{if(hasJSX(e,t)){const i=t.get("body").filter(e=>e.isImportDeclaration()).map(e=>e.node),o=i.filter(e=>e.source.value===n),r=o.some(t=>t.specifiers.some(t=>e.isImportSpecifier(t)&&"h"===t.local.name));if(!r){const i=e.importSpecifier(e.identifier("h"),e.identifier("h"));o.length>0?o[0].specifiers.push(i):t.unshiftContainer("body",e.importDeclaration([i],e.stringLiteral(n)))}}};var index=(e,{importSource:importSource="@vue/composition-api"}={})=>{const t=e.types;return{inherits:syntaxJsx,visitor:{Program(e){remove$createElement(t,e),autoImportH(t,e,importSource)}}}};module.exports=index;
|
78
node_modules/@vue/babel-sugar-composition-api-inject-h/package.json
generated
vendored
Normal file
78
node_modules/@vue/babel-sugar-composition-api-inject-h/package.json
generated
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
{
|
||||
"_from": "@vue/babel-sugar-composition-api-inject-h@^1.4.0",
|
||||
"_id": "@vue/babel-sugar-composition-api-inject-h@1.4.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-VQq6zEddJHctnG4w3TfmlVp5FzDavUSut/DwR0xVoe/mJKXyMcsIibL42wPntozITEoY90aBV0/1d2KjxHU52g==",
|
||||
"_location": "/@vue/babel-sugar-composition-api-inject-h",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@vue/babel-sugar-composition-api-inject-h@^1.4.0",
|
||||
"name": "@vue/babel-sugar-composition-api-inject-h",
|
||||
"escapedName": "@vue%2fbabel-sugar-composition-api-inject-h",
|
||||
"scope": "@vue",
|
||||
"rawSpec": "^1.4.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.4.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@vue/babel-preset-jsx"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@vue/babel-sugar-composition-api-inject-h/-/babel-sugar-composition-api-inject-h-1.4.0.tgz",
|
||||
"_shasum": "187e1389f8871d89ece743bb50aed713be9d6c85",
|
||||
"_spec": "@vue/babel-sugar-composition-api-inject-h@^1.4.0",
|
||||
"_where": "C:\\Users\\zhouxueli\\Desktop\\scheduling-app\\node_modules\\@vue\\babel-preset-jsx",
|
||||
"author": {
|
||||
"name": "luwanquan",
|
||||
"email": "luwanquan@f-road.com.cn"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@babel/plugin-syntax-jsx": "^7.2.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Babel syntactic sugar for h automatic injection for Vue JSX with @vue/composition-api",
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.2.0",
|
||||
"@babel/core": "^7.2.0",
|
||||
"@babel/preset-env": "^7.2.0",
|
||||
"ava": "^0.25.0",
|
||||
"nyc": "^13.1.0",
|
||||
"rollup": "^0.67.4",
|
||||
"rollup-plugin-babel": "4.0.3",
|
||||
"rollup-plugin-istanbul": "^2.0.1",
|
||||
"rollup-plugin-uglify-es": "^0.0.1",
|
||||
"vue": "^2.5.17"
|
||||
},
|
||||
"files": [],
|
||||
"gitHead": "6566e12067f5d6c02d3849b574a1b84de5634008",
|
||||
"license": "MIT",
|
||||
"main": "dist/plugin.js",
|
||||
"name": "@vue/babel-sugar-composition-api-inject-h",
|
||||
"nyc": {
|
||||
"exclude": [
|
||||
"dist",
|
||||
"test"
|
||||
]
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vuejs/jsx/tree/master/packages/babel-sugar-composition-api-inject-h"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"build:test": "rollup -c rollup.config.testing.js",
|
||||
"prepublish": "yarn build",
|
||||
"pretest": "yarn build:test",
|
||||
"test": "nyc --reporter=html --reporter=text-summary ava -v test/test.js"
|
||||
},
|
||||
"version": "1.4.0"
|
||||
}
|
78
node_modules/@vue/babel-sugar-composition-api-render-instance/README.md
generated
vendored
Normal file
78
node_modules/@vue/babel-sugar-composition-api-render-instance/README.md
generated
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
## @vue/babel-sugar-composition-api-render-instance
|
||||
|
||||
> Ported from [luwanquan/babel-preset-vca-jsx](https://github.com/luwanquan/babel-preset-vca-jsx) by [@luwanquan](https://github.com/luwanquan)
|
||||
|
||||
Babel syntactic sugar for replacing `this` with `getCurrentInstance()` in Vue JSX with @vue/composition-api
|
||||
|
||||
### Babel Compatibility Notes
|
||||
|
||||
- This repo is only compatible with Babel 7.x
|
||||
|
||||
### Usage
|
||||
|
||||
Install the dependencies:
|
||||
|
||||
```sh
|
||||
# for yarn:
|
||||
yarn add @vue/babel-sugar-composition-api-render-instance
|
||||
# for npm:
|
||||
npm install @vue/babel-sugar-composition-api-render-instance --save
|
||||
```
|
||||
|
||||
In your `.babelrc`:
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["@vue/babel-sugar-composition-api-render-instance"]
|
||||
}
|
||||
```
|
||||
|
||||
However it is recommended to use the [configurable preset](../babel-preset-jsx/README.md) instead.
|
||||
|
||||
### Details
|
||||
|
||||
This plugin automatically replaces `this` in `setup()` with `getCurrentInstance()`. This is required for JSX to work in @vue/composition-api as `this` is not available in `setup()`
|
||||
|
||||
Input:
|
||||
|
||||
```jsx
|
||||
defineComponent({
|
||||
setup() {
|
||||
return () => <MyComponent vModel={a.b} />
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
Output (without @vue/babel-sugar-composition-api-render-instance):
|
||||
|
||||
```jsx
|
||||
defineComponent({
|
||||
setup() {
|
||||
return () => <MyComponent model={{
|
||||
value: a.b,
|
||||
callback: $$v => {
|
||||
this.$set(a, "b", $$v);
|
||||
}
|
||||
}} />
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
Output (with @vue/babel-sugar-composition-api-render-instance):
|
||||
|
||||
```jsx
|
||||
import { getCurrentInstance } from "@vue/composition-api";
|
||||
|
||||
defineComponent({
|
||||
setup() {
|
||||
const __currentInstance = getCurrentInstance();
|
||||
|
||||
return () => <MyComponent model={{
|
||||
value: a.b,
|
||||
callback: $$v => {
|
||||
__currentInstance.$set(a, "b", $$v);
|
||||
}
|
||||
}} />
|
||||
}
|
||||
})
|
||||
```
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user