From cd9b81b8125e80ff57d12506e719155e62f2a023 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Thu, 21 Apr 2022 15:14:06 +0100 Subject: [PATCH] fix: optionally use allowed_query --- package.json | 2 +- src/index.ts | 2 +- yarn.lock | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 748920b..2f4c33e 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "typescript": "^4.6.2" }, "dependencies": { - "@insertish/oapi": "0.1.14", + "@insertish/oapi": "0.1.15", "axios": "^0.26.1", "lodash.defaultsdeep": "^4.6.1" }, diff --git a/src/index.ts b/src/index.ts index ff0814c..8d46867 100644 --- a/src/index.ts +++ b/src/index.ts @@ -138,7 +138,7 @@ export class API { // Map each parameter to the correct object. for (const parameter of Object.keys(params)) { - if (allowed_query.includes(parameter)) { + if (allowed_query?.includes(parameter)) { query = { ...(query ?? {}), [parameter]: (params as Record)[parameter] diff --git a/yarn.lock b/yarn.lock index 4593aa6..a1bf1b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@insertish/oapi@0.1.14": - version "0.1.14" - resolved "https://registry.yarnpkg.com/@insertish/oapi/-/oapi-0.1.14.tgz#0eb78530990a03bd8f3bbb7e9f4ee598b5cd5d6f" - integrity sha512-9GW6tCo/aEG8VG4ICX1s+lN0bmJibEHuEn8Ij58N9VbbJpsQl0sWzCLJVIKHOK4UxKY/25fb08CoMqqgUTDfow== +"@insertish/oapi@0.1.15": + version "0.1.15" + resolved "https://registry.yarnpkg.com/@insertish/oapi/-/oapi-0.1.15.tgz#ee58b82d879ed5af54db846699941b8ad0262e7b" + integrity sha512-2G8eFxrojF651tBoRutQ8CJOw0u8UjYSlw/LQU+xycw5KpXslhWp/KSR86uIFyDIPddwfMCNA91vwHGCFRA63w== dependencies: typescript "^4.6.2" optionalDependencies: