Skip to content

Commit

Permalink
feat(apidom-ls): make variable names explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
kowalczyk-krzysztof committed Dec 15, 2023
1 parent 9d61642 commit bfa1617
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions packages/apidom-ls/src/services/validation/linter-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1018,25 +1018,24 @@ export const standardLinterfunctions: FunctionItem[] = [

const parameterElements: Element[] = [];

const isParameterPolymorphicCheck = (el: Element): boolean => el.element === 'parameter';
const isParameterElement = (el: Element): boolean => el.element === 'parameter';

pathItemElement.forEach((el) => {
if (el.element === 'parameters') {
const parametersObject = pathItemElement.get('parameters');
if (isArrayElement(parametersObject)) {
parametersObject.forEach((parameter) => {
if (isParameterPolymorphicCheck(parameter)) {
const pathItemParameterElements = pathItemElement.get('parameters');
if (isArrayElement(pathItemParameterElements)) {
pathItemParameterElements.forEach((parameter) => {
if (isParameterElement(parameter)) {
parameterElements.push(parameter);
}
});
}
}
if (el.element === 'operation') {
// @ts-ignore
const parameters = el.get('parameters');
if (isArrayElement(parameters)) {
parameters.forEach((parameter) => {
if (isParameterPolymorphicCheck(parameter)) {
const operationParameterElements = (el as ObjectElement).get('parameters');
if (isArrayElement(operationParameterElements)) {
operationParameterElements.forEach((parameter) => {
if (isParameterElement(parameter)) {
parameterElements.push(parameter);
}
});
Expand Down

0 comments on commit bfa1617

Please sign in to comment.