MCPcopy Create free account
hub / github.com/codecombat/codecombat / comparator

Method comparator

app/collections/Branches.js:19–25  ·  view source on GitHub ↗
(branch1, branch2)

Source from the content-addressed store, hash-verified

17 }
18
19 comparator (branch1, branch2) {
20 const iUpdatedB1 = branch1.get('updatedBy') === me.id
21 const iUpdatedB2 = branch2.get('updatedBy') === me.id
22 if (iUpdatedB1 && !iUpdatedB2) { return -1 }
23 if (iUpdatedB2 && !iUpdatedB1) { return 1 }
24 return new Date(branch2.get('updated')).getTime() - new Date(branch1.get('updated')).getTime()
25 }
26 }
27 Branches.initClass()
28 return Branches

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected