Answer the stability review: guard the argument lookup, and correct the claims the split made false
CI / gate (push) Successful in 5s
CI / gate (push) Successful in 5s
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
import type { BlockType } from '../adf/block-directives.ts'
|
||||
|
||||
const blockArguments: Readonly<Record<string, string>> = {
|
||||
blockTaskItem: 'state',
|
||||
panel: 'panelType',
|
||||
taskItem: 'state',
|
||||
} satisfies Partial<Record<BlockType, string>>
|
||||
const argumentByType = new Map(
|
||||
Object.entries({
|
||||
blockTaskItem: 'state',
|
||||
panel: 'panelType',
|
||||
taskItem: 'state',
|
||||
} satisfies Partial<Record<BlockType, string>>),
|
||||
)
|
||||
|
||||
export function blockArgument(type: string): string | undefined {
|
||||
return blockArguments[type]
|
||||
return argumentByType.get(type)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user