ex_yarn v0.4.1 ExYarn.Dependency View Source

An NPM dependency

This module represents an NPM dependency as parsed by ExYarn. It does not provide any utility functions and is therefore intended for data representation only.

Link to this section Summary

Types

The representation of a sub-dependency.

t()

The represenation of a dependency.

Functions

Creates a Dependency struct from a parsed dependency map

Link to this section Types

Specs

dep_name() :: String.t()

Specs

dep_version() :: String.t()

Specs

sub_dependency() :: {dep_name(), dep_version()}

The representation of a sub-dependency.

Specs

t() :: %ExYarn.Dependency{
  dependencies: [sub_dependency()],
  integrity: String.t() | nil,
  name: dep_name(),
  optional_dependencies: [sub_dependency()],
  resolved: String.t(),
  version: dep_version()
}

The represenation of a dependency.

Link to this section Functions

Specs

from_result_map(map()) :: t()

Creates a Dependency struct from a parsed dependency map

Receives a map as returned by the ExYarn.Parser and returns the corresponding Dependency struct.