New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

asl-validator

Package Overview
Dependencies
Maintainers
2
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asl-validator - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

src/lib/terminals.js

4

package.json
{
"name": "asl-validator",
"version": "2.1.0",
"version": "2.2.0",
"description": "Amazon States Language validator",

@@ -35,3 +35,3 @@ "main": "./src/validator.js",

"commander": "^5.1.0",
"jsonpath": "^1.1.0"
"jsonpath-plus": "^7.0.0"
},

@@ -38,0 +38,0 @@ "devDependencies": {

@@ -1,4 +0,4 @@

const jp = require('jsonpath');
const { JSONPath } = require('jsonpath-plus');
module.exports = (definition) => jp.query(definition, '$..[\'InputPath\',\'OutputPath\',\'ResultPath\']')
module.exports = (definition) => JSONPath({ json: definition, path: '$..[InputPath,OutputPath,ResultPath]' })
.filter((path) => typeof path === 'string')

@@ -15,3 +15,3 @@ .map((path) => {

try {
jp.parse(path);
JSONPath({ path, json: definition });
return null;

@@ -18,0 +18,0 @@ } catch (e) {

@@ -1,2 +0,2 @@

const jp = require('jsonpath');
const { JSONPath } = require('jsonpath-plus');

@@ -6,3 +6,3 @@ module.exports = (definition) => {

let machineStates = [];
jp.query(definition, '$..[\'States\']')
JSONPath({ json: definition, path: '$..States' })
.forEach((s) => {

@@ -13,3 +13,3 @@ machineStates = machineStates.concat(Object.keys(s));

// retrieve all reachable states
const reachableStates = jp.query(definition, '$..[\'StartAt\',\'Next\',\'Default\']')
const reachableStates = JSONPath({ json: definition, path: '$..[StartAt,Next,Default]' })
.filter((path) => typeof path === 'string')

@@ -16,0 +16,0 @@ .filter((path, pos, array) => array.indexOf(path) === pos);

@@ -1,2 +0,2 @@

const jp = require('jsonpath');
const { JSONPath } = require('jsonpath-plus');

@@ -6,3 +6,3 @@ module.exports = (definition) => {

const names = new Map();
jp.query(definition, '$..[\'States\']')
JSONPath({ json: definition, path: '$..[\'States\']' })
.forEach((states) => {

@@ -9,0 +9,0 @@ Object.keys(states).forEach((stateName) => {

@@ -1,2 +0,2 @@

const jp = require('jsonpath');
const { JSONPath } = require('jsonpath-plus');

@@ -17,4 +17,4 @@ module.exports = (definition) => {

const isContainer = ['Map', 'Parallel'].indexOf(nestedState.Type) >= 0;
const path = isContainer ? '$.[\'Next\',\'Default\']' : '$..[\'Next\',\'Default\']';
states.push(...jp.query(nestedState, path));
const path = isContainer ? '$.[Next,Default]' : '$..[Next,Default]';
states.push(...JSONPath({ json: nestedState, path }));
});

@@ -31,3 +31,3 @@ return states;

// These are the only valid states to link to from within the branch
jp.query(nestedStateMachine, '$.States').forEach((branchStates) => {
JSONPath({ json: nestedStateMachine, path: '$.States' }).forEach((branchStates) => {
availStateNames = availStateNames.concat(Object.keys(branchStates));

@@ -46,3 +46,3 @@ });

// link outside its branch.
jp.query(definition, '$..[\'Branches\']')
JSONPath({ json: definition, path: '$..Branches' })
.forEach((parallelBranches) => {

@@ -63,3 +63,3 @@ parallelBranches.forEach((nestedStateMachine) => {

// link outside its container.
jp.query(definition, '$..[\'Iterator\']')
JSONPath({ json: definition, path: '$..Iterator' })
.forEach((nestedStateMachine) => {

@@ -66,0 +66,0 @@ const errs = validateNestedStateMachine(nestedStateMachine).map((state) => ({

@@ -18,2 +18,3 @@ const Ajv = require('ajv');

const stateNames = require('./lib/state-names');
const terminals = require('./lib/terminals');

@@ -51,2 +52,3 @@ function formatError(e) {

postSchemaValidationErrors.push(...stateNames(definition));
postSchemaValidationErrors.push(...terminals(definition));
}

@@ -53,0 +55,0 @@

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