New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@bpmn-io/extract-process-variables

Package Overview
Dependencies
Maintainers
9
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bpmn-io/extract-process-variables - npm Package Compare versions

Comparing version 0.6.0 to 0.7.0

41

dist/index.esm.js

@@ -624,2 +624,12 @@ import { filter, find, isArray, forEach, findIndex } from 'min-dash';

/**
* Extractors add ProcessVariables to the `options.processVariables` parameter.
* @callback extractor
* @param {Object} options
* @param {Array<ModdleElement>} options.elements
* @param {ModdleElement} options.containerElement
* @param {Array<ProcessVariable>} options.processVariables
*/
// api /////////////////////////

@@ -630,6 +640,9 @@

* @param {ModdleElement} containerElement
* @param {Array<extractor>} additionalExtractors
*
* @returns {Array<ProcessVariable>}
* @returns {Promise<Array<ProcessVariable>>}
*/
function getProcessVariables(containerElement) {
function getProcessVariables(containerElement, additionalExtractors = []) {
const allPromises = [];
var processVariables = [];

@@ -641,11 +654,14 @@

// (2) extract all variables from the extractors
forEach(extractors, function(extractor) {
extractor({
elements: elements,
containerElement: containerElement,
processVariables: processVariables
});
forEach([ ...extractors, ...additionalExtractors ], function(extractor) {
allPromises.push(
extractor({
elements: elements,
containerElement: containerElement,
processVariables: processVariables
})
);
});
return processVariables;
return Promise.all(allPromises)
.then(() => processVariables);
}

@@ -662,8 +678,9 @@

* @param {ModdleElement} rootElement element from where to extract all variables
* @param {Array<extractor>} additionalExtractors
*
* @returns {Array<ProcessVariable>}
* @returns {Promise<Array<ProcessVariable>>}
*/
function getVariablesForScope(scope, rootElement) {
async function getVariablesForScope(scope, rootElement, additionalExtractors = []) {
var allVariables = getProcessVariables(rootElement);
var allVariables = await getProcessVariables(rootElement, additionalExtractors);

@@ -670,0 +687,0 @@ var scopeElement = getElement(scope, rootElement);

@@ -628,2 +628,12 @@ 'use strict';

/**
* Extractors add ProcessVariables to the `options.processVariables` parameter.
* @callback extractor
* @param {Object} options
* @param {Array<ModdleElement>} options.elements
* @param {ModdleElement} options.containerElement
* @param {Array<ProcessVariable>} options.processVariables
*/
// api /////////////////////////

@@ -634,6 +644,9 @@

* @param {ModdleElement} containerElement
* @param {Array<extractor>} additionalExtractors
*
* @returns {Array<ProcessVariable>}
* @returns {Promise<Array<ProcessVariable>>}
*/
function getProcessVariables(containerElement) {
function getProcessVariables(containerElement, additionalExtractors = []) {
const allPromises = [];
var processVariables = [];

@@ -645,11 +658,14 @@

// (2) extract all variables from the extractors
minDash.forEach(extractors, function(extractor) {
extractor({
elements: elements,
containerElement: containerElement,
processVariables: processVariables
});
minDash.forEach([ ...extractors, ...additionalExtractors ], function(extractor) {
allPromises.push(
extractor({
elements: elements,
containerElement: containerElement,
processVariables: processVariables
})
);
});
return processVariables;
return Promise.all(allPromises)
.then(() => processVariables);
}

@@ -666,8 +682,9 @@

* @param {ModdleElement} rootElement element from where to extract all variables
* @param {Array<extractor>} additionalExtractors
*
* @returns {Array<ProcessVariable>}
* @returns {Promise<Array<ProcessVariable>>}
*/
function getVariablesForScope(scope, rootElement) {
async function getVariablesForScope(scope, rootElement, additionalExtractors = []) {
var allVariables = getProcessVariables(rootElement);
var allVariables = await getProcessVariables(rootElement, additionalExtractors);

@@ -674,0 +691,0 @@ var scopeElement = getElement(scope, rootElement);

{
"name": "@bpmn-io/extract-process-variables",
"version": "0.6.0",
"version": "0.7.0",
"description": "A util for bpmn-js to extract Camunda BPM process variables from a BPMN 2.0 diagram.",

@@ -16,3 +16,3 @@ "main": "dist/index.js",

"lint": "eslint .",
"prepublishOnly": "run-s distro",
"prepare": "run-s distro",
"dev": "mocha -r esm --reporter=spec --recursive --watch test/**/*Spec.js",

@@ -19,0 +19,0 @@ "test": "nyc --reporter=lcov mocha -r esm --reporter=spec --recursive test/**/*Spec.js",

@@ -550,8 +550,18 @@ import { filter, find, isArray, forEach, findIndex } from 'min-dash';

/**
* Extractors add ProcessVariables to the `options.processVariables` parameter.
* @callback extractor
* @param {Object} options
* @param {Array<ModdleElement>} options.elements
* @param {ModdleElement} options.containerElement
* @param {Array<ProcessVariable>} options.processVariables
*/
/**
* Retrieves all process variables for a given container element.
* @param {ModdleElement} containerElement
* @param {Array<extractor>} [additionalExtractors]
*
* @returns {Array<ProcessVariable>}
* @returns {Promise<Array<ProcessVariable>>}
*/
function getProcessVariables(containerElement) {
function getProcessVariables(containerElement, additionalExtractors = []) {
var processVariables = [];

@@ -562,12 +572,15 @@

const allPromises = [];
// (2) extract all variables from the extractors
forEach(extractors, function(extractor) {
extractor({
forEach([ ...extractors, ...additionalExtractors ], function(extractor) {
allPromises.push(extractor({
elements: elements,
containerElement: containerElement,
processVariables: processVariables
});
}));
});
return processVariables;
return Promise.all(allPromises)
.then(() => processVariables);
}

@@ -584,8 +597,9 @@

* @param {ModdleElement} rootElement element from where to extract all variables
* @param {Array<extractor>} [additionalExtractors]
*
* @returns {Array<ProcessVariable>}
* @returns {Promise<Array<ProcessVariable>>}
*/
function getVariablesForScope(scope, rootElement) {
async function getVariablesForScope(scope, rootElement, additionalExtractors = []) {
var allVariables = getProcessVariables(rootElement);
var allVariables = await getProcessVariables(rootElement, additionalExtractors);

@@ -612,4 +626,4 @@ var scopeElement = getElement(scope, rootElement);

function getVariablesForElement(element) {
return getVariablesForScope(getScope(element), getRootElement(element));
function getVariablesForElement(element, additionalExtractors = []) {
return getVariablesForScope(getScope(element), getRootElement(element), additionalExtractors);
}

@@ -616,0 +630,0 @@

@@ -554,8 +554,18 @@ 'use strict';

/**
* Extractors add ProcessVariables to the `options.processVariables` parameter.
* @callback extractor
* @param {Object} options
* @param {Array<ModdleElement>} options.elements
* @param {ModdleElement} options.containerElement
* @param {Array<ProcessVariable>} options.processVariables
*/
/**
* Retrieves all process variables for a given container element.
* @param {ModdleElement} containerElement
* @param {Array<extractor>} [additionalExtractors]
*
* @returns {Array<ProcessVariable>}
* @returns {Promise<Array<ProcessVariable>>}
*/
function getProcessVariables(containerElement) {
function getProcessVariables(containerElement, additionalExtractors = []) {
var processVariables = [];

@@ -566,12 +576,15 @@

const allPromises = [];
// (2) extract all variables from the extractors
minDash.forEach(extractors, function(extractor) {
extractor({
minDash.forEach([ ...extractors, ...additionalExtractors ], function(extractor) {
allPromises.push(extractor({
elements: elements,
containerElement: containerElement,
processVariables: processVariables
});
}));
});
return processVariables;
return Promise.all(allPromises)
.then(() => processVariables);
}

@@ -588,8 +601,9 @@

* @param {ModdleElement} rootElement element from where to extract all variables
* @param {Array<extractor>} [additionalExtractors]
*
* @returns {Array<ProcessVariable>}
* @returns {Promise<Array<ProcessVariable>>}
*/
function getVariablesForScope(scope, rootElement) {
async function getVariablesForScope(scope, rootElement, additionalExtractors = []) {
var allVariables = getProcessVariables(rootElement);
var allVariables = await getProcessVariables(rootElement, additionalExtractors);

@@ -616,4 +630,4 @@ var scopeElement = getElement(scope, rootElement);

function getVariablesForElement(element) {
return getVariablesForScope(getScope(element), getRootElement(element));
function getVariablesForElement(element, additionalExtractors = []) {
return getVariablesForScope(getScope(element), getRootElement(element), additionalExtractors);
}

@@ -620,0 +634,0 @@

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