Class: Spandx::Js::Parsers::Npm

Inherits:
Core::Parser show all
Defined in:
lib/spandx/js/parsers/npm.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/npm.rb', line 7

def match?(filename)
  File.basename(filename) == 'package-lock.json'
end

#parse(path) ⇒ Object



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

def parse(path)
  items = Set.new
  (path) do ||
    items.add(map_from(path, ))
  end
  items
end