fix(oas31): fix recursive bug in hasUserEditedBody selector wrapper (#8499)

Refs #8498
This commit is contained in:
Vladimír Gorej
2023-03-21 21:22:23 +01:00
committed by GitHub
parent 35daf1979f
commit 25edb232f0
2 changed files with 7 additions and 4 deletions

View File

@@ -44,8 +44,10 @@ export const createOnlyOAS31SelectorWrapper =
(oriSelector, system) =>
(state, ...args) => {
if (system.getSystem().specSelectors.isOAS31()) {
const result = selector(state, ...args)
return typeof result === "function" ? result(system) : result
const selectedValue = selector(state, ...args)
return typeof selectedValue === "function"
? selectedValue(system)
: selectedValue
} else {
return oriSelector(...args)
}