source: node_modules/@swagger-api/apidom-ns-openapi-3-0/es/traversal/visitor.mjs

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.7 KB
Line 
1import { keyMap as keyMapBase, isElement } from '@swagger-api/apidom-core';
2
3// getNodeType :: Node -> String
4export const getNodeType = element => {
5 if (!isElement(element)) {
6 return undefined;
7 }
8 return `${element.element.charAt(0).toUpperCase() + element.element.slice(1)}Element`;
9};
10
11/**
12 * There are unfortunately two `LinkElement` types. One is from base namespace
13 * and the other one if from this namespace. `LinkElement` from base namespace
14 * is used extremely rarely, so it's almost always safe during traversing
15 * to assume that `LinkElement` is element from this namespace.
16 *
17 * To be 100% sure that currently visiting `LinkElement` is from this namespace
18 * use `isLinkElement` predicate from this namespace to assert for it.
19 */
20
21export const keyMap = {
22 CallbackElement: ['content'],
23 ComponentsElement: ['content'],
24 ContactElement: ['content'],
25 DiscriminatorElement: ['content'],
26 Encoding: ['content'],
27 Example: ['content'],
28 ExternalDocumentationElement: ['content'],
29 HeaderElement: ['content'],
30 InfoElement: ['content'],
31 LicenseElement: ['content'],
32 MediaTypeElement: ['content'],
33 OAuthFlowElement: ['content'],
34 OAuthFlowsElement: ['content'],
35 OpenApi3_0Element: ['content'],
36 OperationElement: ['content'],
37 ParameterElement: ['content'],
38 PathItemElement: ['content'],
39 PathsElement: ['content'],
40 ReferenceElement: ['content'],
41 RequestBodyElement: ['content'],
42 ResponseElement: ['content'],
43 ResponsesElement: ['content'],
44 SchemaElement: ['content'],
45 SecurityRequirementElement: ['content'],
46 SecuritySchemeElement: ['content'],
47 ServerElement: ['content'],
48 ServerVariableElement: ['content'],
49 TagElement: ['content'],
50 ...keyMapBase
51};
Note: See TracBrowser for help on using the repository browser.