ChemPare Documentation - v0.0.0
    Preparing search index...
    • Type guard to validate if a value is a valid currency code. Checks if the value is a string and if it is in the CURRENCY_SYMBOL_MAP.

      Parameters

      • code: unknown

        The value to validate

      Returns code is valueof<{ [key: string]: string }>

      Type predicate indicating if the value is a valid currency code

      const validCode = "USD";
      if (isCurrencyCode(validCode)) {
      console.log("Valid currency code:", validCode);
      } else {
      console.log("Invalid currency code:", validCode);
      }