ChemPal Documentation - v1.6.0
    Preparing search index...

    Function isVWRSpecificationResponse

    • Type guard validating a VWR chemical specification response (a flat array of {name, result}).

      Parameters

      • data: unknown

        The response to validate

      Returns data is VWRSpecificationResponse

      Type predicate indicating whether data is a VWRSpecificationResponse

      isVWRSpecificationResponse([{ name: "Purity", result: "> 98 %" }]); // true
      isVWRSpecificationResponse({ name: "Purity" }); // false (not an array)
      export function isVWRSpecificationResponse(data: unknown): data is VWRSpecificationResponse {
      return v.safeParse(vwrSpecificationResponseSchema, data).success;
      }