@synnaxlabs/x 0.52.4 → 0.52.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
 
2
- > @synnaxlabs/x@0.52.4 build /home/runner/work/synnax/synnax/x/ts
2
+ > @synnaxlabs/x@0.52.5 build /home/runner/work/synnax/synnax/x/ts
3
3
  > tsc --noEmit && vite build
4
4
 
5
5
   Synnax - Production mode
@@ -10,8 +10,8 @@ rendering chunks...
10
10
  
11
11
  [vite:dts] Start generate declaration files...
12
12
  computing gzip size...
13
- dist/x.js 184.82 kB │ gzip: 45.23 kB
14
- [vite:dts] Declaration files built in 4547ms.
13
+ dist/x.js 184.55 kB │ gzip: 45.19 kB
14
+ [vite:dts] Declaration files built in 4478ms.
15
15
  
16
- dist/x.cjs 103.12 kB │ gzip: 32.16 kB
17
- ✓ built in 5.16s
16
+ dist/x.cjs 102.92 kB │ gzip: 32.11 kB
17
+ ✓ built in 5.06s
@@ -1,42 +1,4 @@
1
1
  import { bounds } from '../spatial/bounds';
2
- /**
3
- * Rounds a number based on the span of the provided bounds. The function adjusts the
4
- * number of decimal places based on the magnitude of the bounds.
5
- *
6
- * @param value - The number to be rounded.
7
- * @param bounds - The bounds object containing the min and max values that provide
8
- * context for rounding.
9
- * @returns The rounded number.
10
- *
11
- * Rules for decimal places:
12
- * - For spans >= 1000: 2 decimal places
13
- * - For spans >= 1: 3 decimal places
14
- * - For spans < 1: 2 decimal places + 2 decimal places past the precision of the span
15
- *
16
- * Edge cases:
17
- * - If the value is `NaN`, returns `NaN`
18
- * - If the value is `Infinity` or `-Infinity`, returns the original value
19
- * - If the bounds span is 0, returns the original value
20
- *
21
- * Examples:
22
- * ```typescript
23
- * // Large spans (>= 1000) use 2 decimal places
24
- * roundBySpan(1234.5678, { start: 0, end: 2000 }); // 1200
25
- *
26
- * // Medium spans (>= 1) use 3 decimal places
27
- * roundBySpan(1.23456, { start: 0, end: 2 }); // 1.235
28
- *
29
- * // Small spans (< 1) adapt based on the span
30
- * roundBySpan(0.123456, { start: 0, end: 0.2 }); // 0.123 = 1 + 2 decimal places
31
- * roundBySpan(0.0001234, { start: 0, end: 0.001 }); // 0.00012 = 3 + 2 decimal places
32
- *
33
- * // Edge cases
34
- * roundBySpan(NaN, { start: 0, end: 1 }); // NaN
35
- * roundBySpan(Infinity, { start: 0, end: 1 }); // Infinity
36
- * roundBySpan(123, { start: 1, end: 1 }); // 123 (span is 0)
37
- * ```
38
- */
39
- export declare const roundBySpan: (value: number, b: bounds.Bounds<number>) => number;
40
2
  /**
41
3
  * Intelligently rounds a number using span-based or significant figure logic.
42
4
  * Designed for UI display where floating-point noise needs to be cleaned up.
@@ -1 +1 @@
1
- {"version":3,"file":"round.d.ts","sourceRoot":"","sources":["../../../src/math/round.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAQ1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAG,MAarE,CAAC;AAKF;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAG,MAkCrE,CAAC"}
1
+ {"version":3,"file":"round.d.ts","sourceRoot":"","sources":["../../../src/math/round.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAW1C;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAG,MAkCrE,CAAC"}