Function searchByCurrency

  • Type Parameters

    Parameters

    • currency: string

      The currency 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 currency

    Example

    const countries = await searchByCurrency('usd');
    const countries = await searchByCurrency('euro', { fields: ['name', 'capital'] });