UNPKG

@hgargg-0710/one

Version:

A tiny npm library purposed for providing beautiful solutions to frequent miniature (one-line/one-expression) tasks for various JS datatypes.

37 lines (36 loc) 1.15 kB
/** * Sums all the given numbers and returns the result */ export declare const sum: (...numbers: number[]) => number; /** * Returns the product of all the given numbers */ export declare const product: (...numbers: number[]) => number; /** * Returns the minimum value of the given numbers */ export declare const min: (...values: number[]) => number; /** * Returns the maximum value of the given numbers */ export declare const max: (...values: number[]) => number; /** * @returns whether the given number is even */ export declare const isEven: (x: number) => boolean; /** * @returns whether the given number is odd */ export declare const isOdd: (x: number) => boolean; /** * Using the given number `x`, constructs and returns a new number guaranteed to be odd - `2 * x + 1` */ export declare const makeOdd: (x: number) => number; /** * Using the given number `x`, constructs and returns a new number guaranteed to be even - "2 * x" */ export declare const makeEven: (x: number) => number; /** * Returns difference of `a` (defaults to 0) with sum of `b` */ export declare const difference: (a?: number, ...b: number[]) => number;