UNPKG

@mirad-work/sms-core

Version:

A framework-agnostic TypeScript SMS service core with provider abstraction for Iranian SMS providers

37 lines 1.2 kB
/** * URL utility functions for the SMS service * Provides common URL manipulation functionality used across drivers */ /** * Build URL with query parameters * Converts a parameters object into URL query string * * @param baseUrl - The base URL to append parameters to * @param params - Object containing key-value pairs for query parameters * @returns Complete URL with query parameters * * @example * ```typescript * const url = buildUrlWithParams( * 'https://api.example.com/send', * { receptor: '1234567890', message: 'Hello' } * ); * // Returns: 'https://api.example.com/send?receptor=1234567890&message=Hello' * ``` */ export declare function buildUrlWithParams(baseUrl: string, params: Record<string, unknown>): string; /** * Validate if a string is a valid URL * * @param url - The URL string to validate * @returns True if the URL is valid, false otherwise */ export declare function isValidUrl(url: string): boolean; /** * Safely encode a value for use in URL parameters * * @param value - The value to encode * @returns Encoded string value */ export declare function encodeUrlParameter(value: unknown): string; //# sourceMappingURL=url-utils.d.ts.map