@@ -2,7 +2,7 @@ import { expectType, expectError, expectNotType, expectNotAssignable, expectAssi
2
2
3
3
import type { Collection } from '../../src/collection' ;
4
4
import { ObjectId } from '../../src/bson' ;
5
- import type { Filter , WithId } from '../../src/mongo_types' ;
5
+ import type { WithId } from '../../src/mongo_types' ;
6
6
7
7
type InsertOneFirstParam < Schema > = Parameters < Collection < Schema > [ 'insertOne' ] > [ 0 ] ;
8
8
@@ -44,23 +44,3 @@ interface B {
44
44
type Data = A | B ;
45
45
expectAssignable < InsertOneFirstParam < Data > > ( { _id : 2 } ) ;
46
46
expectAssignable < InsertOneFirstParam < Data > > ( { _id : 'hi' } ) ;
47
-
48
- // Ensure Exclusive Union Type doesn't break inside our collection methods
49
- type Without < T , U > = { [ P in Exclude < keyof T , keyof U > ] ?: never } ;
50
- // eslint-disable-next-line @typescript-eslint/ban-types
51
- type XOR < T , U > = T | U extends object ? ( Without < T , U > & U ) | ( Without < U , T > & T ) : T | U ;
52
-
53
- interface Dog {
54
- bark : string ;
55
- }
56
- interface Cat {
57
- meow : string ;
58
- }
59
- type Pet = XOR < Dog , Cat > ;
60
- expectNotAssignable < InsertOneFirstParam < Pet > > ( { meow : '' , bark : '' } ) ;
61
- expectAssignable < InsertOneFirstParam < Pet > > ( { meow : '' } ) ;
62
- expectAssignable < InsertOneFirstParam < Pet > > ( { bark : '' } ) ;
63
- expectAssignable < InsertOneFirstParam < Pet > > ( { bark : '' , _id : new ObjectId ( ) } ) ;
64
- expectNotAssignable < Filter < Pet > > ( { meow : '' , bark : '' } ) ; // find
65
- expectAssignable < Filter < Pet > > ( { bark : '' } ) ;
66
- expectAssignable < Filter < Pet > > ( { meow : '' } ) ;
0 commit comments