Home > @rushstack/tree-pattern > ITreePatternCaptureSet

ITreePatternCaptureSet type

Provides additional detail about the success or failure of TreePattern.match().

Signature:

export declare type ITreePatternCaptureSet = {
    [tagName: string]: TreeNode;
} | {
    failPath: string;
};

References: TreeNode

Remarks

On success, the object will contain keys for any successfully matched tags, as defined using TreePattern.tag().

On failure, the failPath member will indicate the JSON path of the node that failed to match.