Skip to content

Commit

Permalink
chore: add joi schema for MAC and UUID
Browse files Browse the repository at this point in the history
  • Loading branch information
mrnagydavid committed Jul 22, 2024
1 parent f650d9f commit 1bcb0bb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/validation/joi/joi.shared.schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,7 @@ export const baseDBEntitySchema: ObjectSchema<BaseDBEntity> = objectSchema<BaseD
created: unixTimestamp2000Schema.optional(),
updated: unixTimestamp2000Schema.optional(),
})

export const macAddressSchema = stringSchema.regex(/^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/)

export const uuidSchema = stringSchema.uuid()

0 comments on commit 1bcb0bb

Please sign in to comment.