Skip to content

Commit f5b1621

Browse files
authored
Update packages/openapi-ts/src/plugins/@hey-api/sdk/operation.ts
1 parent c78c2ca commit f5b1621

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/openapi-ts/src/plugins/@hey-api/sdk/operation.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,11 @@ export const operationClasses = ({
130130
if (className) {
131131
// If root class is already within classCandidates or the same as className
132132
// do not add it again as this will cause a recursion issue.
133-
if (classCandidates.indexOf(rootClass) >= 0 || rootClass === className)
133+
if (classCandidates.includes(rootClass) || rootClass === className) {
134134
path = [...classCandidates, className];
135-
else path = [rootClass, ...classCandidates, className];
135+
} else {
136+
path = [rootClass, ...classCandidates, className];
137+
}
136138
}
137139

138140
classNames.set(rootClass, {

0 commit comments

Comments
 (0)