yeet
This commit is contained in:
22
node_modules/@babel/plugin-transform-duplicate-keys/LICENSE
generated
vendored
Normal file
22
node_modules/@babel/plugin-transform-duplicate-keys/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/plugin-transform-duplicate-keys/README.md
generated
vendored
Normal file
19
node_modules/@babel/plugin-transform-duplicate-keys/README.md
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
# @babel/plugin-transform-duplicate-keys
|
||||
|
||||
> Compile objects with duplicate keys to valid strict ES5
|
||||
|
||||
See our website [@babel/plugin-transform-duplicate-keys](https://babeljs.io/docs/en/babel-plugin-transform-duplicate-keys) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/plugin-transform-duplicate-keys
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/plugin-transform-duplicate-keys --dev
|
||||
```
|
74
node_modules/@babel/plugin-transform-duplicate-keys/lib/index.js
generated
vendored
Normal file
74
node_modules/@babel/plugin-transform-duplicate-keys/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _helperPluginUtils = require("@babel/helper-plugin-utils");
|
||||
|
||||
var _core = require("@babel/core");
|
||||
|
||||
function getName(key) {
|
||||
if (_core.types.isIdentifier(key)) {
|
||||
return key.name;
|
||||
}
|
||||
|
||||
return key.value.toString();
|
||||
}
|
||||
|
||||
var _default = (0, _helperPluginUtils.declare)(api => {
|
||||
api.assertVersion(7);
|
||||
return {
|
||||
name: "transform-duplicate-keys",
|
||||
visitor: {
|
||||
ObjectExpression(path) {
|
||||
const {
|
||||
node
|
||||
} = path;
|
||||
const plainProps = node.properties.filter(prop => !_core.types.isSpreadElement(prop) && !prop.computed);
|
||||
const alreadySeenData = Object.create(null);
|
||||
const alreadySeenGetters = Object.create(null);
|
||||
const alreadySeenSetters = Object.create(null);
|
||||
|
||||
for (const prop of plainProps) {
|
||||
const name = getName(prop.key);
|
||||
let isDuplicate = false;
|
||||
|
||||
switch (prop.kind) {
|
||||
case "get":
|
||||
if (alreadySeenData[name] || alreadySeenGetters[name]) {
|
||||
isDuplicate = true;
|
||||
}
|
||||
|
||||
alreadySeenGetters[name] = true;
|
||||
break;
|
||||
|
||||
case "set":
|
||||
if (alreadySeenData[name] || alreadySeenSetters[name]) {
|
||||
isDuplicate = true;
|
||||
}
|
||||
|
||||
alreadySeenSetters[name] = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (alreadySeenData[name] || alreadySeenGetters[name] || alreadySeenSetters[name]) {
|
||||
isDuplicate = true;
|
||||
}
|
||||
|
||||
alreadySeenData[name] = true;
|
||||
}
|
||||
|
||||
if (isDuplicate) {
|
||||
prop.computed = true;
|
||||
prop.key = _core.types.stringLiteral(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
exports.default = _default;
|
29
node_modules/@babel/plugin-transform-duplicate-keys/package.json
generated
vendored
Normal file
29
node_modules/@babel/plugin-transform-duplicate-keys/package.json
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-duplicate-keys",
|
||||
"version": "7.12.13",
|
||||
"description": "Compile objects with duplicate keys to valid strict ES5",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-plugin-transform-duplicate-keys"
|
||||
},
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-duplicate-keys",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.12.13"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.12.13",
|
||||
"@babel/helper-plugin-test-runner": "7.12.13"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user