We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 83d9a98 commit cc84026Copy full SHA for cc84026
lib/services/projection/isDefiningProjection.js
@@ -0,0 +1,18 @@
1
+'use strict';
2
+
3
+/*!
4
+ * ignore
5
+ */
6
7
+module.exports = function isDefiningProjection(val) {
8
+ if (val == null) {
9
+ // `undefined` or `null` become exclusive projections
10
+ return true;
11
+ }
12
+ if (typeof val === 'object') {
13
+ // Only cases where a value does **not** define whether the whole projection
14
+ // is inclusive or exclusive are `$meta` and `$slice`.
15
+ return !('$meta' in val) && !('$slice' in val);
16
17
18
+}
0 commit comments