v3 new release (#84)

swap to graphql
This commit is contained in:
github-actions[bot]
2022-07-11 13:48:02 -04:00
committed by GitHub
parent 20d2b4f98d
commit e4f3964f67
1492 changed files with 63799 additions and 63001 deletions

View File

@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
exports._guessExecutionStatusRelativeTo = _guessExecutionStatusRelativeTo;
exports._guessExecutionStatusRelativeToDifferentFunctions = _guessExecutionStatusRelativeToDifferentFunctions;
exports._resolve = _resolve;
exports.canHaveVariableDeclarationOrExpression = canHaveVariableDeclarationOrExpression;
exports.canSwapBetweenExpressionAndStatement = canSwapBetweenExpressionAndStatement;
@ -94,9 +93,12 @@ function isCompletionRecord(allowInsideFunction) {
let first = true;
do {
const container = path.container;
const {
type,
container
} = path;
if (path.isFunction() && !first) {
if (!first && (path.isFunction() || type === "StaticBlock")) {
return !!allowInsideFunction;
}
@ -105,7 +107,7 @@ function isCompletionRecord(allowInsideFunction) {
if (Array.isArray(container) && path.key !== container.length - 1) {
return false;
}
} while ((path = path.parentPath) && !path.isProgram());
} while ((path = path.parentPath) && !path.isProgram() && !path.isDoExpression());
return true;
}
@ -120,7 +122,7 @@ function isStatementOrBlock() {
function referencesImport(moduleSource, importName) {
if (!this.isReferencedIdentifier()) {
if ((this.isMemberExpression() || this.isOptionalMemberExpression()) && (this.node.computed ? isStringLiteral(this.node.property, {
if (this.isJSXMemberExpression() && this.node.property.name === importName || (this.isMemberExpression() || this.isOptionalMemberExpression()) && (this.node.computed ? isStringLiteral(this.node.property, {
value: importName
}) : this.node.property.name === importName)) {
const object = this.get("object");
@ -229,20 +231,24 @@ function isExecutionUncertainInList(paths, maxIndex) {
}
function _guessExecutionStatusRelativeTo(target) {
return _guessExecutionStatusRelativeToCached(this, target, new Map());
}
function _guessExecutionStatusRelativeToCached(base, target, cache) {
const funcParent = {
this: getOuterFunction(this),
this: getOuterFunction(base),
target: getOuterFunction(target)
};
if (funcParent.target.node !== funcParent.this.node) {
return this._guessExecutionStatusRelativeToDifferentFunctions(funcParent.target);
return _guessExecutionStatusRelativeToDifferentFunctionsCached(base, funcParent.target, cache);
}
const paths = {
target: target.getAncestry(),
this: this.getAncestry()
this: base.getAncestry()
};
if (paths.target.indexOf(this) >= 0) return "after";
if (paths.target.indexOf(base) >= 0) return "after";
if (paths.this.indexOf(target) >= 0) return "before";
let commonPath;
const commonIndex = {
@ -286,9 +292,9 @@ function _guessExecutionStatusRelativeTo(target) {
return keyPosition.target > keyPosition.this ? "before" : "after";
}
const executionOrderCheckedNodes = new WeakSet();
const executionOrderCheckedNodes = new Set();
function _guessExecutionStatusRelativeToDifferentFunctions(target) {
function _guessExecutionStatusRelativeToDifferentFunctionsInternal(base, target, cache) {
if (!target.isFunctionDeclaration() || target.parentPath.isExportDeclaration()) {
return "unknown";
}
@ -309,20 +315,37 @@ function _guessExecutionStatusRelativeToDifferentFunctions(target) {
if (executionOrderCheckedNodes.has(path.node)) continue;
executionOrderCheckedNodes.add(path.node);
const status = this._guessExecutionStatusRelativeTo(path);
try {
const status = _guessExecutionStatusRelativeToCached(base, path, cache);
executionOrderCheckedNodes.delete(path.node);
if (allStatus && allStatus !== status) {
return "unknown";
} else {
allStatus = status;
if (allStatus && allStatus !== status) {
return "unknown";
} else {
allStatus = status;
}
} finally {
executionOrderCheckedNodes.delete(path.node);
}
}
return allStatus;
}
function _guessExecutionStatusRelativeToDifferentFunctionsCached(base, target, cache) {
let nodeMap = cache.get(base.node);
if (!nodeMap) {
cache.set(base.node, nodeMap = new Map());
} else if (nodeMap.has(target.node)) {
return nodeMap.get(target.node);
}
const result = _guessExecutionStatusRelativeToDifferentFunctionsInternal(base, target, cache);
nodeMap.set(target.node, result);
return result;
}
function resolve(dangerous, resolved) {
return this._resolve(dangerous, resolved) || this;
}