import {fromJSON as behaviorItemFromJSON} from './registry'; import {Traversal} from './traversal'; export class TraversalAndSet extends Traversal { static type() { return 'traversal-and-set'; } constructor() { super(); this.value = undefined; } fromJSON(json) { super.fromJSON(json); this.value = behaviorItemFromJSON(json.value); return this; } traverse(context) { if (context) { return context.traverseAndSet(this.steps, this.value); } } toJSON() { return { ...super.toJSON(), type: 'traversal-and-set', value: this.value.toJSON(), }; } }