request-mocking-protocol
Version:
A protocol for declarative mocking of HTTP requests
13 lines • 688 B
TypeScript
/**
* A module to replace placeholders {{var}} in the string.
* Can be also used for objects within JSON.stringify replacer.
* Supports type hints, see tests.
*/
export declare function cloneWithPlaceholders<T extends object>(obj: T, variables?: Record<string, string>): T;
export declare function stringifyWithPlaceholders(obj: object, variables?: Record<string, string>): string;
type Result<T extends boolean> = T extends true ? string | number | boolean : string;
export declare function replacePlaceholders<T extends boolean = false>(value: string, variables: Record<string, string>, opts?: {
useTypes?: T;
}): Result<T>;
export {};
//# sourceMappingURL=placeholders.d.ts.map