UNPKG

postit-js-core

Version:

[![Netlify Status](https://api.netlify.com/api/v1/badges/72130b1d-f56b-473e-8f3b-50a5af916e64/deploy-status)](https://app.netlify.com/sites/postit-js-demo/deploys) ![Build Status](https://github.com/pinussilvestrus/postit-js/workflows/ci/badge.svg)

25 lines (22 loc) 557 B
/** * Is an element of the given postit type? * * @param {djs.model.Base|ModdleElement} element * @param {String} type * * @return {Boolean} */ export function is(element, type) { var bo = getBusinessObject(element); return bo && (typeof bo.$instanceOf === 'function') && bo.$instanceOf(type); } /** * Return the business object for a given element. * * @param {djs.model.Base|ModdleElement} element * * @return {ModdleElement} */ export function getBusinessObject(element) { return (element && element.businessObject) || element; }