function assertValidArtifacts(artifactDefns) {
  /** @type {Set<string>} */
  const availableArtifacts = new Set();

  for (const artifact of artifactDefns) {
    assertValidArtifact(artifact);

    if (availableArtifacts.has(artifact.id)) {
      throw new Error(`Config defined multiple artifacts with id '${artifact.id}'`);
    }

    availableArtifacts.add(artifact.id);
    if (!artifact.dependencies) continue;

    for (const [dependencyKey, {id: dependencyId}] of Object.entries(artifact.dependencies)) {
      if (availableArtifacts.has(dependencyId)) continue;
      throwInvalidDependencyOrder(artifact.id, dependencyKey);
    }
  }
}
Asserts that artifacts are unique, valid and are in a dependency order that can be computed.

@param {Array<LH.Config.AnyArtifactDefn>} artifactDefns