Skip to content

Commit

Permalink
Merge branch 'main' into feat/mutualtls-refractor
Browse files Browse the repository at this point in the history
  • Loading branch information
kowalczyk-krzysztof committed Feb 12, 2024
2 parents 049004d + e103eb4 commit eed8f16
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
33 changes: 30 additions & 3 deletions packages/apidom-ns-openapi-3-0/src/refractor/toolbox.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
import { createNamespace, isStringElement } from '@swagger-api/apidom-core';
import {
isElement,
isStringElement,
isArrayElement,
isObjectElement,
isMemberElement,
createNamespace,
includesClasses,
hasElementSourceMap,
} from '@swagger-api/apidom-core';

import * as openApi3_0Predicates from '../predicates';
import * as refractorPredicates from './predicates';
import openApi3_0Namespace from '../namespace';

export type Predicates = typeof openApi3_0Predicates & {
isElement: typeof isElement;
isStringElement: typeof isStringElement;
isArrayElement: typeof isArrayElement;
isObjectElement: typeof isObjectElement;
isMemberElement: typeof isMemberElement;
includesClasses: typeof includesClasses;
hasElementSourceMap: typeof hasElementSourceMap;
};

const createToolbox = () => {
const namespace = createNamespace(openApi3_0Namespace);
const predicates = { ...refractorPredicates, ...openApi3_0Predicates, isStringElement };
const predicates: Predicates = {
...openApi3_0Predicates,
isElement,
isStringElement,
isArrayElement,
isObjectElement,
isMemberElement,
includesClasses,
hasElementSourceMap,
};

return { predicates, namespace };
};
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-3-1/src/refractor/toolbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
isMemberElement,
createNamespace,
includesClasses,
hasElementSourceMap,
} from '@swagger-api/apidom-core';
import { isServersElement } from '@swagger-api/apidom-ns-openapi-3-0';

Expand All @@ -20,6 +21,7 @@ export type Predicates = typeof openApi3_1Predicates & {
isMemberElement: typeof isMemberElement;
isServersElement: typeof isServersElement;
includesClasses: typeof includesClasses;
hasElementSourceMap: typeof hasElementSourceMap;
};

const createToolbox = () => {
Expand All @@ -33,6 +35,7 @@ const createToolbox = () => {
isMemberElement,
isServersElement,
includesClasses,
hasElementSourceMap,
};

return { predicates, namespace };
Expand Down

0 comments on commit eed8f16

Please sign in to comment.