File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -865,8 +865,8 @@ type BrainContext = Replace<CliContext, { /** Whether the script is being run vi
865
865
// when anyField: true is given, other fields (except _id) are omitted
866
866
867
867
type MongoProject < TDocument , TProjection > =
868
- true extends ( 1 extends TProjection [ keyof TProjection ] ? true : TProjection [ keyof TProjection ] ) ?
869
- ( TProjection extends { _id : false | 0 } ? { } : { _id : TDocument extends { _id : infer TId } ? TId : MongoId } ) &
868
+ ( TProjection extends { _id : false | 0 } ? { } : { _id : TDocument extends { _id : infer TId } ? TId : MongoId } ) & (
869
+ true extends ( 1 extends TProjection [ keyof TProjection ] ? true : TProjection [ keyof TProjection ] ) ?
870
870
{
871
871
[ K in
872
872
keyof TDocument as K extends keyof TProjection ? TProjection [ K ] extends true | 1 ? K : never : never
@@ -877,7 +877,8 @@ type MongoProject<TDocument, TProjection> =
877
877
keyof TProjection as TProjection [ K ] extends true | 1 ? K extends keyof TDocument ? never : K : never
878
878
] ?: MongoValue
879
879
}
880
- : { [ k : string ] : MongoValue } & { [ K in keyof TDocument as K extends keyof TProjection ? never : K ] : TDocument [ K ] }
880
+ : { [ k : string ] : MongoValue } & { [ K in keyof TDocument as K extends keyof TProjection ? never : K ] : TDocument [ K ] }
881
+ )
881
882
882
883
type DeepFreeze < T > = { readonly [ P in keyof T ] : DeepFreeze < T [ P ] > }
883
884
You can’t perform that action at this time.
0 commit comments