Function searchByDemonym

  • Type Parameters

    Parameters

    • demonym: string

      The demonym to search for

    • Optional options: {
          fields?: F[];
      }

      The options

      • Optional fields?: F[]

        The fields to keep in the response

    Returns Promise<Nullable<Pick<Country, F>[]>>

    The matching countries

    Description

    Search among the countries by their demonym

    Example

    const countries = await searchByDemonym('american');
    const countries = await searchByDemonym('american', { fields: ['name', 'capital'] });