feat: pull country or language by code.

* feat: pull country or language by code.

This differs from the existing `search` functionality in that it allows
you to explicitly pull back a single country or language instead of
anything that matches (which could result in more items returned than
expected).

* refactor(types): add new types for the affected endpoints.
* docs(readme): update to include examples for new functionality.
* test: expand tests to include new parameters.
* feat(package): upgrade dependencies to the latest versions.
* fix(eslint): adjust configuration based on an updated dependency.
* docs(license): bump the year of the license.
This commit is contained in:
Josh Sherman 2020-02-11 18:46:30 -06:00
parent 9b40c4050e
commit 319d67d84b
10 changed files with 4543 additions and 1958 deletions

View file

@ -103,7 +103,15 @@ holidayApi.holidays({ country: 'US', year: 2019 })
holidayApi.countries();
```
#### Search for a country by code or name
#### Fetch a supported country by code
```javascript
holidayApi.countries({
country: 'NO',
});
```
#### Search for countries by code or name
```javascript
holidayApi.countries({
@ -119,7 +127,15 @@ holidayApi.countries({
holidayApi.languages();
```
#### Search for a language by code or name
#### Fetch a supported language by code
```javascript
holidayApi.language({
language: 'es',
});
```
#### Search for languages by code or name
```javascript
holidayApi.language({