UNPKG

@azizbecha/strkit

Version:

strkit is a utility library offering a collection of essential string functions including validation, case conversion, truncation, and more. Ideal for both JavaScript and TypeScript developers to simplify string operations in their applications.

11 lines (10 loc) 363 B
/** * Converts degrees to radians. * Accepts both numbers and numeric strings. * @param degrees - The angle in degrees (number or numeric string). * @returns The angle in radians. * @throws Error if the input is not a valid number. * @example * toRadians(180); // Output: 3.14159... */ export default function toRadians(degrees: number | string): number;