addBestMatch | WebHare Platform SDK
WebHare Platform SDK
    Preparing search index...
    • Return match info as text to append to the end of a message

      Parameters

      • name: string

        Name to search

      • alternatives: string[]

        Alternatives to choose from

      • matchCase: { matchCase?: boolean } = {}

        Do a case sensitive compare (defaults to FALSE)

      Returns string

      Returns ", did you mean 'XXX'?" text if a better match was found, otherwise an empty string

      throw new Error(`${libname} does not export '${name}'${addBestMatch(name, Object.keys(lib))}`);