code: function parsePackageSpecifier(rawPackageSpecifier) {
      rawPackageSpecifier = (rawPackageSpecifier || '').trim();
      const separatorIndex = rawPackageSpecifier.lastIndexOf('@');
      let name;
      let version = undefined;
      if (separatorIndex === 0) {
          // The specifier starts with a scope and doesn't have a version specified
          name = rawPackageSpecifier;
      }
      else if (separatorIndex === -1) {
          // The specifier doesn't have a version
          name = rawPackageSpecifier;
      }
      else {
          name = rawPackageSpecifier.substring(0, separatorIndex);
          version = rawPackageSpecifier.substring(separatorIndex + 1);
      }
      if (!name) {
          throw new Error(`Invalid package specifier: ${rawPackageSpecifier}`);
      }
      return { name, version };
  }
docs: Parse a package specifier (in the form of name\@version) into name and version parts.