| 826 | }; |
| 827 | |
| 828 | const replaceEqualityConstraint = constraint => { |
| 829 | if (typeof constraint !== 'object') { |
| 830 | return constraint; |
| 831 | } |
| 832 | const equalToObject = {}; |
| 833 | let hasDirectConstraint = false; |
| 834 | let hasOperatorConstraint = false; |
| 835 | for (const key in constraint) { |
| 836 | if (key.indexOf('$') !== 0) { |
| 837 | hasDirectConstraint = true; |
| 838 | equalToObject[key] = constraint[key]; |
| 839 | } else { |
| 840 | hasOperatorConstraint = true; |
| 841 | } |
| 842 | } |
| 843 | if (hasDirectConstraint && hasOperatorConstraint) { |
| 844 | constraint['$eq'] = equalToObject; |
| 845 | Object.keys(equalToObject).forEach(key => { |
| 846 | delete constraint[key]; |
| 847 | }); |
| 848 | } |
| 849 | return constraint; |
| 850 | }; |
| 851 | |
| 852 | _UnsafeRestQuery.prototype.replaceEquality = function () { |
| 853 | if (typeof this.restWhere !== 'object') { |