Skip to content

Commit 64ee1bf

Browse files
committed
fix: TS 4.5 fixes
1 parent 4c6cd4b commit 64ee1bf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/mongo_types.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ export type WithoutId<TSchema> = Omit<TSchema, '_id'>;
5656

5757
/** A MongoDB filter can be some portion of the schema or a set of operators @public */
5858
export type Filter<TSchema> = {
59-
[P in Join<NestedPaths<WithId<TSchema>>, '.'>]?: Condition<PropertyType<WithId<TSchema>, P>>;
59+
[Property in Join<NestedPaths<WithId<TSchema>>, '.'>]?: Condition<
60+
PropertyType<WithId<TSchema>, Property>
61+
>;
6062
} & RootFilterOperators<WithId<TSchema>>;
6163

6264
/** @public */
@@ -434,7 +436,7 @@ export type Join<T extends unknown[], D extends string> = T extends []
434436
? `${T[0]}`
435437
: T extends [string | number, ...infer R]
436438
? `${T[0]}${D}${Join<R, D>}`
437-
: string | number;
439+
: string;
438440

439441
/** @public */
440442
export type PropertyType<Type, Property extends string> = string extends Property

0 commit comments

Comments
 (0)