MCPcopy
hub / github.com/github/docs / difference

Function difference

src/rest/scripts/test-open-api-schema.js:156–168  ·  view source on GitHub ↗
(obj1, obj2)

Source from the content-addressed store, hash-verified

154}
155
156function difference(obj1, obj2) {
157 const diff = Object.keys(obj1).reduce((result, key) => {
158 if (!Object.prototype.hasOwnProperty.call(obj2, key)) {
159 result.push(key)
160 } else if (_.isEqual(obj1[key], obj2[key])) {
161 const resultKeyIndex = result.indexOf(key)
162 result.splice(resultKeyIndex, 1)
163 }
164 return result
165 }, Object.keys(obj2))
166
167 return diff
168}

Callers 6

update-readme.jsFile · 0.85
readFrontmatterFunction · 0.85
getDifferencesFunction · 0.85
openapi-schema.jsFile · 0.85
topics.jsFile · 0.85
category-pages.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected