chore: updating dependencies and node versions

* Updated supported Node.js versions

Dropped support for 14 and 16 in favor of the current LTS versions 18
and 20.

* Updated Node.js dependencies

Bumped nearly all dependencies to the latest. The exception being
`node-fetch` which made the jump to using ESM which is still causing
folks a lot of grief.

* Shored code coverage back up to 100%

Had some remnants from when this library did sanity checks pre-flight to
the API that required additional tests to cover them, or just adjusting
the argument defaults.

* Removed the "build" badge from the README

Seems there were some gotchas with that badge that makes it kind of a
pain, as it has to be hard coded a certain way. I messed with it and
couldn't get it working, seems like more trouble than it's worth.

Further details: https://github.com/badges/shields/issues/8671

* Added .nvmrc file

Pretty self explanatory.

* Bumped version number

Lucky number 7, y'all!
This commit is contained in:
Josh Sherman 2023-10-25 20:55:27 -05:00
parent 5a62ac8b5f
commit 250fb4b4e9
8 changed files with 2242 additions and 6455 deletions

32
dist/types.d.ts vendored
View file

@ -1,19 +1,19 @@
export declare type Endpoint = 'countries' | 'holidays' | 'languages' | 'workday' | 'workdays';
export declare type Weekday = {
export type Endpoint = 'countries' | 'holidays' | 'languages' | 'workday' | 'workdays';
export type Weekday = {
name: 'Monday' | 'Tuesday' | 'Wednesday' | 'Thursday' | 'Friday' | 'Saturday' | 'Sunday';
numeric: 1 | 2 | 3 | 4 | 5 | 6 | 7;
};
declare type Request = {
type Request = {
format?: 'csv' | 'json' | 'php' | 'tsv' | 'xml' | 'yaml';
key?: string;
pretty?: boolean;
search?: string;
};
export declare type CountriesRequest = Request & {
export type CountriesRequest = Request & {
country?: string;
public?: boolean;
};
export declare type HolidaysRequest = Request & {
export type HolidaysRequest = Request & {
country?: string;
day?: number;
language?: string;
@ -24,20 +24,20 @@ export declare type HolidaysRequest = Request & {
upcoming?: boolean;
year?: number;
};
export declare type LanguagesRequest = Request & {
export type LanguagesRequest = Request & {
language?: string;
};
export declare type WorkdayRequest = Request & {
export type WorkdayRequest = Request & {
country?: string;
start?: string;
days?: number;
};
export declare type WorkdaysRequest = Request & {
export type WorkdaysRequest = Request & {
country?: string;
start?: string;
end?: string;
};
export declare type Response = {
export type Response = {
requests: {
available: number;
resets: string;
@ -46,7 +46,7 @@ export declare type Response = {
status: number;
error?: string;
};
export declare type CountriesResponse = Response & {
export type CountriesResponse = Response & {
countries?: {
code: string;
codes: {
@ -68,7 +68,7 @@ export declare type CountriesResponse = Response & {
};
}[];
};
export declare type HolidaysResponse = Response & {
export type HolidaysResponse = Response & {
holidays?: {
country: string;
date: string;
@ -79,21 +79,21 @@ export declare type HolidaysResponse = Response & {
subdivisions?: string[];
}[];
};
export declare type LanguagesResponse = Response & {
export type LanguagesResponse = Response & {
languages?: {
code: string;
name: string;
}[];
};
export declare type WorkdayResponse = Response & {
export type WorkdayResponse = Response & {
workday?: {
date: string;
weekday: Weekday;
};
};
export declare type WorkdaysResponse = Response & {
export type WorkdaysResponse = Response & {
workdays?: number;
};
export declare type Requests = (CountriesRequest | HolidaysRequest | LanguagesRequest | WorkdayRequest | WorkdaysRequest);
export declare type Responses = (CountriesResponse | HolidaysResponse | LanguagesResponse | WorkdayResponse | WorkdaysResponse);
export type Requests = (CountriesRequest | HolidaysRequest | LanguagesRequest | WorkdayRequest | WorkdaysRequest);
export type Responses = (CountriesResponse | HolidaysResponse | LanguagesResponse | WorkdayResponse | WorkdaysResponse);
export {};