Pebble App Framework: Phone API
    Preparing search index...

    Function keywordMatcher

    • Prepares a keyword list once, for a caller that checks many titles against it.

      Case is ignored, and a keyword matches only where it starts at the start of a word, which is the title's start or a place after anything that is not a letter or a digit. So Lunch matches "Team Lunch" but not "Brunch", and Canceled: matches "Canceled: Standup".

      Parameters

      • keywords: string | readonly string[]

        The list as the wearer typed it, or a list of keywords, such as the one parseKeywords gave for it. Each keyword in a list is trimmed and lowered too, so a list built by hand matches the same.

      Returns (title: string) => boolean

      Says whether any keyword matches a title. An empty list matches nothing.