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

asl-puml

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asl-puml - npm Package Compare versions

Comparing version 0.18.0 to 0.19.0

16

dist/lib/decls.js

@@ -92,3 +92,5 @@ "use strict";

const { compositeStates } = config.theme;
Object.keys(compositeStates).map((pattern) => {
Object.keys(compositeStates)
.sort()
.map((pattern) => {
const regex = new RegExp(pattern, "iu");

@@ -117,5 +119,13 @@ const matches = [];

});
state_map.forEach((value, key) => {
emit_decl(key, value, accum);
const sorted = Array.from(state_map.keys()).sort();
sorted
.filter((key) => state_map.get(key).parent === null)
.forEach((key) => {
emit_decl(key, state_map.get(key), accum);
});
sorted
.filter((key) => state_map.get(key).parent !== null)
.forEach((key) => {
emit_decl(key, state_map.get(key), accum);
});
return accum.lines.join("\n");

@@ -122,0 +132,0 @@ };

2

package.json
{
"name": "asl-puml",
"version": "0.18.0",
"version": "0.19.0",
"description": "Generates a plant uml file from a valid JSON ASL file",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

@@ -115,36 +115,47 @@ import type { PumlBuilder, StateHints, StateName } from "./types";

const { compositeStates } = config.theme;
Object.keys(compositeStates).map((pattern) => {
const regex = new RegExp(pattern, "iu");
const matches: string[] = [];
state_map.forEach((_value, key) => {
if (accum.emitted.has(key)) {
return;
Object.keys(compositeStates)
.sort()
.map((pattern) => {
const regex = new RegExp(pattern, "iu");
const matches: string[] = [];
state_map.forEach((_value, key) => {
if (accum.emitted.has(key)) {
return;
}
if (regex.test(key)) {
// this state matches a composite state regex
// it should be grouped under the logical header
matches.push(key);
}
});
if (matches.length > 0) {
// the logical header has matches, emit them
const compositeStateLabel = compositeStates[pattern];
must(compositeStateLabel, "missing state label", { pattern });
accum.lines.push(
`state "${compositeStateLabel}" as compositeState${compositeStatesCounter} ##[dashed] {`
);
compositeStatesCounter += 1;
matches.forEach((key) => {
const value = state_map.get(key);
must(value, "failed to find state name", { stateName: key });
emit_decl(key, value, accum);
});
accum.lines.push("}");
}
if (regex.test(key)) {
// this state matches a composite state regex
// it should be grouped under the logical header
matches.push(key);
}
});
if (matches.length > 0) {
// the logical header has matches, emit them
const compositeStateLabel = compositeStates[pattern];
must(compositeStateLabel, "missing state label", { pattern });
accum.lines.push(
`state "${compositeStateLabel}" as compositeState${compositeStatesCounter} ##[dashed] {`
);
compositeStatesCounter += 1;
matches.forEach((key) => {
const value = state_map.get(key);
must(value, "failed to find state name", { stateName: key });
emit_decl(key, value, accum);
});
accum.lines.push("}");
}
});
state_map.forEach((value, key) => {
emit_decl(key, value, accum);
});
const sorted = Array.from(state_map.keys()).sort();
// emit containers first
sorted
.filter((key) => (state_map.get(key) as StateHints).parent === null)
.forEach((key) => {
emit_decl(key, state_map.get(key) as StateHints, accum);
});
sorted
.filter((key) => (state_map.get(key) as StateHints).parent !== null)
.forEach((key) => {
emit_decl(key, state_map.get(key) as StateHints, accum);
});
return accum.lines.join("\n");
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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