@kubb/ast 5.0.0-beta.33 → 5.0.0-beta.34
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/README.md +15 -5
- package/dist/index.cjs +24 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.js +23 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<h1>@kubb/ast</h1>
|
|
3
2
|
<a href="https://kubb.dev" target="_blank" rel="noopener noreferrer">
|
|
4
|
-
<img
|
|
3
|
+
<img src="https://kubb.dev/og.png" alt="Kubb banner">
|
|
5
4
|
</a>
|
|
6
5
|
|
|
7
6
|
[![npm version][npm-version-src]][npm-version-href]
|
|
@@ -11,7 +10,7 @@
|
|
|
11
10
|
[![Sponsors][sponsors-src]][sponsors-href]
|
|
12
11
|
|
|
13
12
|
<h4>
|
|
14
|
-
<a href="https://kubb.dev
|
|
13
|
+
<a href="https://kubb.dev" target="_blank">Documentation</a>
|
|
15
14
|
<span> · </span>
|
|
16
15
|
<a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Report Bug</a>
|
|
17
16
|
<span> · </span>
|
|
@@ -19,7 +18,13 @@
|
|
|
19
18
|
</h4>
|
|
20
19
|
</div>
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
<br />
|
|
22
|
+
|
|
23
|
+
# @kubb/ast
|
|
24
|
+
|
|
25
|
+
### Spec-agnostic AST layer for Kubb
|
|
26
|
+
|
|
27
|
+
Defines the node tree, visitor pattern, factory functions, and type guards used across every Kubb code generation plugin.
|
|
23
28
|
|
|
24
29
|
## Imports
|
|
25
30
|
|
|
@@ -127,9 +132,10 @@ extractRefName('#/components/schemas/Pet') // 'Pet'
|
|
|
127
132
|
|
|
128
133
|
## Supporting Kubb
|
|
129
134
|
|
|
130
|
-
Kubb is an
|
|
135
|
+
Kubb is an open source project, and its development is funded entirely by sponsors. If you would like to become a sponsor, please consider:
|
|
131
136
|
|
|
132
137
|
- [Become a Sponsor on GitHub](https://github.com/sponsors/stijnvanhulle)
|
|
138
|
+
- [See sponsorship tiers and our sponsors](https://kubb.dev/sponsors)
|
|
133
139
|
|
|
134
140
|
<p align="center">
|
|
135
141
|
<a href="https://github.com/sponsors/stijnvanhulle">
|
|
@@ -137,6 +143,10 @@ Kubb is an MIT-licensed open source project with its ongoing development made po
|
|
|
137
143
|
</a>
|
|
138
144
|
</p>
|
|
139
145
|
|
|
146
|
+
## License
|
|
147
|
+
|
|
148
|
+
[MIT](https://github.com/kubb-labs/kubb/blob/main/licenses/LICENSE-MIT)
|
|
149
|
+
|
|
140
150
|
<!-- Badges -->
|
|
141
151
|
|
|
142
152
|
[npm-version-src]: https://img.shields.io/npm/v/@kubb/ast?flat&colorA=18181B&colorB=f58517
|
package/dist/index.cjs
CHANGED
|
@@ -419,6 +419,28 @@ function isKind(kind) {
|
|
|
419
419
|
return (node) => node.kind === kind;
|
|
420
420
|
}
|
|
421
421
|
/**
|
|
422
|
+
* Returns `true` when the input is an `InputNode`.
|
|
423
|
+
*
|
|
424
|
+
* @example
|
|
425
|
+
* ```ts
|
|
426
|
+
* if (isInputNode(node)) {
|
|
427
|
+
* console.log(node.schemas.length)
|
|
428
|
+
* }
|
|
429
|
+
* ```
|
|
430
|
+
*/
|
|
431
|
+
const isInputNode = isKind("Input");
|
|
432
|
+
/**
|
|
433
|
+
* Returns `true` when the input is an `OutputNode`.
|
|
434
|
+
*
|
|
435
|
+
* @example
|
|
436
|
+
* ```ts
|
|
437
|
+
* if (isOutputNode(node)) {
|
|
438
|
+
* console.log(node.files.length)
|
|
439
|
+
* }
|
|
440
|
+
* ```
|
|
441
|
+
*/
|
|
442
|
+
const isOutputNode = isKind("Output");
|
|
443
|
+
/**
|
|
422
444
|
* Returns `true` when the input is an `OperationNode`.
|
|
423
445
|
*
|
|
424
446
|
* @example
|
|
@@ -2711,7 +2733,9 @@ exports.findCircularSchemas = findCircularSchemas;
|
|
|
2711
2733
|
exports.findDiscriminator = findDiscriminator;
|
|
2712
2734
|
exports.httpMethods = httpMethods;
|
|
2713
2735
|
exports.isHttpOperationNode = isHttpOperationNode;
|
|
2736
|
+
exports.isInputNode = isInputNode;
|
|
2714
2737
|
exports.isOperationNode = isOperationNode;
|
|
2738
|
+
exports.isOutputNode = isOutputNode;
|
|
2715
2739
|
exports.isSchemaNode = isSchemaNode;
|
|
2716
2740
|
exports.isStringType = isStringType;
|
|
2717
2741
|
exports.mergeAdjacentObjectsLazy = mergeAdjacentObjectsLazy;
|