fraction.js
Advanced tools
| /* | ||
| Fraction.js v5.3.1 8/17/2025 | ||
| Fraction.js v5.3.2 8/22/2025 | ||
| https://raw.org/article/rational-numbers-in-javascript/ | ||
@@ -4,0 +4,0 @@ |
+51
-37
@@ -5,23 +5,5 @@ /** | ||
| export interface NumeratorDenominator { | ||
| n: number | bigint; | ||
| d: number | bigint; | ||
| } | ||
| export type FractionInput = | ||
| | Fraction | ||
| | number | ||
| | bigint | ||
| | string | ||
| | [number | bigint | string, number | bigint | string] | ||
| | NumeratorDenominator; | ||
| export type FractionParam = { | ||
| (numerator: number | bigint, denominator: number | bigint): Fraction; | ||
| (num: FractionInput): Fraction; | ||
| }; | ||
| declare class Fraction { | ||
| constructor(); | ||
| constructor(num: FractionInput); | ||
| constructor(num: Fraction.FractionInput); | ||
| constructor(numerator: number | bigint, denominator: number | bigint); | ||
@@ -36,13 +18,13 @@ | ||
| add: FractionParam; | ||
| sub: FractionParam; | ||
| mul: FractionParam; | ||
| div: FractionParam; | ||
| pow: FractionParam; | ||
| log: FractionParam; | ||
| gcd: FractionParam; | ||
| lcm: FractionParam; | ||
| add: Fraction.FractionParam; | ||
| sub: Fraction.FractionParam; | ||
| mul: Fraction.FractionParam; | ||
| div: Fraction.FractionParam; | ||
| pow: Fraction.FractionParam; | ||
| log: Fraction.FractionParam; | ||
| gcd: Fraction.FractionParam; | ||
| lcm: Fraction.FractionParam; | ||
| mod(): Fraction; | ||
| mod(num: FractionInput): Fraction; | ||
| mod(num: Fraction.FractionInput): Fraction; | ||
@@ -52,3 +34,3 @@ ceil(places?: number): Fraction; | ||
| round(places?: number): Fraction; | ||
| roundTo: FractionParam; | ||
| roundTo: Fraction.FractionParam; | ||
@@ -58,9 +40,9 @@ inverse(): Fraction; | ||
| equals(num: FractionInput): boolean; | ||
| lt(num: FractionInput): boolean; | ||
| lte(num: FractionInput): boolean; | ||
| gt(num: FractionInput): boolean; | ||
| gte(num: FractionInput): boolean; | ||
| compare(num: FractionInput): number; | ||
| divisible(num: FractionInput): boolean; | ||
| equals(num: Fraction.FractionInput): boolean; | ||
| lt(num: Fraction.FractionInput): boolean; | ||
| lte(num: Fraction.FractionInput): boolean; | ||
| gt(num: Fraction.FractionInput): boolean; | ||
| gte(num: Fraction.FractionInput): boolean; | ||
| compare(num: Fraction.FractionInput): number; | ||
| divisible(num: Fraction.FractionInput): boolean; | ||
@@ -73,4 +55,36 @@ valueOf(): number; | ||
| clone(): Fraction; | ||
| static Fraction: typeof Fraction; | ||
| static default: typeof Fraction; | ||
| } | ||
| export = Fraction; | ||
| declare namespace Fraction { | ||
| /** | ||
| * Interface representing a fraction with numerator and denominator. | ||
| */ | ||
| interface NumeratorDenominator { | ||
| n: number | bigint; | ||
| d: number | bigint; | ||
| } | ||
| /** | ||
| * Type for handling multiple types of input for Fraction operations. | ||
| */ | ||
| type FractionInput = | ||
| | Fraction | ||
| | number | ||
| | bigint | ||
| | string | ||
| | [number | bigint | string, number | bigint | string] | ||
| | NumeratorDenominator; | ||
| /** | ||
| * Function signature for Fraction operations like add, sub, mul, etc. | ||
| */ | ||
| type FractionParam = { | ||
| (numerator: number | bigint, denominator: number | bigint): Fraction; | ||
| (num: FractionInput): Fraction; | ||
| }; | ||
| } | ||
| export = Fraction; |
+1
-1
| { | ||
| "name": "fraction.js", | ||
| "title": "Fraction.js", | ||
| "version": "5.3.1", | ||
| "version": "5.3.2", | ||
| "description": "The RAW rational numbers library", | ||
@@ -6,0 +6,0 @@ "homepage": "https://raw.org/article/rational-numbers-in-javascript/", |
+1
-1
| /** | ||
| * @license Fraction.js v5.3.1 8/17/2025 | ||
| * @license Fraction.js v5.3.2 8/22/2025 | ||
| * https://raw.org/article/rational-numbers-in-javascript/ | ||
@@ -4,0 +4,0 @@ * |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
147953
0.36%4725
0.25%