Function getCatalogVersion

  • Given a dependency package name and a version spec string, if the version starts with catalog:, look up the actual version spec (not the final resolved version) from the given catalogs.

    Throws an error if there's anything invalid about the catalog spec (no catalogs defined, no matching catalog, catalog doesn't contain name, recursive catalog version).

    Returns undefined if the version doesn't start with catalog:.

    Parameters

    • params: {
          catalogs: undefined | Catalogs;
          name: string;
          version: string;
      }
      • catalogs: undefined | Catalogs
      • name: string
      • version: string

    Returns string | undefined

    Actual version spec from the catalog, or undefined if not a catalog version