[d24f17c] | 1 | "use strict";
|
---|
| 2 |
|
---|
| 3 | exports.__esModule = true;
|
---|
| 4 | exports.keyMap = exports.getNodeType = void 0;
|
---|
| 5 | var _apidomCore = require("@swagger-api/apidom-core");
|
---|
| 6 | // getNodeType :: Node -> String
|
---|
| 7 | const 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 | */
|
---|
| 23 | exports.getNodeType = getNodeType;
|
---|
| 24 | const 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_1Element: ['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 | }; |
---|