#Union type is expanding after bundling

4 messages · Page 1 of 1 (latest)

pine bobcat
#

**this is my type in code **

export const CrudFactory = <T extends PrismaModelKeys>({ module, table, dtos, searchableFields, include, csvHeaderFields, selectableFields = {}, isPublic = false, upsertUniqueFields = [], validations, exportConfig, }: CrudFactoryType<T>): CrudFactoryReturnType<T> =>

after bundling this has been changed expanded to

declare const ControllerFactory: <T extends "accesstoken" | "action" | "auditlog" | "cron" | "gallery" | "gallerycategory" | "galleryitems" | "migration" | "module" | "permission" | "realtimenotification" | "realtimenotificationstatus" | "role" | "schedulednotification" | "settings" | "template" | "user" | "sample">({ module, table, dtos, upsertUniqueFields, validations, isPublic, }: ControllerFactoryType<T>) => new () => CrudControllerType<T>;

How can i fix this ,i am using tsup for bundling and my ts config look like this

{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"module": "NodeNext",
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"target": "ES2021",
"sourceMap": true,
"skipLibCheck": true,
"strictNullChecks": true,
"noImplicitAny": false,
"strictBindCallApply": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"strictPropertyInitialization": false,
"allowJs": true,
"declaration": true,
"declarationDir": "dist"
}
}

pine bobcat
#

<@&608770230818308165> , a help wouild be appreciated

modest cape
pine bobcat
#

@modest cape , sorry for that, i will keep that in mind