Skip to content

Commit

Permalink
feat(compiler): implement check for valid roles (lint fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
minenwerfer committed Feb 15, 2025
1 parent 79514d2 commit b14b8f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/compiler/src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const ICON_NAMES = icons.map((icon) => icon.name)
export const locationMap = new WeakMap<symbol, Location>()
export const memoTable: {
roles?: string[]
} = {}
} = {}

type StrictToken<TTokenType extends TokenType, TValue> = undefined extends TValue
? Token<TTokenType>
Expand Down Expand Up @@ -1025,7 +1025,7 @@ export const parse = (tokens: (Token | undefined)[]) => {
const collection = parseCollection(ast)
if( collection.name === 'User' ) {
const { properties } = collection
if( properties.roles && 'items' in properties.roles.property && 'enum' in properties.roles.property.items ) {
if( 'roles' in properties && 'items' in properties.roles.property && 'enum' in properties.roles.property.items ) {
memoTable.roles = properties.roles.property.items.enum as string[]
}
}
Expand Down

0 comments on commit b14b8f6

Please sign in to comment.