(id1, id2)
| 199 | * @returns {boolean} |
| 200 | */ |
| 201 | function matches(id1, id2) { |
| 202 | if (id1 === undefined || id1 === null || id1 === '' || |
| 203 | id2 === undefined || id2 === null || id2 === '') { |
| 204 | return false; |
| 205 | } |
| 206 | // The id can be a MongoDB ObjectID |
| 207 | return id1 === id2 || id1.toString() === id2.toString(); |
| 208 | } |
| 209 | |
| 210 | /** |
| 211 | * Check if a given user ID is the owner the model instance. |
no outgoing calls
no test coverage detected
searching dependent graphs…