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

ebnf2railroad

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ebnf2railroad - npm Package Compare versions

Comparing version 1.8.1 to 1.8.2

7

CHANGELOG.md

@@ -7,2 +7,9 @@ # Changelog

## [1.8.2] - 2019-01-21
### Changed
- Updated example outputs
### Fixed
- Optimization issue in choice length
## [1.8.1] - 2019-01-21

@@ -9,0 +16,0 @@ ### Changed

2

package.json
{
"name": "ebnf2railroad",
"version": "1.8.1",
"version": "1.8.2",
"description": "EBNF to Railroad diagram",

@@ -5,0 +5,0 @@ "keywords": [

@@ -86,3 +86,2 @@ const {

const MAX_CHOICE_LENGTH = 10;
const MAX_SEQUENCE_LENGTH = 45;

@@ -117,4 +116,4 @@ const productionToDiagram = (production, options) => {

const choiceLists = [];
while (choiceOptions.length > options.shrinkChoiceAt) {
const subList = choiceOptions.splice(0, options.shrinkChoiceAt);
while (choiceOptions.length > options.maxChoiceLength) {
const subList = choiceOptions.splice(0, options.maxChoiceLength);
choiceLists.push(makeChoice(subList));

@@ -129,3 +128,3 @@ }

const sequenceLength = determineDiagramSequenceLength(production);
if (sequenceLength > options.maxSequenceLength) {
if (sequenceLength > 45 && options.optimizeSequenceLength) {
const subSequences = production.sequence

@@ -143,3 +142,3 @@ .reduce(

if (
currentLength + remainingLength > options.maxSequenceLength - 5 &&
currentLength + remainingLength > 40 &&
currentLength >= 25 &&

@@ -271,5 +270,3 @@ remainingLength > 10

: Infinity,
maxSequenceLength: options.optimizeDiagrams
? MAX_SEQUENCE_LENGTH
: Infinity
optimizeSequenceLength: options.optimizeDiagrams
}

@@ -276,0 +273,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