@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.
- package/.turbo/turbo-build.log +5 -5
- package/dist/src/math/round.d.ts +0 -38
- package/dist/src/math/round.d.ts.map +1 -1
- package/dist/x.cjs +6 -6
- package/dist/x.js +831 -840
- package/package.json +1 -1
- package/src/math/round.spec.ts +0 -68
- package/src/math/round.ts +0 -52
- package/tsconfig.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @synnaxlabs/x@0.52.
|
|
2
|
+
> @synnaxlabs/x@0.52.5 build /home/runner/work/synnax/synnax/x/ts
|
|
3
3
|
> tsc --noEmit && vite build
|
|
4
4
|
|
|
5
5
|
[34m Synnax - Production mode[0m
|
|
@@ -10,8 +10,8 @@ rendering chunks...
|
|
|
10
10
|
[32m
|
|
11
11
|
[36m[vite:dts][32m Start generate declaration files...[39m
|
|
12
12
|
computing gzip size...
|
|
13
|
-
[2mdist/[22m[36mx.js [39m[1m[2m184.
|
|
14
|
-
[32m[36m[vite:dts][32m Declaration files built in
|
|
13
|
+
[2mdist/[22m[36mx.js [39m[1m[2m184.55 kB[22m[1m[22m[2m │ gzip: 45.19 kB[22m
|
|
14
|
+
[32m[36m[vite:dts][32m Declaration files built in 4478ms.
|
|
15
15
|
[39m
|
|
16
|
-
[2mdist/[22m[36mx.cjs [39m[1m[
|
|
17
|
-
[32m✓ built in 5.
|
|
16
|
+
[2mdist/[22m[36mx.cjs [39m[1m[2m102.92 kB[22m[1m[22m[2m │ gzip: 32.11 kB[22m
|
|
17
|
+
[32m✓ built in 5.06s[39m
|
package/dist/src/math/round.d.ts
CHANGED
|
@@ -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;
|
|
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"}
|