ChemPal Documentation - v1.6.0
    Preparing search index...
    • This can be used to typeguard the .price.gross and .price.net fields of a SynthetikaProduct

      Parameters

      • data: unknown

        The data to typeguard

      Returns data is SynthetikaProductPrice

      True if the data is a SynthetikaProductPrice, false otherwise

      const product = { price: { gross: { final: "100" }, net: { final: "90" } } };
      if (isSynthetikaProductPrice(product.price)) {
      console.log(product.price.gross.final);
      }
      export function isSynthetikaProductPrice(data: unknown): data is SynthetikaProductPrice {
      return v.safeParse(synthetikaProductPriceSchema, data).success;
      }