harcon-flow
Advanced tools
Comparing version 2.6.5 to 2.6.7
@@ -7,3 +7,3 @@ const Assigner = require('assign.js') | ||
function densify (str) { | ||
return str.replace(/[^A-Za-z0-9\{\}\[\]<>\{\}\(\)]+/g, '') | ||
return str.replace(/[^A-Za-z0-9\{\}\[\]<>\.\{\}\(\)]+/g, '') | ||
} | ||
@@ -20,2 +20,11 @@ let shouldNamify = true | ||
function extractVersion (data) { | ||
if (data.actor.endsWith(']') ) { | ||
let index = data.actor.indexOf('[') | ||
data.version = data.actor.substring( index + 1, data.actor.length - 1 ) | ||
data.actor = data.actor.substring( 0, index ) | ||
} | ||
return data | ||
} | ||
function extractActor (actor) { | ||
@@ -70,3 +79,3 @@ if ( actor.startsWith('()') ) return { actor: actor.substring(2), web: true } | ||
var comp = def.split(':') | ||
res = assigner.assign( res, extractActor( densify( comp[0].trim() ) ) ) | ||
res = assigner.assign( res, extractVersion( extractActor( densify( comp[0].trim() ) ) ) ) | ||
res.actor = namify( res.actor ) | ||
@@ -73,0 +82,0 @@ |
{ | ||
"name": "harcon-flow", | ||
"version": "2.6.5", | ||
"version": "2.6.7", | ||
"description": "Small utility library to descript business flows for harcon", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -52,2 +52,4 @@ Harcon-flow is a simple utility library aiming to leverage a very simple syntax to define microtransaction between entities. | ||
Actors can be versioned. | ||
A 'skip if' can be added to the end of the definition to declare, that the given message can be sent only if the 'actor.message' is performed and returned with approving answer. | ||
@@ -149,3 +151,3 @@ | ||
C : do | ||
D : act | ||
D[1.0.0] : act | ||
<>E : manage | ||
@@ -156,5 +158,5 @@ ()C : care | ||
The entity __'B'__ will eventually perform its service 'greetings' which will send out messages to entities _'C', 'D', 'E' and 'C'__ in that order sending the result of a given call to the next actor, as waterfall model works. | ||
In case of 'D', the version of the entity is also defined. | ||
## License | ||
@@ -161,0 +163,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21040
408
186