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

@devsnicket/eunice-dependency-and-structure

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@devsnicket/eunice-dependency-and-structure

Takes YAML objects, replaces the identifiers of whats depended upon with references, adds dependent references in other direction and normalises the hierarchical structure.

  • 2.18.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Eunice Dependency and structure

This package takes YAML that contains dependencies and structure, represented as objects and does the following:

  • Standardizes structure (to support varying YAML verbosity)
  • Replaces the identifiers of whats depended upon with object references
  • Adds dependent object references (so dependencies are available in both directions)

It is used by the renderer and some of the processors of Eunice.

For more information https://devsnicket.com/eunice.

NPM Build Status Coverage Status License: MIT Gitter chat

Install using npm:

npm install @devsnicket/eunice-dependency-and-structure

Or with yarn:

yarn add @devsnicket/eunice-dependency-and-structure

YAML

  • YAML is read using the function createStackFromYaml and written using createYamlFromStack.
  • Parsing and formatting of YAML is not included in this package. Javascript objects are expected for the parameter of createStackFromYaml and will be returned by createYamlFromStack. These objects are expected to be in a form that matches the js-yaml package.
  • The YAML content supported is specified in the main Eunice repository. Any additional content will be preserved when reading and writing.

Stacks

After a stack has been read/created from YAML using createStackFromYaml (see above), the following functions can be used on the stack or sub-stacks:

findDirectionBetweenItemsInFirstMutualStack

This function takes two stacks as parameters, works up the hierarchical structure from those stacks, finds the first ancestor stack that both stacks specified are descendants of, and returns that mutual ancestor stack and what the direction is between the "from" and "to" stacks specified.

findItemInStackWithIdentifierHierarchy

This function takes a stack and an array of item identifiers as parameters, it will then work its way down the hierarchical structure of the stack specified, looking for an item that matches the identifier specified at that index and returns the item that matches the last identifier specified. If at any point during this process there are no child items or an child item can't be found with a matching identifier, an error is thrown.

isInnerStack

This function takes two stacks as parameters, navigates up the hierarchical structure and returns true if "target" stack specified is an ancestor of the "source" stack specified.

Keywords

FAQs

Package last updated on 02 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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