UNPKG

nhb-toolbox

Version:

A versatile collection of smart, efficient, and reusable utility functions, classes and types for everyday development needs.

45 lines (44 loc) 1.52 kB
import type { Numeric } from '../types/index'; /** * * Check if a number is even or not. * * @param input The number or numeric string to check. * @returns Boolean: `true` if even and `false` if not even. */ export declare const isEven: (input: Numeric) => boolean; /** * * Checks if a number is odd or not. * * @param input The number or numeric string to check. * @returns Boolean: `true` if odd and `false` if not odd. */ export declare const isOdd: (input: Numeric) => boolean; /** * * Checks if a number is a multiple of another number. * * @param input - The number to check. * @param multipleOf - The number to check against. * @returns `true` if `input` is a multiple of `multipleOf`, otherwise `false`. */ export declare const isMultiple: (input: number, multipleOf: number) => boolean; /** * * Checks if a number is a perfect square. * * @param num The number to check. * @returns `true` if the number is a perfect square, otherwise `false`. */ export declare function isPerfectSquare(num: number): boolean; /** * * Checks if a number is part of the Fibonacci sequence. * * @param num The number to check. * @returns `true` if the number is a Fibonacci number, otherwise `false`. */ export declare function isFibonacci(num: number): boolean; /** * * Checks whether any input is not a finite number. * * @param numbers - The list of numbers to validate. * @returns `true` if any input is not finite. */ export declare function areInvalidNumbers(...numbers: number[]): boolean;