Created
March 27, 2024 23:34
-
-
Save KrisKnez/56089ffccf4bfcd4ac28ded5261f9417 to your computer and use it in GitHub Desktop.
IPrismaIntFilter.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Prisma } from '@prisma/client'; | |
type IPrismaIntFilter< | |
Prefix extends string, | |
Delimiter extends string = '_', | |
Operations extends keyof Prisma.IntFilter = keyof Prisma.IntFilter, | |
> = { | |
[K in `${Prefix}${Delimiter}${keyof Pick< | |
Prisma.IntFilter, | |
Extract<'equals' | 'gt' | 'gte' | 'lt' | 'lte' | 'not', Operations> | |
>}`]?: string; | |
} & { | |
[K in `${Prefix}${Delimiter}${keyof Pick<Prisma.IntFilter, Extract<'in' | 'notIn', Operations>>}`]?: string[]; | |
} & { | |
[K in `${Prefix}`]: Prisma.IntFilter; | |
}; | |
export default IPrismaIntFilter; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment