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:
579 bytes
|
Line | |
---|
1 | import stampit from 'stampit';
|
---|
2 | import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
---|
3 | import Visitor from "./Visitor.mjs";
|
---|
4 | /**
|
---|
5 | * This visitor is responsible for falling back to current traversed element
|
---|
6 | * Given JSONSchemaVisitor expects ObjectElement to be traversed. If
|
---|
7 | * different Element is provided FallBackVisitor is responsible to assigning
|
---|
8 | * this Element as current element.
|
---|
9 | */
|
---|
10 | const FallbackVisitor = stampit(Visitor, {
|
---|
11 | methods: {
|
---|
12 | enter(element) {
|
---|
13 | this.element = cloneDeep(element);
|
---|
14 | return BREAK;
|
---|
15 | }
|
---|
16 | }
|
---|
17 | });
|
---|
18 | export default FallbackVisitor; |
---|
Note:
See
TracBrowser
for help on using the repository browser.