3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-19 14:45:44 +01:00

Answer the stability review: guard the argument lookup, and correct the claims the split made false

This commit is contained in:
2026-08-27 22:50:55 +02:00
parent 44b2db3200
commit 3656b2de97
5 changed files with 14 additions and 13 deletions
+8 -6
View File
@@ -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)
}