Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bpmn-io/element-templates-icons-renderer

Package Overview
Dependencies
Maintainers
9
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bpmn-io/element-templates-icons-renderer - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

4

CHANGELOG.md

@@ -9,2 +9,6 @@ # Changelog

## 0.1.2
* `FIX`: move `modelerTemplateIcon` to property ([#3](https://github.com/bpmn-io/element-templates-icons-renderer/pull/3))
## 0.1.1

@@ -11,0 +15,0 @@

4

package.json
{
"name": "@bpmn-io/element-templates-icons-renderer",
"version": "0.1.1",
"version": "0.1.2",
"description": "A bpmn-js extension to render element templates icons.",

@@ -67,3 +67,3 @@ "main": "src/index.js",

"webpack": "^5.70.0",
"zeebe-bpmn-moddle": "^0.12.0"
"zeebe-bpmn-moddle": "^0.12.1"
},

@@ -70,0 +70,0 @@ "dependencies": {

import {
getBusinessObject,
is
getBusinessObject
} from 'bpmn-js/lib/util/ModelUtil';
export function getModelerTemplateIcon(element) {
var modelerTemplateIcon = findExtension(element, 'zeebe:ModelerTemplateIcon');
return modelerTemplateIcon && (modelerTemplateIcon.$body || modelerTemplateIcon.body);
var modelerTemplateIcon = getBusinessObject(element).get('zeebe:modelerTemplateIcon');
return modelerTemplateIcon;
}
export function findExtension(element, type) {
var businessObject = getBusinessObject(element);
var extensionElements;
if (is(businessObject, 'bpmn:ExtensionElements')) {
extensionElements = businessObject;
} else {
extensionElements = businessObject.get('extensionElements');
}
if (!extensionElements) {
return null;
}
return extensionElements.get('values').find((value) => {
// make sure we can read the model without moddle descriptors to be required
return value && value.$type.toLowerCase() === type.toLowerCase();
});
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc