MCPcopy Create free account
hub / github.com/nodejs/node / _pad_version

Function _pad_version

tools/gyp/pylib/packaging/specifiers.py:685–700  ·  view source on GitHub ↗
(left: List[str], right: List[str])

Source from the content-addressed store, hash-verified

683
684
685def _pad_version(left: List[str], right: List[str]) -> Tuple[List[str], List[str]]:
686 left_split, right_split = [], []
687
688 # Get the release segment of our versions
689 left_split.append(list(itertools.takewhile(lambda x: x.isdigit(), left)))
690 right_split.append(list(itertools.takewhile(lambda x: x.isdigit(), right)))
691
692 # Get the rest of our versions
693 left_split.append(left[len(left_split[0]) :])
694 right_split.append(right[len(right_split[0]) :])
695
696 # Insert our padding
697 left_split.insert(1, ["0"] * max(0, len(right_split[0]) - len(left_split[0])))
698 right_split.insert(1, ["0"] * max(0, len(left_split[0]) - len(right_split[0])))
699
700 return (list(itertools.chain(*left_split)), list(itertools.chain(*right_split)))
701
702
703class SpecifierSet(BaseSpecifier):

Callers 1

_compare_equalMethod · 0.85

Calls 4

listFunction · 0.50
maxFunction · 0.50
appendMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected