PipelineOutput

PipelineOutput class API reference

Properties

errorMessages

This property returns an array of PipeEngineErrorMessage.

const errorMessages: Array<PipeEngineErrorMessage> = pipelineOutput.errorMessages;

warningMessages

This property returns an array of PipeEngineWarningMessage.

const warningMessages: Array<PipeEngineWarningMessage> = pipelineOutput.warningMessages;

informationMessages

This property returns an array of PipeEngineInformationMessage.

const informationMessages: Array<PipeEngineInformationMessage> = pipelineOutput.informationMessages;

outputs

This property returns an array of PipeEngineRuleOutput.

const outputs: Array<PipeEngineRuleOutput> = pipelineOutput.outputs;

Methods

constructor

This method is used to create a new instance of the PipelineOutput class.

const pipelineOutput = new PipelineOutput(outputs, {
  errorMessages: errors,
  warningMessages: warnings,
  informationMessages: informations,
});

hasError

This method returns a boolean indicating if the pipeline returned an error.

const hasError: boolean = pipelineOutput.hasError;

hasWarning

This method returns a boolean indicating if the pipeline returned a warning.

const hasWarning: boolean = pipelineOutput.hasWarning;

hasInformation

This method returns a boolean indicating if the pipeline returned an information.

const hasInformation: boolean = pipelineOutput.hasInformation;

logErrorMessages

This method prints the error messages to the console.

logErrorMessages(): void;

logWarningMessages

This method prints the warning messages to the console.

logWarningMessages(): void;

logInformationMessages

This method prints the information messages to the console.

logInformationMessages(): void;

logAll

This method prints the error, warning and information messages to the console.

logAll(): void;

mapFiles

This method maps files in place. It's convenient if you want to run some post-process on the files.

pipelineOutput.mapFiles((file: FilesOutput['files'][number]) => {
    // Your mapping function here
});

writeToDisk

This method writes the output of the parsers to your file system.

const { errors, outputPaths } = await pipelineOutput.writeToDisk(directoryPath: string)

Last updated