Skip to content

Commit b878676

Browse files
committed
docs: add comments
1 parent 50edb39 commit b878676

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/apitypes/rest/rest.changes.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,15 @@ export const compareDocuments = async (
102102
let prevDocData = prevFile && JSON.parse(await prevFile.text())
103103
let currDocData = currFile && JSON.parse(await currFile.text())
104104

105+
// create a copy of the document with only the operations belonging to the prefix group if there are prefix groups
105106
if (prevDocData && previousGroup) {
106107
prevDocData = createCopyWithPrefixGroupOperationsOnly(prevDocData, previousGroup)
107108
}
108-
109109
if (currDocData && currentGroup) {
110110
currDocData = createCopyWithPrefixGroupOperationsOnly(currDocData, currentGroup)
111111
}
112112

113+
// create an empty counterpart of the document for the case when one of the documents is empty
113114
if (!prevDocData && currDocData) {
114115
prevDocData = createCopyWithEmptyPathItems(currDocData)
115116
}

0 commit comments

Comments
 (0)