package.es.refractor.predicates.mjs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of apidom-ns-openapi-3-0 Show documentation
Show all versions of apidom-ns-openapi-3-0 Show documentation
OpenAPI 3.0.x namespace for ApiDOM.
import { startsWith } from 'ramda';
import { isStringElement, isObjectElement, toValue } from '@swagger-api/apidom-core';
export const isReferenceLikeElement = element => {
return isObjectElement(element) && element.hasKey('$ref');
};
export const isServerLikeElement = isObjectElement;
export const isTagLikeElement = isObjectElement;
export const isOpenApiExtension = element => {
// @ts-ignore
return isStringElement(element.key) && startsWith('x-', toValue(element.key));
};