persona-community-5/.pnpm-store/v3/files/ec/ee518ebeed5e997124e3125de27bd112c4e5064e9ac176cdacdd80dcafe589e26ee185413e407597a002a9d579ab87395e40725df6032f16562e2a0e22b5b3
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

20 lines
571 B
Plaintext

import { checkIfMatchByStrategy, filter } from './filter-helper';
import type { Oas2Decorator, Oas3Decorator } from '../../../visitors';
const DEFAULT_STRATEGY = 'any';
export const FilterIn: Oas3Decorator | Oas2Decorator = ({ property, value, matchStrategy }) => {
const strategy = matchStrategy || DEFAULT_STRATEGY;
const filterInCriteria = (item: any) =>
item?.[property] && !checkIfMatchByStrategy(item?.[property], value, strategy);
return {
any: {
enter: (node, ctx) => {
filter(node, ctx, filterInCriteria);
},
},
};
};