Skip to content

Commit

Permalink
feat: Typing for the content of the metadata
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Lanser <[email protected]>
  • Loading branch information
Tommylans committed Nov 11, 2024
1 parent 51bad4e commit 7345e2d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/core/src/metadata/entity/utils/createEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { commonMetadataSchema } from '../../common'
import { swapValidators } from '../../operator'
import { metadataPolicySchema } from '../../policy'

export const createEntity = <T extends string>({
export const createEntity = <T extends string, S extends z.ZodRawShape>({
identifier,
additionalValidation = {},
additionalValidation,
}: {
identifier: T
additionalValidation?: z.ZodRawShape
additionalValidation?: S
}) => {
const schema = commonMetadataSchema.extend(additionalValidation)
const schema = commonMetadataSchema.extend(additionalValidation ?? {})
return {
identifier,
schema,
Expand Down

0 comments on commit 7345e2d

Please sign in to comment.