Function: findBodyType()
Less than 1 minute
@ghentcdh/annotated-text / findBodyType
Function: findBodyType()
findBodyType<
B>(type,validator): (annotation) =>B
Defined in: libs/core/src/lib/adapter/annotation/w3c/utils/body.utils.ts:18
Type Parameters
B
B extends { format: "text"; language?: string; source?: string; type: "TextualBody"; value: string; } | { purpose: "tagging"; type: "TextualBody"; value?: string; } | { id?: string; purpose: "describing"; source?: string; type: "SpecificResource"; value: any; } | { textType: string; type: "AnnotationType"; }
Parameters
type
"AnnotationType" | "TextualBody" | "SpecificResource"
validator
(body) => boolean
Returns
(
annotation):B
Parameters
annotation
Pick<W3CAnnotation, "body">
Returns
B