You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/apidom-ast/README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,18 +38,18 @@ along with [formatters for canonical block scalars](https://github.com/swagger-a
38
38
39
39
## Traversal
40
40
41
-
`@swagger-api/apidom-ast` comes with its own traversal algorithm convenient for traversing [CST](https://en.wikipedia.org/wiki/Parse_tree) or [AST](https://en.wikipedia.org/wiki/AST).
41
+
`@swagger-api/apidom-ast` comes with its own traversal algorithm convenient for traversing [CST](https://en.wikipedia.org/wiki/Parse_tree) or [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree).
42
42
43
43
### visit
44
44
45
-
[visit](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ast/src/visitor.ts#L214) will walk through an CST/AST using a depth first traversal, calling
45
+
[visit](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ast/src/traversal/visitor.ts#L442) will walk through an CST/AST using a depth first traversal, calling
46
46
the visitor's enter function at each node in the traversal, and calling the
47
47
leave function after visiting that node and all of its child nodes.
48
48
49
49
By returning different values from the enter and leave functions, the
50
50
behavior of the visitor can be altered, including skipping over a sub-tree of
51
51
the Node (by returning false), editing the Node Tree by returning a value or null
52
-
to remove the value, or to stop the whole traversal by returning [BREAK](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ast/src/visitor.ts#L64).
52
+
to remove the value, or to stop the whole traversal by returning [BREAK](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ast/src/traversal/visitor.ts#L52).
53
53
54
54
When using `visit` to edit an Node Tree, the original Node Tree will not be modified, and
55
55
a new version of the Node Tree with the changes applied will be returned from the
<aname="keyMap"></a>`keyMap` | `Object` | `null` | Defines how nodes map to it's children.
91
91
<aname="state"></a>`state` | `Object` | `{}` | Additional state that is provided to the visitor. State is merged inti visitor object in following manner: `Object.assign(visitor, state)`
92
92
<aname="breakSymbol"></a>`breakSymbol` | `Object` | `{}` | Defines a symbol that can break the traversal. Symbol is compared by strict equality (`===`).
93
-
<aname="visitFnGetter"></a>`visitFnGetter` | `Function` | [getVisitFn](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ast/src/visitor.ts#L33) | Function that extract appropriate method from the visitor given specific Node type.
94
-
<aname="nodeTypeGetter"></a>`nodeTypeGetter` | `Function` | [getNodeType](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ast/src/visitor.ts#L67) | Node type extractor function.
95
-
<aname="nodePredicate"><a/>`nodePredicate` | `Function` | [isNode](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ast/src/visitor.ts#L70) | Predicate that checks if particular Node can be really considered a Node.
93
+
<aname="visitFnGetter"></a>`visitFnGetter` | `Function` | [getVisitFn](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ast/src/traversal/visitor.ts#L12) | Function that extract appropriate method from the visitor given specific Node type.
94
+
<aname="nodeTypeGetter"></a>`nodeTypeGetter` | `Function` | [getNodeType](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ast/src/traversal/visitor.ts#L57) | Node type extractor function.
95
+
<aname="nodePredicate"><a/>`nodePredicate` | `Function` | [isNode](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ast/src/traversal/visitor.ts#L62) | Predicate that checks if particular Node can be really considered a Node.
96
96
<aname="detectCycles"><a/>`detectCycles` | `Boolean` | `true` | If the structure that needs to be traversed is represented as directed cyclic graph, `visit` will skip Nodes that have already been traversed to avoid infinite recursion.
Copy file name to clipboardExpand all lines: packages/apidom-core/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ You can install this package via [npm CLI](https://docs.npmjs.com/cli) by runnin
14
14
15
15
## Base namespace
16
16
17
-
Base namespace consists of [four higher order elements](https://github.com/swagger-api/apidom/tree/main/packages/apidom-core/src/elements) implemented on top
17
+
Base namespace consists of [three higher order elements](https://github.com/swagger-api/apidom/tree/main/packages/apidom-core/src/elements) implemented on top
18
18
of [primitive ones](https://github.com/refractproject/minim/tree/master/lib/primitives).
[visit](https://github.com/swagger-api/apidom/blob/main/packages/apidom-core/src/traversal/visitor.ts#L104-L103) will walk through an AST using a depth first traversal, calling
581
+
[visit](https://github.com/swagger-api/apidom/blob/main/packages/apidom-core/src/traversal/visitor.ts#L128) will walk through an AST using a depth first traversal, calling
582
582
the visitor's enter function at each node in the traversal, and calling the
583
583
leave function after visiting that node and all of its child nodes.
584
584
585
585
By returning different values from the enter and leave functions, the
586
586
behavior of the visitor can be altered, including skipping over a sub-tree of
587
587
the ApiDOM (by returning false), editing the ApiDOM by returning a value or null
588
-
to remove the value, or to stop the whole traversal by returning [BREAK](https://github.com/swagger-api/apidom/blob/main/packages/apidom-core/src/index.ts#L52).
588
+
to remove the value, or to stop the whole traversal by returning [BREAK](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ast/src/traversal/visitor.ts#L52).
589
589
590
590
When using `visit` to edit an ApiDOM, the original ApiDOM will not be modified, and
591
591
a new version of the ApiDOM with the changes applied will be returned from the
@@ -604,7 +604,7 @@ const element = new ObjectElement({ a: 1 });
This function originally comes from [@swagger-api/apidom-ast package](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ast/src/visitor.ts)
607
+
This function originally comes from [@swagger-api/apidom-ast package](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ast/src/traversal/visitor.ts)
608
608
and is originally designed to work with [CST](https://en.wikipedia.org/wiki/Parse_tree). `apidom-core` package
609
609
imports it, specializes it to work with ApiDOM and re-export it.
Traversing ApiDOM in this namespace is possible by using `visit` function from `apidom-core` package.
56
-
This package comes with its own [keyMap](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ns-api-design-systems/src/traversal/visitor.ts) and and [nodeTypeGetter](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ns-api-design-systems/src/traversal/visitor.ts).
56
+
This package comes with its own [keyMap](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ns-api-design-systems/src/traversal/visitor.ts#L16) and [nodeTypeGetter](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ns-api-design-systems/src/traversal/visitor.ts#L6).
57
57
To learn more about these `visit` configuration options please refer to [@swagger-api/apidom-ast documentation](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ast/README.md#visit).
Traversing ApiDOM in this namespace is possible by using `visit` function from `apidom-core` package.
56
-
This package comes with its own [keyMap](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ns-arazzo-1/src/traversal/visitor.ts) and [nodeTypeGetter](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ns-arazzo-1/src/traversal/visitor.ts).
56
+
This package comes with its own [keyMap](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ns-arazzo-1/src/traversal/visitor.ts#L18) and [nodeTypeGetter](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ns-arazzo-1/src/traversal/visitor.ts#L6).
57
57
To learn more about these `visit` configuration options please refer to [@swagger-api/apidom-ast documentation](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ast/README.md#visit).
Copy file name to clipboardExpand all lines: packages/apidom-ns-asyncapi-2/README.md
+41-41Lines changed: 41 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ You can install this package via [npm CLI](https://docs.npmjs.com/cli) by runnin
22
22
## AsyncApi 2.x.y namespace
23
23
24
24
AsyncApi 2.x.y namespace consists of [number of elements](https://github.com/swagger-api/apidom/tree/main/packages/apidom-ns-asyncapi-2/src/elements) implemented on top
25
-
of [primitive ones](https://github.com/refractproject/minim/tree/main/lib/primitives).
25
+
of [primitive ones](https://github.com/refractproject/minim/tree/master/lib/primitives).
Traversing ApiDOM in this namespace is possible by using `visit` function from `apidom-core` package.
65
-
This package comes with its own [keyMap](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ns-asyncapi-2/src/traversal/visitor.ts#L11) and [nodeTypeGetter](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ns-asyncapi-2/src/traversal/visitor.ts#L4).
65
+
This package comes with its own [keyMap](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ns-asyncapi-2/src/traversal/visitor.ts#L16) and [nodeTypeGetter](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ns-asyncapi-2/src/traversal/visitor.ts#L6).
66
66
To learn more about these `visit` configuration options please refer to [@swagger-api/apidom-ast documentation](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ast/README.md#visit).
67
67
68
68
```js
@@ -193,41 +193,41 @@ Only fully implemented specification objects should be checked here.
Traversing ApiDOM in this namespace is possible by using `visit` function from `apidom-core` package.
56
-
This package comes with its own [keyMap](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ns-json-schema-2019-09/src/traversal/visitor.ts#L11) and [nodeTypeGetter](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ns-json-schema-2019-09/src/traversal/visitor.ts#L4).
56
+
This package comes with its own [keyMap](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ns-json-schema-2019-09/src/traversal/visitor.ts#L8) and [nodeTypeGetter](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ns-json-schema-2019-09/src/traversal/visitor.ts#L3).
57
57
To learn more about these `visit` configuration options please refer to [@swagger-api/apidom-ast documentation](https://github.com/swagger-api/apidom/blob/main/packages/apidom-ast/README.md#visit).
0 commit comments