bpmnlint
Advanced tools
Comparing version 7.5.0 to 7.6.0
@@ -9,2 +9,7 @@ # Changelog | ||
## 7.6.0 | ||
* `FEAT`: allow passing object as third parameter to `Reporter#report` ([#75](https://github.com/bpmn-io/bpmnlint/pull/75)) | ||
## 7.5.0 | ||
@@ -11,0 +16,0 @@ |
const traverse = require('./traverse'); | ||
const { | ||
isArray, | ||
isObject | ||
} = require('min-dash'); | ||
class Reporter { | ||
@@ -11,2 +17,18 @@ constructor({ moddleRoot, rule }) { | ||
/** | ||
* @param {string} id | ||
* @param {string} message | ||
* @param {string[]|Object} path | ||
* | ||
* @example | ||
* | ||
* Reporter.report('foo', 'Foo error', [ 'foo', 'bar', 'baz' ]); | ||
* | ||
* @example | ||
* | ||
* Reporter.report('foo', 'Foo error', { | ||
* path: [ 'foo', 'bar', 'baz' ], | ||
* foo: 'foo' | ||
* }); | ||
*/ | ||
report(id, message, path) { | ||
@@ -18,3 +40,3 @@ let report = { | ||
if (path) { | ||
if (path && isArray(path)) { | ||
report = { | ||
@@ -26,2 +48,9 @@ ...report, | ||
if (path && isObject(path)) { | ||
report = { | ||
...report, | ||
...path | ||
}; | ||
} | ||
this.messages.push(report); | ||
@@ -28,0 +57,0 @@ } |
{ | ||
"name": "bpmnlint", | ||
"description": "Validate your BPMN diagrams based on configurable lint rules", | ||
"version": "7.5.0", | ||
"version": "7.6.0", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
55705
1625
0