mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Fix CodeQL threadflow steps (#15873)
* Upload SARIF artifact * Test removal of empty object * Fix polynomial-redos * Revert fail-fast change Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
This commit is contained in:
@@ -110,7 +110,7 @@ export default async function getASTFromQuery(
|
||||
|
||||
const children: (NestedCollectionNode | FieldNode | FunctionFieldNode)[] = [];
|
||||
|
||||
const relationalStructure: Record<string, string[] | anyNested> = {};
|
||||
const relationalStructure: Record<string, string[] | anyNested> = Object.create(null);
|
||||
|
||||
for (const fieldKey of fields) {
|
||||
let name = fieldKey;
|
||||
|
||||
@@ -6,12 +6,19 @@ type RelationInfo = {
|
||||
relationType: string | null;
|
||||
};
|
||||
|
||||
function checkImplicitRelation(field: string) {
|
||||
if (field.startsWith('$FOLLOW(') && field.endsWith(')')) {
|
||||
return field.slice(8, -1).split(',');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
export function getRelationInfo(relations: Relation[], collection: string, field: string): RelationInfo {
|
||||
if (field.startsWith('$FOLLOW') && field.length > 500) {
|
||||
throw new Error(`Implicit $FOLLOW statement is too big to parse. Got: "${field.substring(500)}..."`);
|
||||
}
|
||||
|
||||
const implicitRelation = field.match(/^\$FOLLOW\((.*?),(.*?)(?:,(.*?))?\)$/)?.slice(1);
|
||||
const implicitRelation = checkImplicitRelation(field);
|
||||
|
||||
if (implicitRelation) {
|
||||
if (implicitRelation[2] === undefined) {
|
||||
|
||||
Reference in New Issue
Block a user