Skip to content

Commit 1f87ee1

Browse files
author
Nil20
committed
clean up
1 parent 14af0a6 commit 1f87ee1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/commons/src/events/EventConfig.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ export const EventConfig = z
134134
}
135135
}
136136

137+
const isInherentFlag = (value: unknown): value is InherentFlags =>
138+
Object.values(InherentFlags).includes(value as InherentFlags)
139+
137140
// Validate that all referenced action flags are configured in the event flags array.
138141
const configuredFlagIds = event.flags.map((flag) => flag.id)
139142
const actionFlagIds = event.actions.flatMap((action) =>
@@ -142,10 +145,7 @@ export const EventConfig = z
142145

143146
for (const actionFlagId of actionFlagIds) {
144147
const isConfigured = configuredFlagIds.includes(actionFlagId)
145-
const isInherent = Object.values(InherentFlags).includes(
146-
// @ts-expect-error - actionFlagId can be a inherent flag or any string
147-
actionFlagId
148-
)
148+
const isInherent = isInherentFlag(actionFlagId)
149149

150150
if (!isConfigured && !isInherent) {
151151
ctx.addIssue({

packages/commons/src/scopes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ const ConfigurableRawScopes = z.discriminatedUnion('type', [
328328
])
329329

330330
export const ConfigurableActionScopes = z.discriminatedUnion('type', [
331-
// @TODO - Configure actual action scopes
331+
// @TODO - Record scope holds non-action scopes as well e.g., `record.read`
332332
RecordScope,
333333
CustomActionScope
334334
])

0 commit comments

Comments
 (0)