ChemPal Documentation - v1.6.0
    Preparing search index...
    • Normalizes a value already validated by isPubChemCID into the branded PubChemCID number, coercing a numeric string to its number form. The assertion is unavoidable and lives here as the single sanctioned construction point: a nominal brand can't be minted from Number() without one.

      Parameters

      • value: string | number

        A number or numeric string already confirmed by isPubChemCID.

      Returns PubChemCID

      The CID as a branded number.

      if (isPubChemCID(raw)) product.pubchemId = toPubChemCID(raw);
      toPubChemCID("11413"); // 11413
      export function toPubChemCID(value: number | string): PubChemCID {
      return Number(value) as PubChemCID;
      }