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

    Function isRecordablePrice

    • Whether a value is a usable price: a finite, strictly-positive number. Guards against undefined, NaN, and zero/negative anchors that would make a meaningless history point.

      Parameters

      • value: unknown

        The candidate price.

      Returns value is number

      True when the value can be recorded as a price point.

      isRecordablePrice(19.99); // true
      isRecordablePrice(0); // false
      export function isRecordablePrice(value: unknown): value is number {
      return typeof value === 'number' && Number.isFinite(value) && value > 0;
      }