Skip to content

Commit 49c1848

Browse files
authored
fixed star projection option being required (#29)
Fixed star projection being optional + added a couple of typing tests for it
1 parent 9173b3c commit 49c1848

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/data-api/types/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export type StrictProjection<Schema extends SomeDoc> = {
157157
? 1 | 0 | true | false | ProjectionSlice
158158
: 1 | 0 | true | false;
159159
} & {
160-
'*': 1 | 0 | true | false;
160+
'*'?: 1 | 0 | true | false;
161161
};
162162

163163
/**

tests/typing/strict-projection.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,12 @@ const test4: StrictProjection<Schema> = {
4343
const test5: StrictProjection<ConvolutedSchema2> = {
4444
numOrArray: { $slice: [1, 3] },
4545
}
46+
47+
const test6: StrictProjection<ConvolutedSchema2> = {
48+
numOrArray: { $slice: [1, 3] },
49+
'*': 1,
50+
}
51+
52+
const test7: StrictProjection<ConvolutedSchema2> = {
53+
'*': false,
54+
}

0 commit comments

Comments
 (0)