method TransformationPipeline.prototype.transform
TransformationPipeline.prototype.transform(
rules: string[],
configuration: IConfiguration | ISource,
transformations?: TransformationType[],
): Promise<string[]>

Apply exclusion/inclusion pattern filters and then execute the requested transformations in canonical order.

The method follows a three-phase approach:

  1. Exclusions — rules matching any exclusion pattern are removed.
  2. Inclusions — if inclusion patterns are configured, only rules matching at least one pattern are kept.
  3. Transformations — each requested transformation is executed in the fixed canonical order, with before/after/error hooks invoked around each execution.

The method uses a readonly string[] internally during the transformation loop to avoid unnecessary array copies; it only materialises a mutable copy at the very end.

Parameters

rules: string[]
  • Input rule strings to transform
configuration: IConfiguration | ISource
  • Source or global configuration (supplies exclusion/inclusion patterns)
optional
transformations: TransformationType[]
  • Transformation types to apply (subset of TransformationType)

Return Type

Promise<string[]>

A new mutable array of transformed rules

Usage

import { TransformationPipeline } from ".";