UNPKG

@yeepay/yop-nodejs-sdk

Version:

YOP NodeJS SDK with TypeScript support

37 lines (36 loc) 1.24 kB
import { Request } from '../types.js'; export declare class HttpUtils { /** * Normalizes a value by encoding special characters * @param value - The value to normalize * @returns Normalized string */ static normalize(value: any): string; /** * Converts a string to bytes (UTF-8 encoding) * @param str - The string to convert * @returns Array of bytes */ static stringToByte(str: string): number[]; /** * Encodes parameters in a request * @param req - The request containing parameters * @returns Encoded parameters */ static encodeParams(req: Request): Record<string, string>; /** * Checks if a string starts with a substring * @param haystack - The string to check * @param needle - The substring to look for * @returns True if haystack starts with needle */ static startsWith(haystack: string, needle: string): boolean; /** * Checks if a string ends with a substring * @param haystack - The string to check * @param needle - The substring to look for * @returns True if haystack ends with needle */ static endsWith(haystack: string, needle: string): boolean; } export default HttpUtils;