bpmnlint-plugin-camunda-compat 2.11.0 → 2.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpmnlint-plugin-camunda-compat",
3
- "version": "2.11.0",
3
+ "version": "2.11.1",
4
4
  "description": "A bpmnlint plug-in for Camunda compatibility",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -14,7 +14,7 @@ const { skipInNonExecutableProcess } = require('../utils/rule');
14
14
 
15
15
  const { greaterOrEqual } = require('../utils/version');
16
16
 
17
- const formIdAllowedVersion = '8.3';
17
+ const formIdAllowedVersion = '8.4';
18
18
 
19
19
  module.exports = skipInNonExecutableProcess(function({ version }) {
20
20
  function check(node, reporter) {
@@ -4,6 +4,8 @@ const {
4
4
  isFunction,
5
5
  isNil,
6
6
  isObject,
7
+ isString,
8
+ isUndefined,
7
9
  some
8
10
  } = require('min-dash');
9
11
 
@@ -141,7 +143,7 @@ module.exports.hasProperties = function(node, properties, parentNode = null) {
141
143
 
142
144
  const propertyValue = node.get(propertyName);
143
145
 
144
- if (propertyChecks.required && !propertyValue) {
146
+ if (propertyChecks.required && isEmptyValue(propertyValue)) {
145
147
  return [
146
148
  ...results,
147
149
  {
@@ -164,7 +166,7 @@ module.exports.hasProperties = function(node, properties, parentNode = null) {
164
166
  if (propertyChecks.dependentRequired) {
165
167
  const dependency = node.get(propertyChecks.dependentRequired);
166
168
 
167
- if (dependency && !propertyValue) {
169
+ if (dependency && isEmptyValue(propertyValue)) {
168
170
  return [
169
171
  ...results,
170
172
  {
@@ -303,7 +305,9 @@ function findProperties(node, propertyNames) {
303
305
  const properties = [];
304
306
 
305
307
  for (const propertyName of propertyNames) {
306
- if (isDefined(node.get(propertyName))) {
308
+ const propertyValue = node.get(propertyName);
309
+
310
+ if (!isEmptyValue(propertyValue)) {
307
311
  properties.push(node.get(propertyName));
308
312
  }
309
313
  }
@@ -470,4 +474,12 @@ function findParent(node, type) {
470
474
  return findParent(parent, type);
471
475
  }
472
476
 
473
- module.exports.findParent = findParent;
477
+ module.exports.findParent = findParent;
478
+
479
+ function isEmptyString(value) {
480
+ return isString(value) && value.trim() === '';
481
+ }
482
+
483
+ function isEmptyValue(value) {
484
+ return isUndefined(value) || isNil(value) || isEmptyString(value);
485
+ }