function toDependency(dependencyString: string): Dependency {
  let [name, ...rest] = dependencyString.split('@').filter(part => part !== '');
  let version = rest.join('@');
  if (name.includes('/')) {
    name = '@' + name;
  }
  return version.length > 0 ? { name, version } : { name };
}
Takes a string in one of the following forms:
 "pkgName", "pkgName@version", "@scope/pkgName", "@scope/pkgName@version"
and returns an object with the package name and version (if passed)