Skip to content

Commit

Permalink
Merge pull request #206 from mollie/pimm/update-dependencies
Browse files Browse the repository at this point in the history
Updated the dependencies
  • Loading branch information
Pimm authored May 13, 2021
2 parents cac8639 + 6375882 commit 079032b
Show file tree
Hide file tree
Showing 5 changed files with 1,398 additions and 1,609 deletions.
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,35 +42,35 @@
},
"dependencies": {
"axios": "^0.21.1",
"lodash": "^4.17.20"
"lodash": "^4.17.21"
},
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/preset-env": "^7.12.11",
"@babel/preset-typescript": "^7.12.7",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/preset-env": "^7.14.2",
"@babel/preset-typescript": "^7.13.0",
"@mollie/eslint-config-typescript": "^1.4.0",
"@types/jest": "^26.0.20",
"@types/lodash": "^4.14.167",
"@types/node": "^14.14.20",
"@typescript-eslint/eslint-plugin": "^4.13.0",
"@types/jest": "^26.0.23",
"@types/lodash": "^4.14.169",
"@types/node": "^15.0.3",
"@typescript-eslint/eslint-plugin": "^4.23.0",
"axios-mock-adapter": "^1.19.0",
"babel-jest": "^26.6.3",
"commitizen": "^4.2.2",
"commitizen": "^4.2.4",
"cz-conventional-changelog": "^3.3.0",
"dotenv": "^8.2.0",
"eslint": "^7.17.0",
"eslint-config-prettier": "^7.1.0",
"eslint-plugin-prettier": "^3.3.1",
"husky": "^4.3.7",
"dotenv": "^9.0.2",
"eslint": "^7.26.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"husky": "^6.0.0",
"jest": "24.9.0",
"jest-bluster": "^1.0.1",
"lint-staged": "^10.5.3",
"prettier": "^2.2.1",
"rollup": "^2.36.1",
"lint-staged": "^11.0.0",
"prettier": "^2.3.0",
"rollup": "^2.47.0",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"typescript": "^4.1.3"
"typescript": "^4.2.4"
},
"husky": {
"hooks": {
Expand Down
4 changes: 2 additions & 2 deletions src/Options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type Options = Xor<
*/
versionStrings?: string | string[];
/**
* The headers set in the requests sent to the Mollie API. `Authorization`, `User-Agent`, `Accept-Encoding`, and
* `Content-Type` are set by this library directly, setting them here has no effect.
* The headers set in the requests sent to the Mollie API. `Authorization`, `User-Agent`, `Accept`,
* `Accept-Encoding`, and `Content-Type` are set by this library directly. Setting them here has no effect.
*/
headers?: Record<string, string>;
/**
Expand Down
2 changes: 1 addition & 1 deletion src/data/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export enum SequenceType {
recurring = 'recurring',
}

export type MollieApiErrorLinks = { [key: string]: Url } | Links;
export type MollieApiErrorLinks = Record<string, Url> & Links;

export interface MollieApiError {
status?: number;
Expand Down
12 changes: 6 additions & 6 deletions src/errors/ApiError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default class ApiError extends Error {
*
* @since 3.0.0
*/
public getDocumentationUrl(): string {
public getDocumentationUrl(): Maybe<string> {
return this.getUrl('documentation');
}

Expand All @@ -50,7 +50,7 @@ export default class ApiError extends Error {
*
* @since 3.0.0
*/
public getDashboardUrl(): string {
public getDashboardUrl(): Maybe<string> {
return this.getUrl('dashboard');
}

Expand All @@ -68,15 +68,15 @@ export default class ApiError extends Error {
*
* @since 3.0.0
*/
public getLink(key: string): Url {
return get(this.links, key);
public getLink(key: string): Maybe<Url> {
return this.links?.[key];
}

/**
* @since 3.0.0
*/
public getUrl(key: string): string {
return get(this.getLink(key), 'href');
public getUrl(key: keyof MollieApiErrorLinks): Maybe<string> {
return this.links?.[key]?.href;
}

public toString(): string {
Expand Down
Loading

0 comments on commit 079032b

Please sign in to comment.