@pact-foundation/pact
Version:
Pact for all things Javascript
26 lines (25 loc) • 1.05 kB
TypeScript
import type { Matcher, Rules, StatusCodeMatcher } from '../v3/types';
/**
* Converts a matcher to the FFI format expected by pact-core
* @param matcher The matcher to convert
* @returns The matcher in FFI format
*/
export declare const convertMatcherToFFI: (matcher: Matcher<unknown>) => Record<string, unknown>;
/**
* Converts a StatusCodeMatcher to the FFI matching rules format expected by pact-core
* @param matcher The status code matcher
* @returns The matching rules in FFI format
*/
export declare const convertStatusMatcherToFFI: (matcher: StatusCodeMatcher<number>) => Record<string, unknown>;
/**
* Validates that the rules parameter is of type Rules
* @param rules The rules to validate
* @throws Error if rules is not a valid Rules object
*/
export declare const validateRules: (rules: Rules) => void;
/**
* Converts Rules format to FFI matching rules format
* @param rules Rules in the user-friendly format
* @returns Rules in FFI format
*/
export declare const convertRulesToFFI: (rules: Rules) => Record<string, unknown>;