MCPcopy Create free account
hub / github.com/aboutcode-org/vulnerablecode / data_from_toml_lines

Function data_from_toml_lines

vulnerabilities/importers/rust.py:216–226  ·  view source on GitHub ↗

Return a mapping of data from an iterable of TOML text ``lines``. For example:: >>> lines = ['[advisory]', 'id = "RUST1"', '', '[versions]', 'patch = [">= 1"]'] >>> data_from_toml_lines(lines) {'advisory': {'id': 'RUST1'}, 'versions': {'patch': ['>= 1']}}

(lines)

Source from the content-addressed store, hash-verified

214
215
216def data_from_toml_lines(lines):
217 """
218 Return a mapping of data from an iterable of TOML text ``lines``.
219
220 For example::
221
222 >>> lines = ['[advisory]', 'id = "RUST1"', '', '[versions]', 'patch = [">= 1"]']
223 >>> data_from_toml_lines(lines)
224 {'advisory': {'id': 'RUST1'}, 'versions': {'patch': ['>= 1']}}
225 """
226 return toml.loads("\n".join(lines))
227
228
229def get_advisory_data(location):

Callers 1

get_advisory_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected