Skip to content

Commit

Permalink
fix(core): address compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Mar 1, 2022
1 parent 61c5c06 commit aeadc14
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions packages/core/router/router-explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,21 @@ export class RouterExplorer {

// Custom Extractor Versioning Handler
if (versioningOptions.type === VersioningType.CUSTOM) {
const extractedVersion = versioningOptions.extractor(req);
const extractedVersion = versioningOptions.extractor(req) as
| string
| string[]
| Array<string | symbol>;

if (Array.isArray(version)) {
if (
Array.isArray(extractedVersion) &&
version.filter(extractedVersion.includes).length
version.filter(
extractedVersion.includes as (
value: string | symbol,
index: number,
array: Array<string | symbol>,
) => boolean,
).length
) {
return handler(req, res, next);
} else if (
Expand Down
2 changes: 1 addition & 1 deletion packages/platform-express/adapters/express-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export class ExpressAdapter extends AbstractHttpAdapter {
if (Array.isArray(version)) {
if (
Array.isArray(extractedVersion) &&
version.filter(v => extractedVersion.includes(v)).length
version.filter(v => extractedVersion.includes(v as string)).length
) {
return handler(req, res, next);
} else if (
Expand Down

0 comments on commit aeadc14

Please sign in to comment.