@swagger-api/apidom-core 1.0.0-rc.2 → 1.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +6 -6
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.0.0-rc.4](https://github.com/swagger-api/apidom/compare/v1.0.0-rc.3...v1.0.0-rc.4) (2025-11-25)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @swagger-api/apidom-core
|
|
9
|
+
|
|
10
|
+
# [1.0.0-rc.3](https://github.com/swagger-api/apidom/compare/v1.0.0-rc.2...v1.0.0-rc.3) (2025-11-07)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @swagger-api/apidom-core
|
|
13
|
+
|
|
6
14
|
# [1.0.0-rc.2](https://github.com/swagger-api/apidom/compare/v1.0.0-rc.1...v1.0.0-rc.2) (2025-11-07)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @swagger-api/apidom-core
|
package/README.md
CHANGED
|
@@ -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 [
|
|
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).
|
|
19
19
|
|
|
20
20
|
```js
|
|
@@ -88,7 +88,7 @@ const replace = new NumberElement(4);
|
|
|
88
88
|
transclude(search, replace, element); // => ArrayElement<[1, 4, 3]>
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
When multiple transclusions are going to be performed use [Transcluder
|
|
91
|
+
When multiple transclusions are going to be performed use [Transcluder class](https://github.com/swagger-api/apidom/blob/main/packages/apidom-core/src/transcluder/Transcluder.ts)
|
|
92
92
|
for optimal performance.
|
|
93
93
|
|
|
94
94
|
```js
|
|
@@ -97,7 +97,7 @@ import { Transcluder, ArrayElement, NumberElement } from '@swagger-api/apidom-co
|
|
|
97
97
|
const element = new ArrayElement([1, 2, 3]);
|
|
98
98
|
const search = element.get(1);
|
|
99
99
|
const replace = new NumberElement(4);
|
|
100
|
-
const transcluder = Transcluder({ element });
|
|
100
|
+
const transcluder = new Transcluder({ element });
|
|
101
101
|
|
|
102
102
|
transcluder.transclude(search, replace); // => ArrayElement<[1, 4, 3]>
|
|
103
103
|
```
|
|
@@ -578,14 +578,14 @@ objectElement.getMember('info').value.id; // 'OnReGGrO7fMd9ztacvGfwGbOdGKuOFLiQQ
|
|
|
578
578
|
|
|
579
579
|
### visit
|
|
580
580
|
|
|
581
|
-
[visit](https://github.com/swagger-api/apidom/blob/main/packages/apidom-core/src/traversal/visitor.ts#
|
|
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-
|
|
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 });
|
|
|
604
604
|
const newElement = visit(element, visitor); // => ObjectElement<{a: 2}>
|
|
605
605
|
```
|
|
606
606
|
|
|
607
|
-
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.
|
|
610
610
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swagger-api/apidom-core",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.4",
|
|
4
4
|
"description": "Tools for manipulating ApiDOM structures.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"license": "Apache-2.0",
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@babel/runtime-corejs3": "^7.26.10",
|
|
45
|
-
"@swagger-api/apidom-ast": "^1.0.0-rc.
|
|
46
|
-
"@swagger-api/apidom-error": "^1.0.0-rc.
|
|
45
|
+
"@swagger-api/apidom-ast": "^1.0.0-rc.4",
|
|
46
|
+
"@swagger-api/apidom-error": "^1.0.0-rc.4",
|
|
47
47
|
"@types/ramda": "~0.30.0",
|
|
48
48
|
"minim": "~0.23.8",
|
|
49
49
|
"ramda": "~0.30.0",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"README.md",
|
|
63
63
|
"CHANGELOG.md"
|
|
64
64
|
],
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "ee774281a884eedf1445699d8f2b0092e50db432"
|
|
66
66
|
}
|