@pawells/math-extended 1.1.1 → 3.0.0
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/README.md +15 -21
- package/build/angles.d.ts +28 -18
- package/build/angles.d.ts.map +1 -1
- package/build/angles.js +28 -18
- package/build/angles.js.map +1 -1
- package/build/clamp.d.ts +2 -0
- package/build/clamp.d.ts.map +1 -1
- package/build/clamp.js +2 -0
- package/build/clamp.js.map +1 -1
- package/build/core.d.ts +23 -0
- package/build/core.d.ts.map +1 -0
- package/build/core.js +25 -0
- package/build/core.js.map +1 -0
- package/build/index.d.ts +1 -4
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -6
- package/build/index.js.map +1 -1
- package/build/interpolation.d.ts +62 -13
- package/build/interpolation.d.ts.map +1 -1
- package/build/interpolation.js +66 -23
- package/build/interpolation.js.map +1 -1
- package/build/matrices/arithmetic.d.ts +65 -76
- package/build/matrices/arithmetic.d.ts.map +1 -1
- package/build/matrices/arithmetic.js +65 -107
- package/build/matrices/arithmetic.js.map +1 -1
- package/build/matrices/asserts.d.ts +26 -273
- package/build/matrices/asserts.d.ts.map +1 -1
- package/build/matrices/asserts.js +106 -350
- package/build/matrices/asserts.js.map +1 -1
- package/build/matrices/core.d.ts +150 -79
- package/build/matrices/core.d.ts.map +1 -1
- package/build/matrices/core.js +128 -104
- package/build/matrices/core.js.map +1 -1
- package/build/matrices/decompositions.d.ts +41 -44
- package/build/matrices/decompositions.d.ts.map +1 -1
- package/build/matrices/decompositions.js +51 -94
- package/build/matrices/decompositions.js.map +1 -1
- package/build/matrices/index.d.ts +2 -2
- package/build/matrices/index.d.ts.map +1 -1
- package/build/matrices/index.js +2 -2
- package/build/matrices/index.js.map +1 -1
- package/build/matrices/linear-algebra.d.ts +56 -19
- package/build/matrices/linear-algebra.d.ts.map +1 -1
- package/build/matrices/linear-algebra.js +80 -36
- package/build/matrices/linear-algebra.js.map +1 -1
- package/build/matrices/normalization.d.ts +36 -15
- package/build/matrices/normalization.d.ts.map +1 -1
- package/build/matrices/normalization.js +32 -23
- package/build/matrices/normalization.js.map +1 -1
- package/build/matrices/transformations.d.ts +39 -52
- package/build/matrices/transformations.d.ts.map +1 -1
- package/build/matrices/transformations.js +8 -11
- package/build/matrices/transformations.js.map +1 -1
- package/build/matrices/types.d.ts +39 -67
- package/build/matrices/types.d.ts.map +1 -1
- package/build/matrices/types.js +63 -1
- package/build/matrices/types.js.map +1 -1
- package/build/quaternions/asserts.d.ts +114 -15
- package/build/quaternions/asserts.d.ts.map +1 -1
- package/build/quaternions/asserts.js +189 -51
- package/build/quaternions/asserts.js.map +1 -1
- package/build/quaternions/conversions.d.ts +18 -8
- package/build/quaternions/conversions.d.ts.map +1 -1
- package/build/quaternions/conversions.js +14 -4
- package/build/quaternions/conversions.js.map +1 -1
- package/build/quaternions/core.d.ts +31 -2
- package/build/quaternions/core.d.ts.map +1 -1
- package/build/quaternions/core.js +32 -4
- package/build/quaternions/core.js.map +1 -1
- package/build/quaternions/index.d.ts +2 -2
- package/build/quaternions/index.d.ts.map +1 -1
- package/build/quaternions/index.js +3 -2
- package/build/quaternions/index.js.map +1 -1
- package/build/quaternions/interpolation.d.ts +7 -1
- package/build/quaternions/interpolation.d.ts.map +1 -1
- package/build/quaternions/interpolation.js +12 -6
- package/build/quaternions/interpolation.js.map +1 -1
- package/build/quaternions/predefined.d.ts +7 -1
- package/build/quaternions/predefined.d.ts.map +1 -1
- package/build/quaternions/predefined.js +6 -0
- package/build/quaternions/predefined.js.map +1 -1
- package/build/quaternions/types.d.ts +24 -13
- package/build/quaternions/types.d.ts.map +1 -1
- package/build/quaternions/types.js +51 -1
- package/build/quaternions/types.js.map +1 -1
- package/build/random.d.ts +66 -20
- package/build/random.d.ts.map +1 -1
- package/build/random.js +73 -20
- package/build/random.js.map +1 -1
- package/build/vectors/asserts.d.ts +33 -99
- package/build/vectors/asserts.d.ts.map +1 -1
- package/build/vectors/asserts.js +145 -181
- package/build/vectors/asserts.js.map +1 -1
- package/build/vectors/core.d.ts +76 -44
- package/build/vectors/core.d.ts.map +1 -1
- package/build/vectors/core.js +128 -119
- package/build/vectors/core.js.map +1 -1
- package/build/vectors/index.d.ts.map +1 -1
- package/build/vectors/index.js +1 -0
- package/build/vectors/index.js.map +1 -1
- package/build/vectors/interpolation.d.ts +13 -1
- package/build/vectors/interpolation.d.ts.map +1 -1
- package/build/vectors/interpolation.js +48 -47
- package/build/vectors/interpolation.js.map +1 -1
- package/build/vectors/predefined.d.ts +73 -25
- package/build/vectors/predefined.d.ts.map +1 -1
- package/build/vectors/predefined.js +62 -18
- package/build/vectors/predefined.js.map +1 -1
- package/build/vectors/types.d.ts +26 -4
- package/build/vectors/types.d.ts.map +1 -1
- package/build/vectors/types.js +50 -1
- package/build/vectors/types.js.map +1 -1
- package/package.json +4 -3
|
@@ -3,66 +3,22 @@
|
|
|
3
3
|
* Provides comprehensive validation functions to ensure vector data integrity
|
|
4
4
|
* and catch errors early in mathematical operations.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
6
|
+
import { type TVector, type TVector2, type TVector3, type TVector4 } from './types.js';
|
|
7
|
+
import z from 'zod';
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
export type TAssertVectorArgs = IAssertNumberArgs & IAssertArrayArgs;
|
|
13
|
-
/**
|
|
14
|
-
* Extended configuration for validating multiple vectors.
|
|
15
|
-
* Includes all single vector options plus multi-vector constraints.
|
|
16
|
-
*/
|
|
17
|
-
interface IAssertVectorsArgs extends TAssertVectorArgs {
|
|
18
|
-
/**
|
|
19
|
-
* Minimum vector size allowed.
|
|
20
|
-
* If specified, vectors must have at least this many components.
|
|
21
|
-
*/
|
|
22
|
-
minSize?: number;
|
|
23
|
-
/**
|
|
24
|
-
* Whether all vectors must have the same size.
|
|
25
|
-
* Default: true when using individual arguments, configurable when using array syntax.
|
|
26
|
-
*/
|
|
27
|
-
sameSize?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Whether all vector elements must be finite numbers.
|
|
30
|
-
* If true, validates that each element is not Infinity or -Infinity.
|
|
31
|
-
*/
|
|
32
|
-
finite?: boolean;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Extended exception interface for vector-specific error information.
|
|
36
|
-
* Provides additional context about which vector component caused the error.
|
|
37
|
-
*/
|
|
38
|
-
interface IAssertVectorException extends IAssertException {
|
|
39
|
-
/**
|
|
40
|
-
* Index of the vector component that caused the validation failure.
|
|
41
|
-
* Useful for debugging which specific element is invalid.
|
|
42
|
-
*/
|
|
43
|
-
index?: number;
|
|
44
|
-
}
|
|
45
|
-
type TAssertVectorValueArgs = IAssertNumberArgs;
|
|
46
|
-
/**
|
|
47
|
-
* Specialized error class for vector-related operations and validations.
|
|
48
|
-
* Thrown when vector assertions fail or vector operations encounter invalid data.
|
|
9
|
+
* Vector error class for validation failures and vector operations.
|
|
10
|
+
* Extends Error to provide detailed error information with optional cause chain.
|
|
49
11
|
*
|
|
50
12
|
* @example
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* if (error instanceof VectorError) {
|
|
55
|
-
* console.log("Vector validation failed:", error.message);
|
|
56
|
-
* }
|
|
57
|
-
* }
|
|
13
|
+
* ```typescript
|
|
14
|
+
* throw new VectorError('Invalid vector dimensions', { cause: originalError });
|
|
15
|
+
* ```
|
|
58
16
|
*/
|
|
59
17
|
export declare class VectorError extends Error {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
*/
|
|
65
|
-
constructor(message?: string);
|
|
18
|
+
readonly code: string;
|
|
19
|
+
constructor(message: string, options?: {
|
|
20
|
+
cause?: unknown;
|
|
21
|
+
});
|
|
66
22
|
}
|
|
67
23
|
/**
|
|
68
24
|
* Validates that an unknown value is a valid vector (array of numbers).
|
|
@@ -79,15 +35,14 @@ export declare class VectorError extends Error {
|
|
|
79
35
|
* ```typescript
|
|
80
36
|
* // Basic validation — passes silently for a valid vector
|
|
81
37
|
* AssertVector([1, 2, 3]);
|
|
82
|
-
*
|
|
83
38
|
* // Validate with size constraint
|
|
84
39
|
* AssertVector([1, 2], { size: 2 });
|
|
85
|
-
*
|
|
86
40
|
* // Throws VectorError for non-array input
|
|
87
41
|
* AssertVector("not a vector"); // throws VectorError
|
|
88
42
|
* ```
|
|
89
43
|
*/
|
|
90
|
-
export declare function AssertVector(vector: unknown
|
|
44
|
+
export declare function AssertVector(vector: unknown): asserts vector is TVector;
|
|
45
|
+
export declare function ValidateVector(vector: unknown): boolean;
|
|
91
46
|
/**
|
|
92
47
|
* Validates that an unknown value is a valid 2D vector (exactly 2 numeric components).
|
|
93
48
|
*
|
|
@@ -102,7 +57,8 @@ export declare function AssertVector(vector: unknown, args?: TAssertVectorArgs,
|
|
|
102
57
|
* AssertVector2("not a vec"); // throws
|
|
103
58
|
* ```
|
|
104
59
|
*/
|
|
105
|
-
export declare function AssertVector2(vector: unknown
|
|
60
|
+
export declare function AssertVector2(vector: unknown): asserts vector is TVector2;
|
|
61
|
+
export declare function ValidateVector2(vector: unknown): boolean;
|
|
106
62
|
/**
|
|
107
63
|
* Validates that an unknown value is a valid 3D vector (exactly 3 numeric components).
|
|
108
64
|
*
|
|
@@ -117,7 +73,8 @@ export declare function AssertVector2(vector: unknown, exception?: IAssertVector
|
|
|
117
73
|
* AssertVector3(null); // throws
|
|
118
74
|
* ```
|
|
119
75
|
*/
|
|
120
|
-
export declare function AssertVector3(vector: unknown
|
|
76
|
+
export declare function AssertVector3(vector: unknown): asserts vector is TVector3;
|
|
77
|
+
export declare function ValidateVector3(vector: unknown): boolean;
|
|
121
78
|
/**
|
|
122
79
|
* Validates that an unknown value is a valid 4D vector (exactly 4 numeric components).
|
|
123
80
|
*
|
|
@@ -132,51 +89,28 @@ export declare function AssertVector3(vector: unknown, exception?: IAssertVector
|
|
|
132
89
|
* AssertVector4(undefined); // throws
|
|
133
90
|
* ```
|
|
134
91
|
*/
|
|
135
|
-
export declare function AssertVector4(vector: unknown
|
|
92
|
+
export declare function AssertVector4(vector: unknown): asserts vector is TVector4;
|
|
93
|
+
export declare function ValidateVector4(vector: unknown): boolean;
|
|
94
|
+
export declare const VECTOR_SAME_SIZE_SCHEMA: z.ZodArray<z.ZodArray<z.ZodNumber>>;
|
|
95
|
+
export type TVectorSameSize = z.infer<typeof VECTOR_SAME_SIZE_SCHEMA>;
|
|
96
|
+
export declare function AssertVectorSameSize(vectors: unknown[]): asserts vectors is TVectorSameSize;
|
|
97
|
+
export declare function ValidateVectorSameSize(vectors: unknown[]): boolean;
|
|
136
98
|
/**
|
|
137
|
-
* Validates that
|
|
138
|
-
*
|
|
139
|
-
* Supports optional numeric constraints such as range bounds, integer enforcement,
|
|
140
|
-
* and finiteness checks. Throws `VectorError` with the component index when available.
|
|
99
|
+
* Validates that the given vector is not a zero vector (all components are not zero).
|
|
100
|
+
* Throws a VectorError if the vector is zero.
|
|
141
101
|
*
|
|
142
|
-
* @param
|
|
143
|
-
* @param
|
|
144
|
-
* @
|
|
145
|
-
* @throws {VectorError} If the value is not a valid number or violates any constraint
|
|
102
|
+
* @param vector - The vector to validate
|
|
103
|
+
* @param label - The label for the vector used in the error message (default: 'Vector')
|
|
104
|
+
* @throws {VectorError} If the vector is a zero vector
|
|
146
105
|
*
|
|
147
106
|
* @example
|
|
148
107
|
* ```typescript
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
* AssertVectorValue(Infinity, { finite: true }); // throws
|
|
152
|
-
* AssertVectorValue(NaN); // throws
|
|
153
|
-
* AssertVectorValue(5, { gte: 0, lte: 10 }); // passes
|
|
154
|
-
* ```
|
|
155
|
-
*/
|
|
156
|
-
export declare function AssertVectorValue(value: unknown, args?: TAssertVectorValueArgs, exception?: IAssertVectorException): asserts value is number;
|
|
157
|
-
/**
|
|
158
|
-
* Validates an array of vectors, ensuring each vector is valid and optionally
|
|
159
|
-
* enforcing that all vectors share the same size.
|
|
160
|
-
*
|
|
161
|
-
* @param vectors - The array of vectors to validate (must be non-empty)
|
|
162
|
-
* @param args - Validation constraints applied to each vector; set `sameSize: true`
|
|
163
|
-
* to require all vectors to have identical lengths
|
|
164
|
-
* @param exception - Custom exception details if validation fails
|
|
165
|
-
* @throws {VectorError} If the array is empty, any vector is invalid, or sizes
|
|
166
|
-
* differ when `sameSize` is `true`
|
|
167
|
-
*
|
|
168
|
-
* @example
|
|
169
|
-
* ```typescript
|
|
170
|
-
* // Validate an array of 3D vectors
|
|
171
|
-
* AssertVectors([[1, 2, 3], [4, 5, 6]]);
|
|
172
|
-
*
|
|
173
|
-
* // Require all vectors to share the same length
|
|
174
|
-
* AssertVectors([[1, 2], [3, 4]], { sameSize: true });
|
|
108
|
+
* const v = [1, 2, 3];
|
|
109
|
+
* AssertVectorNonZero(v); // Valid
|
|
175
110
|
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
111
|
+
* const zero = [0, 0, 0];
|
|
112
|
+
* AssertVectorNonZero(zero, 'Direction'); // Throws VectorError: Direction must not be zero
|
|
178
113
|
* ```
|
|
179
114
|
*/
|
|
180
|
-
export declare function
|
|
181
|
-
export {};
|
|
115
|
+
export declare function AssertVectorNonZero(vector: TVector, label?: string): void;
|
|
182
116
|
//# sourceMappingURL=asserts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asserts.d.ts","sourceRoot":"","sources":["../../src/vectors/asserts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"asserts.d.ts","sourceRoot":"","sources":["../../src/vectors/asserts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAiE,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtJ,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB;;;;;;;;GAQG;AACH,qBAAa,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AAK,GAAE,MAAiB,GAAG,IAAI,CAOnF"}
|
package/build/vectors/asserts.js
CHANGED
|
@@ -3,30 +3,25 @@
|
|
|
3
3
|
* Provides comprehensive validation functions to ensure vector data integrity
|
|
4
4
|
* and catch errors early in mathematical operations.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { VECTOR2_SCHEMA, VECTOR3_SCHEMA, VECTOR4_SCHEMA, VECTOR_SCHEMA } from './types.js';
|
|
7
|
+
import z from 'zod';
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
9
|
+
* Vector error class for validation failures and vector operations.
|
|
10
|
+
* Extends Error to provide detailed error information with optional cause chain.
|
|
10
11
|
*
|
|
11
12
|
* @example
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* if (error instanceof VectorError) {
|
|
16
|
-
* console.log("Vector validation failed:", error.message);
|
|
17
|
-
* }
|
|
18
|
-
* }
|
|
13
|
+
* ```typescript
|
|
14
|
+
* throw new VectorError('Invalid vector dimensions', { cause: originalError });
|
|
15
|
+
* ```
|
|
19
16
|
*/
|
|
20
17
|
export class VectorError extends Error {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*
|
|
24
|
-
* @param message - Optional error message describing the validation failure
|
|
25
|
-
*/
|
|
26
|
-
constructor(message) {
|
|
18
|
+
code = 'VECTOR_ERROR';
|
|
19
|
+
constructor(message, options) {
|
|
27
20
|
super(message);
|
|
28
21
|
this.name = 'VectorError';
|
|
29
|
-
|
|
22
|
+
if (options?.cause) {
|
|
23
|
+
this.cause = options.cause;
|
|
24
|
+
}
|
|
30
25
|
}
|
|
31
26
|
}
|
|
32
27
|
/**
|
|
@@ -44,53 +39,30 @@ export class VectorError extends Error {
|
|
|
44
39
|
* ```typescript
|
|
45
40
|
* // Basic validation — passes silently for a valid vector
|
|
46
41
|
* AssertVector([1, 2, 3]);
|
|
47
|
-
*
|
|
48
42
|
* // Validate with size constraint
|
|
49
43
|
* AssertVector([1, 2], { size: 2 });
|
|
50
|
-
*
|
|
51
44
|
* // Throws VectorError for non-array input
|
|
52
45
|
* AssertVector("not a vector"); // throws VectorError
|
|
53
46
|
* ```
|
|
54
47
|
*/
|
|
55
|
-
export function AssertVector(vector
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
exc.class ??= VectorError;
|
|
59
|
-
// First validate that it's an array
|
|
60
|
-
if (!Array.isArray(vector)) {
|
|
61
|
-
SetExceptionMessage(exc, 'Not a Valid Vector');
|
|
62
|
-
ThrowException(exc);
|
|
63
|
-
}
|
|
64
|
-
// Type cast is safe after array validation
|
|
65
|
-
const array = vector;
|
|
66
|
-
// Validate array size constraints (inherited from AssertArrayArgs)
|
|
67
|
-
if (args.size !== undefined && array.length !== args.size) {
|
|
68
|
-
SetExceptionMessage(exc, `Vector does not match expected size. (size: ${args.size})`);
|
|
69
|
-
ThrowException(exc);
|
|
48
|
+
export function AssertVector(vector) {
|
|
49
|
+
try {
|
|
50
|
+
VECTOR_SCHEMA.parse(vector);
|
|
70
51
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
52
|
+
catch (error) {
|
|
53
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
54
|
+
throw new VectorError(`Invalid vector: ${message}`, {
|
|
55
|
+
cause: error instanceof Error ? error : undefined,
|
|
56
|
+
});
|
|
74
57
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
58
|
+
}
|
|
59
|
+
export function ValidateVector(vector) {
|
|
60
|
+
try {
|
|
61
|
+
AssertVector(vector);
|
|
62
|
+
return true;
|
|
78
63
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
try {
|
|
82
|
-
AssertVectorValue(array[i], args, { ...exc, index: i });
|
|
83
|
-
}
|
|
84
|
-
catch (error) {
|
|
85
|
-
// Re-throw with vector context if it's our error type
|
|
86
|
-
if (error instanceof VectorError) {
|
|
87
|
-
throw error;
|
|
88
|
-
}
|
|
89
|
-
// Wrap other errors in VectorError
|
|
90
|
-
SetExceptionMessage(exc, `Invalid Vector Element${exc.index ? `[${exc.index}]` : ''}: ${error.message}`);
|
|
91
|
-
exc.index = i;
|
|
92
|
-
ThrowException(exc);
|
|
93
|
-
}
|
|
64
|
+
catch {
|
|
65
|
+
return false;
|
|
94
66
|
}
|
|
95
67
|
}
|
|
96
68
|
/**
|
|
@@ -107,8 +79,25 @@ export function AssertVector(vector, args = {}, exception = {}) {
|
|
|
107
79
|
* AssertVector2("not a vec"); // throws
|
|
108
80
|
* ```
|
|
109
81
|
*/
|
|
110
|
-
export function AssertVector2(vector
|
|
111
|
-
|
|
82
|
+
export function AssertVector2(vector) {
|
|
83
|
+
try {
|
|
84
|
+
VECTOR2_SCHEMA.parse(vector);
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
88
|
+
throw new VectorError(`Invalid 2D vector: ${message}`, {
|
|
89
|
+
cause: error instanceof Error ? error : undefined,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
export function ValidateVector2(vector) {
|
|
94
|
+
try {
|
|
95
|
+
AssertVector2(vector);
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
112
101
|
}
|
|
113
102
|
/**
|
|
114
103
|
* Validates that an unknown value is a valid 3D vector (exactly 3 numeric components).
|
|
@@ -124,8 +113,25 @@ export function AssertVector2(vector, exception = {}) {
|
|
|
124
113
|
* AssertVector3(null); // throws
|
|
125
114
|
* ```
|
|
126
115
|
*/
|
|
127
|
-
export function AssertVector3(vector
|
|
128
|
-
|
|
116
|
+
export function AssertVector3(vector) {
|
|
117
|
+
try {
|
|
118
|
+
VECTOR3_SCHEMA.parse(vector);
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
122
|
+
throw new VectorError(`Invalid 3D vector: ${message}`, {
|
|
123
|
+
cause: error instanceof Error ? error : undefined,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
export function ValidateVector3(vector) {
|
|
128
|
+
try {
|
|
129
|
+
AssertVector3(vector);
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
129
135
|
}
|
|
130
136
|
/**
|
|
131
137
|
* Validates that an unknown value is a valid 4D vector (exactly 4 numeric components).
|
|
@@ -141,145 +147,103 @@ export function AssertVector3(vector, exception = {}) {
|
|
|
141
147
|
* AssertVector4(undefined); // throws
|
|
142
148
|
* ```
|
|
143
149
|
*/
|
|
144
|
-
export function AssertVector4(vector
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Validates that an unknown value is a valid vector element (a finite, non-NaN number).
|
|
149
|
-
*
|
|
150
|
-
* Supports optional numeric constraints such as range bounds, integer enforcement,
|
|
151
|
-
* and finiteness checks. Throws `VectorError` with the component index when available.
|
|
152
|
-
*
|
|
153
|
-
* @param value - The value to validate as a vector element
|
|
154
|
-
* @param args - Numeric constraints (finite, integer, gt, gte, lt, lte, eq)
|
|
155
|
-
* @param exception - Custom exception details, optionally including a component `index`
|
|
156
|
-
* @throws {VectorError} If the value is not a valid number or violates any constraint
|
|
157
|
-
*
|
|
158
|
-
* @example
|
|
159
|
-
* ```typescript
|
|
160
|
-
* AssertVectorValue(3.14); // passes
|
|
161
|
-
* AssertVectorValue(3.14, { finite: true }); // passes
|
|
162
|
-
* AssertVectorValue(Infinity, { finite: true }); // throws
|
|
163
|
-
* AssertVectorValue(NaN); // throws
|
|
164
|
-
* AssertVectorValue(5, { gte: 0, lte: 10 }); // passes
|
|
165
|
-
* ```
|
|
166
|
-
*/
|
|
167
|
-
export function AssertVectorValue(value, args = {}, exception = {}) {
|
|
168
|
-
// Initialize exception configuration with defaults
|
|
169
|
-
const exc = exception ?? {};
|
|
170
|
-
exc.class ??= VectorError;
|
|
171
|
-
// Validate that the value is a number (and not NaN)
|
|
172
|
-
if (typeof value !== 'number' || Number.isNaN(value)) {
|
|
173
|
-
if (exc.index !== undefined) {
|
|
174
|
-
SetExceptionMessage(exc, `Vector[${exc.index}] Not a Number`);
|
|
175
|
-
}
|
|
176
|
-
else {
|
|
177
|
-
SetExceptionMessage(exc, `Vector element must be a number, got ${typeof value}`);
|
|
178
|
-
}
|
|
179
|
-
ThrowException(exc);
|
|
150
|
+
export function AssertVector4(vector) {
|
|
151
|
+
try {
|
|
152
|
+
VECTOR4_SCHEMA.parse(vector);
|
|
180
153
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
if (args.finite === true && !Number.isFinite(numValue)) {
|
|
187
|
-
SetExceptionMessage(exc, `Vector${exc.index ? `[${exc.index}]` : ''} Must be Finite`);
|
|
188
|
-
ThrowException(exc);
|
|
154
|
+
catch (error) {
|
|
155
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
156
|
+
throw new VectorError(`Invalid 4D vector: ${message}`, {
|
|
157
|
+
cause: error instanceof Error ? error : undefined,
|
|
158
|
+
});
|
|
189
159
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
160
|
+
}
|
|
161
|
+
export function ValidateVector4(vector) {
|
|
162
|
+
try {
|
|
163
|
+
AssertVector4(vector);
|
|
164
|
+
return true;
|
|
194
165
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
166
|
+
catch {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
export const VECTOR_SAME_SIZE_SCHEMA = z.array(VECTOR_SCHEMA).superRefine((vectors, ctx) => {
|
|
171
|
+
if (!Array.isArray(vectors) || vectors.length === 0) {
|
|
172
|
+
ctx.addIssue({
|
|
173
|
+
code: 'custom',
|
|
174
|
+
message: 'Input must be a non-empty array of vectors',
|
|
175
|
+
});
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
const [firstVector] = vectors;
|
|
179
|
+
if (!Array.isArray(firstVector)) {
|
|
180
|
+
ctx.addIssue({
|
|
181
|
+
code: 'custom',
|
|
182
|
+
message: 'Each item must be an array representing a vector',
|
|
183
|
+
});
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
const size = firstVector.length;
|
|
187
|
+
for (const vector of vectors) {
|
|
188
|
+
if (!Array.isArray(vector)) {
|
|
189
|
+
ctx.addIssue({
|
|
190
|
+
code: 'custom',
|
|
191
|
+
message: 'Each item must be an array representing a vector',
|
|
192
|
+
});
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
if (vector.length !== size) {
|
|
196
|
+
ctx.addIssue({
|
|
197
|
+
code: 'custom',
|
|
198
|
+
message: `All vectors must have the same size. Expected size: ${size}, but got: ${vector.length}`,
|
|
199
|
+
});
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
199
202
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
203
|
+
});
|
|
204
|
+
export function AssertVectorSameSize(vectors) {
|
|
205
|
+
try {
|
|
206
|
+
VECTOR_SAME_SIZE_SCHEMA.parse(vectors);
|
|
204
207
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
208
|
+
catch (error) {
|
|
209
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
210
|
+
throw new VectorError(`Vectors must have same size: ${message}`, {
|
|
211
|
+
cause: error instanceof Error ? error : undefined,
|
|
212
|
+
});
|
|
209
213
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
+
}
|
|
215
|
+
export function ValidateVectorSameSize(vectors) {
|
|
216
|
+
try {
|
|
217
|
+
AssertVectorSameSize(vectors);
|
|
218
|
+
return true;
|
|
214
219
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
SetExceptionMessage(exc, `Vector${exc.index ? `[${exc.index}]` : ''} Must be less than or equal to ${args.lte}`);
|
|
218
|
-
ThrowException(exc);
|
|
220
|
+
catch {
|
|
221
|
+
return false;
|
|
219
222
|
}
|
|
220
223
|
}
|
|
221
224
|
/**
|
|
222
|
-
* Validates
|
|
223
|
-
*
|
|
225
|
+
* Validates that the given vector is not a zero vector (all components are not zero).
|
|
226
|
+
* Throws a VectorError if the vector is zero.
|
|
224
227
|
*
|
|
225
|
-
* @param
|
|
226
|
-
* @param
|
|
227
|
-
*
|
|
228
|
-
* @param exception - Custom exception details if validation fails
|
|
229
|
-
* @throws {VectorError} If the array is empty, any vector is invalid, or sizes
|
|
230
|
-
* differ when `sameSize` is `true`
|
|
228
|
+
* @param vector - The vector to validate
|
|
229
|
+
* @param label - The label for the vector used in the error message (default: 'Vector')
|
|
230
|
+
* @throws {VectorError} If the vector is a zero vector
|
|
231
231
|
*
|
|
232
232
|
* @example
|
|
233
233
|
* ```typescript
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
* // Require all vectors to share the same length
|
|
238
|
-
* AssertVectors([[1, 2], [3, 4]], { sameSize: true });
|
|
234
|
+
* const v = [1, 2, 3];
|
|
235
|
+
* AssertVectorNonZero(v); // Valid
|
|
239
236
|
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
237
|
+
* const zero = [0, 0, 0];
|
|
238
|
+
* AssertVectorNonZero(zero, 'Direction'); // Throws VectorError: Direction must not be zero
|
|
242
239
|
* ```
|
|
243
240
|
*/
|
|
244
|
-
export function
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
if (
|
|
249
|
-
|
|
250
|
-
ThrowException(exc);
|
|
251
|
-
}
|
|
252
|
-
if (vectors.length === 0) {
|
|
253
|
-
SetExceptionMessage(exc, 'Vectors array is empty');
|
|
254
|
-
ThrowException(exc);
|
|
255
|
-
}
|
|
256
|
-
// Validate each vector and collect their sizes
|
|
257
|
-
const sizes = [];
|
|
258
|
-
for (let i = 0; i < vectors.length; i++) {
|
|
259
|
-
try {
|
|
260
|
-
AssertVector(vectors[i], args, { ...exc, index: i });
|
|
261
|
-
sizes.push(vectors[i].length);
|
|
262
|
-
}
|
|
263
|
-
catch (error) {
|
|
264
|
-
if (error instanceof VectorError) {
|
|
265
|
-
throw error;
|
|
266
|
-
}
|
|
267
|
-
SetExceptionMessage(exc, `Invalid vector at index ${i}: ${error.message}`);
|
|
268
|
-
exc.index = i;
|
|
269
|
-
ThrowException(exc);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
// Check if all vectors have the same size if required
|
|
273
|
-
const requireSameSize = args?.sameSize ?? true;
|
|
274
|
-
if (requireSameSize) {
|
|
275
|
-
const [firstSize] = sizes;
|
|
276
|
-
for (let i = 1; i < sizes.length; i++) {
|
|
277
|
-
if (sizes[i] !== firstSize) {
|
|
278
|
-
SetExceptionMessage(exc, `Vectors at index 0 and ${i} do not have the same size (${firstSize} vs ${sizes[i]})`);
|
|
279
|
-
exc.index = i;
|
|
280
|
-
ThrowException(exc);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
241
|
+
export function AssertVectorNonZero(vector, label = 'Vector') {
|
|
242
|
+
AssertVector(vector);
|
|
243
|
+
// Check if vector is zero (all components are 0)
|
|
244
|
+
const isZero = vector.every((v) => v === 0);
|
|
245
|
+
if (isZero) {
|
|
246
|
+
throw new VectorError(`${label} must not be zero`);
|
|
283
247
|
}
|
|
284
248
|
}
|
|
285
249
|
//# sourceMappingURL=asserts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asserts.js","sourceRoot":"","sources":["../../src/vectors/asserts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"asserts.js","sourceRoot":"","sources":["../../src/vectors/asserts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAA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