Skip to content

Commit

Permalink
fix: add readonly modifier to reflect recent prisma changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rostislav-simonik committed Feb 4, 2024
1 parent 9507681 commit d864440
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/prisma-utils/index_.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export * from './externalToInternalDMMF'
* // ^^^^^^^^^^^^^^^^^^^^
* ```
*/
export const TypeScriptOrmCompoundUniquePropertyName = (fieldNames: string[]) => fieldNames.join('_')
export const TypeScriptOrmCompoundUniquePropertyName = (fieldNames: readonly string[]) => fieldNames.join('_')

/**
* Convert a Prisma model name as it would appear in a PSL file to its version as it would appear in the ORM `prismaClient.<model>.<operation>(...)`.
Expand Down
2 changes: 1 addition & 1 deletion src/lib/prisma-utils/whereUniqueInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const createWhereUniqueInput = (source: RecordUnknown, model: DMMF.Model)
* 3. Exactly one field with an `@unique` annotation (if multiple, use first).
* 4. Multiple fields targeted by an `@@unique` clause.
*/
function getUniqueIdentifierFields(model: DMMF.Model): FieldName[] {
function getUniqueIdentifierFields(model: DMMF.Model): readonly FieldName[] {
// Try finding 1
const singleIdField = model.fields.find((f) => f.isId)

Expand Down

0 comments on commit d864440

Please sign in to comment.