@synnaxlabs/x 0.38.0 → 0.38.1
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 +19 -19
- package/dist/binary.js +1 -1
- package/dist/{box-Cto-5Uxu.js → box-DPJAbf32.js} +64 -64
- package/dist/box-Daep7oxr.cjs +1 -0
- package/dist/box.cjs +1 -1
- package/dist/box.js +1 -1
- package/dist/caseconv.js +1 -1
- package/dist/{external-vFGUdZf6.js → external-CtAt3tnU.js} +14 -15
- package/dist/external-DSKjMZ7J.cjs +1 -0
- package/dist/{index-OHIRoCei.js → index-C3QzbIwt.js} +1 -1
- package/dist/{index-BfDeGfej.js → index-DizUWH6z.js} +8 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +9 -9
- package/dist/{location-C5Ot4MVG.js → location-BVkZhfQG.js} +1 -1
- package/dist/location.js +1 -1
- package/dist/{position-CvSNZkSD.cjs → position-96CBRKEd.cjs} +1 -1
- package/dist/{position-GeF1oEYk.js → position-uVDP52PM.js} +2 -2
- package/dist/position.cjs +1 -1
- package/dist/position.js +1 -1
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.js +1 -1
- package/dist/{scale-BTgf0Mr-.cjs → scale-Bzjm1mhv.cjs} +1 -1
- package/dist/{scale-Dh1UNRoC.js → scale-D_UMXSZN.js} +2 -2
- package/dist/scale.cjs +1 -1
- package/dist/scale.js +1 -1
- package/dist/{series-DxDIugLj.js → series-Cwc_z2OS.js} +5 -5
- package/dist/{series-BMhEEJZL.cjs → series-DuOxifEy.cjs} +1 -1
- package/dist/spatial.cjs +1 -1
- package/dist/spatial.js +4 -4
- package/dist/src/breaker/breaker.d.ts.map +1 -1
- package/dist/src/breaker/index.d.ts.map +1 -1
- package/dist/src/caseconv/caseconv.d.ts.map +1 -1
- package/dist/src/runtime/os.d.ts +7 -7
- package/dist/src/runtime/os.d.ts.map +1 -1
- package/dist/src/sleep/index.d.ts.map +1 -1
- package/dist/src/sleep/sleep.d.ts.map +1 -1
- package/dist/src/testutil/index.d.ts +2 -0
- package/dist/src/testutil/index.d.ts.map +1 -0
- package/dist/src/testutil/testutil.d.ts +2 -0
- package/dist/src/testutil/testutil.d.ts.map +1 -0
- package/dist/src/url/url.d.ts +1 -1
- package/dist/src/url/url.d.ts.map +1 -1
- package/dist/src/zodutil/zodutil.d.ts.map +1 -1
- package/dist/telem.cjs +1 -1
- package/dist/telem.js +1 -1
- package/eslint.config.js +1 -1
- package/package.json +3 -3
- package/src/binary/encoder.spec.ts +1 -1
- package/src/binary/encoder.ts +1 -1
- package/src/binary/index.ts +1 -1
- package/src/breaker/breaker.spec.ts +9 -0
- package/src/breaker/breaker.ts +9 -0
- package/src/breaker/index.ts +9 -0
- package/src/caseconv/caseconv.spec.ts +1 -1
- package/src/caseconv/caseconv.ts +16 -8
- package/src/caseconv/index.ts +1 -1
- package/src/change/change.ts +1 -1
- package/src/change/index.ts +1 -1
- package/src/clamp/clamp.ts +1 -1
- package/src/clamp/index.ts +1 -1
- package/src/compare/compare.spec.ts +1 -1
- package/src/compare/compare.ts +1 -1
- package/src/compare/index.ts +1 -1
- package/src/control/control.ts +1 -1
- package/src/control/index.ts +1 -1
- package/src/debounce/debounce.spec.ts +1 -1
- package/src/debounce/debounce.ts +1 -1
- package/src/debounce/index.ts +1 -1
- package/src/deep/copy.ts +1 -1
- package/src/deep/delete.spec.ts +1 -1
- package/src/deep/delete.ts +1 -1
- package/src/deep/difference.spec.ts +1 -1
- package/src/deep/difference.ts +1 -1
- package/src/deep/equal.spec.ts +1 -1
- package/src/deep/equal.ts +1 -1
- package/src/deep/external.ts +1 -1
- package/src/deep/index.ts +1 -1
- package/src/deep/merge.spec.ts +1 -1
- package/src/deep/merge.ts +1 -1
- package/src/deep/partial.ts +1 -1
- package/src/deep/path.spec.ts +2 -3
- package/src/deep/path.ts +3 -3
- package/src/destructor.ts +1 -1
- package/src/errors/errors.ts +1 -1
- package/src/errors/index.ts +1 -1
- package/src/id/id.ts +6 -6
- package/src/id/index.ts +1 -1
- package/src/identity.ts +1 -1
- package/src/index.ts +1 -1
- package/src/invert.ts +1 -1
- package/src/join.ts +1 -1
- package/src/kv/external.ts +1 -1
- package/src/kv/index.ts +1 -1
- package/src/kv/mock.ts +1 -1
- package/src/kv/types.ts +1 -1
- package/src/link/index.ts +1 -1
- package/src/link/link.spec.ts +1 -1
- package/src/link/link.ts +1 -1
- package/src/math/index.ts +1 -1
- package/src/math/math.spec.ts +1 -1
- package/src/math/math.ts +1 -1
- package/src/migrate/index.ts +1 -1
- package/src/migrate/migrate.spec.ts +1 -1
- package/src/migrate/migrate.ts +1 -1
- package/src/mock/MockGLBufferController.ts +1 -1
- package/src/mock/index.ts +1 -1
- package/src/numeric/index.ts +1 -1
- package/src/numeric/numeric.ts +1 -1
- package/src/observe/index.ts +1 -1
- package/src/observe/observe.ts +1 -1
- package/src/observe/obsever.spec.ts +1 -1
- package/src/optional.ts +1 -1
- package/src/primitive.ts +1 -1
- package/src/record.spec.ts +9 -0
- package/src/record.ts +1 -1
- package/src/renderable.ts +1 -1
- package/src/runtime/detect.ts +3 -3
- package/src/runtime/external.ts +1 -1
- package/src/runtime/index.ts +1 -1
- package/src/runtime/os.ts +20 -20
- package/src/search.ts +1 -1
- package/src/shallowCopy.ts +1 -1
- package/src/sleep/index.ts +9 -0
- package/src/sleep/sleep.ts +9 -0
- package/src/spatial/base.ts +1 -1
- package/src/spatial/bounds/bounds.spec.ts +4 -3
- package/src/spatial/bounds/bounds.ts +4 -4
- package/src/spatial/bounds/index.ts +1 -1
- package/src/spatial/box/box.spec.ts +1 -1
- package/src/spatial/box/box.ts +2 -2
- package/src/spatial/box/index.ts +1 -1
- package/src/spatial/dimensions/dimensions.spec.ts +1 -1
- package/src/spatial/dimensions/dimensions.ts +1 -1
- package/src/spatial/dimensions/index.ts +1 -1
- package/src/spatial/direction/direction.spec.ts +1 -1
- package/src/spatial/direction/direction.ts +1 -1
- package/src/spatial/direction/index.ts +1 -1
- package/src/spatial/external.ts +1 -1
- package/src/spatial/index.ts +1 -1
- package/src/spatial/location/index.ts +1 -1
- package/src/spatial/location/location.spec.ts +1 -1
- package/src/spatial/location/location.ts +2 -2
- package/src/spatial/position/index.ts +1 -1
- package/src/spatial/position/position.spec.ts +1 -1
- package/src/spatial/position/position.ts +1 -1
- package/src/spatial/scale/index.ts +1 -1
- package/src/spatial/scale/scale.spec.ts +1 -1
- package/src/spatial/scale/scale.ts +2 -2
- package/src/spatial/spatial.ts +1 -1
- package/src/spatial/xy/index.ts +1 -1
- package/src/spatial/xy/xy.spec.ts +1 -1
- package/src/spatial/xy/xy.ts +1 -1
- package/src/strings/index.ts +1 -1
- package/src/strings/strings.spec.ts +1 -1
- package/src/strings/strings.ts +1 -1
- package/src/telem/generate.ts +1 -1
- package/src/telem/gl.ts +1 -1
- package/src/telem/index.ts +1 -1
- package/src/telem/series.spec.ts +1 -1
- package/src/telem/series.ts +4 -4
- package/src/telem/telem.spec.ts +2 -2
- package/src/telem/telem.ts +1 -1
- package/src/testutil/index.ts +10 -0
- package/src/testutil/testutil.ts +14 -0
- package/src/toArray.ts +1 -1
- package/src/transform.ts +1 -1
- package/src/unique/index.ts +1 -1
- package/src/unique/unique.spec.ts +1 -1
- package/src/unique/unique.ts +1 -1
- package/src/url/index.ts +1 -1
- package/src/url/url.spec.ts +1 -1
- package/src/url/url.ts +2 -2
- package/src/worker/index.ts +1 -1
- package/src/worker/worker.spec.ts +1 -1
- package/src/worker/worker.ts +1 -1
- package/src/zodutil/index.ts +1 -1
- package/src/zodutil/zodutil.spec.ts +1 -1
- package/src/zodutil/zodutil.ts +2 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/vite.config.ts +1 -1
- package/dist/box-BZ6d2d5A.cjs +0 -1
- package/dist/external-Cax-LfQW.cjs +0 -1
package/src/deep/merge.spec.ts
CHANGED
package/src/deep/merge.ts
CHANGED
package/src/deep/partial.ts
CHANGED
package/src/deep/path.spec.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2025 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
import { describe, expect, it } from "vitest";
|
|
11
11
|
|
|
12
12
|
import { deep } from "@/deep";
|
|
13
|
-
import { type UnknownRecord } from "@/record";
|
|
14
13
|
|
|
15
14
|
interface TestRecord {
|
|
16
15
|
a: number;
|
|
@@ -68,7 +67,7 @@ describe("path", () => {
|
|
|
68
67
|
getter: (obj, key) => {
|
|
69
68
|
if (key === "value()")
|
|
70
69
|
return (obj as { value: () => { c: number } }).value();
|
|
71
|
-
return
|
|
70
|
+
return obj[key];
|
|
72
71
|
},
|
|
73
72
|
}),
|
|
74
73
|
).toEqual(0);
|
package/src/deep/path.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2025 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -112,7 +112,7 @@ export const transformPath = (
|
|
|
112
112
|
if (typeof r === "string") return r;
|
|
113
113
|
return r.join(separator);
|
|
114
114
|
})
|
|
115
|
-
.filter((part) => part != null)
|
|
115
|
+
.filter((part) => part != null);
|
|
116
116
|
return result.join(separator);
|
|
117
117
|
};
|
|
118
118
|
|
|
@@ -133,7 +133,7 @@ export const get = (<V = unknown, T = UnknownRecord>(
|
|
|
133
133
|
opts: GetOptions = { optional: false, separator: "." },
|
|
134
134
|
): V | null => {
|
|
135
135
|
opts.separator ??= ".";
|
|
136
|
-
const { optional, getter = (obj, key) => (obj
|
|
136
|
+
const { optional, getter = (obj, key) => (obj)[key] } = opts;
|
|
137
137
|
const parts = path.split(opts.separator);
|
|
138
138
|
if (parts.length === 1 && parts[0] === "") return obj as unknown as V;
|
|
139
139
|
let result: UnknownRecord = obj as UnknownRecord;
|
package/src/destructor.ts
CHANGED
package/src/errors/errors.ts
CHANGED
package/src/errors/index.ts
CHANGED
package/src/id/id.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2025 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
|
-
// Use of this software is governed by the Business Source License included in
|
|
4
|
-
//
|
|
3
|
+
// Use of this software is governed by the Business Source License included in the file
|
|
4
|
+
// licenses/BSL.txt.
|
|
5
5
|
//
|
|
6
|
-
// As of the Change Date specified in that file, in accordance with the Business
|
|
7
|
-
//
|
|
8
|
-
//
|
|
6
|
+
// As of the Change Date specified in that file, in accordance with the Business Source
|
|
7
|
+
// License, use of this software will be governed by the Apache License, Version 2.0,
|
|
8
|
+
// included in the file licenses/APL.txt.
|
|
9
9
|
|
|
10
10
|
import { customAlphabet } from "nanoid/non-secure";
|
|
11
11
|
|
package/src/id/index.ts
CHANGED
package/src/identity.ts
CHANGED
package/src/index.ts
CHANGED
package/src/invert.ts
CHANGED
package/src/join.ts
CHANGED
package/src/kv/external.ts
CHANGED
package/src/kv/index.ts
CHANGED
package/src/kv/mock.ts
CHANGED
package/src/kv/types.ts
CHANGED
package/src/link/index.ts
CHANGED
package/src/link/link.spec.ts
CHANGED
package/src/link/link.ts
CHANGED
package/src/math/index.ts
CHANGED
package/src/math/math.spec.ts
CHANGED
package/src/math/math.ts
CHANGED
package/src/migrate/index.ts
CHANGED
package/src/migrate/migrate.ts
CHANGED
package/src/mock/index.ts
CHANGED
package/src/numeric/index.ts
CHANGED
package/src/numeric/numeric.ts
CHANGED
package/src/observe/index.ts
CHANGED
package/src/observe/observe.ts
CHANGED
package/src/optional.ts
CHANGED
package/src/primitive.ts
CHANGED
package/src/record.spec.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
// Copyright 2025 Synnax Labs, Inc.
|
|
2
|
+
//
|
|
3
|
+
// Use of this software is governed by the Business Source License included in the file
|
|
4
|
+
// licenses/BSL.txt.
|
|
5
|
+
//
|
|
6
|
+
// As of the Change Date specified in that file, in accordance with the Business Source
|
|
7
|
+
// License, use of this software will be governed by the Apache License, Version 2.0,
|
|
8
|
+
// included in the file licenses/APL.txt.
|
|
9
|
+
|
|
1
10
|
import { describe, expect, it } from "vitest";
|
|
2
11
|
|
|
3
12
|
import { mapValues } from "@/record";
|
package/src/record.ts
CHANGED
package/src/renderable.ts
CHANGED
package/src/runtime/detect.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2025 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -17,14 +17,14 @@ export type Runtime = "browser" | "node" | "webworker";
|
|
|
17
17
|
*/
|
|
18
18
|
export const detect = (): Runtime => {
|
|
19
19
|
if (
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
typeof process !== "undefined" &&
|
|
22
22
|
process.versions != null &&
|
|
23
23
|
process.versions.node != null
|
|
24
24
|
)
|
|
25
25
|
return "node";
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
|
|
28
28
|
if (typeof window === "undefined" || window.document === undefined)
|
|
29
29
|
return "webworker";
|
|
30
30
|
|
package/src/runtime/external.ts
CHANGED
package/src/runtime/index.ts
CHANGED
package/src/runtime/os.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2025 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -9,17 +9,17 @@
|
|
|
9
9
|
|
|
10
10
|
import { z } from "zod";
|
|
11
11
|
|
|
12
|
-
export const OPERATING_SYSTEMS = ["
|
|
13
|
-
const LOWERCASE_OPERATING_SYSTEMS = ["macos", "windows", "linux"
|
|
12
|
+
export const OPERATING_SYSTEMS = ["macOS", "Windows", "Linux"] as const;
|
|
13
|
+
const LOWERCASE_OPERATING_SYSTEMS = ["macos", "windows", "linux"] as const;
|
|
14
14
|
const LOWER_TO_UPPER_OPERATING_SYSTEMS: Record<
|
|
15
15
|
(typeof LOWERCASE_OPERATING_SYSTEMS)[number],
|
|
16
16
|
(typeof OPERATING_SYSTEMS)[number]
|
|
17
17
|
> = {
|
|
18
|
-
macos: "
|
|
18
|
+
macos: "macOS",
|
|
19
19
|
windows: "Windows",
|
|
20
20
|
linux: "Linux",
|
|
21
|
-
docker: "Docker",
|
|
22
21
|
};
|
|
22
|
+
|
|
23
23
|
export const osZ = z
|
|
24
24
|
.enum(OPERATING_SYSTEMS)
|
|
25
25
|
.or(
|
|
@@ -29,35 +29,35 @@ export const osZ = z
|
|
|
29
29
|
);
|
|
30
30
|
export type OS = (typeof OPERATING_SYSTEMS)[number];
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
const evalOS = (): OS | undefined => {
|
|
33
|
+
if (typeof window === "undefined") return undefined;
|
|
34
|
+
const userAgent = window.navigator.userAgent.toLowerCase();
|
|
35
|
+
if (userAgent.includes("mac")) return "macOS";
|
|
36
|
+
if (userAgent.includes("win")) return "Windows";
|
|
37
|
+
if (userAgent.includes("linux")) return "Linux";
|
|
38
|
+
return undefined;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export interface RequiredGetOSProps {
|
|
33
42
|
force?: OS;
|
|
34
43
|
default?: OS;
|
|
35
|
-
}
|
|
44
|
+
}
|
|
36
45
|
|
|
37
|
-
export
|
|
38
|
-
force?: OS
|
|
46
|
+
export interface OptionalGetOSProps {
|
|
47
|
+
force?: OS;
|
|
39
48
|
default: OS;
|
|
40
|
-
}
|
|
49
|
+
}
|
|
41
50
|
|
|
42
51
|
export type GetOSProps = RequiredGetOSProps | OptionalGetOSProps;
|
|
43
52
|
|
|
44
53
|
let os: OS | undefined;
|
|
45
54
|
|
|
46
|
-
const evalOS = (): OS | undefined => {
|
|
47
|
-
if (typeof window === "undefined") return undefined;
|
|
48
|
-
const userAgent = window.navigator.userAgent.toLowerCase();
|
|
49
|
-
if (userAgent.includes("mac")) return "MacOS";
|
|
50
|
-
if (userAgent.includes("win")) return "Windows";
|
|
51
|
-
if (userAgent.includes("linux")) return "Linux";
|
|
52
|
-
return undefined;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
55
|
export interface GetOS {
|
|
56
56
|
(props?: RequiredGetOSProps): OS;
|
|
57
57
|
(props?: OptionalGetOSProps): OS | undefined;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
export const getOS = ((props
|
|
60
|
+
export const getOS: GetOS = ((props = {}) => {
|
|
61
61
|
const { force, default: default_ } = props;
|
|
62
62
|
if (force != null) return force;
|
|
63
63
|
if (os != null) return os;
|
package/src/search.ts
CHANGED
package/src/shallowCopy.ts
CHANGED
package/src/sleep/index.ts
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
+
// Copyright 2025 Synnax Labs, Inc.
|
|
2
|
+
//
|
|
3
|
+
// Use of this software is governed by the Business Source License included in the file
|
|
4
|
+
// licenses/BSL.txt.
|
|
5
|
+
//
|
|
6
|
+
// As of the Change Date specified in that file, in accordance with the Business Source
|
|
7
|
+
// License, use of this software will be governed by the Apache License, Version 2.0,
|
|
8
|
+
// included in the file licenses/APL.txt.
|
|
9
|
+
|
|
1
10
|
export * as sleep from "@/sleep/sleep";
|
package/src/sleep/sleep.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
// Copyright 2025 Synnax Labs, Inc.
|
|
2
|
+
//
|
|
3
|
+
// Use of this software is governed by the Business Source License included in the file
|
|
4
|
+
// licenses/BSL.txt.
|
|
5
|
+
//
|
|
6
|
+
// As of the Change Date specified in that file, in accordance with the Business Source
|
|
7
|
+
// License, use of this software will be governed by the Apache License, Version 2.0,
|
|
8
|
+
// included in the file licenses/APL.txt.
|
|
9
|
+
|
|
1
10
|
import { type CrudeTimeSpan, TimeSpan } from "@/telem";
|
|
2
11
|
|
|
3
12
|
export const sleep = async (span: CrudeTimeSpan): Promise<void> =>
|
package/src/spatial/base.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2025 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -11,6 +11,7 @@ import { describe, expect, it, test } from "vitest";
|
|
|
11
11
|
|
|
12
12
|
import { type numeric } from "@/numeric";
|
|
13
13
|
import * as bounds from "@/spatial/bounds/bounds";
|
|
14
|
+
import { testutil } from "@/testutil";
|
|
14
15
|
|
|
15
16
|
describe("Bounds", () => {
|
|
16
17
|
describe("construction", () => {
|
|
@@ -322,7 +323,7 @@ describe("Bounds", () => {
|
|
|
322
323
|
},
|
|
323
324
|
];
|
|
324
325
|
SPECS.forEach(({ bounds: b, start, dist, expected }) => {
|
|
325
|
-
test(`should return ${expected} for ${b} and ${start} and ${dist}`, () => {
|
|
326
|
+
test(`should return ${expected} for ${testutil.toString(b)} and ${start} and ${dist}`, () => {
|
|
326
327
|
expect(bounds.traverse(b, start, dist)).toEqual(expected);
|
|
327
328
|
});
|
|
328
329
|
});
|
|
@@ -366,7 +367,7 @@ describe("Bounds", () => {
|
|
|
366
367
|
},
|
|
367
368
|
];
|
|
368
369
|
SPECS.forEach(({ bounds: b, start, end, expected }) => {
|
|
369
|
-
test(`should return ${expected} for ${b} and ${start} and ${end}`, () => {
|
|
370
|
+
test(`should return ${expected} for ${JSON.stringify(b)} and ${start} and ${end}`, () => {
|
|
370
371
|
expect(bounds.distance(b, start, end)).toEqual(expected);
|
|
371
372
|
});
|
|
372
373
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2025 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -523,16 +523,16 @@ export const traverse = <T extends numeric.Value = number>(
|
|
|
523
523
|
if (index !== -1) {
|
|
524
524
|
const b = _bounds[index];
|
|
525
525
|
let distanceInBound: T;
|
|
526
|
-
if (dir > 0) distanceInBound = math.sub(b.upper, currentPosition)
|
|
526
|
+
if (dir > 0) distanceInBound = math.sub(b.upper, currentPosition);
|
|
527
527
|
else distanceInBound = math.sub(currentPosition, b.lower) as T;
|
|
528
528
|
|
|
529
529
|
if (distanceInBound > (0 as T)) {
|
|
530
|
-
const moveDist = math.min(math.abs(remainingDist), distanceInBound)
|
|
530
|
+
const moveDist = math.min(math.abs(remainingDist), distanceInBound);
|
|
531
531
|
currentPosition = math.add(
|
|
532
532
|
currentPosition,
|
|
533
533
|
dir > 0 ? moveDist : -moveDist,
|
|
534
534
|
) as T;
|
|
535
|
-
remainingDist = math.sub(remainingDist, dir > 0 ? moveDist : -moveDist)
|
|
535
|
+
remainingDist = math.sub(remainingDist, dir > 0 ? moveDist : -moveDist);
|
|
536
536
|
|
|
537
537
|
// If we've exhausted the distance, return the current position
|
|
538
538
|
if (math.equal(remainingDist, 0)) return currentPosition as T;
|
package/src/spatial/box/box.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2025 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -341,7 +341,7 @@ export const edgePoints = (b: Crude, loc: location.Location): [xy.XY, xy.XY] =>
|
|
|
341
341
|
: location.Y_LOCATIONS.includes(loc as location.Y)
|
|
342
342
|
? "y"
|
|
343
343
|
: null;
|
|
344
|
-
if (x === null) throw new Error(`Invalid location: ${
|
|
344
|
+
if (x === null) throw new Error(`Invalid location: ${loc}`);
|
|
345
345
|
const f = loc === "top" || loc === "left" ? Math.min : Math.max;
|
|
346
346
|
const one = { ...b_.one };
|
|
347
347
|
const two = { ...b_.two };
|
package/src/spatial/box/index.ts
CHANGED