UNPKG

@lyra/form-builder

Version:
20 lines (19 loc) 527 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = findInlineByAnnotationKey; function findInlineByAnnotationKey(key, document) { return document.filterDescendants(desc => { if (desc.object !== 'inline') { return false; } const annotations = desc.data.get('annotations'); if (!annotations) { return false; } return Object.keys(annotations).find(annotationName => { return annotations[annotationName]._key === key; }); }).get(0); }