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

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

Initial commit

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