@allmaps/annotation
Version:
Functions for generating and parsing IIIF georeference annotations
10 lines (9 loc) • 432 B
JavaScript
// Type guard that checks if georeferencedMap is v2 GeoreferencedMap
export function isGeoreferencedMap2(georeferencedMap) {
return ('type' in georeferencedMap && georeferencedMap.type === 'GeoreferencedMap');
}
// Type guard that checks if annotation is v1 Georeference Annotation
export function isAnnotation1(annotation) {
return ('source' in annotation.target &&
typeof annotation.target.source === 'object');
}