package.es.refractor.visitors.FallbackVisitor.mjs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of apidom-ns-api-design-systems Show documentation
Show all versions of apidom-ns-api-design-systems Show documentation
API Design Systems 2021-05-07 namespace for ApiDOM.
The newest version!
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
import Visitor from "./Visitor.mjs";
/**
* This visitor is responsible for falling back to current traversed element
* Given AsyncApi2Visitor expects ObjectElement to be traversed. If
* different Element is provided FallBackVisitor is responsible to assigning
* this Element as current element.
*/
class FallbackVisitor extends Visitor {
enter(element) {
this.element = cloneDeep(element);
return BREAK;
}
}
export default FallbackVisitor;