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

amazon-states-language-service

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amazon-states-language-service - npm Package Compare versions

Comparing version 1.4.0 to 1.4.1

22

out/validation/validateStates.js

@@ -106,3 +106,2 @@ "use strict";

// keep track of reached states and unreached states to avoid multiple loops
const unreachedStates = {};
let reachedStates = {};

@@ -129,13 +128,5 @@ let hasTerminalState = false;

}
// if the state hasn't been reached in any of the previous iterations
// mark it as unreached
if (!reachedStates[stateName]) {
unreachedStates[stateName] = prop;
}
// mark the value of Next property as reached state
// and delete it from the list of unreached states
if (typeof nextNodeValue === 'string') {
reachedStates[nextNodeValue] = true;
// tslint:disable-next-line no-dynamic-delete
delete unreachedStates[nextNodeValue];
}

@@ -194,4 +185,2 @@ // Validate Parameters for given state types

reachedStates[name] = true;
// tslint:disable-next-line no-dynamic-delete
delete unreachedStates[name];
}

@@ -225,5 +214,10 @@ }

}
// loop through the hash map of unreached states and create diagnostics
Object.values(unreachedStates).forEach(statePropNode => {
const { length, offset } = statePropNode.keyNode;
// Create diagnostics for states that weren't referenced by a State, Choice Rule, or Catcher's "Next" field
statesValueNode.properties
.filter(statePropNode => {
const stateName = statePropNode.keyNode.value;
return !reachedStates[stateName];
})
.forEach(unreachableStatePropNode => {
const { length, offset } = unreachableStatePropNode.keyNode;
const range = vscode_json_languageservice_1.Range.create(document.positionAt(offset), document.positionAt(offset + length));

@@ -230,0 +224,0 @@ diagnostics.push(vscode_json_languageservice_1.Diagnostic.create(range, diagnosticStrings_1.MESSAGES.UNREACHABLE_STATE, vscode_json_languageservice_1.DiagnosticSeverity.Error));

@@ -15,3 +15,3 @@ {

"license": "MIT",
"version": "1.4.0",
"version": "1.4.1",
"publisher": "aws",

@@ -18,0 +18,0 @@ "categories": [

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