@@ -37,7 +37,7 @@ export const compareDocuments = async (
3737 currDoc : ResolvedVersionDocument | undefined ,
3838 ctx : CompareOperationsPairContext ) : Promise < {
3939 operationChanges : OperationChanges [ ]
40- tags : string [ ]
40+ tags : Set < string >
4141} > => {
4242 const { apiType, rawDocumentResolver, previousVersion, currentVersion, previousPackageId, currentPackageId } = ctx
4343 const prevFile = prevDoc && await rawDocumentResolver ( previousVersion , previousPackageId , prevDoc . slug )
@@ -78,17 +78,15 @@ export const compareDocuments = async (
7878 ) as { merged : GraphApiSchema ; diffs : Diff [ ] }
7979
8080 if ( isEmpty ( diffs ) ) {
81- return { operationChanges : [ ] , tags : [ ] }
81+ return { operationChanges : [ ] , tags : new Set ( ) }
8282 }
8383
8484 let operationDiffs : Diff [ ] = [ ]
8585
8686 const { currentGroup, previousGroup } = ctx
87- const currGroupSlug = slugify ( removeFirstSlash ( currentGroup || '' ) )
88- const prevGroupSlug = slugify ( removeFirstSlash ( previousGroup || '' ) )
8987
9088 const tags = new Set < string > ( )
91- const changedOperations : OperationChanges [ ] = [ ]
89+ const operationChanges : OperationChanges [ ] = [ ]
9290
9391 for ( const type of GRAPHQL_TYPE_KEYS ) {
9492 const operationsByType = merged [ type ]
@@ -116,12 +114,12 @@ export const compareDocuments = async (
116114 continue
117115 }
118116
119- changedOperations . push ( createOperationChange ( apiType , operationDiffs , previous , current , currentGroup , previousGroup ) )
117+ operationChanges . push ( createOperationChange ( apiType , operationDiffs , previous , current , currentGroup , previousGroup ) )
120118 getOperationTags ( current ?? previous ) . forEach ( tag => tags . add ( tag ) )
121119 }
122120 }
123121
124- return { operationChanges : changedOperations , tags : Array . from ( tags ) }
122+ return { operationChanges, tags }
125123}
126124
127125function getCopyWithEmptyOperations ( template : GraphApiSchema ) : GraphApiSchema {
0 commit comments