persona-community-5/.pnpm-store/v3/files/df/a5b5e2279114922f3e1f335be11cb17e74ff4cc7f9165e8b0f82d91af93f9168a2bca8214f87d8d99bf739bd8130511f4931e4d14d68c6a4b22cc7678cd39a
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
553 B
Plaintext

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