@medic/cht-datasource
    Preparing search index...

    Function isFreetextQualifier

    • Returns true if the given qualifier is a FreetextQualifier otherwise false.

      The condition for being a valid freetext is that the qualifier should have a freetext key and the value should be a string which is more than 3 characters in length. The additional condition is that the value should not contain a whitespace(' ') unless the value is in the key:value pattern.

      Parameters

      • qualifier: unknown

        the qualifier to check

      Returns qualifier is Readonly<{ freetext: string }>

      true if the given type is a FreetextQualifier, otherwise false.

      // valid
      { freetext: 'abc' }
      // valid
      { freetext: 'key:value with spaces' }
      // invalid
      { freetext: 'value with spaces' }