Add node modules and compiled JavaScript from main
This commit is contained in:
parent
8bccaeaf7c
commit
4181bfdf50
7465 changed files with 1775003 additions and 2 deletions
22
node_modules/@babel/helper-validator-option/LICENSE
generated
vendored
Normal file
22
node_modules/@babel/helper-validator-option/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
19
node_modules/@babel/helper-validator-option/README.md
generated
vendored
Normal file
19
node_modules/@babel/helper-validator-option/README.md
generated
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
# @babel/helper-validator-option
|
||||
|
||||
> Validate plugin/preset options
|
||||
|
||||
See our website [@babel/helper-validator-option](https://babeljs.io/docs/en/babel-helper-validator-option) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save @babel/helper-validator-option
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/helper-validator-option
|
||||
```
|
45
node_modules/@babel/helper-validator-option/lib/find-suggestion.js
generated
vendored
Normal file
45
node_modules/@babel/helper-validator-option/lib/find-suggestion.js
generated
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.findSuggestion = findSuggestion;
|
||||
const {
|
||||
min
|
||||
} = Math;
|
||||
|
||||
function levenshtein(a, b) {
|
||||
let t = [],
|
||||
u = [],
|
||||
i,
|
||||
j;
|
||||
const m = a.length,
|
||||
n = b.length;
|
||||
|
||||
if (!m) {
|
||||
return n;
|
||||
}
|
||||
|
||||
if (!n) {
|
||||
return m;
|
||||
}
|
||||
|
||||
for (j = 0; j <= n; j++) {
|
||||
t[j] = j;
|
||||
}
|
||||
|
||||
for (i = 1; i <= m; i++) {
|
||||
for (u = [i], j = 1; j <= n; j++) {
|
||||
u[j] = a[i - 1] === b[j - 1] ? t[j - 1] : min(t[j - 1], t[j], u[j - 1]) + 1;
|
||||
}
|
||||
|
||||
t = u;
|
||||
}
|
||||
|
||||
return u[n];
|
||||
}
|
||||
|
||||
function findSuggestion(str, arr) {
|
||||
const distances = arr.map(el => levenshtein(el, str));
|
||||
return arr[distances.indexOf(min(...distances))];
|
||||
}
|
21
node_modules/@babel/helper-validator-option/lib/index.js
generated
vendored
Normal file
21
node_modules/@babel/helper-validator-option/lib/index.js
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "OptionValidator", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _validator.OptionValidator;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "findSuggestion", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _findSuggestion.findSuggestion;
|
||||
}
|
||||
});
|
||||
|
||||
var _validator = require("./validator");
|
||||
|
||||
var _findSuggestion = require("./find-suggestion");
|
58
node_modules/@babel/helper-validator-option/lib/validator.js
generated
vendored
Normal file
58
node_modules/@babel/helper-validator-option/lib/validator.js
generated
vendored
Normal file
|
@ -0,0 +1,58 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.OptionValidator = void 0;
|
||||
|
||||
var _findSuggestion = require("./find-suggestion");
|
||||
|
||||
class OptionValidator {
|
||||
constructor(descriptor) {
|
||||
this.descriptor = descriptor;
|
||||
}
|
||||
|
||||
validateTopLevelOptions(options, TopLevelOptionShape) {
|
||||
const validOptionNames = Object.keys(TopLevelOptionShape);
|
||||
|
||||
for (const option of Object.keys(options)) {
|
||||
if (!validOptionNames.includes(option)) {
|
||||
throw new Error(this.formatMessage(`'${option}' is not a valid top-level option.
|
||||
- Did you mean '${(0, _findSuggestion.findSuggestion)(option, validOptionNames)}'?`));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
validateBooleanOption(name, value, defaultValue) {
|
||||
if (value === undefined) {
|
||||
return defaultValue;
|
||||
} else {
|
||||
this.invariant(typeof value === "boolean", `'${name}' option must be a boolean.`);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
validateStringOption(name, value, defaultValue) {
|
||||
if (value === undefined) {
|
||||
return defaultValue;
|
||||
} else {
|
||||
this.invariant(typeof value === "string", `'${name}' option must be a string.`);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
invariant(condition, message) {
|
||||
if (!condition) {
|
||||
throw new Error(this.formatMessage(message));
|
||||
}
|
||||
}
|
||||
|
||||
formatMessage(message) {
|
||||
return `${this.descriptor}: ${message}`;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.OptionValidator = OptionValidator;
|
24
node_modules/@babel/helper-validator-option/package.json
generated
vendored
Normal file
24
node_modules/@babel/helper-validator-option/package.json
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"name": "@babel/helper-validator-option",
|
||||
"version": "7.18.6",
|
||||
"description": "Validate plugin/preset options",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-helper-validator-option"
|
||||
},
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"exports": {
|
||||
".": "./lib/index.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"type": "commonjs"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue