Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/npm/client.py
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | class NpmClient: | ||||
def latest_package_version(self): | def latest_package_version(self): | ||||
""" | """ | ||||
Return the last released version of the focused package. | Return the last released version of the focused package. | ||||
Returns: | Returns: | ||||
str: the last releases package version | str: the last releases package version | ||||
""" | """ | ||||
return self.package_metadata['dist-tags']['latest'] | latest = '' | ||||
if 'latest' in self.package_metadata['dist-tags']: | |||||
latest = self.package_metadata['dist-tags']['latest'] | |||||
return latest | |||||
def package_versions(self, known_versions=None): | def package_versions(self, known_versions=None): | ||||
""" | """ | ||||
Return the available versions for the focused package. | Return the available versions for the focused package. | ||||
Args: | Args: | ||||
known_versions (dict): may be provided by the loader, it enables | known_versions (dict): may be provided by the loader, it enables | ||||
to filter out versions already ingested in the archive. | to filter out versions already ingested in the archive. | ||||
▲ Show 20 Lines • Show All 142 Lines • Show Last 20 Lines |