* Format `mod.match` given that it may be an array that we need to $or if * the client has multiple docs with match functions * @param {Array|any} match * @api private
(match)
| 95 | */ |
| 96 | |
| 97 | function _formatMatch(match) { |
| 98 | if (Array.isArray(match)) { |
| 99 | if (match.length > 1) { |
| 100 | return { $or: [].concat(match.map(m => Object.assign({}, m))) }; |
| 101 | } |
| 102 | return Object.assign({}, match[0]); |
| 103 | } |
| 104 | return Object.assign({}, match); |
| 105 | } |
no outgoing calls
no test coverage detected