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

Function compare

vulntotal/vulntotal_utils.py:56–71  ·  view source on GitHub ↗
(version, package_comparator, package_version)

Source from the content-addressed store, hash-verified

54
55
56def compare(version, package_comparator, package_version):
57 operator_comparator = {
58 "<": operator.lt,
59 ">": operator.gt,
60 "=": operator.eq,
61 "<=": operator.le,
62 ">=": operator.ge,
63 "==": operator.eq,
64 "!=": operator.ne,
65 ")": operator.lt,
66 "]": operator.le,
67 "(": operator.gt,
68 "[": operator.ge,
69 }
70 compare_v = operator_comparator[package_comparator]
71 return compare_v(version, package_version)
72
73
74def parse_constraint(constraint):

Callers 3

Calls

no outgoing calls

Tested by

no test coverage detected