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.2 to 1.9.0

4

CHANGELOG.md

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

## [1.9.0] - 2019-01-22
### Fixed
- Improved detection for recursion and roots
## [1.8.2] - 2019-01-21

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

2

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

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

@@ -220,5 +220,5 @@ const {

`<li${
metadata[tocNode.name].root
(metadata[tocNode.name] || {}).root
? ' class="root-node"'
: metadata[tocNode.name].common
: (metadata[tocNode.name] || {}).common
? ' class="common-node"'

@@ -230,3 +230,3 @@ : ""

${
metadata[tocNode.name].recursive
(metadata[tocNode.name] || {}).recursive
? '<dfn title="recursive">♺</dfn>'

@@ -287,8 +287,10 @@ : ""

const alphabetical = createAlphabeticalToc(ast);
const rootItems = alphabetical.filter(item => metadata[item.name].root);
const isRoot = item => (metadata[item.name] || {}).root;
const isCommon = item => (metadata[item.name] || {}).common;
const rootItems = alphabetical.filter(item => isRoot(item));
const commonItems = alphabetical.filter(
item => !metadata[item.name].root && metadata[item.name].common
item => !isRoot(item) && isCommon(item)
);
const otherItems = alphabetical.filter(
item => !metadata[item.name].root && !metadata[item.name].common
item => !isRoot(item) && !isCommon(item)
);

@@ -295,0 +297,0 @@ const hierarchicalToc = createTocStructure(structuralToc, metadata);

@@ -76,8 +76,8 @@ const {

.filter((root, index, list) => {
const childIndex = Math.min(
flatList(root.children || [])
.filter(node => node !== root.name)
.map(node => list.map(p => p.name).indexOf(node))
.filter(e => e !== -1)
);
const indices = flatList(root.children || [])
.filter(node => node !== root.name)
.map(node => list.map(p => p.name).indexOf(node))
.filter(e => e !== -1);
const childIndex = Math.min(...indices);
return index < childIndex;

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