Initial commit: n8n Strike API node

- Add Strike API credentials configuration
- Implement Strike node with 9 resources (Account, Balance, Currency Exchange, Deposit, Invoice, Payment, Payment Method, Payout, Rates)
- Add comprehensive operation descriptions for all resources
- Include CLAUDE.MD documentation
- Set up build configuration with TypeScript, ESLint, and Prettier

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-10 11:00:38 +01:00
commit 5605b9b49a
8925 changed files with 1417728 additions and 0 deletions

20
node_modules/ast-types/LICENSE generated vendored Normal file
View File

@ -0,0 +1,20 @@
Copyright (c) 2013 Ben Newman <bn@cs.stanford.edu>
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.

512
node_modules/ast-types/README.md generated vendored Normal file
View File

@ -0,0 +1,512 @@
# AST Types ![CI](https://github.com/benjamn/ast-types/workflows/CI/badge.svg)
This module provides an efficient, modular,
[Esprima](https://github.com/ariya/esprima)-compatible implementation of
the [abstract syntax
tree](http://en.wikipedia.org/wiki/Abstract_syntax_tree) type hierarchy
pioneered by the [Mozilla Parser
API](https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API).
Installation
---
From NPM:
npm install ast-types
From GitHub:
cd path/to/node_modules
git clone git://github.com/benjamn/ast-types.git
cd ast-types
npm install .
Basic Usage
---
```js
import assert from "assert";
import {
namedTypes as n,
builders as b,
} from "ast-types";
var fooId = b.identifier("foo");
var ifFoo = b.ifStatement(fooId, b.blockStatement([
b.expressionStatement(b.callExpression(fooId, []))
]));
assert.ok(n.IfStatement.check(ifFoo));
assert.ok(n.Statement.check(ifFoo));
assert.ok(n.Node.check(ifFoo));
assert.ok(n.BlockStatement.check(ifFoo.consequent));
assert.strictEqual(
ifFoo.consequent.body[0].expression.arguments.length,
0,
);
assert.strictEqual(ifFoo.test, fooId);
assert.ok(n.Expression.check(ifFoo.test));
assert.ok(n.Identifier.check(ifFoo.test));
assert.ok(!n.Statement.check(ifFoo.test));
```
AST Traversal
---
Because it understands the AST type system so thoroughly, this library
is able to provide excellent node iteration and traversal mechanisms.
If you want complete control over the traversal, and all you need is a way
of enumerating the known fields of your AST nodes and getting their
values, you may be interested in the primitives `getFieldNames` and
`getFieldValue`:
```js
import {
getFieldNames,
getFieldValue,
} from "ast-types";
const partialFunExpr = { type: "FunctionExpression" };
// Even though partialFunExpr doesn't actually contain all the fields that
// are expected for a FunctionExpression, types.getFieldNames knows:
console.log(getFieldNames(partialFunExpr));
// [ 'type', 'id', 'params', 'body', 'generator', 'expression',
// 'defaults', 'rest', 'async' ]
// For fields that have default values, types.getFieldValue will return
// the default if the field is not actually defined.
console.log(getFieldValue(partialFunExpr, "generator"));
// false
```
Two more low-level helper functions, `eachField` and `someField`, are
defined in terms of `getFieldNames` and `getFieldValue`:
```js
// Iterate over all defined fields of an object, including those missing
// or undefined, passing each field name and effective value (as returned
// by getFieldValue) to the callback. If the object has no corresponding
// Def, the callback will never be called.
export function eachField(object, callback, context) {
getFieldNames(object).forEach(function(name) {
callback.call(this, name, getFieldValue(object, name));
}, context);
}
// Similar to eachField, except that iteration stops as soon as the
// callback returns a truthy value. Like Array.prototype.some, the final
// result is either true or false to indicates whether the callback
// returned true for any element or not.
export function someField(object, callback, context) {
return getFieldNames(object).some(function(name) {
return callback.call(this, name, getFieldValue(object, name));
}, context);
}
```
So here's how you might make a copy of an AST node:
```js
import { eachField } from "ast-types";
const copy = {};
eachField(node, function(name, value) {
// Note that undefined fields will be visited too, according to
// the rules associated with node.type, and default field values
// will be substituted if appropriate.
copy[name] = value;
})
```
But that's not all! You can also easily visit entire syntax trees using
the powerful `types.visit` abstraction.
Here's a trivial example of how you might assert that `arguments.callee`
is never used in `ast`:
```js
import assert from "assert";
import {
visit,
namedTypes as n,
} from "ast-types";
visit(ast, {
// This method will be called for any node with .type "MemberExpression":
visitMemberExpression(path) {
// Visitor methods receive a single argument, a NodePath object
// wrapping the node of interest.
var node = path.node;
if (
n.Identifier.check(node.object) &&
node.object.name === "arguments" &&
n.Identifier.check(node.property)
) {
assert.notStrictEqual(node.property.name, "callee");
}
// It's your responsibility to call this.traverse with some
// NodePath object (usually the one passed into the visitor
// method) before the visitor method returns, or return false to
// indicate that the traversal need not continue any further down
// this subtree.
this.traverse(path);
}
});
```
Here's a slightly more involved example of transforming `...rest`
parameters into browser-runnable ES5 JavaScript:
```js
import { builders as b, visit } from "ast-types";
// Reuse the same AST structure for Array.prototype.slice.call.
var sliceExpr = b.memberExpression(
b.memberExpression(
b.memberExpression(
b.identifier("Array"),
b.identifier("prototype"),
false
),
b.identifier("slice"),
false
),
b.identifier("call"),
false
);
visit(ast, {
// This method will be called for any node whose type is a subtype of
// Function (e.g., FunctionDeclaration, FunctionExpression, and
// ArrowFunctionExpression). Note that types.visit precomputes a
// lookup table from every known type to the appropriate visitor
// method to call for nodes of that type, so the dispatch takes
// constant time.
visitFunction(path) {
// Visitor methods receive a single argument, a NodePath object
// wrapping the node of interest.
const node = path.node;
// It's your responsibility to call this.traverse with some
// NodePath object (usually the one passed into the visitor
// method) before the visitor method returns, or return false to
// indicate that the traversal need not continue any further down
// this subtree. An assertion will fail if you forget, which is
// awesome, because it means you will never again make the
// disastrous mistake of forgetting to traverse a subtree. Also
// cool: because you can call this method at any point in the
// visitor method, it's up to you whether your traversal is
// pre-order, post-order, or both!
this.traverse(path);
// This traversal is only concerned with Function nodes that have
// rest parameters.
if (!node.rest) {
return;
}
// For the purposes of this example, we won't worry about functions
// with Expression bodies.
n.BlockStatement.assert(node.body);
// Use types.builders to build a variable declaration of the form
//
// var rest = Array.prototype.slice.call(arguments, n);
//
// where `rest` is the name of the rest parameter, and `n` is a
// numeric literal specifying the number of named parameters the
// function takes.
const restVarDecl = b.variableDeclaration("var", [
b.variableDeclarator(
node.rest,
b.callExpression(sliceExpr, [
b.identifier("arguments"),
b.literal(node.params.length)
])
)
]);
// Similar to doing node.body.body.unshift(restVarDecl), except
// that the other NodePath objects wrapping body statements will
// have their indexes updated to accommodate the new statement.
path.get("body", "body").unshift(restVarDecl);
// Nullify node.rest now that we have simulated the behavior of
// the rest parameter using ordinary JavaScript.
path.get("rest").replace(null);
// There's nothing wrong with doing node.rest = null, but I wanted
// to point out that the above statement has the same effect.
assert.strictEqual(node.rest, null);
}
});
```
Here's how you might use `types.visit` to implement a function that
determines if a given function node refers to `this`:
```js
function usesThis(funcNode) {
n.Function.assert(funcNode);
var result = false;
visit(funcNode, {
visitThisExpression(path) {
result = true;
// The quickest way to terminate the traversal is to call
// this.abort(), which throws a special exception (instanceof
// this.AbortRequest) that will be caught in the top-level
// types.visit method, so you don't have to worry about
// catching the exception yourself.
this.abort();
},
visitFunction(path) {
// ThisExpression nodes in nested scopes don't count as `this`
// references for the original function node, so we can safely
// avoid traversing this subtree.
return false;
},
visitCallExpression(path) {
const node = path.node;
// If the function contains CallExpression nodes involving
// super, those expressions will implicitly depend on the
// value of `this`, even though they do not explicitly contain
// any ThisExpression nodes.
if (this.isSuperCallExpression(node)) {
result = true;
this.abort(); // Throws AbortRequest exception.
}
this.traverse(path);
},
// Yes, you can define arbitrary helper methods.
isSuperCallExpression(callExpr) {
n.CallExpression.assert(callExpr);
return this.isSuperIdentifier(callExpr.callee)
|| this.isSuperMemberExpression(callExpr.callee);
},
// And even helper helper methods!
isSuperIdentifier(node) {
return n.Identifier.check(node.callee)
&& node.callee.name === "super";
},
isSuperMemberExpression(node) {
return n.MemberExpression.check(node.callee)
&& n.Identifier.check(node.callee.object)
&& node.callee.object.name === "super";
}
});
return result;
}
```
As you might guess, when an `AbortRequest` is thrown from a subtree, the
exception will propagate from the corresponding calls to `this.traverse`
in the ancestor visitor methods. If you decide you want to cancel the
request, simply catch the exception and call its `.cancel()` method. The
rest of the subtree beneath the `try`-`catch` block will be abandoned, but
the remaining siblings of the ancestor node will still be visited.
NodePath
---
The `NodePath` object passed to visitor methods is a wrapper around an AST
node, and it serves to provide access to the chain of ancestor objects
(all the way back to the root of the AST) and scope information.
In general, `path.node` refers to the wrapped node, `path.parent.node`
refers to the nearest `Node` ancestor, `path.parent.parent.node` to the
grandparent, and so on.
Note that `path.node` may not be a direct property value of
`path.parent.node`; for instance, it might be the case that `path.node` is
an element of an array that is a direct child of the parent node:
```js
path.node === path.parent.node.elements[3]
```
in which case you should know that `path.parentPath` provides
finer-grained access to the complete path of objects (not just the `Node`
ones) from the root of the AST:
```js
// In reality, path.parent is the grandparent of path:
path.parentPath.parentPath === path.parent
// The path.parentPath object wraps the elements array (note that we use
// .value because the elements array is not a Node):
path.parentPath.value === path.parent.node.elements
// The path.node object is the fourth element in that array:
path.parentPath.value[3] === path.node
// Unlike path.node and path.value, which are synonyms because path.node
// is a Node object, path.parentPath.node is distinct from
// path.parentPath.value, because the elements array is not a
// Node. Instead, path.parentPath.node refers to the closest ancestor
// Node, which happens to be the same as path.parent.node:
path.parentPath.node === path.parent.node
// The path is named for its index in the elements array:
path.name === 3
// Likewise, path.parentPath is named for the property by which
// path.parent.node refers to it:
path.parentPath.name === "elements"
// Putting it all together, we can follow the chain of object references
// from path.parent.node all the way to path.node by accessing each
// property by name:
path.parent.node[path.parentPath.name][path.name] === path.node
```
These `NodePath` objects are created during the traversal without
modifying the AST nodes themselves, so it's not a problem if the same node
appears more than once in the AST (like `Array.prototype.slice.call` in
the example above), because it will be visited with a distict `NodePath`
each time it appears.
Child `NodePath` objects are created lazily, by calling the `.get` method
of a parent `NodePath` object:
```js
// If a NodePath object for the elements array has never been created
// before, it will be created here and cached in the future:
path.get("elements").get(3).value === path.value.elements[3]
// Alternatively, you can pass multiple property names to .get instead of
// chaining multiple .get calls:
path.get("elements", 0).value === path.value.elements[0]
```
`NodePath` objects support a number of useful methods:
```js
// Replace one node with another node:
var fifth = path.get("elements", 4);
fifth.replace(newNode);
// Now do some stuff that might rearrange the list, and this replacement
// remains safe:
fifth.replace(newerNode);
// Replace the third element in an array with two new nodes:
path.get("elements", 2).replace(
b.identifier("foo"),
b.thisExpression()
);
// Remove a node and its parent if it would leave a redundant AST node:
//e.g. var t = 1, y =2; removing the `t` and `y` declarators results in `var undefined`.
path.prune(); //returns the closest parent `NodePath`.
// Remove a node from a list of nodes:
path.get("elements", 3).replace();
// Add three new nodes to the beginning of a list of nodes:
path.get("elements").unshift(a, b, c);
// Remove and return the first node in a list of nodes:
path.get("elements").shift();
// Push two new nodes onto the end of a list of nodes:
path.get("elements").push(d, e);
// Remove and return the last node in a list of nodes:
path.get("elements").pop();
// Insert a new node before/after the seventh node in a list of nodes:
var seventh = path.get("elements", 6);
seventh.insertBefore(newNode);
seventh.insertAfter(newNode);
// Insert a new element at index 5 in a list of nodes:
path.get("elements").insertAt(5, newNode);
```
Scope
---
The object exposed as `path.scope` during AST traversals provides
information about variable and function declarations in the scope that
contains `path.node`. See [scope.ts](lib/scope.ts) for its public
interface, which currently includes `.isGlobal`, `.getGlobalScope()`,
`.depth`, `.declares(name)`, `.lookup(name)`, and `.getBindings()`.
Custom AST Node Types
---
The `ast-types` module was designed to be extended. To that end, it
provides a readable, declarative syntax for specifying new AST node types,
based primarily upon the `require("ast-types").Type.def` function:
```js
import {
Type,
builtInTypes,
builders as b,
finalize,
} from "ast-types";
const { def } = Type;
const { string } = builtInTypes;
// Suppose you need a named File type to wrap your Programs.
def("File")
.bases("Node")
.build("name", "program")
.field("name", string)
.field("program", def("Program"));
// Prevent further modifications to the File type (and any other
// types newly introduced by def(...)).
finalize();
// The b.file builder function is now available. It expects two
// arguments, as named by .build("name", "program") above.
const main = b.file("main.js", b.program([
// Pointless program contents included for extra color.
b.functionDeclaration(b.identifier("succ"), [
b.identifier("x")
], b.blockStatement([
b.returnStatement(
b.binaryExpression(
"+", b.identifier("x"), b.literal(1)
)
)
]))
]));
assert.strictEqual(main.name, "main.js");
assert.strictEqual(main.program.body[0].params[0].name, "x");
// etc.
// If you pass the wrong type of arguments, or fail to pass enough
// arguments, an AssertionError will be thrown.
b.file(b.blockStatement([]));
// ==> AssertionError: {"body":[],"type":"BlockStatement","loc":null} does not match type string
b.file("lib/types.js", b.thisExpression());
// ==> AssertionError: {"type":"ThisExpression","loc":null} does not match type Program
```
The `def` syntax is used to define all the default AST node types found in
[babel-core.ts](def/babel-core.ts),
[babel.ts](def/babel.ts),
[core.ts](def/core.ts),
[es-proposals.ts](def/es-proposals.ts),
[es6.ts](def/es6.ts),
[es7.ts](def/es7.ts),
[es2020.ts](def/es2020.ts),
[esprima.ts](def/esprima.ts),
[flow.ts](def/flow.ts),
[jsx.ts](def/jsx.ts),
[type-annotations.ts](def/type-annotations.ts),
and
[typescript.ts](def/typescript.ts),
so you have
no shortage of examples to learn from.

2
node_modules/ast-types/lib/def/babel-core.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { Fork } from "../types";
export default function (fork: Fork): void;

241
node_modules/ast-types/lib/def/babel-core.js generated vendored Normal file
View File

@ -0,0 +1,241 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var es_proposals_1 = tslib_1.__importDefault(require("./es-proposals"));
var types_1 = tslib_1.__importDefault(require("../types"));
var shared_1 = tslib_1.__importStar(require("../shared"));
function default_1(fork) {
var _a, _b, _c, _d, _e;
fork.use(es_proposals_1.default);
var types = fork.use(types_1.default);
var defaults = fork.use(shared_1.default).defaults;
var def = types.Type.def;
var or = types.Type.or;
var isUndefined = types.builtInTypes.undefined;
def("Noop")
.bases("Statement")
.build();
def("DoExpression")
.bases("Expression")
.build("body")
.field("body", [def("Statement")]);
def("BindExpression")
.bases("Expression")
.build("object", "callee")
.field("object", or(def("Expression"), null))
.field("callee", def("Expression"));
def("ParenthesizedExpression")
.bases("Expression")
.build("expression")
.field("expression", def("Expression"));
def("ExportNamespaceSpecifier")
.bases("Specifier")
.build("exported")
.field("exported", def("Identifier"));
def("ExportDefaultSpecifier")
.bases("Specifier")
.build("exported")
.field("exported", def("Identifier"));
def("CommentBlock")
.bases("Comment")
.build("value", /*optional:*/ "leading", "trailing");
def("CommentLine")
.bases("Comment")
.build("value", /*optional:*/ "leading", "trailing");
def("Directive")
.bases("Node")
.build("value")
.field("value", def("DirectiveLiteral"));
def("DirectiveLiteral")
.bases("Node", "Expression")
.build("value")
.field("value", String, defaults["use strict"]);
def("InterpreterDirective")
.bases("Node")
.build("value")
.field("value", String);
def("BlockStatement")
.bases("Statement")
.build("body")
.field("body", [def("Statement")])
.field("directives", [def("Directive")], defaults.emptyArray);
def("Program")
.bases("Node")
.build("body")
.field("body", [def("Statement")])
.field("directives", [def("Directive")], defaults.emptyArray)
.field("interpreter", or(def("InterpreterDirective"), null), defaults["null"]);
function makeLiteralExtra(rawValueType, toRaw) {
if (rawValueType === void 0) { rawValueType = String; }
return [
"extra",
{
rawValue: rawValueType,
raw: String,
},
function getDefault() {
var value = types.getFieldValue(this, "value");
return {
rawValue: value,
raw: toRaw ? toRaw(value) : String(value),
};
},
];
}
// Split Literal
(_a = def("StringLiteral")
.bases("Literal")
.build("value")
.field("value", String))
.field.apply(_a, makeLiteralExtra(String, function (val) { return JSON.stringify(val); }));
(_b = def("NumericLiteral")
.bases("Literal")
.build("value")
.field("value", Number)
.field("raw", or(String, null), defaults["null"]))
.field.apply(_b, makeLiteralExtra(Number));
(_c = def("BigIntLiteral")
.bases("Literal")
.build("value")
// Only String really seems appropriate here, since BigInt values
// often exceed the limits of JS numbers.
.field("value", or(String, Number)))
.field.apply(_c, makeLiteralExtra(String, function (val) { return val + "n"; }));
// https://github.com/tc39/proposal-decimal
// https://github.com/babel/babel/pull/11640
(_d = def("DecimalLiteral")
.bases("Literal")
.build("value")
.field("value", String))
.field.apply(_d, makeLiteralExtra(String, function (val) { return val + "m"; }));
def("NullLiteral")
.bases("Literal")
.build()
.field("value", null, defaults["null"]);
def("BooleanLiteral")
.bases("Literal")
.build("value")
.field("value", Boolean);
(_e = def("RegExpLiteral")
.bases("Literal")
.build("pattern", "flags")
.field("pattern", String)
.field("flags", String)
.field("value", RegExp, function () {
return new RegExp(this.pattern, this.flags);
}))
.field.apply(_e, makeLiteralExtra(or(RegExp, isUndefined), function (exp) { return "/".concat(exp.pattern, "/").concat(exp.flags || ""); })).field("regex", {
pattern: String,
flags: String
}, function () {
return {
pattern: this.pattern,
flags: this.flags,
};
});
var ObjectExpressionProperty = or(def("Property"), def("ObjectMethod"), def("ObjectProperty"), def("SpreadProperty"), def("SpreadElement"));
// Split Property -> ObjectProperty and ObjectMethod
def("ObjectExpression")
.bases("Expression")
.build("properties")
.field("properties", [ObjectExpressionProperty]);
// ObjectMethod hoist .value properties to own properties
def("ObjectMethod")
.bases("Node", "Function")
.build("kind", "key", "params", "body", "computed")
.field("kind", or("method", "get", "set"))
.field("key", or(def("Literal"), def("Identifier"), def("Expression")))
.field("params", [def("Pattern")])
.field("body", def("BlockStatement"))
.field("computed", Boolean, defaults["false"])
.field("generator", Boolean, defaults["false"])
.field("async", Boolean, defaults["false"])
.field("accessibility", // TypeScript
or(def("Literal"), null), defaults["null"])
.field("decorators", or([def("Decorator")], null), defaults["null"]);
def("ObjectProperty")
.bases("Node")
.build("key", "value")
.field("key", or(def("Literal"), def("Identifier"), def("Expression")))
.field("value", or(def("Expression"), def("Pattern")))
.field("accessibility", // TypeScript
or(def("Literal"), null), defaults["null"])
.field("computed", Boolean, defaults["false"]);
var ClassBodyElement = or(def("MethodDefinition"), def("VariableDeclarator"), def("ClassPropertyDefinition"), def("ClassProperty"), def("ClassPrivateProperty"), def("ClassMethod"), def("ClassPrivateMethod"), def("ClassAccessorProperty"), def("StaticBlock"));
// MethodDefinition -> ClassMethod
def("ClassBody")
.bases("Declaration")
.build("body")
.field("body", [ClassBodyElement]);
def("ClassMethod")
.bases("Declaration", "Function")
.build("kind", "key", "params", "body", "computed", "static")
.field("key", or(def("Literal"), def("Identifier"), def("Expression")));
def("ClassPrivateMethod")
.bases("Declaration", "Function")
.build("key", "params", "body", "kind", "computed", "static")
.field("key", def("PrivateName"));
def("ClassAccessorProperty")
.bases("Declaration")
.build("key", "value", "decorators", "computed", "static")
.field("key", or(def("Literal"), def("Identifier"), def("PrivateName"),
// Only when .computed is true (TODO enforce this)
def("Expression")))
.field("value", or(def("Expression"), null), defaults["null"]);
["ClassMethod",
"ClassPrivateMethod",
].forEach(function (typeName) {
def(typeName)
.field("kind", or("get", "set", "method", "constructor"), function () { return "method"; })
.field("body", def("BlockStatement"))
// For backwards compatibility only. Expect accessibility instead (see below).
.field("access", or("public", "private", "protected", null), defaults["null"]);
});
["ClassMethod",
"ClassPrivateMethod",
"ClassAccessorProperty",
].forEach(function (typeName) {
def(typeName)
.field("computed", Boolean, defaults["false"])
.field("static", Boolean, defaults["false"])
.field("abstract", Boolean, defaults["false"])
.field("accessibility", or("public", "private", "protected", null), defaults["null"])
.field("decorators", or([def("Decorator")], null), defaults["null"])
.field("definite", Boolean, defaults["false"])
.field("optional", Boolean, defaults["false"])
.field("override", Boolean, defaults["false"])
.field("readonly", Boolean, defaults["false"]);
});
var ObjectPatternProperty = or(def("Property"), def("PropertyPattern"), def("SpreadPropertyPattern"), def("SpreadProperty"), // Used by Esprima
def("ObjectProperty"), // Babel 6
def("RestProperty"), // Babel 6
def("RestElement"));
// Split into RestProperty and SpreadProperty
def("ObjectPattern")
.bases("Pattern")
.build("properties")
.field("properties", [ObjectPatternProperty])
.field("decorators", or([def("Decorator")], null), defaults["null"]);
def("SpreadProperty")
.bases("Node")
.build("argument")
.field("argument", def("Expression"));
def("RestProperty")
.bases("Node")
.build("argument")
.field("argument", def("Expression"));
def("ForAwaitStatement")
.bases("Statement")
.build("left", "right", "body")
.field("left", or(def("VariableDeclaration"), def("Expression")))
.field("right", def("Expression"))
.field("body", def("Statement"));
// The callee node of a dynamic import(...) expression.
def("Import")
.bases("Expression")
.build();
}
exports.default = default_1;
;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=babel-core.js.map

1
node_modules/ast-types/lib/def/babel-core.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2
node_modules/ast-types/lib/def/babel.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { Fork } from "../types";
export default function (fork: Fork): void;

26
node_modules/ast-types/lib/def/babel.js generated vendored Normal file
View File

@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var types_1 = tslib_1.__importDefault(require("../types"));
var babel_core_1 = tslib_1.__importDefault(require("./babel-core"));
var flow_1 = tslib_1.__importDefault(require("./flow"));
var shared_1 = require("../shared");
function default_1(fork) {
var types = fork.use(types_1.default);
var def = types.Type.def;
fork.use(babel_core_1.default);
fork.use(flow_1.default);
// https://github.com/babel/babel/pull/10148
def("V8IntrinsicIdentifier")
.bases("Expression")
.build("name")
.field("name", String);
// https://github.com/babel/babel/pull/13191
// https://github.com/babel/website/pull/2541
def("TopicReference")
.bases("Expression")
.build();
}
exports.default = default_1;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=babel.js.map

1
node_modules/ast-types/lib/def/babel.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"babel.js","sourceRoot":"","sources":["../../src/def/babel.ts"],"names":[],"mappings":";;;AACA,2DAAmC;AACnC,oEAAwC;AACxC,wDAA6B;AAC7B,oCAAkD;AAElD,mBAAyB,IAAU;IACjC,IAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,eAAW,CAAC,CAAC;IACpC,IAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;IAE3B,IAAI,CAAC,GAAG,CAAC,oBAAY,CAAC,CAAC;IACvB,IAAI,CAAC,GAAG,CAAC,cAAO,CAAC,CAAC;IAElB,4CAA4C;IAC5C,GAAG,CAAC,uBAAuB,CAAC;SACzB,KAAK,CAAC,YAAY,CAAC;SACnB,KAAK,CAAC,MAAM,CAAC;SACb,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEzB,4CAA4C;IAC5C,6CAA6C;IAC7C,GAAG,CAAC,gBAAgB,CAAC;SAClB,KAAK,CAAC,YAAY,CAAC;SACnB,KAAK,EAAE,CAAC;AACb,CAAC;AAlBD,4BAkBC;AAED,IAAA,8BAAqB,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC,CAAC"}

2
node_modules/ast-types/lib/def/core.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { Fork } from "../types";
export default function (fork: Fork): void;

281
node_modules/ast-types/lib/def/core.js generated vendored Normal file
View File

@ -0,0 +1,281 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var core_1 = tslib_1.__importDefault(require("./operators/core"));
var types_1 = tslib_1.__importDefault(require("../types"));
var shared_1 = tslib_1.__importStar(require("../shared"));
function default_1(fork) {
var types = fork.use(types_1.default);
var Type = types.Type;
var def = Type.def;
var or = Type.or;
var shared = fork.use(shared_1.default);
var defaults = shared.defaults;
var geq = shared.geq;
var _a = fork.use(core_1.default), BinaryOperators = _a.BinaryOperators, AssignmentOperators = _a.AssignmentOperators, LogicalOperators = _a.LogicalOperators;
// Abstract supertype of all syntactic entities that are allowed to have a
// .loc field.
def("Printable")
.field("loc", or(def("SourceLocation"), null), defaults["null"], true);
def("Node")
.bases("Printable")
.field("type", String)
.field("comments", or([def("Comment")], null), defaults["null"], true);
def("SourceLocation")
.field("start", def("Position"))
.field("end", def("Position"))
.field("source", or(String, null), defaults["null"]);
def("Position")
.field("line", geq(1))
.field("column", geq(0));
def("File")
.bases("Node")
.build("program", "name")
.field("program", def("Program"))
.field("name", or(String, null), defaults["null"]);
def("Program")
.bases("Node")
.build("body")
.field("body", [def("Statement")]);
def("Function")
.bases("Node")
.field("id", or(def("Identifier"), null), defaults["null"])
.field("params", [def("Pattern")])
.field("body", def("BlockStatement"))
.field("generator", Boolean, defaults["false"])
.field("async", Boolean, defaults["false"]);
def("Statement").bases("Node");
// The empty .build() here means that an EmptyStatement can be constructed
// (i.e. it's not abstract) but that it needs no arguments.
def("EmptyStatement").bases("Statement").build();
def("BlockStatement")
.bases("Statement")
.build("body")
.field("body", [def("Statement")]);
// TODO Figure out how to silently coerce Expressions to
// ExpressionStatements where a Statement was expected.
def("ExpressionStatement")
.bases("Statement")
.build("expression")
.field("expression", def("Expression"));
def("IfStatement")
.bases("Statement")
.build("test", "consequent", "alternate")
.field("test", def("Expression"))
.field("consequent", def("Statement"))
.field("alternate", or(def("Statement"), null), defaults["null"]);
def("LabeledStatement")
.bases("Statement")
.build("label", "body")
.field("label", def("Identifier"))
.field("body", def("Statement"));
def("BreakStatement")
.bases("Statement")
.build("label")
.field("label", or(def("Identifier"), null), defaults["null"]);
def("ContinueStatement")
.bases("Statement")
.build("label")
.field("label", or(def("Identifier"), null), defaults["null"]);
def("WithStatement")
.bases("Statement")
.build("object", "body")
.field("object", def("Expression"))
.field("body", def("Statement"));
def("SwitchStatement")
.bases("Statement")
.build("discriminant", "cases", "lexical")
.field("discriminant", def("Expression"))
.field("cases", [def("SwitchCase")])
.field("lexical", Boolean, defaults["false"]);
def("ReturnStatement")
.bases("Statement")
.build("argument")
.field("argument", or(def("Expression"), null));
def("ThrowStatement")
.bases("Statement")
.build("argument")
.field("argument", def("Expression"));
def("TryStatement")
.bases("Statement")
.build("block", "handler", "finalizer")
.field("block", def("BlockStatement"))
.field("handler", or(def("CatchClause"), null), function () {
return this.handlers && this.handlers[0] || null;
})
.field("handlers", [def("CatchClause")], function () {
return this.handler ? [this.handler] : [];
}, true) // Indicates this field is hidden from eachField iteration.
.field("guardedHandlers", [def("CatchClause")], defaults.emptyArray)
.field("finalizer", or(def("BlockStatement"), null), defaults["null"]);
def("CatchClause")
.bases("Node")
.build("param", "guard", "body")
.field("param", def("Pattern"))
.field("guard", or(def("Expression"), null), defaults["null"])
.field("body", def("BlockStatement"));
def("WhileStatement")
.bases("Statement")
.build("test", "body")
.field("test", def("Expression"))
.field("body", def("Statement"));
def("DoWhileStatement")
.bases("Statement")
.build("body", "test")
.field("body", def("Statement"))
.field("test", def("Expression"));
def("ForStatement")
.bases("Statement")
.build("init", "test", "update", "body")
.field("init", or(def("VariableDeclaration"), def("Expression"), null))
.field("test", or(def("Expression"), null))
.field("update", or(def("Expression"), null))
.field("body", def("Statement"));
def("ForInStatement")
.bases("Statement")
.build("left", "right", "body")
.field("left", or(def("VariableDeclaration"), def("Expression")))
.field("right", def("Expression"))
.field("body", def("Statement"));
def("DebuggerStatement").bases("Statement").build();
def("Declaration").bases("Statement");
def("FunctionDeclaration")
.bases("Function", "Declaration")
.build("id", "params", "body")
.field("id", def("Identifier"));
def("FunctionExpression")
.bases("Function", "Expression")
.build("id", "params", "body");
def("VariableDeclaration")
.bases("Declaration")
.build("kind", "declarations")
.field("kind", or("var", "let", "const"))
.field("declarations", [def("VariableDeclarator")]);
def("VariableDeclarator")
.bases("Node")
.build("id", "init")
.field("id", def("Pattern"))
.field("init", or(def("Expression"), null), defaults["null"]);
def("Expression").bases("Node");
def("ThisExpression").bases("Expression").build();
def("ArrayExpression")
.bases("Expression")
.build("elements")
.field("elements", [or(def("Expression"), null)]);
def("ObjectExpression")
.bases("Expression")
.build("properties")
.field("properties", [def("Property")]);
// TODO Not in the Mozilla Parser API, but used by Esprima.
def("Property")
.bases("Node") // Want to be able to visit Property Nodes.
.build("kind", "key", "value")
.field("kind", or("init", "get", "set"))
.field("key", or(def("Literal"), def("Identifier")))
.field("value", def("Expression"));
def("SequenceExpression")
.bases("Expression")
.build("expressions")
.field("expressions", [def("Expression")]);
var UnaryOperator = or("-", "+", "!", "~", "typeof", "void", "delete");
def("UnaryExpression")
.bases("Expression")
.build("operator", "argument", "prefix")
.field("operator", UnaryOperator)
.field("argument", def("Expression"))
// Esprima doesn't bother with this field, presumably because it's
// always true for unary operators.
.field("prefix", Boolean, defaults["true"]);
var BinaryOperator = or.apply(void 0, BinaryOperators);
def("BinaryExpression")
.bases("Expression")
.build("operator", "left", "right")
.field("operator", BinaryOperator)
.field("left", def("Expression"))
.field("right", def("Expression"));
var AssignmentOperator = or.apply(void 0, AssignmentOperators);
def("AssignmentExpression")
.bases("Expression")
.build("operator", "left", "right")
.field("operator", AssignmentOperator)
.field("left", or(def("Pattern"), def("MemberExpression")))
.field("right", def("Expression"));
var UpdateOperator = or("++", "--");
def("UpdateExpression")
.bases("Expression")
.build("operator", "argument", "prefix")
.field("operator", UpdateOperator)
.field("argument", def("Expression"))
.field("prefix", Boolean);
var LogicalOperator = or.apply(void 0, LogicalOperators);
def("LogicalExpression")
.bases("Expression")
.build("operator", "left", "right")
.field("operator", LogicalOperator)
.field("left", def("Expression"))
.field("right", def("Expression"));
def("ConditionalExpression")
.bases("Expression")
.build("test", "consequent", "alternate")
.field("test", def("Expression"))
.field("consequent", def("Expression"))
.field("alternate", def("Expression"));
def("NewExpression")
.bases("Expression")
.build("callee", "arguments")
.field("callee", def("Expression"))
// The Mozilla Parser API gives this type as [or(def("Expression"),
// null)], but null values don't really make sense at the call site.
// TODO Report this nonsense.
.field("arguments", [def("Expression")]);
def("CallExpression")
.bases("Expression")
.build("callee", "arguments")
.field("callee", def("Expression"))
// See comment for NewExpression above.
.field("arguments", [def("Expression")]);
def("MemberExpression")
.bases("Expression")
.build("object", "property", "computed")
.field("object", def("Expression"))
.field("property", or(def("Identifier"), def("Expression")))
.field("computed", Boolean, function () {
var type = this.property.type;
if (type === 'Literal' ||
type === 'MemberExpression' ||
type === 'BinaryExpression') {
return true;
}
return false;
});
def("Pattern").bases("Node");
def("SwitchCase")
.bases("Node")
.build("test", "consequent")
.field("test", or(def("Expression"), null))
.field("consequent", [def("Statement")]);
def("Identifier")
.bases("Expression", "Pattern")
.build("name")
.field("name", String)
.field("optional", Boolean, defaults["false"]);
def("Literal")
.bases("Expression")
.build("value")
.field("value", or(String, Boolean, null, Number, RegExp, BigInt));
// Abstract (non-buildable) comment supertype. Not a Node.
def("Comment")
.bases("Printable")
.field("value", String)
// A .leading comment comes before the node, whereas a .trailing
// comment comes after it. These two fields should not both be true,
// but they might both be false when the comment falls inside a node
// and the node has no children for the comment to lead or trail,
// e.g. { /*dangling*/ }.
.field("leading", Boolean, defaults["true"])
.field("trailing", Boolean, defaults["false"]);
}
exports.default = default_1;
;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=core.js.map

1
node_modules/ast-types/lib/def/core.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2
node_modules/ast-types/lib/def/es-proposals.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { Fork } from "../types";
export default function (fork: Fork): void;

70
node_modules/ast-types/lib/def/es-proposals.js generated vendored Normal file
View File

@ -0,0 +1,70 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var types_1 = tslib_1.__importDefault(require("../types"));
var shared_1 = tslib_1.__importStar(require("../shared"));
var es2022_1 = tslib_1.__importDefault(require("./es2022"));
function default_1(fork) {
fork.use(es2022_1.default);
var types = fork.use(types_1.default);
var Type = types.Type;
var def = types.Type.def;
var or = Type.or;
var shared = fork.use(shared_1.default);
var defaults = shared.defaults;
def("AwaitExpression")
.build("argument", "all")
.field("argument", or(def("Expression"), null))
.field("all", Boolean, defaults["false"]);
// Decorators
def("Decorator")
.bases("Node")
.build("expression")
.field("expression", def("Expression"));
def("Property")
.field("decorators", or([def("Decorator")], null), defaults["null"]);
def("MethodDefinition")
.field("decorators", or([def("Decorator")], null), defaults["null"]);
// Private names
def("PrivateName")
.bases("Expression", "Pattern")
.build("id")
.field("id", def("Identifier"));
def("ClassPrivateProperty")
.bases("ClassProperty")
.build("key", "value")
.field("key", def("PrivateName"))
.field("value", or(def("Expression"), null), defaults["null"]);
// https://github.com/tc39/proposal-import-assertions
def("ImportAttribute")
.bases("Node")
.build("key", "value")
.field("key", or(def("Identifier"), def("Literal")))
.field("value", def("Expression"));
["ImportDeclaration",
"ExportAllDeclaration",
"ExportNamedDeclaration",
].forEach(function (decl) {
def(decl).field("assertions", [def("ImportAttribute")], defaults.emptyArray);
});
// https://github.com/tc39/proposal-record-tuple
// https://github.com/babel/babel/pull/10865
def("RecordExpression")
.bases("Expression")
.build("properties")
.field("properties", [or(def("ObjectProperty"), def("ObjectMethod"), def("SpreadElement"))]);
def("TupleExpression")
.bases("Expression")
.build("elements")
.field("elements", [or(def("Expression"), def("SpreadElement"), null)]);
// https://github.com/tc39/proposal-js-module-blocks
// https://github.com/babel/babel/pull/12469
def("ModuleExpression")
.bases("Node")
.build("body")
.field("body", def("Program"));
}
exports.default = default_1;
;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=es-proposals.js.map

1
node_modules/ast-types/lib/def/es-proposals.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"es-proposals.js","sourceRoot":"","sources":["../../src/def/es-proposals.ts"],"names":[],"mappings":";;;AACA,2DAAmC;AACnC,0DAAgE;AAChE,4DAAiC;AAEjC,mBAAyB,IAAU;IACjC,IAAI,CAAC,GAAG,CAAC,gBAAS,CAAC,CAAC;IAEpB,IAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,eAAW,CAAC,CAAC;IACpC,IAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IACxB,IAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;IAC3B,IAAM,EAAE,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5C,GAAG,CAAC,kBAAkB,CAAC;SACpB,KAAK,CAAC,MAAM,CAAC;SACb,KAAK,CAAC,MAAM,CAAC;SACb,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;AACnC,CAAC;AAvFD,4BAuFC;AAAA,CAAC;AAEF,IAAA,8BAAqB,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC,CAAC"}

2
node_modules/ast-types/lib/def/es2016.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { Fork } from "../types";
export default function (fork: Fork): void;

17
node_modules/ast-types/lib/def/es2016.js generated vendored Normal file
View File

@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var es2016_1 = tslib_1.__importDefault(require("./operators/es2016"));
var es6_1 = tslib_1.__importDefault(require("./es6"));
var shared_1 = require("../shared");
function default_1(fork) {
// The es2016OpsDef plugin comes before es6Def so BinaryOperators and
// AssignmentOperators will be appropriately augmented before they are first
// used in the core definitions for this fork.
fork.use(es2016_1.default);
fork.use(es6_1.default);
}
exports.default = default_1;
;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=es2016.js.map

1
node_modules/ast-types/lib/def/es2016.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"es2016.js","sourceRoot":"","sources":["../../src/def/es2016.ts"],"names":[],"mappings":";;;AACA,sEAA8C;AAC9C,sDAA2B;AAC3B,oCAAkD;AAElD,mBAAyB,IAAU;IACjC,qEAAqE;IACrE,4EAA4E;IAC5E,8CAA8C;IAC9C,IAAI,CAAC,GAAG,CAAC,gBAAY,CAAC,CAAC;IACvB,IAAI,CAAC,GAAG,CAAC,aAAM,CAAC,CAAC;AACnB,CAAC;AAND,4BAMC;AAAA,CAAC;AAEF,IAAA,8BAAqB,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC,CAAC"}

2
node_modules/ast-types/lib/def/es2017.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { Fork } from "../types";
export default function (fork: Fork): void;

22
node_modules/ast-types/lib/def/es2017.js generated vendored Normal file
View File

@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var es2016_1 = tslib_1.__importDefault(require("./es2016"));
var types_1 = tslib_1.__importDefault(require("../types"));
var shared_1 = tslib_1.__importStar(require("../shared"));
function default_1(fork) {
fork.use(es2016_1.default);
var types = fork.use(types_1.default);
var def = types.Type.def;
var defaults = fork.use(shared_1.default).defaults;
def("Function")
.field("async", Boolean, defaults["false"]);
def("AwaitExpression")
.bases("Expression")
.build("argument")
.field("argument", def("Expression"));
}
exports.default = default_1;
;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=es2017.js.map

1
node_modules/ast-types/lib/def/es2017.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"es2017.js","sourceRoot":"","sources":["../../src/def/es2017.ts"],"names":[],"mappings":";;;AACA,4DAAiC;AACjC,2DAAmC;AACnC,0DAAgE;AAEhE,mBAAyB,IAAU;IACjC,IAAI,CAAC,GAAG,CAAC,gBAAS,CAAC,CAAC;IAEpB,IAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,eAAW,CAAC,CAAC;IACpC,IAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;IAC3B,IAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAY,CAAC,CAAC,QAAQ,CAAC;IAEjD,GAAG,CAAC,UAAU,CAAC;SACZ,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IAE9C,GAAG,CAAC,iBAAiB,CAAC;SACnB,KAAK,CAAC,YAAY,CAAC;SACnB,KAAK,CAAC,UAAU,CAAC;SACjB,KAAK,CAAC,UAAU,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;AAC1C,CAAC;AAdD,4BAcC;AAAA,CAAC;AAEF,IAAA,8BAAqB,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC,CAAC"}

2
node_modules/ast-types/lib/def/es2018.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { Fork } from "../types";
export default function (fork: Fork): void;

36
node_modules/ast-types/lib/def/es2018.js generated vendored Normal file
View File

@ -0,0 +1,36 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var es2017_1 = tslib_1.__importDefault(require("./es2017"));
var types_1 = tslib_1.__importDefault(require("../types"));
var shared_1 = tslib_1.__importStar(require("../shared"));
function default_1(fork) {
fork.use(es2017_1.default);
var types = fork.use(types_1.default);
var def = types.Type.def;
var or = types.Type.or;
var defaults = fork.use(shared_1.default).defaults;
def("ForOfStatement")
.field("await", Boolean, defaults["false"]);
// Legacy
def("SpreadProperty")
.bases("Node")
.build("argument")
.field("argument", def("Expression"));
def("ObjectExpression")
.field("properties", [or(def("Property"), def("SpreadProperty"), // Legacy
def("SpreadElement"))]);
def("TemplateElement")
.field("value", { "cooked": or(String, null), "raw": String });
// Legacy
def("SpreadPropertyPattern")
.bases("Pattern")
.build("argument")
.field("argument", def("Pattern"));
def("ObjectPattern")
.field("properties", [or(def("PropertyPattern"), def("Property"), def("RestElement"), def("SpreadPropertyPattern"))]);
}
exports.default = default_1;
;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=es2018.js.map

1
node_modules/ast-types/lib/def/es2018.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"es2018.js","sourceRoot":"","sources":["../../src/def/es2018.ts"],"names":[],"mappings":";;;AACA,4DAAiC;AACjC,2DAAmC;AACnC,0DAAgE;AAEhE,mBAAyB,IAAU;IACjC,IAAI,CAAC,GAAG,CAAC,gBAAS,CAAC,CAAC;IAEpB,IAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,eAAW,CA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CAAC,CAAC,CAAC;AAC1H,CAAC;AAnCD,4BAmCC;AAAA,CAAC;AAEF,IAAA,8BAAqB,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC,CAAC"}

2
node_modules/ast-types/lib/def/es2019.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { Fork } from "../types";
export default function (fork: Fork): void;

19
node_modules/ast-types/lib/def/es2019.js generated vendored Normal file
View File

@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var es2018_1 = tslib_1.__importDefault(require("./es2018"));
var types_1 = tslib_1.__importDefault(require("../types"));
var shared_1 = tslib_1.__importStar(require("../shared"));
function default_1(fork) {
fork.use(es2018_1.default);
var types = fork.use(types_1.default);
var def = types.Type.def;
var or = types.Type.or;
var defaults = fork.use(shared_1.default).defaults;
def("CatchClause")
.field("param", or(def("Pattern"), null), defaults["null"]);
}
exports.default = default_1;
;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=es2019.js.map

1
node_modules/ast-types/lib/def/es2019.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"es2019.js","sourceRoot":"","sources":["../../src/def/es2019.ts"],"names":[],"mappings":";;;AACA,4DAAiC;AACjC,2DAAmC;AACnC,0DAAgE;AAEhE,mBAAyB,IAAU;IACjC,IAAI,CAAC,GAAG,CAAC,gBAAS,CAAC,CAAC;IAEpB,IAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,eAAW,CAAC,CAAC;IACpC,IAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;IAC3B,IAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;IACzB,IAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAY,CAAC,CAAC,QAAQ,CAAC;IAEjD,GAAG,CAAC,aAAa,CAAC;SACf,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AAChE,CAAC;AAVD,4BAUC;AAAA,CAAC;AAEF,IAAA,8BAAqB,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC,CAAC"}

2
node_modules/ast-types/lib/def/es2020.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { Fork } from "../types";
export default function (fork: Fork): void;

52
node_modules/ast-types/lib/def/es2020.js generated vendored Normal file
View File

@ -0,0 +1,52 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var es2020_1 = tslib_1.__importDefault(require("./operators/es2020"));
var es2019_1 = tslib_1.__importDefault(require("./es2019"));
var types_1 = tslib_1.__importDefault(require("../types"));
var shared_1 = tslib_1.__importStar(require("../shared"));
function default_1(fork) {
// The es2020OpsDef plugin comes before es2019Def so LogicalOperators will be
// appropriately augmented before first used.
fork.use(es2020_1.default);
fork.use(es2019_1.default);
var types = fork.use(types_1.default);
var def = types.Type.def;
var or = types.Type.or;
var shared = fork.use(shared_1.default);
var defaults = shared.defaults;
def("ImportExpression")
.bases("Expression")
.build("source")
.field("source", def("Expression"));
def("ExportAllDeclaration")
.bases("Declaration")
.build("source", "exported")
.field("source", def("Literal"))
.field("exported", or(def("Identifier"), null, void 0), defaults["null"]);
// Optional chaining
def("ChainElement")
.bases("Node")
.field("optional", Boolean, defaults["false"]);
def("CallExpression")
.bases("Expression", "ChainElement");
def("MemberExpression")
.bases("Expression", "ChainElement");
def("ChainExpression")
.bases("Expression")
.build("expression")
.field("expression", def("ChainElement"));
def("OptionalCallExpression")
.bases("CallExpression")
.build("callee", "arguments", "optional")
.field("optional", Boolean, defaults["true"]);
// Deprecated optional chaining type, doesn't work with babelParser@7.11.0 or newer
def("OptionalMemberExpression")
.bases("MemberExpression")
.build("object", "property", "computed", "optional")
.field("optional", Boolean, defaults["true"]);
}
exports.default = default_1;
;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=es2020.js.map

1
node_modules/ast-types/lib/def/es2020.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"es2020.js","sourceRoot":"","sources":["../../src/def/es2020.ts"],"names":[],"mappings":";;;AACA,sEAA8C;AAC9C,4DAAiC;AACjC,2DAAmC;AACnC,0DAAgE;AAEhE,mBAAyB,IAAU;IACjC,6EAA6E;IAC7E,6CAA6C;IAC7C,IAAI,CAAC,GAAG,CAAC,gBAAY,CAAC,CAAC;IAEvB,IAAI,CAAC,GAAG,CAAC,gBAAS,CAAC,CAAC;IAEpB,IAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,eAAW,CAAC,CAAC;IACpC,IAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;IAC3B,IAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;IAEzB,IAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAY,CAAC,CAAC;IACtC,IAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IAEjC,GAAG,CAAC,kBAAkB,CAAC;SACpB,KAAK,CAAC,YAAY,CAAC;SACnB,KAAK,CAAC,QAAQ,CAAC;SACf,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;IAEtC,GAAG,CAAC,sBAAsB,CAAC;SACxB,KAAK,CAAC,aAAa,CAAC;SACpB,KAAK,CAAC,QAAQ,EAAE,UAAU,CAAC;SAC3B,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;SAC/B,KAAK,CAAC,UAAU,EAAE,EAAE,CACnB,GAAG,CAAC,YAAY,CAAC,EACjB,IAAI,EACJ,KAAK,CAAC,CACP,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAEvB,oBAAoB;IACpB,GAAG,CAAC,cAAc,CAAC;SAChB,KAAK,CAAC,MAAM,CAAC;SACb,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IAEjD,GAAG,CAAC,gBAAgB,CAAC;SAClB,KAAK,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;IAEvC,GAAG,CAAC,kBAAkB,CAAC;SACpB,KAAK,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;IAEvC,GAAG,CAAC,iBAAiB,CAAC;SACnB,KAAK,CAAC,YAAY,CAAC;SACnB,KAAK,CAAC,YAAY,CAAC;SACnB,KAAK,CAAC,YAAY,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC;IAE5C,GAAG,CAAC,wBAAwB,CAAC;SAC1B,KAAK,CAAC,gBAAgB,CAAC;SACvB,KAAK,CAAC,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAC;SACxC,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAEhD,mFAAmF;IACnF,GAAG,CAAC,0BAA0B,CAAC;SAC5B,KAAK,CAAC,kBAAkB,CAAC;SACzB,KAAK,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC;SACnD,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AAClD,CAAC;AAvDD,4BAuDC;AAAA,CAAC;AAEF,IAAA,8BAAqB,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC,CAAC"}

2
node_modules/ast-types/lib/def/es2021.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { Fork } from "../types";
export default function (fork: Fork): void;

15
node_modules/ast-types/lib/def/es2021.js generated vendored Normal file
View File

@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var es2021_1 = tslib_1.__importDefault(require("./operators/es2021"));
var es2020_1 = tslib_1.__importDefault(require("./es2020"));
var shared_1 = require("../shared");
function default_1(fork) {
// The es2021OpsDef plugin comes before es2020Def so AssignmentOperators will
// be appropriately augmented before first used.
fork.use(es2021_1.default);
fork.use(es2020_1.default);
}
exports.default = default_1;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=es2021.js.map

1
node_modules/ast-types/lib/def/es2021.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"es2021.js","sourceRoot":"","sources":["../../src/def/es2021.ts"],"names":[],"mappings":";;;AACA,sEAA8C;AAC9C,4DAAiC;AACjC,oCAAkD;AAElD,mBAAyB,IAAU;IACjC,6EAA6E;IAC7E,gDAAgD;IAChD,IAAI,CAAC,GAAG,CAAC,gBAAY,CAAC,CAAC;IACvB,IAAI,CAAC,GAAG,CAAC,gBAAS,CAAC,CAAC;AACtB,CAAC;AALD,4BAKC;AAED,IAAA,8BAAqB,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC,CAAC"}

2
node_modules/ast-types/lib/def/es2022.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { Fork } from "../types";
export default function (fork: Fork): void;

18
node_modules/ast-types/lib/def/es2022.js generated vendored Normal file
View File

@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var es2021_1 = tslib_1.__importDefault(require("./es2021"));
var types_1 = tslib_1.__importDefault(require("../types"));
var shared_1 = require("../shared");
function default_1(fork) {
fork.use(es2021_1.default);
var types = fork.use(types_1.default);
var def = types.Type.def;
def("StaticBlock")
.bases("Declaration")
.build("body")
.field("body", [def("Statement")]);
}
exports.default = default_1;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=es2022.js.map

1
node_modules/ast-types/lib/def/es2022.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"es2022.js","sourceRoot":"","sources":["../../src/def/es2022.ts"],"names":[],"mappings":";;;AACA,4DAAiC;AACjC,2DAAmC;AACnC,oCAAkD;AAElD,mBAAyB,IAAU;IACjC,IAAI,CAAC,GAAG,CAAC,gBAAS,CAAC,CAAC;IAEpB,IAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,eAAW,CAAC,CAAC;IACpC,IAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;IAE3B,GAAG,CAAC,aAAa,CAAC;SACf,KAAK,CAAC,aAAa,CAAC;SACpB,KAAK,CAAC,MAAM,CAAC;SACb,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;AACvC,CAAC;AAVD,4BAUC;AAED,IAAA,8BAAqB,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC,CAAC"}

2
node_modules/ast-types/lib/def/es6.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { Fork } from "../types";
export default function (fork: Fork): void;

238
node_modules/ast-types/lib/def/es6.js generated vendored Normal file
View File

@ -0,0 +1,238 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var core_1 = tslib_1.__importDefault(require("./core"));
var types_1 = tslib_1.__importDefault(require("../types"));
var shared_1 = tslib_1.__importStar(require("../shared"));
function default_1(fork) {
fork.use(core_1.default);
var types = fork.use(types_1.default);
var def = types.Type.def;
var or = types.Type.or;
var defaults = fork.use(shared_1.default).defaults;
def("Function")
.field("generator", Boolean, defaults["false"])
.field("expression", Boolean, defaults["false"])
.field("defaults", [or(def("Expression"), null)], defaults.emptyArray)
// Legacy
.field("rest", or(def("Identifier"), null), defaults["null"]);
// The ESTree way of representing a ...rest parameter.
def("RestElement")
.bases("Pattern")
.build("argument")
.field("argument", def("Pattern"))
.field("typeAnnotation", // for Babylon. Flow parser puts it on the identifier
or(def("TypeAnnotation"), def("TSTypeAnnotation"), null), defaults["null"]);
def("SpreadElementPattern")
.bases("Pattern")
.build("argument")
.field("argument", def("Pattern"));
def("FunctionDeclaration")
.build("id", "params", "body", "generator", "expression")
// May be `null` in the context of `export default function () {}`
.field("id", or(def("Identifier"), null));
def("FunctionExpression")
.build("id", "params", "body", "generator", "expression");
def("ArrowFunctionExpression")
.bases("Function", "Expression")
.build("params", "body", "expression")
// The forced null value here is compatible with the overridden
// definition of the "id" field in the Function interface.
.field("id", null, defaults["null"])
// Arrow function bodies are allowed to be expressions.
.field("body", or(def("BlockStatement"), def("Expression")))
// The current spec forbids arrow generators, so I have taken the
// liberty of enforcing that. TODO Report this.
.field("generator", false, defaults["false"]);
def("ForOfStatement")
.bases("Statement")
.build("left", "right", "body")
.field("left", or(def("VariableDeclaration"), def("Pattern")))
.field("right", def("Expression"))
.field("body", def("Statement"));
def("YieldExpression")
.bases("Expression")
.build("argument", "delegate")
.field("argument", or(def("Expression"), null))
.field("delegate", Boolean, defaults["false"]);
def("GeneratorExpression")
.bases("Expression")
.build("body", "blocks", "filter")
.field("body", def("Expression"))
.field("blocks", [def("ComprehensionBlock")])
.field("filter", or(def("Expression"), null));
def("ComprehensionExpression")
.bases("Expression")
.build("body", "blocks", "filter")
.field("body", def("Expression"))
.field("blocks", [def("ComprehensionBlock")])
.field("filter", or(def("Expression"), null));
def("ComprehensionBlock")
.bases("Node")
.build("left", "right", "each")
.field("left", def("Pattern"))
.field("right", def("Expression"))
.field("each", Boolean);
def("Property")
.field("key", or(def("Literal"), def("Identifier"), def("Expression")))
.field("value", or(def("Expression"), def("Pattern")))
.field("method", Boolean, defaults["false"])
.field("shorthand", Boolean, defaults["false"])
.field("computed", Boolean, defaults["false"]);
def("ObjectProperty")
.field("shorthand", Boolean, defaults["false"]);
def("PropertyPattern")
.bases("Pattern")
.build("key", "pattern")
.field("key", or(def("Literal"), def("Identifier"), def("Expression")))
.field("pattern", def("Pattern"))
.field("computed", Boolean, defaults["false"]);
def("ObjectPattern")
.bases("Pattern")
.build("properties")
.field("properties", [or(def("PropertyPattern"), def("Property"))]);
def("ArrayPattern")
.bases("Pattern")
.build("elements")
.field("elements", [or(def("Pattern"), null)]);
def("SpreadElement")
.bases("Node")
.build("argument")
.field("argument", def("Expression"));
def("ArrayExpression")
.field("elements", [or(def("Expression"), def("SpreadElement"), def("RestElement"), null)]);
def("NewExpression")
.field("arguments", [or(def("Expression"), def("SpreadElement"))]);
def("CallExpression")
.field("arguments", [or(def("Expression"), def("SpreadElement"))]);
// Note: this node type is *not* an AssignmentExpression with a Pattern on
// the left-hand side! The existing AssignmentExpression type already
// supports destructuring assignments. AssignmentPattern nodes may appear
// wherever a Pattern is allowed, and the right-hand side represents a
// default value to be destructured against the left-hand side, if no
// value is otherwise provided. For example: default parameter values.
def("AssignmentPattern")
.bases("Pattern")
.build("left", "right")
.field("left", def("Pattern"))
.field("right", def("Expression"));
def("MethodDefinition")
.bases("Declaration")
.build("kind", "key", "value", "static")
.field("kind", or("constructor", "method", "get", "set"))
.field("key", def("Expression"))
.field("value", def("Function"))
.field("computed", Boolean, defaults["false"])
.field("static", Boolean, defaults["false"]);
var ClassBodyElement = or(def("MethodDefinition"), def("VariableDeclarator"), def("ClassPropertyDefinition"), def("ClassProperty"), def("StaticBlock"));
def("ClassProperty")
.bases("Declaration")
.build("key")
.field("key", or(def("Literal"), def("Identifier"), def("Expression")))
.field("computed", Boolean, defaults["false"]);
def("ClassPropertyDefinition") // static property
.bases("Declaration")
.build("definition")
// Yes, Virginia, circular definitions are permitted.
.field("definition", ClassBodyElement);
def("ClassBody")
.bases("Declaration")
.build("body")
.field("body", [ClassBodyElement]);
def("ClassDeclaration")
.bases("Declaration")
.build("id", "body", "superClass")
.field("id", or(def("Identifier"), null))
.field("body", def("ClassBody"))
.field("superClass", or(def("Expression"), null), defaults["null"]);
def("ClassExpression")
.bases("Expression")
.build("id", "body", "superClass")
.field("id", or(def("Identifier"), null), defaults["null"])
.field("body", def("ClassBody"))
.field("superClass", or(def("Expression"), null), defaults["null"]);
def("Super")
.bases("Expression")
.build();
// Specifier and ModuleSpecifier are abstract non-standard types
// introduced for definitional convenience.
def("Specifier").bases("Node");
// This supertype is shared/abused by both def/babel.js and
// def/esprima.js. In the future, it will be possible to load only one set
// of definitions appropriate for a given parser, but until then we must
// rely on default functions to reconcile the conflicting AST formats.
def("ModuleSpecifier")
.bases("Specifier")
// This local field is used by Babel/Acorn. It should not technically
// be optional in the Babel/Acorn AST format, but it must be optional
// in the Esprima AST format.
.field("local", or(def("Identifier"), null), defaults["null"])
// The id and name fields are used by Esprima. The id field should not
// technically be optional in the Esprima AST format, but it must be
// optional in the Babel/Acorn AST format.
.field("id", or(def("Identifier"), null), defaults["null"])
.field("name", or(def("Identifier"), null), defaults["null"]);
// import {<id [as name]>} from ...;
def("ImportSpecifier")
.bases("ModuleSpecifier")
.build("imported", "local")
.field("imported", def("Identifier"));
// import <id> from ...;
def("ImportDefaultSpecifier")
.bases("ModuleSpecifier")
.build("local");
// import <* as id> from ...;
def("ImportNamespaceSpecifier")
.bases("ModuleSpecifier")
.build("local");
def("ImportDeclaration")
.bases("Declaration")
.build("specifiers", "source", "importKind")
.field("specifiers", [or(def("ImportSpecifier"), def("ImportNamespaceSpecifier"), def("ImportDefaultSpecifier"))], defaults.emptyArray)
.field("source", def("Literal"))
.field("importKind", or("value", "type"), function () {
return "value";
});
def("ExportNamedDeclaration")
.bases("Declaration")
.build("declaration", "specifiers", "source")
.field("declaration", or(def("Declaration"), null))
.field("specifiers", [def("ExportSpecifier")], defaults.emptyArray)
.field("source", or(def("Literal"), null), defaults["null"]);
def("ExportSpecifier")
.bases("ModuleSpecifier")
.build("local", "exported")
.field("exported", def("Identifier"));
def("ExportDefaultDeclaration")
.bases("Declaration")
.build("declaration")
.field("declaration", or(def("Declaration"), def("Expression")));
def("ExportAllDeclaration")
.bases("Declaration")
.build("source")
.field("source", def("Literal"));
def("TaggedTemplateExpression")
.bases("Expression")
.build("tag", "quasi")
.field("tag", def("Expression"))
.field("quasi", def("TemplateLiteral"));
def("TemplateLiteral")
.bases("Expression")
.build("quasis", "expressions")
.field("quasis", [def("TemplateElement")])
.field("expressions", [def("Expression")]);
def("TemplateElement")
.bases("Node")
.build("value", "tail")
.field("value", { "cooked": String, "raw": String })
.field("tail", Boolean);
def("MetaProperty")
.bases("Expression")
.build("meta", "property")
.field("meta", def("Identifier"))
.field("property", def("Identifier"));
}
exports.default = default_1;
;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=es6.js.map

1
node_modules/ast-types/lib/def/es6.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2
node_modules/ast-types/lib/def/esprima.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { Fork } from "../types";
export default function (fork: Fork): void;

51
node_modules/ast-types/lib/def/esprima.js generated vendored Normal file
View File

@ -0,0 +1,51 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var es_proposals_1 = tslib_1.__importDefault(require("./es-proposals"));
var types_1 = tslib_1.__importDefault(require("../types"));
var shared_1 = tslib_1.__importStar(require("../shared"));
function default_1(fork) {
fork.use(es_proposals_1.default);
var types = fork.use(types_1.default);
var defaults = fork.use(shared_1.default).defaults;
var def = types.Type.def;
var or = types.Type.or;
def("VariableDeclaration")
.field("declarations", [or(def("VariableDeclarator"), def("Identifier") // Esprima deviation.
)]);
def("Property")
.field("value", or(def("Expression"), def("Pattern") // Esprima deviation.
));
def("ArrayPattern")
.field("elements", [or(def("Pattern"), def("SpreadElement"), null)]);
def("ObjectPattern")
.field("properties", [or(def("Property"), def("PropertyPattern"), def("SpreadPropertyPattern"), def("SpreadProperty") // Used by Esprima.
)]);
// Like ModuleSpecifier, except type:"ExportSpecifier" and buildable.
// export {<id [as name]>} [from ...];
def("ExportSpecifier")
.bases("ModuleSpecifier")
.build("id", "name");
// export <*> from ...;
def("ExportBatchSpecifier")
.bases("Specifier")
.build();
def("ExportDeclaration")
.bases("Declaration")
.build("default", "declaration", "specifiers", "source")
.field("default", Boolean)
.field("declaration", or(def("Declaration"), def("Expression"), // Implies default.
null))
.field("specifiers", [or(def("ExportSpecifier"), def("ExportBatchSpecifier"))], defaults.emptyArray)
.field("source", or(def("Literal"), null), defaults["null"]);
def("Block")
.bases("Comment")
.build("value", /*optional:*/ "leading", "trailing");
def("Line")
.bases("Comment")
.build("value", /*optional:*/ "leading", "trailing");
}
exports.default = default_1;
;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=esprima.js.map

1
node_modules/ast-types/lib/def/esprima.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"esprima.js","sourceRoot":"","sources":["../../src/def/esprima.ts"],"names":[],"mappings":";;;AACA,wEAA4C;AAC5C,2DAAmC;AACnC,0DAAgE;AAEhE,mBAAyB,IAAU;IACjC,IAAI,CAAC,GAAG,CAAC,sBAAc,CAAC,CAAC;IAEzB,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,eAAW,CAAC,CAAC;IAClC,IAAI,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAY,CAAC,CAAC,QAAQ,CAAC;IAC/C,IAAI,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;IACzB,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;IAEvB,GAAG,CAAC,qBAAqB,CAAC;SACvB,KAAK,CAAC,cAAc,EAAE,CAAC,EAAE,CACxB,GAAG,CAAC,oBAAoB,CAAC,EACzB,GAAG,CAAC,YAAY,CAAC,CAAC,qBAAqB;SACxC,CAAC,CAAC,CAAC;IAEN,GAAG,CAAC,UAAU,CAAC;SACZ,KAAK,CAAC,OAAO,EAAE,EAAE,CAChB,GAAG,CAAC,YAAY,CAAC,EACjB,GAAG,CAAC,SAAS,CAAC,CAAC,qBAAqB;KACrC,CAAC,CAAC;IAEL,GAAG,CAAC,cAAc,CAAC;SAChB,KAAK,CAAC,UAAU,EAAE,CAAC,EAAE,CACpB,GAAG,CAAC,SAAS,CAAC,EACd,GAAG,CAAC,eAAe,CAAC,EAC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AEvD,GAAG,CAAC,MAAM,CAAC;SACR,KAAK,CAAC,SAAS,CAAC;SAChB,KAAK,CAAC,OAAO,EAAE,aAAa,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AACzD,CAAC;AAvED,4BAuEC;AAAA,CAAC;AAEF,IAAA,8BAAqB,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC,CAAC"}

2
node_modules/ast-types/lib/def/flow.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { Fork } from "../types";
export default function (fork: Fork): void;

362
node_modules/ast-types/lib/def/flow.js generated vendored Normal file
View File

@ -0,0 +1,362 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var es_proposals_1 = tslib_1.__importDefault(require("./es-proposals"));
var type_annotations_1 = tslib_1.__importDefault(require("./type-annotations"));
var types_1 = tslib_1.__importDefault(require("../types"));
var shared_1 = tslib_1.__importStar(require("../shared"));
function default_1(fork) {
fork.use(es_proposals_1.default);
fork.use(type_annotations_1.default);
var types = fork.use(types_1.default);
var def = types.Type.def;
var or = types.Type.or;
var defaults = fork.use(shared_1.default).defaults;
// Base types
def("Flow").bases("Node");
def("FlowType").bases("Flow");
// Type annotations
def("AnyTypeAnnotation")
.bases("FlowType")
.build();
def("EmptyTypeAnnotation")
.bases("FlowType")
.build();
def("MixedTypeAnnotation")
.bases("FlowType")
.build();
def("VoidTypeAnnotation")
.bases("FlowType")
.build();
def("SymbolTypeAnnotation")
.bases("FlowType")
.build();
def("NumberTypeAnnotation")
.bases("FlowType")
.build();
def("BigIntTypeAnnotation")
.bases("FlowType")
.build();
def("NumberLiteralTypeAnnotation")
.bases("FlowType")
.build("value", "raw")
.field("value", Number)
.field("raw", String);
// Babylon 6 differs in AST from Flow
// same as NumberLiteralTypeAnnotation
def("NumericLiteralTypeAnnotation")
.bases("FlowType")
.build("value", "raw")
.field("value", Number)
.field("raw", String);
def("BigIntLiteralTypeAnnotation")
.bases("FlowType")
.build("value", "raw")
.field("value", null)
.field("raw", String);
def("StringTypeAnnotation")
.bases("FlowType")
.build();
def("StringLiteralTypeAnnotation")
.bases("FlowType")
.build("value", "raw")
.field("value", String)
.field("raw", String);
def("BooleanTypeAnnotation")
.bases("FlowType")
.build();
def("BooleanLiteralTypeAnnotation")
.bases("FlowType")
.build("value", "raw")
.field("value", Boolean)
.field("raw", String);
def("TypeAnnotation")
.bases("Node")
.build("typeAnnotation")
.field("typeAnnotation", def("FlowType"));
def("NullableTypeAnnotation")
.bases("FlowType")
.build("typeAnnotation")
.field("typeAnnotation", def("FlowType"));
def("NullLiteralTypeAnnotation")
.bases("FlowType")
.build();
def("NullTypeAnnotation")
.bases("FlowType")
.build();
def("ThisTypeAnnotation")
.bases("FlowType")
.build();
def("ExistsTypeAnnotation")
.bases("FlowType")
.build();
def("ExistentialTypeParam")
.bases("FlowType")
.build();
def("FunctionTypeAnnotation")
.bases("FlowType")
.build("params", "returnType", "rest", "typeParameters")
.field("params", [def("FunctionTypeParam")])
.field("returnType", def("FlowType"))
.field("rest", or(def("FunctionTypeParam"), null))
.field("typeParameters", or(def("TypeParameterDeclaration"), null));
def("FunctionTypeParam")
.bases("Node")
.build("name", "typeAnnotation", "optional")
.field("name", or(def("Identifier"), null))
.field("typeAnnotation", def("FlowType"))
.field("optional", Boolean);
def("ArrayTypeAnnotation")
.bases("FlowType")
.build("elementType")
.field("elementType", def("FlowType"));
def("ObjectTypeAnnotation")
.bases("FlowType")
.build("properties", "indexers", "callProperties")
.field("properties", [
or(def("ObjectTypeProperty"), def("ObjectTypeSpreadProperty"))
])
.field("indexers", [def("ObjectTypeIndexer")], defaults.emptyArray)
.field("callProperties", [def("ObjectTypeCallProperty")], defaults.emptyArray)
.field("inexact", or(Boolean, void 0), defaults["undefined"])
.field("exact", Boolean, defaults["false"])
.field("internalSlots", [def("ObjectTypeInternalSlot")], defaults.emptyArray);
def("Variance")
.bases("Node")
.build("kind")
.field("kind", or("plus", "minus"));
var LegacyVariance = or(def("Variance"), "plus", "minus", null);
def("ObjectTypeProperty")
.bases("Node")
.build("key", "value", "optional")
.field("key", or(def("Literal"), def("Identifier")))
.field("value", def("FlowType"))
.field("optional", Boolean)
.field("variance", LegacyVariance, defaults["null"]);
def("ObjectTypeIndexer")
.bases("Node")
.build("id", "key", "value")
.field("id", def("Identifier"))
.field("key", def("FlowType"))
.field("value", def("FlowType"))
.field("variance", LegacyVariance, defaults["null"])
.field("static", Boolean, defaults["false"]);
def("ObjectTypeCallProperty")
.bases("Node")
.build("value")
.field("value", def("FunctionTypeAnnotation"))
.field("static", Boolean, defaults["false"]);
def("QualifiedTypeIdentifier")
.bases("Node")
.build("qualification", "id")
.field("qualification", or(def("Identifier"), def("QualifiedTypeIdentifier")))
.field("id", def("Identifier"));
def("GenericTypeAnnotation")
.bases("FlowType")
.build("id", "typeParameters")
.field("id", or(def("Identifier"), def("QualifiedTypeIdentifier")))
.field("typeParameters", or(def("TypeParameterInstantiation"), null));
def("MemberTypeAnnotation")
.bases("FlowType")
.build("object", "property")
.field("object", def("Identifier"))
.field("property", or(def("MemberTypeAnnotation"), def("GenericTypeAnnotation")));
def("IndexedAccessType")
.bases("FlowType")
.build("objectType", "indexType")
.field("objectType", def("FlowType"))
.field("indexType", def("FlowType"));
def("OptionalIndexedAccessType")
.bases("FlowType")
.build("objectType", "indexType", "optional")
.field("objectType", def("FlowType"))
.field("indexType", def("FlowType"))
.field('optional', Boolean);
def("UnionTypeAnnotation")
.bases("FlowType")
.build("types")
.field("types", [def("FlowType")]);
def("IntersectionTypeAnnotation")
.bases("FlowType")
.build("types")
.field("types", [def("FlowType")]);
def("TypeofTypeAnnotation")
.bases("FlowType")
.build("argument")
.field("argument", def("FlowType"));
def("ObjectTypeSpreadProperty")
.bases("Node")
.build("argument")
.field("argument", def("FlowType"));
def("ObjectTypeInternalSlot")
.bases("Node")
.build("id", "value", "optional", "static", "method")
.field("id", def("Identifier"))
.field("value", def("FlowType"))
.field("optional", Boolean)
.field("static", Boolean)
.field("method", Boolean);
def("TypeParameterDeclaration")
.bases("Node")
.build("params")
.field("params", [def("TypeParameter")]);
def("TypeParameterInstantiation")
.bases("Node")
.build("params")
.field("params", [def("FlowType")]);
def("TypeParameter")
.bases("FlowType")
.build("name", "variance", "bound", "default")
.field("name", String)
.field("variance", LegacyVariance, defaults["null"])
.field("bound", or(def("TypeAnnotation"), null), defaults["null"])
.field("default", or(def("FlowType"), null), defaults["null"]);
def("ClassProperty")
.field("variance", LegacyVariance, defaults["null"]);
def("ClassImplements")
.bases("Node")
.build("id")
.field("id", def("Identifier"))
.field("superClass", or(def("Expression"), null), defaults["null"])
.field("typeParameters", or(def("TypeParameterInstantiation"), null), defaults["null"]);
def("InterfaceTypeAnnotation")
.bases("FlowType")
.build("body", "extends")
.field("body", def("ObjectTypeAnnotation"))
.field("extends", or([def("InterfaceExtends")], null), defaults["null"]);
def("InterfaceDeclaration")
.bases("Declaration")
.build("id", "body", "extends")
.field("id", def("Identifier"))
.field("typeParameters", or(def("TypeParameterDeclaration"), null), defaults["null"])
.field("body", def("ObjectTypeAnnotation"))
.field("extends", [def("InterfaceExtends")]);
def("DeclareInterface")
.bases("InterfaceDeclaration")
.build("id", "body", "extends");
def("InterfaceExtends")
.bases("Node")
.build("id")
.field("id", def("Identifier"))
.field("typeParameters", or(def("TypeParameterInstantiation"), null), defaults["null"]);
def("TypeAlias")
.bases("Declaration")
.build("id", "typeParameters", "right")
.field("id", def("Identifier"))
.field("typeParameters", or(def("TypeParameterDeclaration"), null))
.field("right", def("FlowType"));
def("DeclareTypeAlias")
.bases("TypeAlias")
.build("id", "typeParameters", "right");
def("OpaqueType")
.bases("Declaration")
.build("id", "typeParameters", "impltype", "supertype")
.field("id", def("Identifier"))
.field("typeParameters", or(def("TypeParameterDeclaration"), null))
.field("impltype", def("FlowType"))
.field("supertype", or(def("FlowType"), null));
def("DeclareOpaqueType")
.bases("OpaqueType")
.build("id", "typeParameters", "supertype")
.field("impltype", or(def("FlowType"), null));
def("TypeCastExpression")
.bases("Expression")
.build("expression", "typeAnnotation")
.field("expression", def("Expression"))
.field("typeAnnotation", def("TypeAnnotation"));
def("TupleTypeAnnotation")
.bases("FlowType")
.build("types")
.field("types", [def("FlowType")]);
def("DeclareVariable")
.bases("Statement")
.build("id")
.field("id", def("Identifier"));
def("DeclareFunction")
.bases("Statement")
.build("id")
.field("id", def("Identifier"))
.field("predicate", or(def("FlowPredicate"), null), defaults["null"]);
def("DeclareClass")
.bases("InterfaceDeclaration")
.build("id");
def("DeclareModule")
.bases("Statement")
.build("id", "body")
.field("id", or(def("Identifier"), def("Literal")))
.field("body", def("BlockStatement"));
def("DeclareModuleExports")
.bases("Statement")
.build("typeAnnotation")
.field("typeAnnotation", def("TypeAnnotation"));
def("DeclareExportDeclaration")
.bases("Declaration")
.build("default", "declaration", "specifiers", "source")
.field("default", Boolean)
.field("declaration", or(def("DeclareVariable"), def("DeclareFunction"), def("DeclareClass"), def("FlowType"), // Implies default.
def("TypeAlias"), // Implies named type
def("DeclareOpaqueType"), // Implies named opaque type
def("InterfaceDeclaration"), null))
.field("specifiers", [or(def("ExportSpecifier"), def("ExportBatchSpecifier"))], defaults.emptyArray)
.field("source", or(def("Literal"), null), defaults["null"]);
def("DeclareExportAllDeclaration")
.bases("Declaration")
.build("source")
.field("source", or(def("Literal"), null), defaults["null"]);
def("ImportDeclaration")
.field("importKind", or("value", "type", "typeof"), function () { return "value"; });
def("FlowPredicate").bases("Flow");
def("InferredPredicate")
.bases("FlowPredicate")
.build();
def("DeclaredPredicate")
.bases("FlowPredicate")
.build("value")
.field("value", def("Expression"));
def("Function")
.field("predicate", or(def("FlowPredicate"), null), defaults["null"]);
def("CallExpression")
.field("typeArguments", or(null, def("TypeParameterInstantiation")), defaults["null"]);
def("NewExpression")
.field("typeArguments", or(null, def("TypeParameterInstantiation")), defaults["null"]);
// Enums
def("EnumDeclaration")
.bases("Declaration")
.build("id", "body")
.field("id", def("Identifier"))
.field("body", or(def("EnumBooleanBody"), def("EnumNumberBody"), def("EnumStringBody"), def("EnumSymbolBody")));
def("EnumBooleanBody")
.build("members", "explicitType")
.field("members", [def("EnumBooleanMember")])
.field("explicitType", Boolean);
def("EnumNumberBody")
.build("members", "explicitType")
.field("members", [def("EnumNumberMember")])
.field("explicitType", Boolean);
def("EnumStringBody")
.build("members", "explicitType")
.field("members", or([def("EnumStringMember")], [def("EnumDefaultedMember")]))
.field("explicitType", Boolean);
def("EnumSymbolBody")
.build("members")
.field("members", [def("EnumDefaultedMember")]);
def("EnumBooleanMember")
.build("id", "init")
.field("id", def("Identifier"))
.field("init", or(def("Literal"), Boolean));
def("EnumNumberMember")
.build("id", "init")
.field("id", def("Identifier"))
.field("init", def("Literal"));
def("EnumStringMember")
.build("id", "init")
.field("id", def("Identifier"))
.field("init", def("Literal"));
def("EnumDefaultedMember")
.build("id")
.field("id", def("Identifier"));
}
exports.default = default_1;
;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=flow.js.map

1
node_modules/ast-types/lib/def/flow.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2
node_modules/ast-types/lib/def/jsx.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { Fork } from "../types";
export default function (fork: Fork): void;

110
node_modules/ast-types/lib/def/jsx.js generated vendored Normal file
View File

@ -0,0 +1,110 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var es_proposals_1 = tslib_1.__importDefault(require("./es-proposals"));
var types_1 = tslib_1.__importDefault(require("../types"));
var shared_1 = tslib_1.__importStar(require("../shared"));
function default_1(fork) {
fork.use(es_proposals_1.default);
var types = fork.use(types_1.default);
var def = types.Type.def;
var or = types.Type.or;
var defaults = fork.use(shared_1.default).defaults;
def("JSXAttribute")
.bases("Node")
.build("name", "value")
.field("name", or(def("JSXIdentifier"), def("JSXNamespacedName")))
.field("value", or(def("Literal"), // attr="value"
def("JSXExpressionContainer"), // attr={value}
def("JSXElement"), // attr=<div />
def("JSXFragment"), // attr=<></>
null // attr= or just attr
), defaults["null"]);
def("JSXIdentifier")
.bases("Identifier")
.build("name")
.field("name", String);
def("JSXNamespacedName")
.bases("Node")
.build("namespace", "name")
.field("namespace", def("JSXIdentifier"))
.field("name", def("JSXIdentifier"));
def("JSXMemberExpression")
.bases("MemberExpression")
.build("object", "property")
.field("object", or(def("JSXIdentifier"), def("JSXMemberExpression")))
.field("property", def("JSXIdentifier"))
.field("computed", Boolean, defaults.false);
var JSXElementName = or(def("JSXIdentifier"), def("JSXNamespacedName"), def("JSXMemberExpression"));
def("JSXSpreadAttribute")
.bases("Node")
.build("argument")
.field("argument", def("Expression"));
var JSXAttributes = [or(def("JSXAttribute"), def("JSXSpreadAttribute"))];
def("JSXExpressionContainer")
.bases("Expression")
.build("expression")
.field("expression", or(def("Expression"), def("JSXEmptyExpression")));
var JSXChildren = [or(def("JSXText"), def("JSXExpressionContainer"), def("JSXSpreadChild"), def("JSXElement"), def("JSXFragment"), def("Literal") // Legacy: Esprima should return JSXText instead.
)];
def("JSXElement")
.bases("Expression")
.build("openingElement", "closingElement", "children")
.field("openingElement", def("JSXOpeningElement"))
.field("closingElement", or(def("JSXClosingElement"), null), defaults["null"])
.field("children", JSXChildren, defaults.emptyArray)
.field("name", JSXElementName, function () {
// Little-known fact: the `this` object inside a default function
// is none other than the partially-built object itself, and any
// fields initialized directly from builder function arguments
// (like openingElement, closingElement, and children) are
// guaranteed to be available.
return this.openingElement.name;
}, true) // hidden from traversal
.field("selfClosing", Boolean, function () {
return this.openingElement.selfClosing;
}, true) // hidden from traversal
.field("attributes", JSXAttributes, function () {
return this.openingElement.attributes;
}, true); // hidden from traversal
def("JSXOpeningElement")
.bases("Node")
.build("name", "attributes", "selfClosing")
.field("name", JSXElementName)
.field("attributes", JSXAttributes, defaults.emptyArray)
.field("selfClosing", Boolean, defaults["false"]);
def("JSXClosingElement")
.bases("Node")
.build("name")
.field("name", JSXElementName);
def("JSXFragment")
.bases("Expression")
.build("openingFragment", "closingFragment", "children")
.field("openingFragment", def("JSXOpeningFragment"))
.field("closingFragment", def("JSXClosingFragment"))
.field("children", JSXChildren, defaults.emptyArray);
def("JSXOpeningFragment")
.bases("Node")
.build();
def("JSXClosingFragment")
.bases("Node")
.build();
def("JSXText")
.bases("Literal")
.build("value", "raw")
.field("value", String)
.field("raw", String, function () {
return this.value;
});
def("JSXEmptyExpression")
.bases("Node")
.build();
def("JSXSpreadChild")
.bases("Node")
.build("expression")
.field("expression", def("Expression"));
}
exports.default = default_1;
;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=jsx.js.map

1
node_modules/ast-types/lib/def/jsx.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"jsx.js","sourceRoot":"","sources":["../../src/def/jsx.ts"],"names":[],"mappings":";;;AACA,wEAA4C;AAC5C,2DAAmC;AACnC,0DAAgE;AAGhE,mBAAyB,IAAU;IACjC,IAAI,CAAC,GAAG,CAAC,sBAAc,CAAC,CAAC;IAEzB,IAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,eAAW,CAAC,CAAC;IACpC,IAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;IAC3B,IAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;IACzB,IAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAY,CAAC,CAAC,QAAQ,CAAC;IAEjD,GAAG,CAAC,cAAc,CAAC;SAChB,KAAK,CAAC,MAAM,CAAC;SACb,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC;SACtB,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAAC;SACjE,KAAK,CAAC,OAAO,EAAE,EAAE,CAChB,GAAG,CAAC,SAAS,CAAC,EAAE,eAAe;IAC/B,GAAG,CAAC,wBAAwB,CAAC,EAAE,eAAe;IAC9C,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EAAE,MAAM,CAAC;SACtB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC,CAAC,CAAC;IAEN,GAAG,CAAC,oBAAoB,CAAC;SACtB,KAAK,CAAC,MAAM,CAAC;SACb,KAAK,EAAE,CAAC;IAEX,GAAG,CAAC,gBAAgB,CAAC;SAClB,KAAK,CAAC,MAAM,CAAC;SACb,KAAK,CAAC,YAAY,CAAC;SACnB,KAAK,CAAC,YAAY,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;AAC5C,CAAC;AApID,4BAoIC;AAAA,CAAC;AAEF,IAAA,8BAAqB,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC,CAAC"}

5
node_modules/ast-types/lib/def/operators/core.d.ts generated vendored Normal file
View File

@ -0,0 +1,5 @@
export default function (): {
BinaryOperators: string[];
AssignmentOperators: string[];
LogicalOperators: string[];
};

27
node_modules/ast-types/lib/def/operators/core.js generated vendored Normal file
View File

@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var shared_1 = require("../../shared");
function default_1() {
return {
BinaryOperators: [
"==", "!=", "===", "!==",
"<", "<=", ">", ">=",
"<<", ">>", ">>>",
"+", "-", "*", "/", "%",
"&",
"|", "^", "in",
"instanceof",
],
AssignmentOperators: [
"=", "+=", "-=", "*=", "/=", "%=",
"<<=", ">>=", ">>>=",
"|=", "^=", "&=",
],
LogicalOperators: [
"||", "&&",
],
};
}
exports.default = default_1;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=core.js.map

1
node_modules/ast-types/lib/def/operators/core.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/def/operators/core.ts"],"names":[],"mappings":";;AAAA,uCAAqD;AAErD;IACE,OAAO;QACL,eAAe,EAAE;YACf,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK;YACxB,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI;YACpB,IAAI,EAAE,IAAI,EAAE,KAAK;YACjB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;YACvB,GAAG;YACH,GAAG,EAAE,GAAG,EAAE,IAAI;YACd,YAAY;SACb;QAED,mBAAmB,EAAE;YACnB,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;YACjC,KAAK,EAAE,KAAK,EAAE,MAAM;YACpB,IAAI,EAAE,IAAI,EAAE,IAAI;SACjB;QAED,gBAAgB,EAAE;YAChB,IAAI,EAAE,IAAI;SACX;KACF,CAAC;AACJ,CAAC;AAtBD,4BAsBC;AAED,IAAA,8BAAqB,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC,CAAC"}

5
node_modules/ast-types/lib/def/operators/es2016.d.ts generated vendored Normal file
View File

@ -0,0 +1,5 @@
export default function (fork: import("../../types").Fork): {
BinaryOperators: string[];
AssignmentOperators: string[];
LogicalOperators: string[];
};

21
node_modules/ast-types/lib/def/operators/es2016.js generated vendored Normal file
View File

@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var shared_1 = require("../../shared");
var core_1 = tslib_1.__importDefault(require("./core"));
function default_1(fork) {
var result = fork.use(core_1.default);
// Exponentiation operators. Must run before BinaryOperators or
// AssignmentOperators are used (hence before fork.use(es6Def)).
// https://github.com/tc39/proposal-exponentiation-operator
if (result.BinaryOperators.indexOf("**") < 0) {
result.BinaryOperators.push("**");
}
if (result.AssignmentOperators.indexOf("**=") < 0) {
result.AssignmentOperators.push("**=");
}
return result;
}
exports.default = default_1;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=es2016.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"es2016.js","sourceRoot":"","sources":["../../../src/def/operators/es2016.ts"],"names":[],"mappings":";;;AAAA,uCAAqD;AACrD,wDAAgC;AAEhC,mBAAyB,IAAgC;IACvD,IAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,cAAU,CAAC,CAAC;IAEpC,+DAA+D;IAC/D,gEAAgE;IAChE,2DAA2D;IAC3D,IAAI,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAC5C,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACnC;IACD,IAAI,MAAM,CAAC,mBAAmB,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;QACjD,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACxC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAdD,4BAcC;AAED,IAAA,8BAAqB,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC,CAAC"}

5
node_modules/ast-types/lib/def/operators/es2020.d.ts generated vendored Normal file
View File

@ -0,0 +1,5 @@
export default function (fork: import("../../types").Fork): {
BinaryOperators: string[];
AssignmentOperators: string[];
LogicalOperators: string[];
};

17
node_modules/ast-types/lib/def/operators/es2020.js generated vendored Normal file
View File

@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var shared_1 = require("../../shared");
var es2016_1 = tslib_1.__importDefault(require("./es2016"));
function default_1(fork) {
var result = fork.use(es2016_1.default);
// Nullish coalescing. Must run before LogicalOperators is used.
// https://github.com/tc39/proposal-nullish-coalescing
if (result.LogicalOperators.indexOf("??") < 0) {
result.LogicalOperators.push("??");
}
return result;
}
exports.default = default_1;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=es2020.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"es2020.js","sourceRoot":"","sources":["../../../src/def/operators/es2020.ts"],"names":[],"mappings":";;;AAAA,uCAAqD;AACrD,4DAAoC;AAEpC,mBAAyB,IAAgC;IACvD,IAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAY,CAAC,CAAC;IAEtC,gEAAgE;IAChE,sDAAsD;IACtD,IAAI,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAC7C,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACpC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAVD,4BAUC;AAED,IAAA,8BAAqB,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC,CAAC"}

5
node_modules/ast-types/lib/def/operators/es2021.d.ts generated vendored Normal file
View File

@ -0,0 +1,5 @@
export default function (fork: import("../../types").Fork): {
BinaryOperators: string[];
AssignmentOperators: string[];
LogicalOperators: string[];
};

20
node_modules/ast-types/lib/def/operators/es2021.js generated vendored Normal file
View File

@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var shared_1 = require("../../shared");
var es2020_1 = tslib_1.__importDefault(require("./es2020"));
function default_1(fork) {
var result = fork.use(es2020_1.default);
// Logical assignment operators. Must run before AssignmentOperators is used.
// https://github.com/tc39/proposal-logical-assignment
result.LogicalOperators.forEach(function (op) {
var assignOp = op + "=";
if (result.AssignmentOperators.indexOf(assignOp) < 0) {
result.AssignmentOperators.push(assignOp);
}
});
return result;
}
exports.default = default_1;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=es2021.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"es2021.js","sourceRoot":"","sources":["../../../src/def/operators/es2021.ts"],"names":[],"mappings":";;;AAAA,uCAAqD;AACrD,4DAAoC;AAEpC,mBAAyB,IAAgC;IACvD,IAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAY,CAAC,CAAC;IAEtC,6EAA6E;IAC7E,sDAAsD;IACtD,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,UAAA,EAAE;QAChC,IAAM,QAAQ,GAAG,EAAE,GAAG,GAAG,CAAC;QAC1B,IAAI,MAAM,CAAC,mBAAmB,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACpD,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAC3C;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAbD,4BAaC;AAED,IAAA,8BAAqB,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC,CAAC"}

7
node_modules/ast-types/lib/def/type-annotations.d.ts generated vendored Normal file
View File

@ -0,0 +1,7 @@
/**
* Type annotation defs shared between Flow and TypeScript.
* These defs could not be defined in ./flow.ts or ./typescript.ts directly
* because they use the same name.
*/
import { Fork } from "../types";
export default function (fork: Fork): void;

42
node_modules/ast-types/lib/def/type-annotations.js generated vendored Normal file
View File

@ -0,0 +1,42 @@
"use strict";
/**
* Type annotation defs shared between Flow and TypeScript.
* These defs could not be defined in ./flow.ts or ./typescript.ts directly
* because they use the same name.
*/
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var types_1 = tslib_1.__importDefault(require("../types"));
var shared_1 = tslib_1.__importStar(require("../shared"));
function default_1(fork) {
var types = fork.use(types_1.default);
var def = types.Type.def;
var or = types.Type.or;
var defaults = fork.use(shared_1.default).defaults;
var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
def("Identifier")
.field("typeAnnotation", TypeAnnotation, defaults["null"]);
def("ObjectPattern")
.field("typeAnnotation", TypeAnnotation, defaults["null"]);
def("Function")
.field("returnType", TypeAnnotation, defaults["null"])
.field("typeParameters", TypeParamDecl, defaults["null"]);
def("ClassProperty")
.build("key", "value", "typeAnnotation", "static")
.field("value", or(def("Expression"), null))
.field("static", Boolean, defaults["false"])
.field("typeAnnotation", TypeAnnotation, defaults["null"]);
["ClassDeclaration",
"ClassExpression",
].forEach(function (typeName) {
def(typeName)
.field("typeParameters", TypeParamDecl, defaults["null"])
.field("superTypeParameters", or(def("TypeParameterInstantiation"), def("TSTypeParameterInstantiation"), null), defaults["null"])
.field("implements", or([def("ClassImplements")], [def("TSExpressionWithTypeArguments")]), defaults.emptyArray);
});
}
exports.default = default_1;
;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=type-annotations.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"type-annotations.js","sourceRoot":"","sources":["../../src/def/type-annotations.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,2DAAmC;AACnC,0DAAgE;AAEhE,mBAAyB,IAAU;IACjC,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,eAAW,CAAC,CAAC;IAClC,IAAI,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;IACzB,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;IACvB,IAAI,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAY,CAAC,CAAC,QAAQ,CAAC;IAE/C,IAAI,cAAc,GAAG,EAAE,CACrB,GAAG,CAAC,gBAAgB,CAAC,EACrB,GAAG,CAAC,kBAAkB,CAAC,EACvB,IAAI,CACL,CAAC;IAEF,IAAI,aAAa,GAAG,EAAE,CACpB,GAAG,CAAC,0BAA0B,CAAC,EAC/B,GAAG,CAAC,4BAA4B,CAAC,EACjC,IAAI,CACL,CAAC;IAEF,GAAG,CAAC,YAAY,CAAC;SACd,KAAK,CAAC,gBAAgB,EAAE,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAE7D,GAAG,CAAC,eAAe,CAAC;SACjB,KAAK,CAAC,gBAAgB,EAAE,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAE7D,GAAG,CAAC,UAAU,CAAC;SAC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ork): void;

369
node_modules/ast-types/lib/def/typescript.js generated vendored Normal file
View File

@ -0,0 +1,369 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var babel_core_1 = tslib_1.__importDefault(require("./babel-core"));
var type_annotations_1 = tslib_1.__importDefault(require("./type-annotations"));
var types_1 = tslib_1.__importDefault(require("../types"));
var shared_1 = tslib_1.__importStar(require("../shared"));
function default_1(fork) {
// Since TypeScript is parsed by Babylon, include the core Babylon types
// but omit the Flow-related types.
fork.use(babel_core_1.default);
fork.use(type_annotations_1.default);
var types = fork.use(types_1.default);
var n = types.namedTypes;
var def = types.Type.def;
var or = types.Type.or;
var defaults = fork.use(shared_1.default).defaults;
var StringLiteral = types.Type.from(function (value, deep) {
if (n.StringLiteral &&
n.StringLiteral.check(value, deep)) {
return true;
}
if (n.Literal &&
n.Literal.check(value, deep) &&
typeof value.value === "string") {
return true;
}
return false;
}, "StringLiteral");
def("TSType")
.bases("Node");
var TSEntityName = or(def("Identifier"), def("TSQualifiedName"));
def("TSTypeReference")
.bases("TSType", "TSHasOptionalTypeParameterInstantiation")
.build("typeName", "typeParameters")
.field("typeName", TSEntityName);
// An abstract (non-buildable) base type that provide a commonly-needed
// optional .typeParameters field.
def("TSHasOptionalTypeParameterInstantiation")
.field("typeParameters", or(def("TSTypeParameterInstantiation"), null), defaults["null"]);
// An abstract (non-buildable) base type that provide a commonly-needed
// optional .typeParameters field.
def("TSHasOptionalTypeParameters")
.field("typeParameters", or(def("TSTypeParameterDeclaration"), null, void 0), defaults["null"]);
// An abstract (non-buildable) base type that provide a commonly-needed
// optional .typeAnnotation field.
def("TSHasOptionalTypeAnnotation")
.field("typeAnnotation", or(def("TSTypeAnnotation"), null), defaults["null"]);
def("TSQualifiedName")
.bases("Node")
.build("left", "right")
.field("left", TSEntityName)
.field("right", TSEntityName);
def("TSAsExpression")
.bases("Expression", "Pattern")
.build("expression", "typeAnnotation")
.field("expression", def("Expression"))
.field("typeAnnotation", def("TSType"))
.field("extra", or({ parenthesized: Boolean }, null), defaults["null"]);
def("TSTypeCastExpression")
.bases("Expression")
.build("expression", "typeAnnotation")
.field("expression", def("Expression"))
.field("typeAnnotation", def("TSType"));
def("TSSatisfiesExpression")
.bases("Expression", "Pattern")
.build("expression", "typeAnnotation")
.field("expression", def("Expression"))
.field("typeAnnotation", def("TSType"));
def("TSNonNullExpression")
.bases("Expression", "Pattern")
.build("expression")
.field("expression", def("Expression"));
[
"TSAnyKeyword",
"TSBigIntKeyword",
"TSBooleanKeyword",
"TSNeverKeyword",
"TSNullKeyword",
"TSNumberKeyword",
"TSObjectKeyword",
"TSStringKeyword",
"TSSymbolKeyword",
"TSUndefinedKeyword",
"TSUnknownKeyword",
"TSVoidKeyword",
"TSIntrinsicKeyword",
"TSThisType",
].forEach(function (keywordType) {
def(keywordType)
.bases("TSType")
.build();
});
def("TSArrayType")
.bases("TSType")
.build("elementType")
.field("elementType", def("TSType"));
def("TSLiteralType")
.bases("TSType")
.build("literal")
.field("literal", or(def("NumericLiteral"), def("StringLiteral"), def("BooleanLiteral"), def("TemplateLiteral"), def("UnaryExpression"), def("BigIntLiteral")));
def("TemplateLiteral")
// The TemplateLiteral type appears to be reused for TypeScript template
// literal types (instead of introducing a new TSTemplateLiteralType type),
// so we allow the templateLiteral.expressions array to be either all
// expressions or all TypeScript types.
.field("expressions", or([def("Expression")], [def("TSType")]));
["TSUnionType",
"TSIntersectionType",
].forEach(function (typeName) {
def(typeName)
.bases("TSType")
.build("types")
.field("types", [def("TSType")]);
});
def("TSConditionalType")
.bases("TSType")
.build("checkType", "extendsType", "trueType", "falseType")
.field("checkType", def("TSType"))
.field("extendsType", def("TSType"))
.field("trueType", def("TSType"))
.field("falseType", def("TSType"));
def("TSInferType")
.bases("TSType")
.build("typeParameter")
.field("typeParameter", def("TSTypeParameter"));
def("TSParenthesizedType")
.bases("TSType")
.build("typeAnnotation")
.field("typeAnnotation", def("TSType"));
var ParametersType = [or(def("Identifier"), def("RestElement"), def("ArrayPattern"), def("ObjectPattern"))];
["TSFunctionType",
"TSConstructorType",
].forEach(function (typeName) {
def(typeName)
.bases("TSType", "TSHasOptionalTypeParameters", "TSHasOptionalTypeAnnotation")
.build("parameters")
.field("parameters", ParametersType);
});
def("TSDeclareFunction")
.bases("Declaration", "TSHasOptionalTypeParameters")
.build("id", "params", "returnType")
.field("declare", Boolean, defaults["false"])
.field("async", Boolean, defaults["false"])
.field("generator", Boolean, defaults["false"])
.field("id", or(def("Identifier"), null), defaults["null"])
.field("params", [def("Pattern")])
// tSFunctionTypeAnnotationCommon
.field("returnType", or(def("TSTypeAnnotation"), def("Noop"), // Still used?
null), defaults["null"]);
def("TSDeclareMethod")
.bases("Declaration", "TSHasOptionalTypeParameters")
.build("key", "params", "returnType")
.field("async", Boolean, defaults["false"])
.field("generator", Boolean, defaults["false"])
.field("params", [def("Pattern")])
// classMethodOrPropertyCommon
.field("abstract", Boolean, defaults["false"])
.field("accessibility", or("public", "private", "protected", void 0), defaults["undefined"])
.field("static", Boolean, defaults["false"])
.field("computed", Boolean, defaults["false"])
.field("optional", Boolean, defaults["false"])
.field("key", or(def("Identifier"), def("StringLiteral"), def("NumericLiteral"),
// Only allowed if .computed is true.
def("Expression")))
// classMethodOrDeclareMethodCommon
.field("kind", or("get", "set", "method", "constructor"), function getDefault() { return "method"; })
.field("access", // Not "accessibility"?
or("public", "private", "protected", void 0), defaults["undefined"])
.field("decorators", or([def("Decorator")], null), defaults["null"])
// tSFunctionTypeAnnotationCommon
.field("returnType", or(def("TSTypeAnnotation"), def("Noop"), // Still used?
null), defaults["null"]);
def("TSMappedType")
.bases("TSType")
.build("typeParameter", "typeAnnotation")
.field("readonly", or(Boolean, "+", "-"), defaults["false"])
.field("typeParameter", def("TSTypeParameter"))
.field("optional", or(Boolean, "+", "-"), defaults["false"])
.field("typeAnnotation", or(def("TSType"), null), defaults["null"]);
def("TSTupleType")
.bases("TSType")
.build("elementTypes")
.field("elementTypes", [or(def("TSType"), def("TSNamedTupleMember"))]);
def("TSNamedTupleMember")
.bases("TSType")
.build("label", "elementType", "optional")
.field("label", def("Identifier"))
.field("optional", Boolean, defaults["false"])
.field("elementType", def("TSType"));
def("TSRestType")
.bases("TSType")
.build("typeAnnotation")
.field("typeAnnotation", def("TSType"));
def("TSOptionalType")
.bases("TSType")
.build("typeAnnotation")
.field("typeAnnotation", def("TSType"));
def("TSIndexedAccessType")
.bases("TSType")
.build("objectType", "indexType")
.field("objectType", def("TSType"))
.field("indexType", def("TSType"));
def("TSTypeOperator")
.bases("TSType")
.build("operator")
.field("operator", String)
.field("typeAnnotation", def("TSType"));
def("TSTypeAnnotation")
.bases("Node")
.build("typeAnnotation")
.field("typeAnnotation", or(def("TSType"), def("TSTypeAnnotation")));
def("TSIndexSignature")
.bases("Declaration", "TSHasOptionalTypeAnnotation")
.build("parameters", "typeAnnotation")
.field("parameters", [def("Identifier")]) // Length === 1
.field("readonly", Boolean, defaults["false"]);
def("TSPropertySignature")
.bases("Declaration", "TSHasOptionalTypeAnnotation")
.build("key", "typeAnnotation", "optional")
.field("key", def("Expression"))
.field("computed", Boolean, defaults["false"])
.field("readonly", Boolean, defaults["false"])
.field("optional", Boolean, defaults["false"])
.field("initializer", or(def("Expression"), null), defaults["null"]);
def("TSMethodSignature")
.bases("Declaration", "TSHasOptionalTypeParameters", "TSHasOptionalTypeAnnotation")
.build("key", "parameters", "typeAnnotation")
.field("key", def("Expression"))
.field("computed", Boolean, defaults["false"])
.field("optional", Boolean, defaults["false"])
.field("parameters", ParametersType);
def("TSTypePredicate")
.bases("TSTypeAnnotation", "TSType")
.build("parameterName", "typeAnnotation", "asserts")
.field("parameterName", or(def("Identifier"), def("TSThisType")))
.field("typeAnnotation", or(def("TSTypeAnnotation"), null), defaults["null"])
.field("asserts", Boolean, defaults["false"]);
["TSCallSignatureDeclaration",
"TSConstructSignatureDeclaration",
].forEach(function (typeName) {
def(typeName)
.bases("Declaration", "TSHasOptionalTypeParameters", "TSHasOptionalTypeAnnotation")
.build("parameters", "typeAnnotation")
.field("parameters", ParametersType);
});
def("TSEnumMember")
.bases("Node")
.build("id", "initializer")
.field("id", or(def("Identifier"), StringLiteral))
.field("initializer", or(def("Expression"), null), defaults["null"]);
def("TSTypeQuery")
.bases("TSType")
.build("exprName")
.field("exprName", or(TSEntityName, def("TSImportType")));
// Inferred from Babylon's tsParseTypeMember method.
var TSTypeMember = or(def("TSCallSignatureDeclaration"), def("TSConstructSignatureDeclaration"), def("TSIndexSignature"), def("TSMethodSignature"), def("TSPropertySignature"));
def("TSTypeLiteral")
.bases("TSType")
.build("members")
.field("members", [TSTypeMember]);
def("TSTypeParameter")
.bases("Identifier")
.build("name", "constraint", "default")
.field("name", or(def("Identifier"), String))
.field("constraint", or(def("TSType"), void 0), defaults["undefined"])
.field("default", or(def("TSType"), void 0), defaults["undefined"]);
def("TSTypeAssertion")
.bases("Expression", "Pattern")
.build("typeAnnotation", "expression")
.field("typeAnnotation", def("TSType"))
.field("expression", def("Expression"))
.field("extra", or({ parenthesized: Boolean }, null), defaults["null"]);
def("TSTypeParameterDeclaration")
.bases("Declaration")
.build("params")
.field("params", [def("TSTypeParameter")]);
def("TSInstantiationExpression")
.bases("Expression", "TSHasOptionalTypeParameterInstantiation")
.build("expression", "typeParameters")
.field("expression", def("Expression"));
def("TSTypeParameterInstantiation")
.bases("Node")
.build("params")
.field("params", [def("TSType")]);
def("TSEnumDeclaration")
.bases("Declaration")
.build("id", "members")
.field("id", def("Identifier"))
.field("const", Boolean, defaults["false"])
.field("declare", Boolean, defaults["false"])
.field("members", [def("TSEnumMember")])
.field("initializer", or(def("Expression"), null), defaults["null"]);
def("TSTypeAliasDeclaration")
.bases("Declaration", "TSHasOptionalTypeParameters")
.build("id", "typeAnnotation")
.field("id", def("Identifier"))
.field("declare", Boolean, defaults["false"])
.field("typeAnnotation", def("TSType"));
def("TSModuleBlock")
.bases("Node")
.build("body")
.field("body", [def("Statement")]);
def("TSModuleDeclaration")
.bases("Declaration")
.build("id", "body")
.field("id", or(StringLiteral, TSEntityName))
.field("declare", Boolean, defaults["false"])
.field("global", Boolean, defaults["false"])
.field("body", or(def("TSModuleBlock"), def("TSModuleDeclaration"), null), defaults["null"]);
def("TSImportType")
.bases("TSType", "TSHasOptionalTypeParameterInstantiation")
.build("argument", "qualifier", "typeParameters")
.field("argument", StringLiteral)
.field("qualifier", or(TSEntityName, void 0), defaults["undefined"]);
def("TSImportEqualsDeclaration")
.bases("Declaration")
.build("id", "moduleReference")
.field("id", def("Identifier"))
.field("isExport", Boolean, defaults["false"])
.field("moduleReference", or(TSEntityName, def("TSExternalModuleReference")));
def("TSExternalModuleReference")
.bases("Declaration")
.build("expression")
.field("expression", StringLiteral);
def("TSExportAssignment")
.bases("Statement")
.build("expression")
.field("expression", def("Expression"));
def("TSNamespaceExportDeclaration")
.bases("Declaration")
.build("id")
.field("id", def("Identifier"));
def("TSInterfaceBody")
.bases("Node")
.build("body")
.field("body", [TSTypeMember]);
def("TSExpressionWithTypeArguments")
.bases("TSType", "TSHasOptionalTypeParameterInstantiation")
.build("expression", "typeParameters")
.field("expression", TSEntityName);
def("TSInterfaceDeclaration")
.bases("Declaration", "TSHasOptionalTypeParameters")
.build("id", "body")
.field("id", TSEntityName)
.field("declare", Boolean, defaults["false"])
.field("extends", or([def("TSExpressionWithTypeArguments")], null), defaults["null"])
.field("body", def("TSInterfaceBody"));
def("TSParameterProperty")
.bases("Pattern")
.build("parameter")
.field("accessibility", or("public", "private", "protected", void 0), defaults["undefined"])
.field("readonly", Boolean, defaults["false"])
.field("parameter", or(def("Identifier"), def("AssignmentPattern")));
def("ClassProperty")
.field("access", // Not "accessibility"?
or("public", "private", "protected", void 0), defaults["undefined"]);
def("ClassAccessorProperty")
.bases("Declaration", "TSHasOptionalTypeAnnotation");
// Defined already in es6 and babel-core.
def("ClassBody")
.field("body", [or(def("MethodDefinition"), def("VariableDeclarator"), def("ClassPropertyDefinition"), def("ClassProperty"), def("ClassPrivateProperty"), def("ClassAccessorProperty"), def("ClassMethod"), def("ClassPrivateMethod"), def("StaticBlock"),
// Just need to add these types:
def("TSDeclareMethod"), TSTypeMember)]);
}
exports.default = default_1;
;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=typescript.js.map

1
node_modules/ast-types/lib/def/typescript.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

5
node_modules/ast-types/lib/equiv.d.ts generated vendored Normal file
View File

@ -0,0 +1,5 @@
import { Fork } from "./types";
export default function (fork: Fork): {
(a: any, b: any, problemPath?: any): boolean;
assert(a: any, b: any): void;
};

157
node_modules/ast-types/lib/equiv.js generated vendored Normal file
View File

@ -0,0 +1,157 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var shared_1 = require("./shared");
var types_1 = tslib_1.__importDefault(require("./types"));
function default_1(fork) {
var types = fork.use(types_1.default);
var getFieldNames = types.getFieldNames;
var getFieldValue = types.getFieldValue;
var isArray = types.builtInTypes.array;
var isObject = types.builtInTypes.object;
var isDate = types.builtInTypes.Date;
var isRegExp = types.builtInTypes.RegExp;
var hasOwn = Object.prototype.hasOwnProperty;
function astNodesAreEquivalent(a, b, problemPath) {
if (isArray.check(problemPath)) {
problemPath.length = 0;
}
else {
problemPath = null;
}
return areEquivalent(a, b, problemPath);
}
astNodesAreEquivalent.assert = function (a, b) {
var problemPath = [];
if (!astNodesAreEquivalent(a, b, problemPath)) {
if (problemPath.length === 0) {
if (a !== b) {
throw new Error("Nodes must be equal");
}
}
else {
throw new Error("Nodes differ in the following path: " +
problemPath.map(subscriptForProperty).join(""));
}
}
};
function subscriptForProperty(property) {
if (/[_$a-z][_$a-z0-9]*/i.test(property)) {
return "." + property;
}
return "[" + JSON.stringify(property) + "]";
}
function areEquivalent(a, b, problemPath) {
if (a === b) {
return true;
}
if (isArray.check(a)) {
return arraysAreEquivalent(a, b, problemPath);
}
if (isObject.check(a)) {
return objectsAreEquivalent(a, b, problemPath);
}
if (isDate.check(a)) {
return isDate.check(b) && (+a === +b);
}
if (isRegExp.check(a)) {
return isRegExp.check(b) && (a.source === b.source &&
a.global === b.global &&
a.multiline === b.multiline &&
a.ignoreCase === b.ignoreCase);
}
return a == b;
}
function arraysAreEquivalent(a, b, problemPath) {
isArray.assert(a);
var aLength = a.length;
if (!isArray.check(b) || b.length !== aLength) {
if (problemPath) {
problemPath.push("length");
}
return false;
}
for (var i = 0; i < aLength; ++i) {
if (problemPath) {
problemPath.push(i);
}
if (i in a !== i in b) {
return false;
}
if (!areEquivalent(a[i], b[i], problemPath)) {
return false;
}
if (problemPath) {
var problemPathTail = problemPath.pop();
if (problemPathTail !== i) {
throw new Error("" + problemPathTail);
}
}
}
return true;
}
function objectsAreEquivalent(a, b, problemPath) {
isObject.assert(a);
if (!isObject.check(b)) {
return false;
}
// Fast path for a common property of AST nodes.
if (a.type !== b.type) {
if (problemPath) {
problemPath.push("type");
}
return false;
}
var aNames = getFieldNames(a);
var aNameCount = aNames.length;
var bNames = getFieldNames(b);
var bNameCount = bNames.length;
if (aNameCount === bNameCount) {
for (var i = 0; i < aNameCount; ++i) {
var name = aNames[i];
var aChild = getFieldValue(a, name);
var bChild = getFieldValue(b, name);
if (problemPath) {
problemPath.push(name);
}
if (!areEquivalent(aChild, bChild, problemPath)) {
return false;
}
if (problemPath) {
var problemPathTail = problemPath.pop();
if (problemPathTail !== name) {
throw new Error("" + problemPathTail);
}
}
}
return true;
}
if (!problemPath) {
return false;
}
// Since aNameCount !== bNameCount, we need to find some name that's
// missing in aNames but present in bNames, or vice-versa.
var seenNames = Object.create(null);
for (i = 0; i < aNameCount; ++i) {
seenNames[aNames[i]] = true;
}
for (i = 0; i < bNameCount; ++i) {
name = bNames[i];
if (!hasOwn.call(seenNames, name)) {
problemPath.push(name);
return false;
}
delete seenNames[name];
}
for (name in seenNames) {
problemPath.push(name);
break;
}
return false;
}
return astNodesAreEquivalent;
}
exports.default = default_1;
;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=equiv.js.map

1
node_modules/ast-types/lib/equiv.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"equiv.js","sourceRoot":"","sources":["../src/equiv.ts"],"names":[],"mappings":";;;AAAA,mCAAiD;AACjD,0DAA4C;AAE5C,mBAAyB,IAAU;IAC/B,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,eAAW,CAAC,CAAC;IAClC,IAAI,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;IACxC,IAAI,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;IACxC,IAAI,OAAO,GAAG,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC;IACvC,IAAI,QAAQ,GAAG,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC;IACzC,IAAI,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC;IACrC,IAAI,QAAQ,GAAG,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC;IACzC,IAAI,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;IAE7C,SAAS,qBAAqB,CAAC,CAAM,EAAE,CAAM,EAAE,WAAiB;QAC5D,IAAI,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE;YAC5B,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC;SAC1B;aAAM;YACH,WAAW,GAAG,IAAI,CAAC;SACtB;QAED,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC;IAC5C,CAAC;IAED,qBAAqB,CAAC,MAAM,GAAG,UAAU,CAAM,EAAE,CAAM;QACnD,IAAI,WAAW,GAAU,EAAE,CAAC;QAC5B,IAAI,CAAC,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,EAAE;YAC3C,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC1B,IAAI,CAAC,KAAK,CAAC,EAAE;oBACT,MAAM,IAAI,KAAK,CAAC,qBAAqB,CA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D;QAE1D,IAAI,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAEpC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,EAAE,CAAC,EAAE;YAC7B,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;SAC/B;QAED,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,EAAE,CAAC,EAAE;YAC7B,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YAEjB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE;gBAC/B,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACvB,OAAO,KAAK,CAAC;aAChB;YAED,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;SAC1B;QAED,KAAK,IAAI,IAAI,SAAS,EAAE;YACpB,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACvB,MAAM;SACT;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,OAAO,qBAAqB,CAAC;AACjC,CAAC;AAzLD,4BAyLC;AAAA,CAAC;AAEF,IAAA,8BAAqB,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC,CAAC"}

43
node_modules/ast-types/lib/fork.d.ts generated vendored Normal file
View File

@ -0,0 +1,43 @@
import { Plugin } from "./types";
export default function (plugins: Plugin<any>[]): {
Type: {
or(...types: any[]): import("./types").Type<any>;
from<T>(value: any, name?: string | undefined): import("./types").Type<T>;
def(typeName: string): import("./types").Def<any>;
hasDef(typeName: string): boolean;
};
builtInTypes: {
string: import("./types").Type<string>;
function: import("./types").Type<Function>;
array: import("./types").Type<any[]>;
object: import("./types").Type<{
[key: string]: any;
}>;
RegExp: import("./types").Type<RegExp>;
Date: import("./types").Type<Date>;
number: import("./types").Type<number>;
boolean: import("./types").Type<boolean>;
null: import("./types").Type<null>;
undefined: import("./types").Type<undefined>;
BigInt: import("./types").Type<BigInt>;
};
namedTypes: import("./gen/namedTypes").NamedTypes;
builders: import("./gen/builders").builders;
defineMethod: (name: any, func?: Function | undefined) => Function;
getFieldNames: (object: any) => string[];
getFieldValue: (object: any, fieldName: any) => any;
eachField: (object: any, callback: (name: any, value: any) => any, context?: any) => void;
someField: (object: any, callback: (name: any, value: any) => any, context?: any) => boolean;
getSupertypeNames: (typeName: string) => string[];
getBuilderName: (typeName: any) => any;
astNodesAreEquivalent: {
(a: any, b: any, problemPath?: any): boolean;
assert(a: any, b: any): void;
};
finalize: () => void;
Path: import("./path").PathConstructor;
NodePath: import("./node-path").NodePathConstructor;
PathVisitor: import("./path-visitor").PathVisitorConstructor;
use: <T_1>(plugin: Plugin<T_1>) => T_1;
visit: <M = {}>(node: import("./types").ASTNode, methods?: import("./main").Visitor<M> | undefined) => any;
};

55
node_modules/ast-types/lib/fork.js generated vendored Normal file
View File

@ -0,0 +1,55 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var types_1 = tslib_1.__importDefault(require("./types"));
var path_visitor_1 = tslib_1.__importDefault(require("./path-visitor"));
var equiv_1 = tslib_1.__importDefault(require("./equiv"));
var path_1 = tslib_1.__importDefault(require("./path"));
var node_path_1 = tslib_1.__importDefault(require("./node-path"));
var shared_1 = require("./shared");
function default_1(plugins) {
var fork = createFork();
var types = fork.use(types_1.default);
plugins.forEach(fork.use);
types.finalize();
var PathVisitor = fork.use(path_visitor_1.default);
return {
Type: types.Type,
builtInTypes: types.builtInTypes,
namedTypes: types.namedTypes,
builders: types.builders,
defineMethod: types.defineMethod,
getFieldNames: types.getFieldNames,
getFieldValue: types.getFieldValue,
eachField: types.eachField,
someField: types.someField,
getSupertypeNames: types.getSupertypeNames,
getBuilderName: types.getBuilderName,
astNodesAreEquivalent: fork.use(equiv_1.default),
finalize: types.finalize,
Path: fork.use(path_1.default),
NodePath: fork.use(node_path_1.default),
PathVisitor: PathVisitor,
use: fork.use,
visit: PathVisitor.visit,
};
}
exports.default = default_1;
;
function createFork() {
var used = [];
var usedResult = [];
function use(plugin) {
var idx = used.indexOf(plugin);
if (idx === -1) {
idx = used.length;
used.push(plugin);
usedResult[idx] = plugin(fork);
}
return usedResult[idx];
}
var fork = { use: use };
return fork;
}
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=fork.js.map

1
node_modules/ast-types/lib/fork.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"fork.js","sourceRoot":"","sources":["../src/fork.ts"],"names":[],"mappings":";;;AAAA,0DAAkC;AAClC,wEAA+C;AAC/C,0DAAkC;AAClC,wDAAgC;AAChC,kEAAyC;AAEzC,mCAAiD;AAEjD,mBAAyB,OAAsB;IAC7C,IAAM,IAAI,GAAG,UAAU,EAAE,CAAC;IAE1B,IAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,eAAW,CAAC,CAAC;IAEpC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE1B,KAAK,CAAC,QAAQ,EAAE,CAAC;IAEjB,IAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,sBAAiB,CAAC,CAAC;IAEhD,OAAO;QACL,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;QAC1C,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,qBAAqB,EAAE,IAAI,CAAC,GAAG,CAAC,eAAW,CAAC;QAC5C,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,cAAU,CAAC;QAC1B,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,mBAAc,CAAC;QAClC,WAAW,aAAA;QACX,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,KAAK,EAAE,WAAW,CAAC,KAAK;KACzB,CAAC;AACJ,CAAC;AA/BD,4BA+BC;AAAA,CAAC;AAEF,SAAS,UAAU;IACjB,IAAM,IAAI,GAAsB,EAAE,CAAC;IACnC,IAAM,UAAU,GAAc,EAAE,CAAC;IAEjC,SAAS,GAAG,CAAI,MAAiB;QAC/B,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC/B,IAAI,GAAG,KAAK,CAAC,CAAC,EAAE;YACd,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;YAClB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAClB,UAAU,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;SAChC;QACD,OAAO,UAAU,CAAC,GAAG,CAAM,CAAC;IAC9B,CAAC;IAED,IAAI,IAAI,GAAS,EAAE,GAAG,KAAA,EAAE,CAAC;IAEzB,OAAO,IAAI,CAAC;AACd,CAAC;AAED,IAAA,8BAAqB,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC,CAAC"}

2850
node_modules/ast-types/lib/gen/builders.d.ts generated vendored Normal file

File diff suppressed because it is too large Load Diff

3
node_modules/ast-types/lib/gen/builders.js generated vendored Normal file
View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=builders.js.map

1
node_modules/ast-types/lib/gen/builders.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"builders.js","sourceRoot":"","sources":["../../src/gen/builders.ts"],"names":[],"mappings":""}

293
node_modules/ast-types/lib/gen/kinds.d.ts generated vendored Normal file

File diff suppressed because one or more lines are too long

3
node_modules/ast-types/lib/gen/kinds.js generated vendored Normal file
View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=kinds.js.map

1
node_modules/ast-types/lib/gen/kinds.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"kinds.js","sourceRoot":"","sources":["../../src/gen/kinds.ts"],"names":[],"mappings":""}

2029
node_modules/ast-types/lib/gen/namedTypes.d.ts generated vendored Normal file

File diff suppressed because one or more lines are too long

7
node_modules/ast-types/lib/gen/namedTypes.js generated vendored Normal file
View File

@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.namedTypes = void 0;
var namedTypes;
(function (namedTypes) {
})(namedTypes = exports.namedTypes || (exports.namedTypes = {}));
//# sourceMappingURL=namedTypes.js.map

1
node_modules/ast-types/lib/gen/namedTypes.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"namedTypes.js","sourceRoot":"","sources":["../../src/gen/namedTypes.ts"],"names":[],"mappings":";;;AAIA,IAAiB,UAAU,CA69D1B;AA79DD,WAAiB,UAAU;AA69D3B,CAAC,EA79DgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QA69D1B"}

297
node_modules/ast-types/lib/gen/visitor.d.ts generated vendored Normal file
View File

@ -0,0 +1,297 @@
import { NodePath } from "../node-path";
import { Context } from "../path-visitor";
import { namedTypes } from "./namedTypes";
export interface Visitor<M = {}> {
visitPrintable?(this: Context & M, path: NodePath<namedTypes.Printable>): any;
visitSourceLocation?(this: Context & M, path: NodePath<namedTypes.SourceLocation>): any;
visitNode?(this: Context & M, path: NodePath<namedTypes.Node>): any;
visitComment?(this: Context & M, path: NodePath<namedTypes.Comment>): any;
visitPosition?(this: Context & M, path: NodePath<namedTypes.Position>): any;
visitFile?(this: Context & M, path: NodePath<namedTypes.File>): any;
visitProgram?(this: Context & M, path: NodePath<namedTypes.Program>): any;
visitStatement?(this: Context & M, path: NodePath<namedTypes.Statement>): any;
visitFunction?(this: Context & M, path: NodePath<namedTypes.Function>): any;
visitExpression?(this: Context & M, path: NodePath<namedTypes.Expression>): any;
visitPattern?(this: Context & M, path: NodePath<namedTypes.Pattern>): any;
visitIdentifier?(this: Context & M, path: NodePath<namedTypes.Identifier>): any;
visitBlockStatement?(this: Context & M, path: NodePath<namedTypes.BlockStatement>): any;
visitEmptyStatement?(this: Context & M, path: NodePath<namedTypes.EmptyStatement>): any;
visitExpressionStatement?(this: Context & M, path: NodePath<namedTypes.ExpressionStatement>): any;
visitIfStatement?(this: Context & M, path: NodePath<namedTypes.IfStatement>): any;
visitLabeledStatement?(this: Context & M, path: NodePath<namedTypes.LabeledStatement>): any;
visitBreakStatement?(this: Context & M, path: NodePath<namedTypes.BreakStatement>): any;
visitContinueStatement?(this: Context & M, path: NodePath<namedTypes.ContinueStatement>): any;
visitWithStatement?(this: Context & M, path: NodePath<namedTypes.WithStatement>): any;
visitSwitchStatement?(this: Context & M, path: NodePath<namedTypes.SwitchStatement>): any;
visitSwitchCase?(this: Context & M, path: NodePath<namedTypes.SwitchCase>): any;
visitReturnStatement?(this: Context & M, path: NodePath<namedTypes.ReturnStatement>): any;
visitThrowStatement?(this: Context & M, path: NodePath<namedTypes.ThrowStatement>): any;
visitTryStatement?(this: Context & M, path: NodePath<namedTypes.TryStatement>): any;
visitCatchClause?(this: Context & M, path: NodePath<namedTypes.CatchClause>): any;
visitWhileStatement?(this: Context & M, path: NodePath<namedTypes.WhileStatement>): any;
visitDoWhileStatement?(this: Context & M, path: NodePath<namedTypes.DoWhileStatement>): any;
visitForStatement?(this: Context & M, path: NodePath<namedTypes.ForStatement>): any;
visitDeclaration?(this: Context & M, path: NodePath<namedTypes.Declaration>): any;
visitVariableDeclaration?(this: Context & M, path: NodePath<namedTypes.VariableDeclaration>): any;
visitForInStatement?(this: Context & M, path: NodePath<namedTypes.ForInStatement>): any;
visitDebuggerStatement?(this: Context & M, path: NodePath<namedTypes.DebuggerStatement>): any;
visitFunctionDeclaration?(this: Context & M, path: NodePath<namedTypes.FunctionDeclaration>): any;
visitFunctionExpression?(this: Context & M, path: NodePath<namedTypes.FunctionExpression>): any;
visitVariableDeclarator?(this: Context & M, path: NodePath<namedTypes.VariableDeclarator>): any;
visitThisExpression?(this: Context & M, path: NodePath<namedTypes.ThisExpression>): any;
visitArrayExpression?(this: Context & M, path: NodePath<namedTypes.ArrayExpression>): any;
visitObjectExpression?(this: Context & M, path: NodePath<namedTypes.ObjectExpression>): any;
visitProperty?(this: Context & M, path: NodePath<namedTypes.Property>): any;
visitLiteral?(this: Context & M, path: NodePath<namedTypes.Literal>): any;
visitSequenceExpression?(this: Context & M, path: NodePath<namedTypes.SequenceExpression>): any;
visitUnaryExpression?(this: Context & M, path: NodePath<namedTypes.UnaryExpression>): any;
visitBinaryExpression?(this: Context & M, path: NodePath<namedTypes.BinaryExpression>): any;
visitAssignmentExpression?(this: Context & M, path: NodePath<namedTypes.AssignmentExpression>): any;
visitChainElement?(this: Context & M, path: NodePath<namedTypes.ChainElement>): any;
visitMemberExpression?(this: Context & M, path: NodePath<namedTypes.MemberExpression>): any;
visitUpdateExpression?(this: Context & M, path: NodePath<namedTypes.UpdateExpression>): any;
visitLogicalExpression?(this: Context & M, path: NodePath<namedTypes.LogicalExpression>): any;
visitConditionalExpression?(this: Context & M, path: NodePath<namedTypes.ConditionalExpression>): any;
visitNewExpression?(this: Context & M, path: NodePath<namedTypes.NewExpression>): any;
visitCallExpression?(this: Context & M, path: NodePath<namedTypes.CallExpression>): any;
visitRestElement?(this: Context & M, path: NodePath<namedTypes.RestElement>): any;
visitTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.TypeAnnotation>): any;
visitTSTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.TSTypeAnnotation>): any;
visitSpreadElementPattern?(this: Context & M, path: NodePath<namedTypes.SpreadElementPattern>): any;
visitArrowFunctionExpression?(this: Context & M, path: NodePath<namedTypes.ArrowFunctionExpression>): any;
visitForOfStatement?(this: Context & M, path: NodePath<namedTypes.ForOfStatement>): any;
visitYieldExpression?(this: Context & M, path: NodePath<namedTypes.YieldExpression>): any;
visitGeneratorExpression?(this: Context & M, path: NodePath<namedTypes.GeneratorExpression>): any;
visitComprehensionBlock?(this: Context & M, path: NodePath<namedTypes.ComprehensionBlock>): any;
visitComprehensionExpression?(this: Context & M, path: NodePath<namedTypes.ComprehensionExpression>): any;
visitObjectProperty?(this: Context & M, path: NodePath<namedTypes.ObjectProperty>): any;
visitPropertyPattern?(this: Context & M, path: NodePath<namedTypes.PropertyPattern>): any;
visitObjectPattern?(this: Context & M, path: NodePath<namedTypes.ObjectPattern>): any;
visitArrayPattern?(this: Context & M, path: NodePath<namedTypes.ArrayPattern>): any;
visitSpreadElement?(this: Context & M, path: NodePath<namedTypes.SpreadElement>): any;
visitAssignmentPattern?(this: Context & M, path: NodePath<namedTypes.AssignmentPattern>): any;
visitMethodDefinition?(this: Context & M, path: NodePath<namedTypes.MethodDefinition>): any;
visitClassPropertyDefinition?(this: Context & M, path: NodePath<namedTypes.ClassPropertyDefinition>): any;
visitClassProperty?(this: Context & M, path: NodePath<namedTypes.ClassProperty>): any;
visitStaticBlock?(this: Context & M, path: NodePath<namedTypes.StaticBlock>): any;
visitClassBody?(this: Context & M, path: NodePath<namedTypes.ClassBody>): any;
visitClassDeclaration?(this: Context & M, path: NodePath<namedTypes.ClassDeclaration>): any;
visitClassExpression?(this: Context & M, path: NodePath<namedTypes.ClassExpression>): any;
visitSuper?(this: Context & M, path: NodePath<namedTypes.Super>): any;
visitSpecifier?(this: Context & M, path: NodePath<namedTypes.Specifier>): any;
visitModuleSpecifier?(this: Context & M, path: NodePath<namedTypes.ModuleSpecifier>): any;
visitImportSpecifier?(this: Context & M, path: NodePath<namedTypes.ImportSpecifier>): any;
visitImportDefaultSpecifier?(this: Context & M, path: NodePath<namedTypes.ImportDefaultSpecifier>): any;
visitImportNamespaceSpecifier?(this: Context & M, path: NodePath<namedTypes.ImportNamespaceSpecifier>): any;
visitImportDeclaration?(this: Context & M, path: NodePath<namedTypes.ImportDeclaration>): any;
visitExportNamedDeclaration?(this: Context & M, path: NodePath<namedTypes.ExportNamedDeclaration>): any;
visitExportSpecifier?(this: Context & M, path: NodePath<namedTypes.ExportSpecifier>): any;
visitExportDefaultDeclaration?(this: Context & M, path: NodePath<namedTypes.ExportDefaultDeclaration>): any;
visitExportAllDeclaration?(this: Context & M, path: NodePath<namedTypes.ExportAllDeclaration>): any;
visitTaggedTemplateExpression?(this: Context & M, path: NodePath<namedTypes.TaggedTemplateExpression>): any;
visitTemplateLiteral?(this: Context & M, path: NodePath<namedTypes.TemplateLiteral>): any;
visitTemplateElement?(this: Context & M, path: NodePath<namedTypes.TemplateElement>): any;
visitMetaProperty?(this: Context & M, path: NodePath<namedTypes.MetaProperty>): any;
visitAwaitExpression?(this: Context & M, path: NodePath<namedTypes.AwaitExpression>): any;
visitSpreadProperty?(this: Context & M, path: NodePath<namedTypes.SpreadProperty>): any;
visitSpreadPropertyPattern?(this: Context & M, path: NodePath<namedTypes.SpreadPropertyPattern>): any;
visitImportExpression?(this: Context & M, path: NodePath<namedTypes.ImportExpression>): any;
visitChainExpression?(this: Context & M, path: NodePath<namedTypes.ChainExpression>): any;
visitOptionalCallExpression?(this: Context & M, path: NodePath<namedTypes.OptionalCallExpression>): any;
visitOptionalMemberExpression?(this: Context & M, path: NodePath<namedTypes.OptionalMemberExpression>): any;
visitDecorator?(this: Context & M, path: NodePath<namedTypes.Decorator>): any;
visitPrivateName?(this: Context & M, path: NodePath<namedTypes.PrivateName>): any;
visitClassPrivateProperty?(this: Context & M, path: NodePath<namedTypes.ClassPrivateProperty>): any;
visitImportAttribute?(this: Context & M, path: NodePath<namedTypes.ImportAttribute>): any;
visitRecordExpression?(this: Context & M, path: NodePath<namedTypes.RecordExpression>): any;
visitObjectMethod?(this: Context & M, path: NodePath<namedTypes.ObjectMethod>): any;
visitTupleExpression?(this: Context & M, path: NodePath<namedTypes.TupleExpression>): any;
visitModuleExpression?(this: Context & M, path: NodePath<namedTypes.ModuleExpression>): any;
visitJSXAttribute?(this: Context & M, path: NodePath<namedTypes.JSXAttribute>): any;
visitJSXIdentifier?(this: Context & M, path: NodePath<namedTypes.JSXIdentifier>): any;
visitJSXNamespacedName?(this: Context & M, path: NodePath<namedTypes.JSXNamespacedName>): any;
visitJSXExpressionContainer?(this: Context & M, path: NodePath<namedTypes.JSXExpressionContainer>): any;
visitJSXElement?(this: Context & M, path: NodePath<namedTypes.JSXElement>): any;
visitJSXFragment?(this: Context & M, path: NodePath<namedTypes.JSXFragment>): any;
visitJSXMemberExpression?(this: Context & M, path: NodePath<namedTypes.JSXMemberExpression>): any;
visitJSXSpreadAttribute?(this: Context & M, path: NodePath<namedTypes.JSXSpreadAttribute>): any;
visitJSXEmptyExpression?(this: Context & M, path: NodePath<namedTypes.JSXEmptyExpression>): any;
visitJSXText?(this: Context & M, path: NodePath<namedTypes.JSXText>): any;
visitJSXSpreadChild?(this: Context & M, path: NodePath<namedTypes.JSXSpreadChild>): any;
visitJSXOpeningElement?(this: Context & M, path: NodePath<namedTypes.JSXOpeningElement>): any;
visitJSXClosingElement?(this: Context & M, path: NodePath<namedTypes.JSXClosingElement>): any;
visitJSXOpeningFragment?(this: Context & M, path: NodePath<namedTypes.JSXOpeningFragment>): any;
visitJSXClosingFragment?(this: Context & M, path: NodePath<namedTypes.JSXClosingFragment>): any;
visitTypeParameterDeclaration?(this: Context & M, path: NodePath<namedTypes.TypeParameterDeclaration>): any;
visitTSTypeParameterDeclaration?(this: Context & M, path: NodePath<namedTypes.TSTypeParameterDeclaration>): any;
visitTypeParameterInstantiation?(this: Context & M, path: NodePath<namedTypes.TypeParameterInstantiation>): any;
visitTSTypeParameterInstantiation?(this: Context & M, path: NodePath<namedTypes.TSTypeParameterInstantiation>): any;
visitClassImplements?(this: Context & M, path: NodePath<namedTypes.ClassImplements>): any;
visitTSType?(this: Context & M, path: NodePath<namedTypes.TSType>): any;
visitTSHasOptionalTypeParameterInstantiation?(this: Context & M, path: NodePath<namedTypes.TSHasOptionalTypeParameterInstantiation>): any;
visitTSExpressionWithTypeArguments?(this: Context & M, path: NodePath<namedTypes.TSExpressionWithTypeArguments>): any;
visitFlow?(this: Context & M, path: NodePath<namedTypes.Flow>): any;
visitFlowType?(this: Context & M, path: NodePath<namedTypes.FlowType>): any;
visitAnyTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.AnyTypeAnnotation>): any;
visitEmptyTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.EmptyTypeAnnotation>): any;
visitMixedTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.MixedTypeAnnotation>): any;
visitVoidTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.VoidTypeAnnotation>): any;
visitSymbolTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.SymbolTypeAnnotation>): any;
visitNumberTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.NumberTypeAnnotation>): any;
visitBigIntTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.BigIntTypeAnnotation>): any;
visitNumberLiteralTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.NumberLiteralTypeAnnotation>): any;
visitNumericLiteralTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.NumericLiteralTypeAnnotation>): any;
visitBigIntLiteralTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.BigIntLiteralTypeAnnotation>): any;
visitStringTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.StringTypeAnnotation>): any;
visitStringLiteralTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.StringLiteralTypeAnnotation>): any;
visitBooleanTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.BooleanTypeAnnotation>): any;
visitBooleanLiteralTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.BooleanLiteralTypeAnnotation>): any;
visitNullableTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.NullableTypeAnnotation>): any;
visitNullLiteralTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.NullLiteralTypeAnnotation>): any;
visitNullTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.NullTypeAnnotation>): any;
visitThisTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.ThisTypeAnnotation>): any;
visitExistsTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.ExistsTypeAnnotation>): any;
visitExistentialTypeParam?(this: Context & M, path: NodePath<namedTypes.ExistentialTypeParam>): any;
visitFunctionTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.FunctionTypeAnnotation>): any;
visitFunctionTypeParam?(this: Context & M, path: NodePath<namedTypes.FunctionTypeParam>): any;
visitArrayTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.ArrayTypeAnnotation>): any;
visitObjectTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.ObjectTypeAnnotation>): any;
visitObjectTypeProperty?(this: Context & M, path: NodePath<namedTypes.ObjectTypeProperty>): any;
visitObjectTypeSpreadProperty?(this: Context & M, path: NodePath<namedTypes.ObjectTypeSpreadProperty>): any;
visitObjectTypeIndexer?(this: Context & M, path: NodePath<namedTypes.ObjectTypeIndexer>): any;
visitObjectTypeCallProperty?(this: Context & M, path: NodePath<namedTypes.ObjectTypeCallProperty>): any;
visitObjectTypeInternalSlot?(this: Context & M, path: NodePath<namedTypes.ObjectTypeInternalSlot>): any;
visitVariance?(this: Context & M, path: NodePath<namedTypes.Variance>): any;
visitQualifiedTypeIdentifier?(this: Context & M, path: NodePath<namedTypes.QualifiedTypeIdentifier>): any;
visitGenericTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.GenericTypeAnnotation>): any;
visitMemberTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.MemberTypeAnnotation>): any;
visitIndexedAccessType?(this: Context & M, path: NodePath<namedTypes.IndexedAccessType>): any;
visitOptionalIndexedAccessType?(this: Context & M, path: NodePath<namedTypes.OptionalIndexedAccessType>): any;
visitUnionTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.UnionTypeAnnotation>): any;
visitIntersectionTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.IntersectionTypeAnnotation>): any;
visitTypeofTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.TypeofTypeAnnotation>): any;
visitTypeParameter?(this: Context & M, path: NodePath<namedTypes.TypeParameter>): any;
visitInterfaceTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.InterfaceTypeAnnotation>): any;
visitInterfaceExtends?(this: Context & M, path: NodePath<namedTypes.InterfaceExtends>): any;
visitInterfaceDeclaration?(this: Context & M, path: NodePath<namedTypes.InterfaceDeclaration>): any;
visitDeclareInterface?(this: Context & M, path: NodePath<namedTypes.DeclareInterface>): any;
visitTypeAlias?(this: Context & M, path: NodePath<namedTypes.TypeAlias>): any;
visitDeclareTypeAlias?(this: Context & M, path: NodePath<namedTypes.DeclareTypeAlias>): any;
visitOpaqueType?(this: Context & M, path: NodePath<namedTypes.OpaqueType>): any;
visitDeclareOpaqueType?(this: Context & M, path: NodePath<namedTypes.DeclareOpaqueType>): any;
visitTypeCastExpression?(this: Context & M, path: NodePath<namedTypes.TypeCastExpression>): any;
visitTupleTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.TupleTypeAnnotation>): any;
visitDeclareVariable?(this: Context & M, path: NodePath<namedTypes.DeclareVariable>): any;
visitDeclareFunction?(this: Context & M, path: NodePath<namedTypes.DeclareFunction>): any;
visitFlowPredicate?(this: Context & M, path: NodePath<namedTypes.FlowPredicate>): any;
visitDeclareClass?(this: Context & M, path: NodePath<namedTypes.DeclareClass>): any;
visitDeclareModule?(this: Context & M, path: NodePath<namedTypes.DeclareModule>): any;
visitDeclareModuleExports?(this: Context & M, path: NodePath<namedTypes.DeclareModuleExports>): any;
visitDeclareExportDeclaration?(this: Context & M, path: NodePath<namedTypes.DeclareExportDeclaration>): any;
visitExportBatchSpecifier?(this: Context & M, path: NodePath<namedTypes.ExportBatchSpecifier>): any;
visitDeclareExportAllDeclaration?(this: Context & M, path: NodePath<namedTypes.DeclareExportAllDeclaration>): any;
visitInferredPredicate?(this: Context & M, path: NodePath<namedTypes.InferredPredicate>): any;
visitDeclaredPredicate?(this: Context & M, path: NodePath<namedTypes.DeclaredPredicate>): any;
visitEnumDeclaration?(this: Context & M, path: NodePath<namedTypes.EnumDeclaration>): any;
visitEnumBooleanBody?(this: Context & M, path: NodePath<namedTypes.EnumBooleanBody>): any;
visitEnumNumberBody?(this: Context & M, path: NodePath<namedTypes.EnumNumberBody>): any;
visitEnumStringBody?(this: Context & M, path: NodePath<namedTypes.EnumStringBody>): any;
visitEnumSymbolBody?(this: Context & M, path: NodePath<namedTypes.EnumSymbolBody>): any;
visitEnumBooleanMember?(this: Context & M, path: NodePath<namedTypes.EnumBooleanMember>): any;
visitEnumNumberMember?(this: Context & M, path: NodePath<namedTypes.EnumNumberMember>): any;
visitEnumStringMember?(this: Context & M, path: NodePath<namedTypes.EnumStringMember>): any;
visitEnumDefaultedMember?(this: Context & M, path: NodePath<namedTypes.EnumDefaultedMember>): any;
visitExportDeclaration?(this: Context & M, path: NodePath<namedTypes.ExportDeclaration>): any;
visitBlock?(this: Context & M, path: NodePath<namedTypes.Block>): any;
visitLine?(this: Context & M, path: NodePath<namedTypes.Line>): any;
visitNoop?(this: Context & M, path: NodePath<namedTypes.Noop>): any;
visitDoExpression?(this: Context & M, path: NodePath<namedTypes.DoExpression>): any;
visitBindExpression?(this: Context & M, path: NodePath<namedTypes.BindExpression>): any;
visitParenthesizedExpression?(this: Context & M, path: NodePath<namedTypes.ParenthesizedExpression>): any;
visitExportNamespaceSpecifier?(this: Context & M, path: NodePath<namedTypes.ExportNamespaceSpecifier>): any;
visitExportDefaultSpecifier?(this: Context & M, path: NodePath<namedTypes.ExportDefaultSpecifier>): any;
visitCommentBlock?(this: Context & M, path: NodePath<namedTypes.CommentBlock>): any;
visitCommentLine?(this: Context & M, path: NodePath<namedTypes.CommentLine>): any;
visitDirective?(this: Context & M, path: NodePath<namedTypes.Directive>): any;
visitDirectiveLiteral?(this: Context & M, path: NodePath<namedTypes.DirectiveLiteral>): any;
visitInterpreterDirective?(this: Context & M, path: NodePath<namedTypes.InterpreterDirective>): any;
visitStringLiteral?(this: Context & M, path: NodePath<namedTypes.StringLiteral>): any;
visitNumericLiteral?(this: Context & M, path: NodePath<namedTypes.NumericLiteral>): any;
visitBigIntLiteral?(this: Context & M, path: NodePath<namedTypes.BigIntLiteral>): any;
visitDecimalLiteral?(this: Context & M, path: NodePath<namedTypes.DecimalLiteral>): any;
visitNullLiteral?(this: Context & M, path: NodePath<namedTypes.NullLiteral>): any;
visitBooleanLiteral?(this: Context & M, path: NodePath<namedTypes.BooleanLiteral>): any;
visitRegExpLiteral?(this: Context & M, path: NodePath<namedTypes.RegExpLiteral>): any;
visitClassMethod?(this: Context & M, path: NodePath<namedTypes.ClassMethod>): any;
visitClassPrivateMethod?(this: Context & M, path: NodePath<namedTypes.ClassPrivateMethod>): any;
visitTSHasOptionalTypeAnnotation?(this: Context & M, path: NodePath<namedTypes.TSHasOptionalTypeAnnotation>): any;
visitClassAccessorProperty?(this: Context & M, path: NodePath<namedTypes.ClassAccessorProperty>): any;
visitRestProperty?(this: Context & M, path: NodePath<namedTypes.RestProperty>): any;
visitForAwaitStatement?(this: Context & M, path: NodePath<namedTypes.ForAwaitStatement>): any;
visitImport?(this: Context & M, path: NodePath<namedTypes.Import>): any;
visitV8IntrinsicIdentifier?(this: Context & M, path: NodePath<namedTypes.V8IntrinsicIdentifier>): any;
visitTopicReference?(this: Context & M, path: NodePath<namedTypes.TopicReference>): any;
visitTSQualifiedName?(this: Context & M, path: NodePath<namedTypes.TSQualifiedName>): any;
visitTSTypeReference?(this: Context & M, path: NodePath<namedTypes.TSTypeReference>): any;
visitTSHasOptionalTypeParameters?(this: Context & M, path: NodePath<namedTypes.TSHasOptionalTypeParameters>): any;
visitTSAsExpression?(this: Context & M, path: NodePath<namedTypes.TSAsExpression>): any;
visitTSTypeCastExpression?(this: Context & M, path: NodePath<namedTypes.TSTypeCastExpression>): any;
visitTSSatisfiesExpression?(this: Context & M, path: NodePath<namedTypes.TSSatisfiesExpression>): any;
visitTSNonNullExpression?(this: Context & M, path: NodePath<namedTypes.TSNonNullExpression>): any;
visitTSAnyKeyword?(this: Context & M, path: NodePath<namedTypes.TSAnyKeyword>): any;
visitTSBigIntKeyword?(this: Context & M, path: NodePath<namedTypes.TSBigIntKeyword>): any;
visitTSBooleanKeyword?(this: Context & M, path: NodePath<namedTypes.TSBooleanKeyword>): any;
visitTSNeverKeyword?(this: Context & M, path: NodePath<namedTypes.TSNeverKeyword>): any;
visitTSNullKeyword?(this: Context & M, path: NodePath<namedTypes.TSNullKeyword>): any;
visitTSNumberKeyword?(this: Context & M, path: NodePath<namedTypes.TSNumberKeyword>): any;
visitTSObjectKeyword?(this: Context & M, path: NodePath<namedTypes.TSObjectKeyword>): any;
visitTSStringKeyword?(this: Context & M, path: NodePath<namedTypes.TSStringKeyword>): any;
visitTSSymbolKeyword?(this: Context & M, path: NodePath<namedTypes.TSSymbolKeyword>): any;
visitTSUndefinedKeyword?(this: Context & M, path: NodePath<namedTypes.TSUndefinedKeyword>): any;
visitTSUnknownKeyword?(this: Context & M, path: NodePath<namedTypes.TSUnknownKeyword>): any;
visitTSVoidKeyword?(this: Context & M, path: NodePath<namedTypes.TSVoidKeyword>): any;
visitTSIntrinsicKeyword?(this: Context & M, path: NodePath<namedTypes.TSIntrinsicKeyword>): any;
visitTSThisType?(this: Context & M, path: NodePath<namedTypes.TSThisType>): any;
visitTSArrayType?(this: Context & M, path: NodePath<namedTypes.TSArrayType>): any;
visitTSLiteralType?(this: Context & M, path: NodePath<namedTypes.TSLiteralType>): any;
visitTSUnionType?(this: Context & M, path: NodePath<namedTypes.TSUnionType>): any;
visitTSIntersectionType?(this: Context & M, path: NodePath<namedTypes.TSIntersectionType>): any;
visitTSConditionalType?(this: Context & M, path: NodePath<namedTypes.TSConditionalType>): any;
visitTSInferType?(this: Context & M, path: NodePath<namedTypes.TSInferType>): any;
visitTSTypeParameter?(this: Context & M, path: NodePath<namedTypes.TSTypeParameter>): any;
visitTSParenthesizedType?(this: Context & M, path: NodePath<namedTypes.TSParenthesizedType>): any;
visitTSFunctionType?(this: Context & M, path: NodePath<namedTypes.TSFunctionType>): any;
visitTSConstructorType?(this: Context & M, path: NodePath<namedTypes.TSConstructorType>): any;
visitTSDeclareFunction?(this: Context & M, path: NodePath<namedTypes.TSDeclareFunction>): any;
visitTSDeclareMethod?(this: Context & M, path: NodePath<namedTypes.TSDeclareMethod>): any;
visitTSMappedType?(this: Context & M, path: NodePath<namedTypes.TSMappedType>): any;
visitTSTupleType?(this: Context & M, path: NodePath<namedTypes.TSTupleType>): any;
visitTSNamedTupleMember?(this: Context & M, path: NodePath<namedTypes.TSNamedTupleMember>): any;
visitTSRestType?(this: Context & M, path: NodePath<namedTypes.TSRestType>): any;
visitTSOptionalType?(this: Context & M, path: NodePath<namedTypes.TSOptionalType>): any;
visitTSIndexedAccessType?(this: Context & M, path: NodePath<namedTypes.TSIndexedAccessType>): any;
visitTSTypeOperator?(this: Context & M, path: NodePath<namedTypes.TSTypeOperator>): any;
visitTSIndexSignature?(this: Context & M, path: NodePath<namedTypes.TSIndexSignature>): any;
visitTSPropertySignature?(this: Context & M, path: NodePath<namedTypes.TSPropertySignature>): any;
visitTSMethodSignature?(this: Context & M, path: NodePath<namedTypes.TSMethodSignature>): any;
visitTSTypePredicate?(this: Context & M, path: NodePath<namedTypes.TSTypePredicate>): any;
visitTSCallSignatureDeclaration?(this: Context & M, path: NodePath<namedTypes.TSCallSignatureDeclaration>): any;
visitTSConstructSignatureDeclaration?(this: Context & M, path: NodePath<namedTypes.TSConstructSignatureDeclaration>): any;
visitTSEnumMember?(this: Context & M, path: NodePath<namedTypes.TSEnumMember>): any;
visitTSTypeQuery?(this: Context & M, path: NodePath<namedTypes.TSTypeQuery>): any;
visitTSImportType?(this: Context & M, path: NodePath<namedTypes.TSImportType>): any;
visitTSTypeLiteral?(this: Context & M, path: NodePath<namedTypes.TSTypeLiteral>): any;
visitTSTypeAssertion?(this: Context & M, path: NodePath<namedTypes.TSTypeAssertion>): any;
visitTSInstantiationExpression?(this: Context & M, path: NodePath<namedTypes.TSInstantiationExpression>): any;
visitTSEnumDeclaration?(this: Context & M, path: NodePath<namedTypes.TSEnumDeclaration>): any;
visitTSTypeAliasDeclaration?(this: Context & M, path: NodePath<namedTypes.TSTypeAliasDeclaration>): any;
visitTSModuleBlock?(this: Context & M, path: NodePath<namedTypes.TSModuleBlock>): any;
visitTSModuleDeclaration?(this: Context & M, path: NodePath<namedTypes.TSModuleDeclaration>): any;
visitTSImportEqualsDeclaration?(this: Context & M, path: NodePath<namedTypes.TSImportEqualsDeclaration>): any;
visitTSExternalModuleReference?(this: Context & M, path: NodePath<namedTypes.TSExternalModuleReference>): any;
visitTSExportAssignment?(this: Context & M, path: NodePath<namedTypes.TSExportAssignment>): any;
visitTSNamespaceExportDeclaration?(this: Context & M, path: NodePath<namedTypes.TSNamespaceExportDeclaration>): any;
visitTSInterfaceBody?(this: Context & M, path: NodePath<namedTypes.TSInterfaceBody>): any;
visitTSInterfaceDeclaration?(this: Context & M, path: NodePath<namedTypes.TSInterfaceDeclaration>): any;
visitTSParameterProperty?(this: Context & M, path: NodePath<namedTypes.TSParameterProperty>): any;
}

3
node_modules/ast-types/lib/gen/visitor.js generated vendored Normal file
View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=visitor.js.map

1
node_modules/ast-types/lib/gen/visitor.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"visitor.js","sourceRoot":"","sources":["../../src/gen/visitor.ts"],"names":[],"mappings":""}

29
node_modules/ast-types/lib/main.d.ts generated vendored Normal file
View File

@ -0,0 +1,29 @@
import { ASTNode, Type, AnyType, Field } from "./types";
import { NodePath } from "./node-path";
import { namedTypes } from "./gen/namedTypes";
import { builders } from "./gen/builders";
import { Visitor } from "./gen/visitor";
declare const astNodesAreEquivalent: {
(a: any, b: any, problemPath?: any): boolean;
assert(a: any, b: any): void;
}, builders: builders, builtInTypes: {
string: Type<string>;
function: Type<Function>;
array: Type<any[]>;
object: Type<{
[key: string]: any;
}>;
RegExp: Type<RegExp>;
Date: Type<Date>;
number: Type<number>;
boolean: Type<boolean>;
null: Type<null>;
undefined: Type<undefined>;
BigInt: Type<BigInt>;
}, defineMethod: (name: any, func?: Function | undefined) => Function, eachField: (object: any, callback: (name: any, value: any) => any, context?: any) => void, finalize: () => void, getBuilderName: (typeName: any) => any, getFieldNames: (object: any) => string[], getFieldValue: (object: any, fieldName: any) => any, getSupertypeNames: (typeName: string) => string[], NodePath: import("./node-path").NodePathConstructor, Path: import("./path").PathConstructor, PathVisitor: import("./path-visitor").PathVisitorConstructor, someField: (object: any, callback: (name: any, value: any) => any, context?: any) => boolean, Type: {
or(...types: any[]): Type<any>;
from<T>(value: any, name?: string | undefined): Type<T>;
def(typeName: string): import("./types").Def<any>;
hasDef(typeName: string): boolean;
}, use: <T>(plugin: import("./types").Plugin<T>) => T, visit: <M = {}>(node: ASTNode, methods?: Visitor<M> | undefined) => any;
export { AnyType, ASTNode, astNodesAreEquivalent, builders, builtInTypes, defineMethod, eachField, Field, finalize, getBuilderName, getFieldNames, getFieldValue, getSupertypeNames, namedTypes, NodePath, Path, PathVisitor, someField, Type, use, visit, Visitor, };

44
node_modules/ast-types/lib/main.js generated vendored Normal file
View File

@ -0,0 +1,44 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.visit = exports.use = exports.Type = exports.someField = exports.PathVisitor = exports.Path = exports.NodePath = exports.namedTypes = exports.getSupertypeNames = exports.getFieldValue = exports.getFieldNames = exports.getBuilderName = exports.finalize = exports.eachField = exports.defineMethod = exports.builtInTypes = exports.builders = exports.astNodesAreEquivalent = void 0;
var tslib_1 = require("tslib");
var fork_1 = tslib_1.__importDefault(require("./fork"));
var es_proposals_1 = tslib_1.__importDefault(require("./def/es-proposals"));
var jsx_1 = tslib_1.__importDefault(require("./def/jsx"));
var flow_1 = tslib_1.__importDefault(require("./def/flow"));
var esprima_1 = tslib_1.__importDefault(require("./def/esprima"));
var babel_1 = tslib_1.__importDefault(require("./def/babel"));
var typescript_1 = tslib_1.__importDefault(require("./def/typescript"));
var namedTypes_1 = require("./gen/namedTypes");
Object.defineProperty(exports, "namedTypes", { enumerable: true, get: function () { return namedTypes_1.namedTypes; } });
var _a = (0, fork_1.default)([
// Feel free to add to or remove from this list of extension modules to
// configure the precise type hierarchy that you need.
es_proposals_1.default,
jsx_1.default,
flow_1.default,
esprima_1.default,
babel_1.default,
typescript_1.default,
]), astNodesAreEquivalent = _a.astNodesAreEquivalent, builders = _a.builders, builtInTypes = _a.builtInTypes, defineMethod = _a.defineMethod, eachField = _a.eachField, finalize = _a.finalize, getBuilderName = _a.getBuilderName, getFieldNames = _a.getFieldNames, getFieldValue = _a.getFieldValue, getSupertypeNames = _a.getSupertypeNames, n = _a.namedTypes, NodePath = _a.NodePath, Path = _a.Path, PathVisitor = _a.PathVisitor, someField = _a.someField, Type = _a.Type, use = _a.use, visit = _a.visit;
exports.astNodesAreEquivalent = astNodesAreEquivalent;
exports.builders = builders;
exports.builtInTypes = builtInTypes;
exports.defineMethod = defineMethod;
exports.eachField = eachField;
exports.finalize = finalize;
exports.getBuilderName = getBuilderName;
exports.getFieldNames = getFieldNames;
exports.getFieldValue = getFieldValue;
exports.getSupertypeNames = getSupertypeNames;
exports.NodePath = NodePath;
exports.Path = Path;
exports.PathVisitor = PathVisitor;
exports.someField = someField;
exports.Type = Type;
exports.use = use;
exports.visit = visit;
// Populate the exported fields of the namedTypes namespace, while still
// retaining its member types.
Object.assign(namedTypes_1.namedTypes, n);
//# sourceMappingURL=main.js.map

1
node_modules/ast-types/lib/main.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;;AAAA,wDAA0B;AAC1B,4EAAgD;AAChD,0DAA+B;AAC/B,4DAAiC;AACjC,kEAAuC;AACvC,8DAAmC;AACnC,wEAA6C;AAG7C,+CAA8C;AAoD5C,2FApDO,uBAAU,OAoDP;AAhDN,IAAA,KAmBF,IAAA,cAAI,EAAC;IACP,uEAAuE;IACvE,sDAAsD;IACtD,sBAAc;IACd,aAAM;IACN,cAAO;IACP,iBAAU;IACV,eAAQ;IACR,oBAAa;CACd,CAAC,EA3BA,qBAAqB,2BAAA,EACrB,QAAQ,cAAA,EACR,YAAY,kBAAA,EACZ,YAAY,kBAAA,EACZ,SAAS,eAAA,EACT,QAAQ,cAAA,EACR,cAAc,oBAAA,EACd,aAAa,mBAAA,EACb,aAAa,mBAAA,EACb,iBAAiB,uBAAA,EACL,CAAC,gBAAA,EACb,QAAQ,cAAA,EACR,IAAI,UAAA,EACJ,WAAW,iBAAA,EACX,SAAS,eAAA,EACT,IAAI,UAAA,EACJ,GAAG,SAAA,EACH,KAAK,WAUL,CAAC;AASD,sDAAqB;AACrB,4BAAQ;AACR,oCAAY;AACZ,oCAAY;AACZ,8BAAS;AAET,4BAAQ;AACR,wCAAc;AACd,sCAAa;AACb,sCAAa;AACb,8CAAiB;AAEjB,4BAAQ;AACR,oBAAI;AACJ,kCAAW;AACX,8BAAS;AACT,oBAAI;AACJ,kBAAG;AACH,sBAAK;AAzBP,wEAAwE;AACxE,8BAA8B;AAC9B,MAAM,CAAC,MAAM,CAAC,uBAAU,EAAE,CAAC,CAAC,CAAC"}

21
node_modules/ast-types/lib/node-path.d.ts generated vendored Normal file
View File

@ -0,0 +1,21 @@
import { ASTNode, Fork } from "./types";
import { Path } from "./path";
import { Scope } from "./scope";
export interface NodePath<N = any, V = any> extends Path<V> {
node: N;
parent: any;
scope: any;
replace: Path['replace'];
prune(...args: any[]): any;
_computeNode(): any;
_computeParent(): any;
_computeScope(): Scope | null;
getValueProperty(name: any): any;
needsParens(assumeExpressionContext?: boolean): boolean;
canBeFirstInStatement(): boolean;
firstInStatement(): boolean;
}
export interface NodePathConstructor {
new <N extends ASTNode = any, V = any>(value: any, parentPath?: any, name?: any): NodePath<N, V>;
}
export default function nodePathPlugin(fork: Fork): NodePathConstructor;

414
node_modules/ast-types/lib/node-path.js generated vendored Normal file
View File

@ -0,0 +1,414 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var types_1 = tslib_1.__importDefault(require("./types"));
var path_1 = tslib_1.__importDefault(require("./path"));
var scope_1 = tslib_1.__importDefault(require("./scope"));
var shared_1 = require("./shared");
function nodePathPlugin(fork) {
var types = fork.use(types_1.default);
var n = types.namedTypes;
var b = types.builders;
var isNumber = types.builtInTypes.number;
var isArray = types.builtInTypes.array;
var Path = fork.use(path_1.default);
var Scope = fork.use(scope_1.default);
var NodePath = function NodePath(value, parentPath, name) {
if (!(this instanceof NodePath)) {
throw new Error("NodePath constructor cannot be invoked without 'new'");
}
Path.call(this, value, parentPath, name);
};
var NPp = NodePath.prototype = Object.create(Path.prototype, {
constructor: {
value: NodePath,
enumerable: false,
writable: true,
configurable: true
}
});
Object.defineProperties(NPp, {
node: {
get: function () {
Object.defineProperty(this, "node", {
configurable: true,
value: this._computeNode()
});
return this.node;
}
},
parent: {
get: function () {
Object.defineProperty(this, "parent", {
configurable: true,
value: this._computeParent()
});
return this.parent;
}
},
scope: {
get: function () {
Object.defineProperty(this, "scope", {
configurable: true,
value: this._computeScope()
});
return this.scope;
}
}
});
NPp.replace = function () {
delete this.node;
delete this.parent;
delete this.scope;
return Path.prototype.replace.apply(this, arguments);
};
NPp.prune = function () {
var remainingNodePath = this.parent;
this.replace();
return cleanUpNodesAfterPrune(remainingNodePath);
};
// The value of the first ancestor Path whose value is a Node.
NPp._computeNode = function () {
var value = this.value;
if (n.Node.check(value)) {
return value;
}
var pp = this.parentPath;
return pp && pp.node || null;
};
// The first ancestor Path whose value is a Node distinct from this.node.
NPp._computeParent = function () {
var value = this.value;
var pp = this.parentPath;
if (!n.Node.check(value)) {
while (pp && !n.Node.check(pp.value)) {
pp = pp.parentPath;
}
if (pp) {
pp = pp.parentPath;
}
}
while (pp && !n.Node.check(pp.value)) {
pp = pp.parentPath;
}
return pp || null;
};
// The closest enclosing scope that governs this node.
NPp._computeScope = function () {
var value = this.value;
var pp = this.parentPath;
var scope = pp && pp.scope;
if (n.Node.check(value) &&
Scope.isEstablishedBy(value)) {
scope = new Scope(this, scope);
}
return scope || null;
};
NPp.getValueProperty = function (name) {
return types.getFieldValue(this.value, name);
};
/**
* Determine whether this.node needs to be wrapped in parentheses in order
* for a parser to reproduce the same local AST structure.
*
* For instance, in the expression `(1 + 2) * 3`, the BinaryExpression
* whose operator is "+" needs parentheses, because `1 + 2 * 3` would
* parse differently.
*
* If assumeExpressionContext === true, we don't worry about edge cases
* like an anonymous FunctionExpression appearing lexically first in its
* enclosing statement and thus needing parentheses to avoid being parsed
* as a FunctionDeclaration with a missing name.
*/
NPp.needsParens = function (assumeExpressionContext) {
var pp = this.parentPath;
if (!pp) {
return false;
}
var node = this.value;
// Only expressions need parentheses.
if (!n.Expression.check(node)) {
return false;
}
// Identifiers never need parentheses.
if (node.type === "Identifier") {
return false;
}
while (!n.Node.check(pp.value)) {
pp = pp.parentPath;
if (!pp) {
return false;
}
}
var parent = pp.value;
switch (node.type) {
case "UnaryExpression":
case "SpreadElement":
case "SpreadProperty":
return parent.type === "MemberExpression"
&& this.name === "object"
&& parent.object === node;
case "BinaryExpression":
case "LogicalExpression":
switch (parent.type) {
case "CallExpression":
return this.name === "callee"
&& parent.callee === node;
case "UnaryExpression":
case "SpreadElement":
case "SpreadProperty":
return true;
case "MemberExpression":
return this.name === "object"
&& parent.object === node;
case "BinaryExpression":
case "LogicalExpression": {
var n_1 = node;
var po = parent.operator;
var pp_1 = PRECEDENCE[po];
var no = n_1.operator;
var np = PRECEDENCE[no];
if (pp_1 > np) {
return true;
}
if (pp_1 === np && this.name === "right") {
if (parent.right !== n_1) {
throw new Error("Nodes must be equal");
}
return true;
}
}
default:
return false;
}
case "SequenceExpression":
switch (parent.type) {
case "ForStatement":
// Although parentheses wouldn't hurt around sequence
// expressions in the head of for loops, traditional style
// dictates that e.g. i++, j++ should not be wrapped with
// parentheses.
return false;
case "ExpressionStatement":
return this.name !== "expression";
default:
// Otherwise err on the side of overparenthesization, adding
// explicit exceptions above if this proves overzealous.
return true;
}
case "YieldExpression":
switch (parent.type) {
case "BinaryExpression":
case "LogicalExpression":
case "UnaryExpression":
case "SpreadElement":
case "SpreadProperty":
case "CallExpression":
case "MemberExpression":
case "NewExpression":
case "ConditionalExpression":
case "YieldExpression":
return true;
default:
return false;
}
case "Literal":
return parent.type === "MemberExpression"
&& isNumber.check(node.value)
&& this.name === "object"
&& parent.object === node;
case "AssignmentExpression":
case "ConditionalExpression":
switch (parent.type) {
case "UnaryExpression":
case "SpreadElement":
case "SpreadProperty":
case "BinaryExpression":
case "LogicalExpression":
return true;
case "CallExpression":
return this.name === "callee"
&& parent.callee === node;
case "ConditionalExpression":
return this.name === "test"
&& parent.test === node;
case "MemberExpression":
return this.name === "object"
&& parent.object === node;
default:
return false;
}
default:
if (parent.type === "NewExpression" &&
this.name === "callee" &&
parent.callee === node) {
return containsCallExpression(node);
}
}
if (assumeExpressionContext !== true &&
!this.canBeFirstInStatement() &&
this.firstInStatement())
return true;
return false;
};
function isBinary(node) {
return n.BinaryExpression.check(node)
|| n.LogicalExpression.check(node);
}
// @ts-ignore 'isUnaryLike' is declared but its value is never read. [6133]
function isUnaryLike(node) {
return n.UnaryExpression.check(node)
// I considered making SpreadElement and SpreadProperty subtypes
// of UnaryExpression, but they're not really Expression nodes.
|| (n.SpreadElement && n.SpreadElement.check(node))
|| (n.SpreadProperty && n.SpreadProperty.check(node));
}
var PRECEDENCE = {};
[["||"],
["&&"],
["|"],
["^"],
["&"],
["==", "===", "!=", "!=="],
["<", ">", "<=", ">=", "in", "instanceof"],
[">>", "<<", ">>>"],
["+", "-"],
["*", "/", "%"]
].forEach(function (tier, i) {
tier.forEach(function (op) {
PRECEDENCE[op] = i;
});
});
function containsCallExpression(node) {
if (n.CallExpression.check(node)) {
return true;
}
if (isArray.check(node)) {
return node.some(containsCallExpression);
}
if (n.Node.check(node)) {
return types.someField(node, function (_name, child) {
return containsCallExpression(child);
});
}
return false;
}
NPp.canBeFirstInStatement = function () {
var node = this.node;
return !n.FunctionExpression.check(node)
&& !n.ObjectExpression.check(node);
};
NPp.firstInStatement = function () {
return firstInStatement(this);
};
function firstInStatement(path) {
for (var node, parent; path.parent; path = path.parent) {
node = path.node;
parent = path.parent.node;
if (n.BlockStatement.check(parent) &&
path.parent.name === "body" &&
path.name === 0) {
if (parent.body[0] !== node) {
throw new Error("Nodes must be equal");
}
return true;
}
if (n.ExpressionStatement.check(parent) &&
path.name === "expression") {
if (parent.expression !== node) {
throw new Error("Nodes must be equal");
}
return true;
}
if (n.SequenceExpression.check(parent) &&
path.parent.name === "expressions" &&
path.name === 0) {
if (parent.expressions[0] !== node) {
throw new Error("Nodes must be equal");
}
continue;
}
if (n.CallExpression.check(parent) &&
path.name === "callee") {
if (parent.callee !== node) {
throw new Error("Nodes must be equal");
}
continue;
}
if (n.MemberExpression.check(parent) &&
path.name === "object") {
if (parent.object !== node) {
throw new Error("Nodes must be equal");
}
continue;
}
if (n.ConditionalExpression.check(parent) &&
path.name === "test") {
if (parent.test !== node) {
throw new Error("Nodes must be equal");
}
continue;
}
if (isBinary(parent) &&
path.name === "left") {
if (parent.left !== node) {
throw new Error("Nodes must be equal");
}
continue;
}
if (n.UnaryExpression.check(parent) &&
!parent.prefix &&
path.name === "argument") {
if (parent.argument !== node) {
throw new Error("Nodes must be equal");
}
continue;
}
return false;
}
return true;
}
/**
* Pruning certain nodes will result in empty or incomplete nodes, here we clean those nodes up.
*/
function cleanUpNodesAfterPrune(remainingNodePath) {
if (n.VariableDeclaration.check(remainingNodePath.node)) {
var declarations = remainingNodePath.get('declarations').value;
if (!declarations || declarations.length === 0) {
return remainingNodePath.prune();
}
}
else if (n.ExpressionStatement.check(remainingNodePath.node)) {
if (!remainingNodePath.get('expression').value) {
return remainingNodePath.prune();
}
}
else if (n.IfStatement.check(remainingNodePath.node)) {
cleanUpIfStatementAfterPrune(remainingNodePath);
}
return remainingNodePath;
}
function cleanUpIfStatementAfterPrune(ifStatement) {
var testExpression = ifStatement.get('test').value;
var alternate = ifStatement.get('alternate').value;
var consequent = ifStatement.get('consequent').value;
if (!consequent && !alternate) {
var testExpressionStatement = b.expressionStatement(testExpression);
ifStatement.replace(testExpressionStatement);
}
else if (!consequent && alternate) {
var negatedTestExpression = b.unaryExpression('!', testExpression, true);
if (n.UnaryExpression.check(testExpression) && testExpression.operator === '!') {
negatedTestExpression = testExpression.argument;
}
ifStatement.get("test").replace(negatedTestExpression);
ifStatement.get("consequent").replace(alternate);
ifStatement.get("alternate").replace();
}
}
return NodePath;
}
exports.default = nodePathPlugin;
;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=node-path.js.map

1
node_modules/ast-types/lib/node-path.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

51
node_modules/ast-types/lib/path-visitor.d.ts generated vendored Normal file
View File

@ -0,0 +1,51 @@
import { ASTNode, Fork, Omit } from "./types";
import { NodePath } from "./node-path";
export interface PathVisitor {
_reusableContextStack: any;
_methodNameTable: any;
_shouldVisitComments: any;
Context: any;
_visiting: any;
_changeReported: any;
_abortRequested: boolean;
visit(...args: any[]): any;
reset(...args: any[]): any;
visitWithoutReset(path: any): any;
AbortRequest: any;
abort(): void;
visitor: any;
acquireContext(path: any): any;
releaseContext(context: any): void;
reportChanged(): void;
wasChangeReported(): any;
}
export interface PathVisitorStatics {
fromMethodsObject(methods?: any): Visitor;
visit<M = {}>(node: ASTNode, methods?: import("./gen/visitor").Visitor<M>): any;
}
export interface PathVisitorConstructor extends PathVisitorStatics {
new (): PathVisitor;
}
export interface Visitor extends PathVisitor {
}
export interface VisitorConstructor extends PathVisitorStatics {
new (): Visitor;
}
export interface VisitorMethods {
[visitorMethod: string]: (path: NodePath) => any;
}
export interface SharedContextMethods {
currentPath: any;
needToCallTraverse: boolean;
Context: any;
visitor: any;
reset(path: any, ...args: any[]): any;
invokeVisitorMethod(methodName: string): any;
traverse(path: any, newVisitor?: VisitorMethods): any;
visit(path: any, newVisitor?: VisitorMethods): any;
reportChanged(): void;
abort(): void;
}
export interface Context extends Omit<PathVisitor, "visit" | "reset">, SharedContextMethods {
}
export default function pathVisitorPlugin(fork: Fork): PathVisitorConstructor;

346
node_modules/ast-types/lib/path-visitor.js generated vendored Normal file
View File

@ -0,0 +1,346 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var types_1 = tslib_1.__importDefault(require("./types"));
var node_path_1 = tslib_1.__importDefault(require("./node-path"));
var shared_1 = require("./shared");
var hasOwn = Object.prototype.hasOwnProperty;
function pathVisitorPlugin(fork) {
var types = fork.use(types_1.default);
var NodePath = fork.use(node_path_1.default);
var isArray = types.builtInTypes.array;
var isObject = types.builtInTypes.object;
var isFunction = types.builtInTypes.function;
var undefined;
var PathVisitor = function PathVisitor() {
if (!(this instanceof PathVisitor)) {
throw new Error("PathVisitor constructor cannot be invoked without 'new'");
}
// Permanent state.
this._reusableContextStack = [];
this._methodNameTable = computeMethodNameTable(this);
this._shouldVisitComments =
hasOwn.call(this._methodNameTable, "Block") ||
hasOwn.call(this._methodNameTable, "Line");
this.Context = makeContextConstructor(this);
// State reset every time PathVisitor.prototype.visit is called.
this._visiting = false;
this._changeReported = false;
};
function computeMethodNameTable(visitor) {
var typeNames = Object.create(null);
for (var methodName in visitor) {
if (/^visit[A-Z]/.test(methodName)) {
typeNames[methodName.slice("visit".length)] = true;
}
}
var supertypeTable = types.computeSupertypeLookupTable(typeNames);
var methodNameTable = Object.create(null);
var typeNameKeys = Object.keys(supertypeTable);
var typeNameCount = typeNameKeys.length;
for (var i = 0; i < typeNameCount; ++i) {
var typeName = typeNameKeys[i];
methodName = "visit" + supertypeTable[typeName];
if (isFunction.check(visitor[methodName])) {
methodNameTable[typeName] = methodName;
}
}
return methodNameTable;
}
PathVisitor.fromMethodsObject = function fromMethodsObject(methods) {
if (methods instanceof PathVisitor) {
return methods;
}
if (!isObject.check(methods)) {
// An empty visitor?
return new PathVisitor;
}
var Visitor = function Visitor() {
if (!(this instanceof Visitor)) {
throw new Error("Visitor constructor cannot be invoked without 'new'");
}
PathVisitor.call(this);
};
var Vp = Visitor.prototype = Object.create(PVp);
Vp.constructor = Visitor;
extend(Vp, methods);
extend(Visitor, PathVisitor);
isFunction.assert(Visitor.fromMethodsObject);
isFunction.assert(Visitor.visit);
return new Visitor;
};
function extend(target, source) {
for (var property in source) {
if (hasOwn.call(source, property)) {
target[property] = source[property];
}
}
return target;
}
PathVisitor.visit = function visit(node, methods) {
return PathVisitor.fromMethodsObject(methods).visit(node);
};
var PVp = PathVisitor.prototype;
PVp.visit = function () {
if (this._visiting) {
throw new Error("Recursively calling visitor.visit(path) resets visitor state. " +
"Try this.visit(path) or this.traverse(path) instead.");
}
// Private state that needs to be reset before every traversal.
this._visiting = true;
this._changeReported = false;
this._abortRequested = false;
var argc = arguments.length;
var args = new Array(argc);
for (var i = 0; i < argc; ++i) {
args[i] = arguments[i];
}
if (!(args[0] instanceof NodePath)) {
args[0] = new NodePath({ root: args[0] }).get("root");
}
// Called with the same arguments as .visit.
this.reset.apply(this, args);
var didNotThrow;
try {
var root = this.visitWithoutReset(args[0]);
didNotThrow = true;
}
finally {
this._visiting = false;
if (!didNotThrow && this._abortRequested) {
// If this.visitWithoutReset threw an exception and
// this._abortRequested was set to true, return the root of
// the AST instead of letting the exception propagate, so that
// client code does not have to provide a try-catch block to
// intercept the AbortRequest exception. Other kinds of
// exceptions will propagate without being intercepted and
// rethrown by a catch block, so their stacks will accurately
// reflect the original throwing context.
return args[0].value;
}
}
return root;
};
PVp.AbortRequest = function AbortRequest() { };
PVp.abort = function () {
var visitor = this;
visitor._abortRequested = true;
var request = new visitor.AbortRequest();
// If you decide to catch this exception and stop it from propagating,
// make sure to call its cancel method to avoid silencing other
// exceptions that might be thrown later in the traversal.
request.cancel = function () {
visitor._abortRequested = false;
};
throw request;
};
PVp.reset = function (_path /*, additional arguments */) {
// Empty stub; may be reassigned or overridden by subclasses.
};
PVp.visitWithoutReset = function (path) {
if (this instanceof this.Context) {
// Since this.Context.prototype === this, there's a chance we
// might accidentally call context.visitWithoutReset. If that
// happens, re-invoke the method against context.visitor.
return this.visitor.visitWithoutReset(path);
}
if (!(path instanceof NodePath)) {
throw new Error("");
}
var value = path.value;
var methodName = value &&
typeof value === "object" &&
typeof value.type === "string" &&
this._methodNameTable[value.type];
if (methodName) {
var context = this.acquireContext(path);
try {
return context.invokeVisitorMethod(methodName);
}
finally {
this.releaseContext(context);
}
}
else {
// If there was no visitor method to call, visit the children of
// this node generically.
return visitChildren(path, this);
}
};
function visitChildren(path, visitor) {
if (!(path instanceof NodePath)) {
throw new Error("");
}
if (!(visitor instanceof PathVisitor)) {
throw new Error("");
}
var value = path.value;
if (isArray.check(value)) {
path.each(visitor.visitWithoutReset, visitor);
}
else if (!isObject.check(value)) {
// No children to visit.
}
else {
var childNames = types.getFieldNames(value);
// The .comments field of the Node type is hidden, so we only
// visit it if the visitor defines visitBlock or visitLine, and
// value.comments is defined.
if (visitor._shouldVisitComments &&
value.comments &&
childNames.indexOf("comments") < 0) {
childNames.push("comments");
}
var childCount = childNames.length;
var childPaths = [];
for (var i = 0; i < childCount; ++i) {
var childName = childNames[i];
if (!hasOwn.call(value, childName)) {
value[childName] = types.getFieldValue(value, childName);
}
childPaths.push(path.get(childName));
}
for (var i = 0; i < childCount; ++i) {
visitor.visitWithoutReset(childPaths[i]);
}
}
return path.value;
}
PVp.acquireContext = function (path) {
if (this._reusableContextStack.length === 0) {
return new this.Context(path);
}
return this._reusableContextStack.pop().reset(path);
};
PVp.releaseContext = function (context) {
if (!(context instanceof this.Context)) {
throw new Error("");
}
this._reusableContextStack.push(context);
context.currentPath = null;
};
PVp.reportChanged = function () {
this._changeReported = true;
};
PVp.wasChangeReported = function () {
return this._changeReported;
};
function makeContextConstructor(visitor) {
function Context(path) {
if (!(this instanceof Context)) {
throw new Error("");
}
if (!(this instanceof PathVisitor)) {
throw new Error("");
}
if (!(path instanceof NodePath)) {
throw new Error("");
}
Object.defineProperty(this, "visitor", {
value: visitor,
writable: false,
enumerable: true,
configurable: false
});
this.currentPath = path;
this.needToCallTraverse = true;
Object.seal(this);
}
if (!(visitor instanceof PathVisitor)) {
throw new Error("");
}
// Note that the visitor object is the prototype of Context.prototype,
// so all visitor methods are inherited by context objects.
var Cp = Context.prototype = Object.create(visitor);
Cp.constructor = Context;
extend(Cp, sharedContextProtoMethods);
return Context;
}
// Every PathVisitor has a different this.Context constructor and
// this.Context.prototype object, but those prototypes can all use the
// same reset, invokeVisitorMethod, and traverse function objects.
var sharedContextProtoMethods = Object.create(null);
sharedContextProtoMethods.reset =
function reset(path) {
if (!(this instanceof this.Context)) {
throw new Error("");
}
if (!(path instanceof NodePath)) {
throw new Error("");
}
this.currentPath = path;
this.needToCallTraverse = true;
return this;
};
sharedContextProtoMethods.invokeVisitorMethod =
function invokeVisitorMethod(methodName) {
if (!(this instanceof this.Context)) {
throw new Error("");
}
if (!(this.currentPath instanceof NodePath)) {
throw new Error("");
}
var result = this.visitor[methodName].call(this, this.currentPath);
if (result === false) {
// Visitor methods return false to indicate that they have handled
// their own traversal needs, and we should not complain if
// this.needToCallTraverse is still true.
this.needToCallTraverse = false;
}
else if (result !== undefined) {
// Any other non-undefined value returned from the visitor method
// is interpreted as a replacement value.
this.currentPath = this.currentPath.replace(result)[0];
if (this.needToCallTraverse) {
// If this.traverse still hasn't been called, visit the
// children of the replacement node.
this.traverse(this.currentPath);
}
}
if (this.needToCallTraverse !== false) {
throw new Error("Must either call this.traverse or return false in " + methodName);
}
var path = this.currentPath;
return path && path.value;
};
sharedContextProtoMethods.traverse =
function traverse(path, newVisitor) {
if (!(this instanceof this.Context)) {
throw new Error("");
}
if (!(path instanceof NodePath)) {
throw new Error("");
}
if (!(this.currentPath instanceof NodePath)) {
throw new Error("");
}
this.needToCallTraverse = false;
return visitChildren(path, PathVisitor.fromMethodsObject(newVisitor || this.visitor));
};
sharedContextProtoMethods.visit =
function visit(path, newVisitor) {
if (!(this instanceof this.Context)) {
throw new Error("");
}
if (!(path instanceof NodePath)) {
throw new Error("");
}
if (!(this.currentPath instanceof NodePath)) {
throw new Error("");
}
this.needToCallTraverse = false;
return PathVisitor.fromMethodsObject(newVisitor || this.visitor).visitWithoutReset(path);
};
sharedContextProtoMethods.reportChanged = function reportChanged() {
this.visitor.reportChanged();
};
sharedContextProtoMethods.abort = function abort() {
this.needToCallTraverse = false;
this.visitor.abort();
};
return PathVisitor;
}
exports.default = pathVisitorPlugin;
;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=path-visitor.js.map

1
node_modules/ast-types/lib/path-visitor.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

24
node_modules/ast-types/lib/path.d.ts generated vendored Normal file
View File

@ -0,0 +1,24 @@
import { ASTNode, Fork } from "./types";
export interface Path<V = any> {
value: V;
parentPath: any;
name: any;
__childCache: object | null;
getValueProperty(name: any): any;
get(...names: any[]): any;
each(callback: any, context?: any): any;
map(callback: any, context?: any): any;
filter(callback: any, context?: any): any;
shift(): any;
unshift(...args: any[]): any;
push(...args: any[]): any;
pop(): any;
insertAt(index: number, ...args: any[]): any;
insertBefore(...args: any[]): any;
insertAfter(...args: any[]): any;
replace(replacement?: ASTNode, ...args: ASTNode[]): any;
}
export interface PathConstructor {
new <V = any>(value: any, parentPath?: any, name?: any): Path<V>;
}
export default function pathPlugin(fork: Fork): PathConstructor;

334
node_modules/ast-types/lib/path.js generated vendored Normal file
View File

@ -0,0 +1,334 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var shared_1 = require("./shared");
var types_1 = tslib_1.__importDefault(require("./types"));
var Op = Object.prototype;
var hasOwn = Op.hasOwnProperty;
function pathPlugin(fork) {
var types = fork.use(types_1.default);
var isArray = types.builtInTypes.array;
var isNumber = types.builtInTypes.number;
var Path = function Path(value, parentPath, name) {
if (!(this instanceof Path)) {
throw new Error("Path constructor cannot be invoked without 'new'");
}
if (parentPath) {
if (!(parentPath instanceof Path)) {
throw new Error("");
}
}
else {
parentPath = null;
name = null;
}
// The value encapsulated by this Path, generally equal to
// parentPath.value[name] if we have a parentPath.
this.value = value;
// The immediate parent Path of this Path.
this.parentPath = parentPath;
// The name of the property of parentPath.value through which this
// Path's value was reached.
this.name = name;
// Calling path.get("child") multiple times always returns the same
// child Path object, for both performance and consistency reasons.
this.__childCache = null;
};
var Pp = Path.prototype;
function getChildCache(path) {
// Lazily create the child cache. This also cheapens cache
// invalidation, since you can just reset path.__childCache to null.
return path.__childCache || (path.__childCache = Object.create(null));
}
function getChildPath(path, name) {
var cache = getChildCache(path);
var actualChildValue = path.getValueProperty(name);
var childPath = cache[name];
if (!hasOwn.call(cache, name) ||
// Ensure consistency between cache and reality.
childPath.value !== actualChildValue) {
childPath = cache[name] = new path.constructor(actualChildValue, path, name);
}
return childPath;
}
// This method is designed to be overridden by subclasses that need to
// handle missing properties, etc.
Pp.getValueProperty = function getValueProperty(name) {
return this.value[name];
};
Pp.get = function get() {
var names = [];
for (var _i = 0; _i < arguments.length; _i++) {
names[_i] = arguments[_i];
}
var path = this;
var count = names.length;
for (var i = 0; i < count; ++i) {
path = getChildPath(path, names[i]);
}
return path;
};
Pp.each = function each(callback, context) {
var childPaths = [];
var len = this.value.length;
var i = 0;
// Collect all the original child paths before invoking the callback.
for (var i = 0; i < len; ++i) {
if (hasOwn.call(this.value, i)) {
childPaths[i] = this.get(i);
}
}
// Invoke the callback on just the original child paths, regardless of
// any modifications made to the array by the callback. I chose these
// semantics over cleverly invoking the callback on new elements because
// this way is much easier to reason about.
context = context || this;
for (i = 0; i < len; ++i) {
if (hasOwn.call(childPaths, i)) {
callback.call(context, childPaths[i]);
}
}
};
Pp.map = function map(callback, context) {
var result = [];
this.each(function (childPath) {
result.push(callback.call(this, childPath));
}, context);
return result;
};
Pp.filter = function filter(callback, context) {
var result = [];
this.each(function (childPath) {
if (callback.call(this, childPath)) {
result.push(childPath);
}
}, context);
return result;
};
function emptyMoves() { }
function getMoves(path, offset, start, end) {
isArray.assert(path.value);
if (offset === 0) {
return emptyMoves;
}
var length = path.value.length;
if (length < 1) {
return emptyMoves;
}
var argc = arguments.length;
if (argc === 2) {
start = 0;
end = length;
}
else if (argc === 3) {
start = Math.max(start, 0);
end = length;
}
else {
start = Math.max(start, 0);
end = Math.min(end, length);
}
isNumber.assert(start);
isNumber.assert(end);
var moves = Object.create(null);
var cache = getChildCache(path);
for (var i = start; i < end; ++i) {
if (hasOwn.call(path.value, i)) {
var childPath = path.get(i);
if (childPath.name !== i) {
throw new Error("");
}
var newIndex = i + offset;
childPath.name = newIndex;
moves[newIndex] = childPath;
delete cache[i];
}
}
delete cache.length;
return function () {
for (var newIndex in moves) {
var childPath = moves[newIndex];
if (childPath.name !== +newIndex) {
throw new Error("");
}
cache[newIndex] = childPath;
path.value[newIndex] = childPath.value;
}
};
}
Pp.shift = function shift() {
var move = getMoves(this, -1);
var result = this.value.shift();
move();
return result;
};
Pp.unshift = function unshift() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var move = getMoves(this, args.length);
var result = this.value.unshift.apply(this.value, args);
move();
return result;
};
Pp.push = function push() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
isArray.assert(this.value);
delete getChildCache(this).length;
return this.value.push.apply(this.value, args);
};
Pp.pop = function pop() {
isArray.assert(this.value);
var cache = getChildCache(this);
delete cache[this.value.length - 1];
delete cache.length;
return this.value.pop();
};
Pp.insertAt = function insertAt(index) {
var argc = arguments.length;
var move = getMoves(this, argc - 1, index);
if (move === emptyMoves && argc <= 1) {
return this;
}
index = Math.max(index, 0);
for (var i = 1; i < argc; ++i) {
this.value[index + i - 1] = arguments[i];
}
move();
return this;
};
Pp.insertBefore = function insertBefore() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var pp = this.parentPath;
var argc = args.length;
var insertAtArgs = [this.name];
for (var i = 0; i < argc; ++i) {
insertAtArgs.push(args[i]);
}
return pp.insertAt.apply(pp, insertAtArgs);
};
Pp.insertAfter = function insertAfter() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var pp = this.parentPath;
var argc = args.length;
var insertAtArgs = [this.name + 1];
for (var i = 0; i < argc; ++i) {
insertAtArgs.push(args[i]);
}
return pp.insertAt.apply(pp, insertAtArgs);
};
function repairRelationshipWithParent(path) {
if (!(path instanceof Path)) {
throw new Error("");
}
var pp = path.parentPath;
if (!pp) {
// Orphan paths have no relationship to repair.
return path;
}
var parentValue = pp.value;
var parentCache = getChildCache(pp);
// Make sure parentCache[path.name] is populated.
if (parentValue[path.name] === path.value) {
parentCache[path.name] = path;
}
else if (isArray.check(parentValue)) {
// Something caused path.name to become out of date, so attempt to
// recover by searching for path.value in parentValue.
var i = parentValue.indexOf(path.value);
if (i >= 0) {
parentCache[path.name = i] = path;
}
}
else {
// If path.value disagrees with parentValue[path.name], and
// path.name is not an array index, let path.value become the new
// parentValue[path.name] and update parentCache accordingly.
parentValue[path.name] = path.value;
parentCache[path.name] = path;
}
if (parentValue[path.name] !== path.value) {
throw new Error("");
}
if (path.parentPath.get(path.name) !== path) {
throw new Error("");
}
return path;
}
Pp.replace = function replace(replacement) {
var results = [];
var parentValue = this.parentPath.value;
var parentCache = getChildCache(this.parentPath);
var count = arguments.length;
repairRelationshipWithParent(this);
if (isArray.check(parentValue)) {
var originalLength = parentValue.length;
var move = getMoves(this.parentPath, count - 1, this.name + 1);
var spliceArgs = [this.name, 1];
for (var i = 0; i < count; ++i) {
spliceArgs.push(arguments[i]);
}
var splicedOut = parentValue.splice.apply(parentValue, spliceArgs);
if (splicedOut[0] !== this.value) {
throw new Error("");
}
if (parentValue.length !== (originalLength - 1 + count)) {
throw new Error("");
}
move();
if (count === 0) {
delete this.value;
delete parentCache[this.name];
this.__childCache = null;
}
else {
if (parentValue[this.name] !== replacement) {
throw new Error("");
}
if (this.value !== replacement) {
this.value = replacement;
this.__childCache = null;
}
for (i = 0; i < count; ++i) {
results.push(this.parentPath.get(this.name + i));
}
if (results[0] !== this) {
throw new Error("");
}
}
}
else if (count === 1) {
if (this.value !== replacement) {
this.__childCache = null;
}
this.value = parentValue[this.name] = replacement;
results.push(this);
}
else if (count === 0) {
delete parentValue[this.name];
delete this.value;
this.__childCache = null;
// Leave this path cached as parentCache[this.name], even though
// it no longer has a value defined.
}
else {
throw new Error("Could not replace path");
}
return results;
};
return Path;
}
exports.default = pathPlugin;
;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=path.js.map

1
node_modules/ast-types/lib/path.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

27
node_modules/ast-types/lib/scope.d.ts generated vendored Normal file
View File

@ -0,0 +1,27 @@
import { NodePath } from "./node-path";
import { Fork } from "./types";
export interface Scope {
path: NodePath;
node: any;
isGlobal: boolean;
depth: number;
parent: any;
bindings: any;
types: any;
didScan: boolean;
declares(name: any): any;
declaresType(name: any): any;
declareTemporary(prefix?: any): any;
injectTemporary(identifier: any, init: any): any;
scan(force?: any): any;
getBindings(): any;
getTypes(): any;
lookup(name: any): any;
lookupType(name: any): any;
getGlobalScope(): Scope;
}
export interface ScopeConstructor {
new (path: NodePath, parentScope: any): Scope;
isEstablishedBy(node: any): any;
}
export default function scopePlugin(fork: Fork): ScopeConstructor;

358
node_modules/ast-types/lib/scope.js generated vendored Normal file
View File

@ -0,0 +1,358 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var shared_1 = require("./shared");
var types_1 = tslib_1.__importDefault(require("./types"));
var hasOwn = Object.prototype.hasOwnProperty;
function scopePlugin(fork) {
var types = fork.use(types_1.default);
var Type = types.Type;
var namedTypes = types.namedTypes;
var Node = namedTypes.Node;
var Expression = namedTypes.Expression;
var isArray = types.builtInTypes.array;
var b = types.builders;
var Scope = function Scope(path, parentScope) {
if (!(this instanceof Scope)) {
throw new Error("Scope constructor cannot be invoked without 'new'");
}
if (!TypeParameterScopeType.check(path.value)) {
ScopeType.assert(path.value);
}
var depth;
if (parentScope) {
if (!(parentScope instanceof Scope)) {
throw new Error("");
}
depth = parentScope.depth + 1;
}
else {
parentScope = null;
depth = 0;
}
Object.defineProperties(this, {
path: { value: path },
node: { value: path.value },
isGlobal: { value: !parentScope, enumerable: true },
depth: { value: depth },
parent: { value: parentScope },
bindings: { value: {} },
types: { value: {} },
});
};
var ScopeType = Type.or(
// Program nodes introduce global scopes.
namedTypes.Program,
// Function is the supertype of FunctionExpression,
// FunctionDeclaration, ArrowExpression, etc.
namedTypes.Function,
// In case you didn't know, the caught parameter shadows any variable
// of the same name in an outer scope.
namedTypes.CatchClause);
// These types introduce scopes that are restricted to type parameters in
// Flow (this doesn't apply to ECMAScript).
var TypeParameterScopeType = Type.or(namedTypes.Function, namedTypes.ClassDeclaration, namedTypes.ClassExpression, namedTypes.InterfaceDeclaration, namedTypes.TSInterfaceDeclaration, namedTypes.TypeAlias, namedTypes.TSTypeAliasDeclaration);
var FlowOrTSTypeParameterType = Type.or(namedTypes.TypeParameter, namedTypes.TSTypeParameter);
Scope.isEstablishedBy = function (node) {
return ScopeType.check(node) || TypeParameterScopeType.check(node);
};
var Sp = Scope.prototype;
// Will be overridden after an instance lazily calls scanScope.
Sp.didScan = false;
Sp.declares = function (name) {
this.scan();
return hasOwn.call(this.bindings, name);
};
Sp.declaresType = function (name) {
this.scan();
return hasOwn.call(this.types, name);
};
Sp.declareTemporary = function (prefix) {
if (prefix) {
if (!/^[a-z$_]/i.test(prefix)) {
throw new Error("");
}
}
else {
prefix = "t$";
}
// Include this.depth in the name to make sure the name does not
// collide with any variables in nested/enclosing scopes.
prefix += this.depth.toString(36) + "$";
this.scan();
var index = 0;
while (this.declares(prefix + index)) {
++index;
}
var name = prefix + index;
return this.bindings[name] = types.builders.identifier(name);
};
Sp.injectTemporary = function (identifier, init) {
identifier || (identifier = this.declareTemporary());
var bodyPath = this.path.get("body");
if (namedTypes.BlockStatement.check(bodyPath.value)) {
bodyPath = bodyPath.get("body");
}
bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier, init || null)]));
return identifier;
};
Sp.scan = function (force) {
if (force || !this.didScan) {
for (var name in this.bindings) {
// Empty out this.bindings, just in cases.
delete this.bindings[name];
}
for (var name in this.types) {
// Empty out this.types, just in cases.
delete this.types[name];
}
scanScope(this.path, this.bindings, this.types);
this.didScan = true;
}
};
Sp.getBindings = function () {
this.scan();
return this.bindings;
};
Sp.getTypes = function () {
this.scan();
return this.types;
};
function scanScope(path, bindings, scopeTypes) {
var node = path.value;
if (TypeParameterScopeType.check(node)) {
var params = path.get('typeParameters', 'params');
if (isArray.check(params.value)) {
params.each(function (childPath) {
addTypeParameter(childPath, scopeTypes);
});
}
}
if (ScopeType.check(node)) {
if (namedTypes.CatchClause.check(node)) {
// A catch clause establishes a new scope but the only variable
// bound in that scope is the catch parameter. Any other
// declarations create bindings in the outer scope.
addPattern(path.get("param"), bindings);
}
else {
recursiveScanScope(path, bindings, scopeTypes);
}
}
}
function recursiveScanScope(path, bindings, scopeTypes) {
var node = path.value;
if (path.parent &&
namedTypes.FunctionExpression.check(path.parent.node) &&
path.parent.node.id) {
addPattern(path.parent.get("id"), bindings);
}
if (!node) {
// None of the remaining cases matter if node is falsy.
}
else if (isArray.check(node)) {
path.each(function (childPath) {
recursiveScanChild(childPath, bindings, scopeTypes);
});
}
else if (namedTypes.Function.check(node)) {
path.get("params").each(function (paramPath) {
addPattern(paramPath, bindings);
});
recursiveScanChild(path.get("body"), bindings, scopeTypes);
recursiveScanScope(path.get("typeParameters"), bindings, scopeTypes);
}
else if ((namedTypes.TypeAlias && namedTypes.TypeAlias.check(node)) ||
(namedTypes.InterfaceDeclaration && namedTypes.InterfaceDeclaration.check(node)) ||
(namedTypes.TSTypeAliasDeclaration && namedTypes.TSTypeAliasDeclaration.check(node)) ||
(namedTypes.TSInterfaceDeclaration && namedTypes.TSInterfaceDeclaration.check(node))) {
addTypePattern(path.get("id"), scopeTypes);
}
else if (namedTypes.VariableDeclarator.check(node)) {
addPattern(path.get("id"), bindings);
recursiveScanChild(path.get("init"), bindings, scopeTypes);
}
else if (node.type === "ImportSpecifier" ||
node.type === "ImportNamespaceSpecifier" ||
node.type === "ImportDefaultSpecifier") {
addPattern(
// Esprima used to use the .name field to refer to the local
// binding identifier for ImportSpecifier nodes, but .id for
// ImportNamespaceSpecifier and ImportDefaultSpecifier nodes.
// ESTree/Acorn/ESpree use .local for all three node types.
path.get(node.local ? "local" :
node.name ? "name" : "id"), bindings);
}
else if (Node.check(node) && !Expression.check(node)) {
types.eachField(node, function (name, child) {
var childPath = path.get(name);
if (!pathHasValue(childPath, child)) {
throw new Error("");
}
recursiveScanChild(childPath, bindings, scopeTypes);
});
}
}
function pathHasValue(path, value) {
if (path.value === value) {
return true;
}
// Empty arrays are probably produced by defaults.emptyArray, in which
// case is makes sense to regard them as equivalent, if not ===.
if (Array.isArray(path.value) &&
path.value.length === 0 &&
Array.isArray(value) &&
value.length === 0) {
return true;
}
return false;
}
function recursiveScanChild(path, bindings, scopeTypes) {
var node = path.value;
if (!node || Expression.check(node)) {
// Ignore falsy values and Expressions.
}
else if (namedTypes.FunctionDeclaration.check(node) &&
node.id !== null) {
addPattern(path.get("id"), bindings);
}
else if (namedTypes.ClassDeclaration &&
namedTypes.ClassDeclaration.check(node) &&
node.id !== null) {
addPattern(path.get("id"), bindings);
recursiveScanScope(path.get("typeParameters"), bindings, scopeTypes);
}
else if ((namedTypes.InterfaceDeclaration &&
namedTypes.InterfaceDeclaration.check(node)) ||
(namedTypes.TSInterfaceDeclaration &&
namedTypes.TSInterfaceDeclaration.check(node))) {
addTypePattern(path.get("id"), scopeTypes);
}
else if (ScopeType.check(node)) {
if (namedTypes.CatchClause.check(node) &&
// TODO Broaden this to accept any pattern.
namedTypes.Identifier.check(node.param)) {
var catchParamName = node.param.name;
var hadBinding = hasOwn.call(bindings, catchParamName);
// Any declarations that occur inside the catch body that do
// not have the same name as the catch parameter should count
// as bindings in the outer scope.
recursiveScanScope(path.get("body"), bindings, scopeTypes);
// If a new binding matching the catch parameter name was
// created while scanning the catch body, ignore it because it
// actually refers to the catch parameter and not the outer
// scope that we're currently scanning.
if (!hadBinding) {
delete bindings[catchParamName];
}
}
}
else {
recursiveScanScope(path, bindings, scopeTypes);
}
}
function addPattern(patternPath, bindings) {
var pattern = patternPath.value;
namedTypes.Pattern.assert(pattern);
if (namedTypes.Identifier.check(pattern)) {
if (hasOwn.call(bindings, pattern.name)) {
bindings[pattern.name].push(patternPath);
}
else {
bindings[pattern.name] = [patternPath];
}
}
else if (namedTypes.AssignmentPattern &&
namedTypes.AssignmentPattern.check(pattern)) {
addPattern(patternPath.get('left'), bindings);
}
else if (namedTypes.ObjectPattern &&
namedTypes.ObjectPattern.check(pattern)) {
patternPath.get('properties').each(function (propertyPath) {
var property = propertyPath.value;
if (namedTypes.Pattern.check(property)) {
addPattern(propertyPath, bindings);
}
else if (namedTypes.Property.check(property) ||
(namedTypes.ObjectProperty &&
namedTypes.ObjectProperty.check(property))) {
addPattern(propertyPath.get('value'), bindings);
}
else if (namedTypes.SpreadProperty &&
namedTypes.SpreadProperty.check(property)) {
addPattern(propertyPath.get('argument'), bindings);
}
});
}
else if (namedTypes.ArrayPattern &&
namedTypes.ArrayPattern.check(pattern)) {
patternPath.get('elements').each(function (elementPath) {
var element = elementPath.value;
if (namedTypes.Pattern.check(element)) {
addPattern(elementPath, bindings);
}
else if (namedTypes.SpreadElement &&
namedTypes.SpreadElement.check(element)) {
addPattern(elementPath.get("argument"), bindings);
}
});
}
else if (namedTypes.PropertyPattern &&
namedTypes.PropertyPattern.check(pattern)) {
addPattern(patternPath.get('pattern'), bindings);
}
else if ((namedTypes.SpreadElementPattern &&
namedTypes.SpreadElementPattern.check(pattern)) ||
(namedTypes.RestElement &&
namedTypes.RestElement.check(pattern)) ||
(namedTypes.SpreadPropertyPattern &&
namedTypes.SpreadPropertyPattern.check(pattern))) {
addPattern(patternPath.get('argument'), bindings);
}
}
function addTypePattern(patternPath, types) {
var pattern = patternPath.value;
namedTypes.Pattern.assert(pattern);
if (namedTypes.Identifier.check(pattern)) {
if (hasOwn.call(types, pattern.name)) {
types[pattern.name].push(patternPath);
}
else {
types[pattern.name] = [patternPath];
}
}
}
function addTypeParameter(parameterPath, types) {
var parameter = parameterPath.value;
FlowOrTSTypeParameterType.assert(parameter);
if (hasOwn.call(types, parameter.name)) {
types[parameter.name].push(parameterPath);
}
else {
types[parameter.name] = [parameterPath];
}
}
Sp.lookup = function (name) {
for (var scope = this; scope; scope = scope.parent)
if (scope.declares(name))
break;
return scope;
};
Sp.lookupType = function (name) {
for (var scope = this; scope; scope = scope.parent)
if (scope.declaresType(name))
break;
return scope;
};
Sp.getGlobalScope = function () {
var scope = this;
while (!scope.isGlobal)
scope = scope.parent;
return scope;
};
return Scope;
}
exports.default = scopePlugin;
;
(0, shared_1.maybeSetModuleExports)(function () { return module; });
//# sourceMappingURL=scope.js.map

1
node_modules/ast-types/lib/scope.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

21
node_modules/ast-types/lib/shared.d.ts generated vendored Normal file
View File

@ -0,0 +1,21 @@
import { Fork } from "./types";
export default function (fork: Fork): {
geq: (than: any) => import("./types").Type<unknown>;
defaults: {
null: () => null;
emptyArray: () => never[];
false: () => boolean;
true: () => boolean;
undefined: () => void;
"use strict": () => string;
};
isPrimitive: import("./types").Type<unknown>;
};
interface NodeModule {
exports: {
default?: any;
__esModule?: boolean;
};
}
export declare function maybeSetModuleExports(moduleGetter: () => NodeModule): void;
export {};

91
node_modules/ast-types/lib/shared.js generated vendored Normal file
View File

@ -0,0 +1,91 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.maybeSetModuleExports = void 0;
var tslib_1 = require("tslib");
var types_1 = tslib_1.__importDefault(require("./types"));
function default_1(fork) {
var types = fork.use(types_1.default);
var Type = types.Type;
var builtin = types.builtInTypes;
var isNumber = builtin.number;
// An example of constructing a new type with arbitrary constraints from
// an existing type.
function geq(than) {
return Type.from(function (value) { return isNumber.check(value) && value >= than; }, isNumber + " >= " + than);
}
;
// Default value-returning functions that may optionally be passed as a
// third argument to Def.prototype.field.
var defaults = {
// Functions were used because (among other reasons) that's the most
// elegant way to allow for the emptyArray one always to give a new
// array instance.
"null": function () { return null; },
"emptyArray": function () { return []; },
"false": function () { return false; },
"true": function () { return true; },
"undefined": function () { },
"use strict": function () { return "use strict"; }
};
var naiveIsPrimitive = Type.or(builtin.string, builtin.number, builtin.boolean, builtin.null, builtin.undefined);
var isPrimitive = Type.from(function (value) {
if (value === null)
return true;
var type = typeof value;
if (type === "object" ||
type === "function") {
return false;
}
return true;
}, naiveIsPrimitive.toString());
return {
geq: geq,
defaults: defaults,
isPrimitive: isPrimitive,
};
}
exports.default = default_1;
;
// This function accepts a getter function that should return an object
// conforming to the NodeModule interface above. Typically, this means calling
// maybeSetModuleExports(() => module) at the very end of any module that has a
// default export, so the default export value can replace module.exports and
// thus CommonJS consumers can continue to rely on require("./that/module")
// returning the default-exported value, rather than always returning an exports
// object with a default property equal to that value. This function should help
// preserve backwards compatibility for CommonJS consumers, as a replacement for
// the ts-add-module-exports package.
function maybeSetModuleExports(moduleGetter) {
try {
var nodeModule = moduleGetter();
var originalExports = nodeModule.exports;
var defaultExport = originalExports["default"];
}
catch (_a) {
// It's normal/acceptable for this code to throw a ReferenceError due to
// the moduleGetter function attempting to access a non-existent global
// `module` variable. That's the reason we use a getter function here:
// so the calling code doesn't have to do its own typeof module ===
// "object" checking (because it's always safe to pass `() => module` as
// an argument, even when `module` is not defined in the calling scope).
return;
}
if (defaultExport &&
defaultExport !== originalExports &&
typeof originalExports === "object") {
// Make all properties found in originalExports properties of the
// default export, including the default property itself, so that
// require(nodeModule.id).default === require(nodeModule.id).
Object.assign(defaultExport, originalExports, { "default": defaultExport });
// Object.assign only transfers enumerable properties, and
// __esModule is (and should remain) non-enumerable.
if (originalExports.__esModule) {
Object.defineProperty(defaultExport, "__esModule", { value: true });
}
// This line allows require(nodeModule.id) === defaultExport, rather
// than (only) require(nodeModule.id).default === defaultExport.
nodeModule.exports = defaultExport;
}
}
exports.maybeSetModuleExports = maybeSetModuleExports;
//# sourceMappingURL=shared.js.map

Some files were not shown because too many files have changed in this diff Show More