function resolveVersion(meta, version) {
	const distTags = meta['dist-tags'];
	if (distTags.hasOwnProperty(version)) {
		return distTags[version];
	}

	if (meta.versions.hasOwnProperty(version)) {
		return version;
	}

	const versions = Object.keys(meta.versions);
	return semverMaxSatisfying(versions, version);
}
Get the highest matching semver version for a package
@param {Meta} meta
@param {string} version