packages/npm/src/getPackageInfoFrom.js
function getPackageInfoFrom(string) {
  if (string[0] === '@') {
    const [scope, rawName] = string.split('/');
    const { name, version } = getVersionFromString(rawName);
    return {
      name: `${scope}/${name}`,
      version,
    };
  }

  return getVersionFromString(string);
}
function getPackageInfoFrom(string) {
  if (string[0] === '@') {
    const [scope, rawName] = string.split('/');
    const { name, version } = getVersionFromString(rawName);
    return {
      name: `${scope}/${name}`,
      version,
    };
  }

  return getVersionFromString(string);
}
function getPackageInfoFrom ( string ) { if ( string [ 0 ] === '@' ) { const [ scope , rawName ] = string . split ( '/' ) ; const { name , version } = getVersionFromString ( rawName ) ; return { name : ` ${ scope } ${ name } ` , version , } ; } return getVersionFromString ( string ) ; }
some-package some-package@next @foo/some-package @foo/some-package@next
some - package some - package