@kubb/ast 5.0.0-alpha.36 → 5.0.0-alpha.38

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/ast",
3
- "version": "5.0.0-alpha.36",
3
+ "version": "5.0.0-alpha.38",
4
4
  "description": "Spec-agnostic AST layer for Kubb. Defines nodes, visitor pattern, and factory functions used across codegen plugins.",
5
5
  "keywords": [
6
6
  "kubb",
package/src/index.ts CHANGED
@@ -42,4 +42,4 @@ export {
42
42
  isStringType,
43
43
  syncSchemaRef,
44
44
  } from './utils.ts'
45
- export { collect, composeTransformers, transform, walk } from './visitor.ts'
45
+ export { collect, transform, walk } from './visitor.ts'
package/src/visitor.ts CHANGED
@@ -485,47 +485,6 @@ export function transform(node: Node, options: TransformOptions): Node {
485
485
  return node
486
486
  }
487
487
  }
488
-
489
- /**
490
- * Composes multiple visitors into one visitor, applied left to right.
491
- *
492
- * For each node kind, output from one visitor is input to the next.
493
- * If a visitor returns `undefined`, the previous node value is kept.
494
- *
495
- * @example
496
- * ```ts
497
- * const visitor = composeTransformers(
498
- * { operation: (node) => ({ ...node, operationId: `a_${node.operationId}` }) },
499
- * { operation: (node) => ({ ...node, operationId: `b_${node.operationId}` }) },
500
- * )
501
- * ```
502
- */
503
- export function composeTransformers(...visitors: Array<Visitor>): Visitor {
504
- return {
505
- input(node, context) {
506
- return visitors.reduce<InputNode>((acc, v) => v.input?.(acc, context) ?? acc, node)
507
- },
508
- output(node, context) {
509
- return visitors.reduce<OutputNode>((acc, v) => v.output?.(acc, context) ?? acc, node)
510
- },
511
- operation(node, context) {
512
- return visitors.reduce<OperationNode>((acc, v) => v.operation?.(acc, context) ?? acc, node)
513
- },
514
- schema(node, context) {
515
- return visitors.reduce<SchemaNode>((acc, v) => v.schema?.(acc, context) ?? acc, node)
516
- },
517
- property(node, context) {
518
- return visitors.reduce<PropertyNode>((acc, v) => v.property?.(acc, context) ?? acc, node)
519
- },
520
- parameter(node, context) {
521
- return visitors.reduce<ParameterNode>((acc, v) => v.parameter?.(acc, context) ?? acc, node)
522
- },
523
- response(node, context) {
524
- return visitors.reduce<ResponseNode>((acc, v) => v.response?.(acc, context) ?? acc, node)
525
- },
526
- }
527
- }
528
-
529
488
  /**
530
489
  * Runs a depth-first synchronous collection pass.
531
490
  *