Class: Spandx::Js::Parsers::Yarn

Inherits:
Core::Parser show all
Defined in:
lib/spandx/js/parsers/yarn.rb

Constant Summary

Constants inherited from Core::Parser

Core::Parser::UNKNOWN

Instance Method Summary collapse

Methods inherited from Core::Parser

for, parse

Methods included from Core::Registerable

#all, #each, #inherited, #registry

Instance Method Details

#match?(filename) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/spandx/js/parsers/yarn.rb', line 7

def match?(filename)
  filename.basename.fnmatch?('yarn.lock')
end

#parse(path) ⇒ Object



11
12
13
14
15
# File 'lib/spandx/js/parsers/yarn.rb', line 11

def parse(path)
  YarnLock.new(path).each_with_object(Set.new) do |, memo|
    memo << map_from(path, )
  end
end