MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / optionLabel

Function optionLabel

packages/app-core/src/lib/database-cells.ts:33–36  ·  view source on GitHub ↗
(field: DbField, value: string)

Source from the content-addressed store, hash-verified

31}
32
33export function optionLabel(field: DbField, value: string): string {
34 const opt = field.options?.find((o) => o.value === value)
35 return opt?.label ?? opt?.value ?? value
36}
37
38export function fieldsById(doc: DatabaseDoc): Map<string, DbField> {
39 return new Map(doc.fields.map((f) => [f.id, f]))

Callers 3

columnLabelFunction · 0.90
DatabaseBoardViewFunction · 0.90
SelectCellFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected