@pawells/math-extended 1.0.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/LICENSE +21 -0
- package/README.md +319 -0
- package/build/angles.d.ts +31 -0
- package/build/angles.d.ts.map +1 -0
- package/build/angles.js +85 -0
- package/build/angles.js.map +1 -0
- package/build/angles.spec.d.ts +2 -0
- package/build/angles.spec.d.ts.map +1 -0
- package/build/angles.spec.js +147 -0
- package/build/angles.spec.js.map +1 -0
- package/build/clamp.d.ts +17 -0
- package/build/clamp.d.ts.map +1 -0
- package/build/clamp.js +19 -0
- package/build/clamp.js.map +1 -0
- package/build/clamp.spec.d.ts +2 -0
- package/build/clamp.spec.d.ts.map +1 -0
- package/build/clamp.spec.js +19 -0
- package/build/clamp.spec.js.map +1 -0
- package/build/documentation-validation.spec.d.ts +11 -0
- package/build/documentation-validation.spec.d.ts.map +1 -0
- package/build/documentation-validation.spec.js +401 -0
- package/build/documentation-validation.spec.js.map +1 -0
- package/build/index.d.ts +8 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +8 -0
- package/build/index.js.map +1 -0
- package/build/interpolation.d.ts +175 -0
- package/build/interpolation.d.ts.map +1 -0
- package/build/interpolation.js +369 -0
- package/build/interpolation.js.map +1 -0
- package/build/interpolation.spec.d.ts +2 -0
- package/build/interpolation.spec.d.ts.map +1 -0
- package/build/interpolation.spec.js +480 -0
- package/build/interpolation.spec.js.map +1 -0
- package/build/matrices/arithmetic.d.ts +411 -0
- package/build/matrices/arithmetic.d.ts.map +1 -0
- package/build/matrices/arithmetic.js +954 -0
- package/build/matrices/arithmetic.js.map +1 -0
- package/build/matrices/arithmetic.spec.d.ts +2 -0
- package/build/matrices/arithmetic.spec.d.ts.map +1 -0
- package/build/matrices/arithmetic.spec.js +915 -0
- package/build/matrices/arithmetic.spec.js.map +1 -0
- package/build/matrices/asserts.d.ts +306 -0
- package/build/matrices/asserts.d.ts.map +1 -0
- package/build/matrices/asserts.js +396 -0
- package/build/matrices/asserts.js.map +1 -0
- package/build/matrices/asserts.spec.d.ts +2 -0
- package/build/matrices/asserts.spec.d.ts.map +1 -0
- package/build/matrices/asserts.spec.js +565 -0
- package/build/matrices/asserts.spec.js.map +1 -0
- package/build/matrices/core.d.ts +168 -0
- package/build/matrices/core.d.ts.map +1 -0
- package/build/matrices/core.js +457 -0
- package/build/matrices/core.js.map +1 -0
- package/build/matrices/core.spec.d.ts +2 -0
- package/build/matrices/core.spec.d.ts.map +1 -0
- package/build/matrices/core.spec.js +634 -0
- package/build/matrices/core.spec.js.map +1 -0
- package/build/matrices/decompositions.d.ts +326 -0
- package/build/matrices/decompositions.d.ts.map +1 -0
- package/build/matrices/decompositions.js +816 -0
- package/build/matrices/decompositions.js.map +1 -0
- package/build/matrices/decompositions.spec.d.ts +2 -0
- package/build/matrices/decompositions.spec.d.ts.map +1 -0
- package/build/matrices/decompositions.spec.js +195 -0
- package/build/matrices/decompositions.spec.js.map +1 -0
- package/build/matrices/index.d.ts +9 -0
- package/build/matrices/index.d.ts.map +1 -0
- package/build/matrices/index.js +9 -0
- package/build/matrices/index.js.map +1 -0
- package/build/matrices/linear-algebra.d.ts +64 -0
- package/build/matrices/linear-algebra.d.ts.map +1 -0
- package/build/matrices/linear-algebra.js +253 -0
- package/build/matrices/linear-algebra.js.map +1 -0
- package/build/matrices/linear-algebra.spec.d.ts +2 -0
- package/build/matrices/linear-algebra.spec.d.ts.map +1 -0
- package/build/matrices/linear-algebra.spec.js +355 -0
- package/build/matrices/linear-algebra.spec.js.map +1 -0
- package/build/matrices/normalization.d.ts +62 -0
- package/build/matrices/normalization.d.ts.map +1 -0
- package/build/matrices/normalization.js +167 -0
- package/build/matrices/normalization.js.map +1 -0
- package/build/matrices/normalization.spec.d.ts +2 -0
- package/build/matrices/normalization.spec.d.ts.map +1 -0
- package/build/matrices/normalization.spec.js +335 -0
- package/build/matrices/normalization.spec.js.map +1 -0
- package/build/matrices/transformations.d.ts +484 -0
- package/build/matrices/transformations.d.ts.map +1 -0
- package/build/matrices/transformations.js +592 -0
- package/build/matrices/transformations.js.map +1 -0
- package/build/matrices/transformations.spec.d.ts +2 -0
- package/build/matrices/transformations.spec.d.ts.map +1 -0
- package/build/matrices/transformations.spec.js +755 -0
- package/build/matrices/transformations.spec.js.map +1 -0
- package/build/matrices/types.d.ts +134 -0
- package/build/matrices/types.d.ts.map +1 -0
- package/build/matrices/types.js +6 -0
- package/build/matrices/types.js.map +1 -0
- package/build/quaternions/asserts.d.ts +77 -0
- package/build/quaternions/asserts.d.ts.map +1 -0
- package/build/quaternions/asserts.js +175 -0
- package/build/quaternions/asserts.js.map +1 -0
- package/build/quaternions/asserts.spec.d.ts +2 -0
- package/build/quaternions/asserts.spec.d.ts.map +1 -0
- package/build/quaternions/asserts.spec.js +320 -0
- package/build/quaternions/asserts.spec.js.map +1 -0
- package/build/quaternions/conversions.d.ts +73 -0
- package/build/quaternions/conversions.d.ts.map +1 -0
- package/build/quaternions/conversions.js +179 -0
- package/build/quaternions/conversions.js.map +1 -0
- package/build/quaternions/conversions.spec.d.ts +2 -0
- package/build/quaternions/conversions.spec.d.ts.map +1 -0
- package/build/quaternions/conversions.spec.js +344 -0
- package/build/quaternions/conversions.spec.js.map +1 -0
- package/build/quaternions/core.d.ts +203 -0
- package/build/quaternions/core.d.ts.map +1 -0
- package/build/quaternions/core.js +374 -0
- package/build/quaternions/core.js.map +1 -0
- package/build/quaternions/core.spec.d.ts +2 -0
- package/build/quaternions/core.spec.d.ts.map +1 -0
- package/build/quaternions/core.spec.js +294 -0
- package/build/quaternions/core.spec.js.map +1 -0
- package/build/quaternions/index.d.ts +7 -0
- package/build/quaternions/index.d.ts.map +1 -0
- package/build/quaternions/index.js +7 -0
- package/build/quaternions/index.js.map +1 -0
- package/build/quaternions/interpolation.d.ts +54 -0
- package/build/quaternions/interpolation.d.ts.map +1 -0
- package/build/quaternions/interpolation.js +201 -0
- package/build/quaternions/interpolation.js.map +1 -0
- package/build/quaternions/interpolation.spec.d.ts +2 -0
- package/build/quaternions/interpolation.spec.d.ts.map +1 -0
- package/build/quaternions/interpolation.spec.js +64 -0
- package/build/quaternions/interpolation.spec.js.map +1 -0
- package/build/quaternions/predefined.d.ts +36 -0
- package/build/quaternions/predefined.d.ts.map +1 -0
- package/build/quaternions/predefined.js +42 -0
- package/build/quaternions/predefined.js.map +1 -0
- package/build/quaternions/predefined.spec.d.ts +2 -0
- package/build/quaternions/predefined.spec.d.ts.map +1 -0
- package/build/quaternions/predefined.spec.js +35 -0
- package/build/quaternions/predefined.spec.js.map +1 -0
- package/build/quaternions/types.d.ts +55 -0
- package/build/quaternions/types.d.ts.map +1 -0
- package/build/quaternions/types.js +7 -0
- package/build/quaternions/types.js.map +1 -0
- package/build/random.d.ts +66 -0
- package/build/random.d.ts.map +1 -0
- package/build/random.js +115 -0
- package/build/random.js.map +1 -0
- package/build/random.spec.d.ts +2 -0
- package/build/random.spec.d.ts.map +1 -0
- package/build/random.spec.js +267 -0
- package/build/random.spec.js.map +1 -0
- package/build/vectors/asserts.d.ts +182 -0
- package/build/vectors/asserts.d.ts.map +1 -0
- package/build/vectors/asserts.js +285 -0
- package/build/vectors/asserts.js.map +1 -0
- package/build/vectors/asserts.spec.d.ts +2 -0
- package/build/vectors/asserts.spec.d.ts.map +1 -0
- package/build/vectors/asserts.spec.js +260 -0
- package/build/vectors/asserts.spec.js.map +1 -0
- package/build/vectors/core.d.ts +507 -0
- package/build/vectors/core.d.ts.map +1 -0
- package/build/vectors/core.js +825 -0
- package/build/vectors/core.js.map +1 -0
- package/build/vectors/core.spec.d.ts +2 -0
- package/build/vectors/core.spec.d.ts.map +1 -0
- package/build/vectors/core.spec.js +343 -0
- package/build/vectors/core.spec.js.map +1 -0
- package/build/vectors/index.d.ts +6 -0
- package/build/vectors/index.d.ts.map +1 -0
- package/build/vectors/index.js +6 -0
- package/build/vectors/index.js.map +1 -0
- package/build/vectors/interpolation.d.ts +404 -0
- package/build/vectors/interpolation.d.ts.map +1 -0
- package/build/vectors/interpolation.js +585 -0
- package/build/vectors/interpolation.js.map +1 -0
- package/build/vectors/interpolation.spec.d.ts +2 -0
- package/build/vectors/interpolation.spec.d.ts.map +1 -0
- package/build/vectors/interpolation.spec.js +378 -0
- package/build/vectors/interpolation.spec.js.map +1 -0
- package/build/vectors/predefined.d.ts +191 -0
- package/build/vectors/predefined.d.ts.map +1 -0
- package/build/vectors/predefined.js +191 -0
- package/build/vectors/predefined.js.map +1 -0
- package/build/vectors/predefined.spec.d.ts +2 -0
- package/build/vectors/predefined.spec.d.ts.map +1 -0
- package/build/vectors/predefined.spec.js +333 -0
- package/build/vectors/predefined.spec.js.map +1 -0
- package/build/vectors/types.d.ts +62 -0
- package/build/vectors/types.d.ts.map +1 -0
- package/build/vectors/types.js +6 -0
- package/build/vectors/types.js.map +1 -0
- package/package.json +75 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vector assertion utilities for type safety and runtime validation.
|
|
3
|
+
* Provides comprehensive validation functions to ensure vector data integrity
|
|
4
|
+
* and catch errors early in mathematical operations.
|
|
5
|
+
*/
|
|
6
|
+
import { SetExceptionMessage, ThrowException } from '@pawells/typescript-common';
|
|
7
|
+
/**
|
|
8
|
+
* Specialized error class for vector-related operations and validations.
|
|
9
|
+
* Thrown when vector assertions fail or vector operations encounter invalid data.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* try {
|
|
13
|
+
* AssertVector("not a vector");
|
|
14
|
+
* } catch (error) {
|
|
15
|
+
* if (error instanceof VectorError) {
|
|
16
|
+
* console.log("Vector validation failed:", error.message);
|
|
17
|
+
* }
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
20
|
+
export class VectorError extends Error {
|
|
21
|
+
/**
|
|
22
|
+
* Creates a new VectorError instance.
|
|
23
|
+
*
|
|
24
|
+
* @param message - Optional error message describing the validation failure
|
|
25
|
+
*/
|
|
26
|
+
constructor(message) {
|
|
27
|
+
super(message);
|
|
28
|
+
this.name = 'VectorError';
|
|
29
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Validates that an unknown value is a valid vector (array of numbers).
|
|
34
|
+
*
|
|
35
|
+
* Performs comprehensive validation including array structure, size constraints,
|
|
36
|
+
* and element-level number validation for every component.
|
|
37
|
+
*
|
|
38
|
+
* @param vector - The value to validate as a vector
|
|
39
|
+
* @param args - Validation constraints (size, minSize, maxSize, finite, integer, gt, gte, lt, lte, eq)
|
|
40
|
+
* @param exception - Custom exception details if validation fails
|
|
41
|
+
* @throws {VectorError} If the value is not a valid vector meeting all constraints
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* // Basic validation — passes silently for a valid vector
|
|
46
|
+
* AssertVector([1, 2, 3]);
|
|
47
|
+
*
|
|
48
|
+
* // Validate with size constraint
|
|
49
|
+
* AssertVector([1, 2], { size: 2 });
|
|
50
|
+
*
|
|
51
|
+
* // Throws VectorError for non-array input
|
|
52
|
+
* AssertVector("not a vector"); // throws VectorError
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export function AssertVector(vector, args = {}, exception = {}) {
|
|
56
|
+
// Initialize exception configuration with defaults
|
|
57
|
+
const exc = exception ?? {};
|
|
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);
|
|
70
|
+
}
|
|
71
|
+
if (args.minSize !== undefined && array.length < args.minSize) {
|
|
72
|
+
SetExceptionMessage(exc, `Vector is less than minimum size. (min: ${args.minSize})`);
|
|
73
|
+
ThrowException(exc);
|
|
74
|
+
}
|
|
75
|
+
if (args.maxSize !== undefined && array.length > args.maxSize) {
|
|
76
|
+
SetExceptionMessage(exc, `Vector exceeds maximum size. (max: ${args.maxSize})`);
|
|
77
|
+
ThrowException(exc);
|
|
78
|
+
}
|
|
79
|
+
// Validate each element is a valid number using AssertVectorValue
|
|
80
|
+
for (let i = 0; i < array.length; i++) {
|
|
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
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Validates that an unknown value is a valid 2D vector (exactly 2 numeric components).
|
|
98
|
+
*
|
|
99
|
+
* @param vector - The value to validate as a 2D vector
|
|
100
|
+
* @param exception - Custom exception details if validation fails
|
|
101
|
+
* @throws {VectorError} If the value is not a 2-component vector
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* AssertVector2([1, 2]); // passes
|
|
106
|
+
* AssertVector2([1, 2, 3]); // throws — too many components
|
|
107
|
+
* AssertVector2("not a vec"); // throws
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
export function AssertVector2(vector, exception = {}) {
|
|
111
|
+
AssertVector(vector, { size: 2 }, exception);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Validates that an unknown value is a valid 3D vector (exactly 3 numeric components).
|
|
115
|
+
*
|
|
116
|
+
* @param vector - The value to validate as a 3D vector
|
|
117
|
+
* @param exception - Custom exception details if validation fails
|
|
118
|
+
* @throws {VectorError} If the value is not a 3-component vector
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* AssertVector3([1, 2, 3]); // passes
|
|
123
|
+
* AssertVector3([1, 2]); // throws — too few components
|
|
124
|
+
* AssertVector3(null); // throws
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
export function AssertVector3(vector, exception = {}) {
|
|
128
|
+
AssertVector(vector, { size: 3 }, exception);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Validates that an unknown value is a valid 4D vector (exactly 4 numeric components).
|
|
132
|
+
*
|
|
133
|
+
* @param vector - The value to validate as a 4D vector
|
|
134
|
+
* @param exception - Custom exception details if validation fails
|
|
135
|
+
* @throws {VectorError} If the value is not a 4-component vector
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```typescript
|
|
139
|
+
* AssertVector4([1, 2, 3, 4]); // passes
|
|
140
|
+
* AssertVector4([1, 2, 3]); // throws — too few components
|
|
141
|
+
* AssertVector4(undefined); // throws
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
export function AssertVector4(vector, exception = {}) {
|
|
145
|
+
AssertVector(vector, { size: 4 }, exception);
|
|
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);
|
|
180
|
+
}
|
|
181
|
+
// Type cast is safe after number validation
|
|
182
|
+
const numValue = value;
|
|
183
|
+
// Apply all number validation constraints using the same logic as AssertNumber
|
|
184
|
+
// but with VectorError as the default error class instead of NumberError
|
|
185
|
+
// Validate finite constraint (if specified, value must be finite)
|
|
186
|
+
if (args.finite === true && !Number.isFinite(numValue)) {
|
|
187
|
+
SetExceptionMessage(exc, `Vector${exc.index ? `[${exc.index}]` : ''} Must be Finite`);
|
|
188
|
+
ThrowException(exc);
|
|
189
|
+
}
|
|
190
|
+
// Validate integer constraint (if specified, value must be an integer)
|
|
191
|
+
if (args.integer === true && !Number.isInteger(numValue)) {
|
|
192
|
+
SetExceptionMessage(exc, `Vector${exc.index ? `[${exc.index}]` : ''} Must be an Integer`);
|
|
193
|
+
ThrowException(exc);
|
|
194
|
+
}
|
|
195
|
+
// Validate equality constraint (if specified, value must exactly match)
|
|
196
|
+
if (args.eq !== undefined && numValue !== args.eq) {
|
|
197
|
+
SetExceptionMessage(exc, `Vector${exc.index ? `[${exc.index}]` : ''} Must be equal to ${args.eq}`);
|
|
198
|
+
ThrowException(exc);
|
|
199
|
+
}
|
|
200
|
+
// Validate greater than constraint (exclusive - value must be strictly greater)
|
|
201
|
+
if (args.gt !== undefined && numValue <= args.gt) {
|
|
202
|
+
SetExceptionMessage(exc, `Vector${exc.index ? `[${exc.index}]` : ''} Must be greater than ${args.gt}`);
|
|
203
|
+
ThrowException(exc);
|
|
204
|
+
}
|
|
205
|
+
// Validate greater than or equal constraint (inclusive - value can equal the bound)
|
|
206
|
+
if (args.gte !== undefined && numValue < args.gte) {
|
|
207
|
+
SetExceptionMessage(exc, `Vector${exc.index ? `[${exc.index}]` : ''} Must be greater than or equal to ${args.gte}`);
|
|
208
|
+
ThrowException(exc);
|
|
209
|
+
}
|
|
210
|
+
// Validate less than constraint (exclusive - value must be strictly less)
|
|
211
|
+
if (args.lt !== undefined && numValue >= args.lt) {
|
|
212
|
+
SetExceptionMessage(exc, `Vector${exc.index ? `[${exc.index}]` : ''} Must be less than ${args.lt}`);
|
|
213
|
+
ThrowException(exc);
|
|
214
|
+
}
|
|
215
|
+
// Validate less than or equal constraint (inclusive - value can equal the bound)
|
|
216
|
+
if (args.lte !== undefined && numValue > args.lte) {
|
|
217
|
+
SetExceptionMessage(exc, `Vector${exc.index ? `[${exc.index}]` : ''} Must be less than or equal to ${args.lte}`);
|
|
218
|
+
ThrowException(exc);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Validates an array of vectors, ensuring each vector is valid and optionally
|
|
223
|
+
* enforcing that all vectors share the same size.
|
|
224
|
+
*
|
|
225
|
+
* @param vectors - The array of vectors to validate (must be non-empty)
|
|
226
|
+
* @param args - Validation constraints applied to each vector; set `sameSize: true`
|
|
227
|
+
* to require all vectors to have identical lengths
|
|
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`
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* ```typescript
|
|
234
|
+
* // Validate an array of 3D vectors
|
|
235
|
+
* AssertVectors([[1, 2, 3], [4, 5, 6]]);
|
|
236
|
+
*
|
|
237
|
+
* // Require all vectors to share the same length
|
|
238
|
+
* AssertVectors([[1, 2], [3, 4]], { sameSize: true });
|
|
239
|
+
*
|
|
240
|
+
* // Throws because vectors have different sizes
|
|
241
|
+
* AssertVectors([[1, 2], [1, 2, 3]], { sameSize: true }); // throws
|
|
242
|
+
* ```
|
|
243
|
+
*/
|
|
244
|
+
export function AssertVectors(vectors, args, exception) {
|
|
245
|
+
const exc = exception ?? {};
|
|
246
|
+
exc.class ??= VectorError;
|
|
247
|
+
// Validate that vectors is an array of arrays
|
|
248
|
+
if (!Array.isArray(vectors)) {
|
|
249
|
+
SetExceptionMessage(exc, 'Vectors argument must be an array of vectors');
|
|
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
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
//# sourceMappingURL=asserts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asserts.js","sourceRoot":"","sources":["../../src/vectors/asserts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAyD,mBAAmB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AA2CxI;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IACrC;;;;OAIG;IACH,YAAY,OAAgB;QAC3B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACnD,CAAC;CACD;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,YAAY,CAAC,MAAe,EAAE,OAA0B,EAAE,EAAE,YAAoC,EAAE;IACjH,mDAAmD;IACnD,MAAM,GAAG,GAA2B,SAAS,IAAI,EAAE,CAAC;IACpD,GAAG,CAAC,KAAK,KAAK,WAAW,CAAC;IAE1B,oCAAoC;IACpC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5B,mBAAmB,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAC;QAC/C,cAAc,CAAC,GA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,CAAC;IACF,CAAC;IAED,sDAAsD;IACtD,MAAM,eAAe,GAAG,IAAI,EAAE,QAAQ,IAAI,IAAI,CAAC;IAC/C,IAAI,eAAe,EAAE,CAAC;QACrB,MAAM,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;QAE1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACvC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;gBAC5B,mBAAmB,CAAC,GAAG,EAAE,0BAA0B,CAAC,+BAA+B,SAAS,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;gBAChH,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;gBACd,cAAc,CAAC,GAAG,CAAC,CAAC;YACrB,CAAC;QACF,CAAC;IACF,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asserts.spec.d.ts","sourceRoot":"","sources":["../../src/vectors/asserts.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { VectorError, AssertVector, AssertVector2, AssertVector3, AssertVector4, AssertVectorValue, AssertVectors, } from './asserts.js';
|
|
2
|
+
describe('Vector Assertions', () => {
|
|
3
|
+
describe('VectorError', () => {
|
|
4
|
+
it('should create a VectorError with message', () => {
|
|
5
|
+
const error = new VectorError('test message');
|
|
6
|
+
expect(error).toBeInstanceOf(Error);
|
|
7
|
+
expect(error).toBeInstanceOf(VectorError);
|
|
8
|
+
expect(error.name).toBe('VectorError');
|
|
9
|
+
expect(error.message).toBe('test message');
|
|
10
|
+
});
|
|
11
|
+
it('should create a VectorError without message', () => {
|
|
12
|
+
const error = new VectorError();
|
|
13
|
+
expect(error).toBeInstanceOf(Error);
|
|
14
|
+
expect(error).toBeInstanceOf(VectorError);
|
|
15
|
+
expect(error.name).toBe('VectorError');
|
|
16
|
+
expect(error.message).toBe('');
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
describe('AssertVector', () => {
|
|
20
|
+
it('should pass for valid vectors', () => {
|
|
21
|
+
expect(() => AssertVector([1, 2, 3])).not.toThrow();
|
|
22
|
+
expect(() => AssertVector([0])).not.toThrow();
|
|
23
|
+
expect(() => AssertVector([1.5, -2.7, 3.14])).not.toThrow();
|
|
24
|
+
expect(() => AssertVector([])).not.toThrow();
|
|
25
|
+
});
|
|
26
|
+
it('should throw for non-arrays', () => {
|
|
27
|
+
expect(() => AssertVector(null)).toThrow(VectorError);
|
|
28
|
+
expect(() => AssertVector(undefined)).toThrow(VectorError);
|
|
29
|
+
expect(() => AssertVector(123)).toThrow(VectorError);
|
|
30
|
+
expect(() => AssertVector('string')).toThrow(VectorError);
|
|
31
|
+
expect(() => AssertVector({})).toThrow(VectorError);
|
|
32
|
+
});
|
|
33
|
+
it('should throw for arrays with non-number elements', () => {
|
|
34
|
+
expect(() => AssertVector([1, 2, 'string'])).toThrow(VectorError);
|
|
35
|
+
expect(() => AssertVector([1, null, 3])).toThrow(VectorError);
|
|
36
|
+
expect(() => AssertVector([1, undefined, 3])).toThrow(VectorError);
|
|
37
|
+
expect(() => AssertVector([1, {}, 3])).toThrow(VectorError);
|
|
38
|
+
expect(() => AssertVector([NaN])).toThrow(VectorError);
|
|
39
|
+
});
|
|
40
|
+
it('should respect size constraints', () => {
|
|
41
|
+
// Exact size
|
|
42
|
+
expect(() => AssertVector([1, 2], { size: 2 })).not.toThrow();
|
|
43
|
+
expect(() => AssertVector([1, 2, 3], { size: 2 })).toThrow(VectorError);
|
|
44
|
+
expect(() => AssertVector([1], { size: 2 })).toThrow(VectorError);
|
|
45
|
+
// Minimum size
|
|
46
|
+
expect(() => AssertVector([1, 2, 3], { minSize: 2 })).not.toThrow();
|
|
47
|
+
expect(() => AssertVector([1, 2], { minSize: 2 })).not.toThrow();
|
|
48
|
+
expect(() => AssertVector([1], { minSize: 2 })).toThrow(VectorError);
|
|
49
|
+
// Maximum size
|
|
50
|
+
expect(() => AssertVector([1], { maxSize: 2 })).not.toThrow();
|
|
51
|
+
expect(() => AssertVector([1, 2], { maxSize: 2 })).not.toThrow();
|
|
52
|
+
expect(() => AssertVector([1, 2, 3], { maxSize: 2 })).toThrow(VectorError);
|
|
53
|
+
});
|
|
54
|
+
it('should respect combined constraints', () => {
|
|
55
|
+
expect(() => AssertVector([1, 2], { minSize: 1, maxSize: 3 })).not.toThrow();
|
|
56
|
+
expect(() => AssertVector([1], { minSize: 2, maxSize: 3 })).toThrow(VectorError);
|
|
57
|
+
expect(() => AssertVector([1, 2, 3, 4], { minSize: 1, maxSize: 3 })).toThrow(VectorError);
|
|
58
|
+
});
|
|
59
|
+
it('should use custom exception properties', () => {
|
|
60
|
+
const customException = { message: 'Custom error', customProp: true };
|
|
61
|
+
expect(() => AssertVector('invalid', {}, customException)).toThrow('Custom error');
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
describe('AssertVector2', () => {
|
|
65
|
+
it('should pass for valid 2D vectors', () => {
|
|
66
|
+
expect(() => AssertVector2([1, 2])).not.toThrow();
|
|
67
|
+
expect(() => AssertVector2([0, 0])).not.toThrow();
|
|
68
|
+
expect(() => AssertVector2([-1.5, 2.7])).not.toThrow();
|
|
69
|
+
});
|
|
70
|
+
it('should throw for invalid 2D vectors', () => {
|
|
71
|
+
expect(() => AssertVector2([1])).toThrow(VectorError);
|
|
72
|
+
expect(() => AssertVector2([1, 2, 3])).toThrow(VectorError);
|
|
73
|
+
expect(() => AssertVector2([])).toThrow(VectorError);
|
|
74
|
+
expect(() => AssertVector2([1, 'string'])).toThrow(VectorError);
|
|
75
|
+
expect(() => AssertVector2('invalid')).toThrow(VectorError);
|
|
76
|
+
});
|
|
77
|
+
it('should use custom exception properties', () => {
|
|
78
|
+
const customException = { message: 'Custom 2D error' };
|
|
79
|
+
expect(() => AssertVector2([1], customException)).toThrow('Custom 2D error');
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
describe('AssertVector3', () => {
|
|
83
|
+
it('should pass for valid 3D vectors', () => {
|
|
84
|
+
expect(() => AssertVector3([1, 2, 3])).not.toThrow();
|
|
85
|
+
expect(() => AssertVector3([0, 0, 0])).not.toThrow();
|
|
86
|
+
expect(() => AssertVector3([-1.5, 2.7, -3.14])).not.toThrow();
|
|
87
|
+
});
|
|
88
|
+
it('should throw for invalid 3D vectors', () => {
|
|
89
|
+
expect(() => AssertVector3([1, 2])).toThrow(VectorError);
|
|
90
|
+
expect(() => AssertVector3([1, 2, 3, 4])).toThrow(VectorError);
|
|
91
|
+
expect(() => AssertVector3([])).toThrow(VectorError);
|
|
92
|
+
expect(() => AssertVector3([1, 2, 'string'])).toThrow(VectorError);
|
|
93
|
+
expect(() => AssertVector3('invalid')).toThrow(VectorError);
|
|
94
|
+
});
|
|
95
|
+
it('should use custom exception properties', () => {
|
|
96
|
+
const customException = { message: 'Custom 3D error' };
|
|
97
|
+
expect(() => AssertVector3([1, 2], customException)).toThrow('Custom 3D error');
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
describe('AssertVector4', () => {
|
|
101
|
+
it('should pass for valid 4D vectors', () => {
|
|
102
|
+
expect(() => AssertVector4([1, 2, 3, 4])).not.toThrow();
|
|
103
|
+
expect(() => AssertVector4([0, 0, 0, 0])).not.toThrow();
|
|
104
|
+
expect(() => AssertVector4([-1.5, 2.7, -3.14, 4.2])).not.toThrow();
|
|
105
|
+
});
|
|
106
|
+
it('should throw for invalid 4D vectors', () => {
|
|
107
|
+
expect(() => AssertVector4([1, 2, 3])).toThrow(VectorError);
|
|
108
|
+
expect(() => AssertVector4([1, 2, 3, 4, 5])).toThrow(VectorError);
|
|
109
|
+
expect(() => AssertVector4([])).toThrow(VectorError);
|
|
110
|
+
expect(() => AssertVector4([1, 2, 3, 'string'])).toThrow(VectorError);
|
|
111
|
+
expect(() => AssertVector4('invalid')).toThrow(VectorError);
|
|
112
|
+
});
|
|
113
|
+
it('should use custom exception properties', () => {
|
|
114
|
+
const customException = { message: 'Custom 4D error' };
|
|
115
|
+
expect(() => AssertVector4([1, 2, 3], customException)).toThrow('Custom 4D error');
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
describe('AssertVectorValue', () => {
|
|
119
|
+
it('should pass for valid numbers', () => {
|
|
120
|
+
expect(() => AssertVectorValue(1)).not.toThrow();
|
|
121
|
+
expect(() => AssertVectorValue(0)).not.toThrow();
|
|
122
|
+
expect(() => AssertVectorValue(-1.5)).not.toThrow();
|
|
123
|
+
expect(() => AssertVectorValue(3.14159)).not.toThrow();
|
|
124
|
+
expect(() => AssertVectorValue(Infinity)).not.toThrow();
|
|
125
|
+
expect(() => AssertVectorValue(-Infinity)).not.toThrow();
|
|
126
|
+
});
|
|
127
|
+
it('should throw for invalid values', () => {
|
|
128
|
+
expect(() => AssertVectorValue(NaN)).toThrow(VectorError);
|
|
129
|
+
expect(() => AssertVectorValue('string')).toThrow(VectorError);
|
|
130
|
+
expect(() => AssertVectorValue(null)).toThrow(VectorError);
|
|
131
|
+
expect(() => AssertVectorValue(undefined)).toThrow(VectorError);
|
|
132
|
+
expect(() => AssertVectorValue({})).toThrow(VectorError);
|
|
133
|
+
expect(() => AssertVectorValue([])).toThrow(VectorError);
|
|
134
|
+
});
|
|
135
|
+
it('should include index in error message when provided', () => {
|
|
136
|
+
expect(() => AssertVectorValue('invalid', {}, { index: 42 })).toThrow('Vector[42] Not a Number');
|
|
137
|
+
});
|
|
138
|
+
it('should throw with generic message when no index provided', () => {
|
|
139
|
+
expect(() => AssertVectorValue('invalid')).toThrow('Vector element must be a number, got string');
|
|
140
|
+
});
|
|
141
|
+
it('should use custom exception properties', () => {
|
|
142
|
+
const customException = { message: 'Custom value error' };
|
|
143
|
+
expect(() => AssertVectorValue('invalid', {}, customException)).toThrow('Custom value error');
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
describe('AssertVectorValue (extended constraints)', () => {
|
|
147
|
+
it('should throw if finite=true and value is Infinity', () => {
|
|
148
|
+
expect(() => AssertVectorValue(Infinity, { finite: true })).toThrow('Vector Must be Finite');
|
|
149
|
+
expect(() => AssertVectorValue(-Infinity, { finite: true })).toThrow('Vector Must be Finite');
|
|
150
|
+
});
|
|
151
|
+
it('should throw if integer=true and value is not integer', () => {
|
|
152
|
+
expect(() => AssertVectorValue(1.5, { integer: true })).toThrow('Vector Must be an Integer');
|
|
153
|
+
});
|
|
154
|
+
it('should throw if eq is set and value does not match', () => {
|
|
155
|
+
expect(() => AssertVectorValue(2, { eq: 3 })).toThrow('Vector Must be equal to 3');
|
|
156
|
+
});
|
|
157
|
+
it('should throw if gt is set and value is not greater', () => {
|
|
158
|
+
expect(() => AssertVectorValue(2, { gt: 2 })).toThrow('Vector Must be greater than 2');
|
|
159
|
+
expect(() => AssertVectorValue(1, { gt: 2 })).toThrow('Vector Must be greater than 2');
|
|
160
|
+
});
|
|
161
|
+
it('should throw if gte is set and value is less', () => {
|
|
162
|
+
expect(() => AssertVectorValue(1, { gte: 2 })).toThrow('Vector Must be greater than or equal to 2');
|
|
163
|
+
});
|
|
164
|
+
it('should throw if lt is set and value is not less', () => {
|
|
165
|
+
expect(() => AssertVectorValue(3, { lt: 2 })).toThrow('Vector Must be less than 2');
|
|
166
|
+
expect(() => AssertVectorValue(2, { lt: 2 })).toThrow('Vector Must be less than 2');
|
|
167
|
+
});
|
|
168
|
+
it('should throw if lte is set and value is greater', () => {
|
|
169
|
+
expect(() => AssertVectorValue(3, { lte: 2 })).toThrow('Vector Must be less than or equal to 2');
|
|
170
|
+
});
|
|
171
|
+
it('should include index in all constraint error messages', () => {
|
|
172
|
+
expect(() => AssertVectorValue(Infinity, { finite: true }, { index: 5 })).toThrow('Vector[5] Must be Finite');
|
|
173
|
+
expect(() => AssertVectorValue(1.5, { integer: true }, { index: 6 })).toThrow('Vector[6] Must be an Integer');
|
|
174
|
+
expect(() => AssertVectorValue(2, { eq: 3 }, { index: 7 })).toThrow('Vector[7] Must be equal to 3');
|
|
175
|
+
expect(() => AssertVectorValue(2, { gt: 2 }, { index: 8 })).toThrow('Vector[8] Must be greater than 2');
|
|
176
|
+
expect(() => AssertVectorValue(1, { gte: 2 }, { index: 9 })).toThrow('Vector[9] Must be greater than or equal to 2');
|
|
177
|
+
expect(() => AssertVectorValue(3, { lt: 2 }, { index: 10 })).toThrow('Vector[10] Must be less than 2');
|
|
178
|
+
expect(() => AssertVectorValue(3, { lte: 2 }, { index: 11 })).toThrow('Vector[11] Must be less than or equal to 2');
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
describe('AssertVectors', () => {
|
|
182
|
+
describe('individual arguments syntax', () => {
|
|
183
|
+
it('should pass for valid vectors of same size', () => {
|
|
184
|
+
expect(() => AssertVectors([[1, 2], [3, 4]])).not.toThrow();
|
|
185
|
+
expect(() => AssertVectors([[1, 2, 3], [4, 5, 6], [7, 8, 9]])).not.toThrow();
|
|
186
|
+
expect(() => AssertVectors([[1]])).not.toThrow();
|
|
187
|
+
});
|
|
188
|
+
it('should throw for vectors of different sizes', () => {
|
|
189
|
+
expect(() => AssertVectors([[1, 2], [3, 4, 5]])).toThrow(VectorError);
|
|
190
|
+
expect(() => AssertVectors([[1], [2, 3], [4, 5, 6]])).toThrow(VectorError);
|
|
191
|
+
});
|
|
192
|
+
it('should throw for invalid vectors', () => {
|
|
193
|
+
expect(() => AssertVectors([[1, 2], 'invalid'])).toThrow(VectorError);
|
|
194
|
+
expect(() => AssertVectors([[1, 2], [3, 'string']])).toThrow(VectorError);
|
|
195
|
+
});
|
|
196
|
+
it('should throw when no vectors provided', () => {
|
|
197
|
+
expect(() => AssertVectors([])).toThrow(VectorError);
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
describe('array with args syntax', () => {
|
|
201
|
+
it('should pass for valid vectors with same size check', () => {
|
|
202
|
+
const vectors = [[1, 2], [3, 4]];
|
|
203
|
+
expect(() => AssertVectors(vectors, { sameSize: true })).not.toThrow();
|
|
204
|
+
});
|
|
205
|
+
it('should pass for valid vectors without same size check', () => {
|
|
206
|
+
const vectors = [[1, 2], [3, 4, 5]];
|
|
207
|
+
expect(() => AssertVectors(vectors, { sameSize: false })).not.toThrow();
|
|
208
|
+
});
|
|
209
|
+
it('should throw for vectors of different sizes when sameSize is true', () => {
|
|
210
|
+
const vectors = [[1, 2], [3, 4, 5]];
|
|
211
|
+
expect(() => AssertVectors(vectors, { sameSize: true })).toThrow(VectorError);
|
|
212
|
+
});
|
|
213
|
+
it('should respect size constraints', () => {
|
|
214
|
+
const vectors = [[1, 2], [3, 4]];
|
|
215
|
+
expect(() => AssertVectors(vectors, { size: 2 })).not.toThrow();
|
|
216
|
+
expect(() => AssertVectors(vectors, { size: 3 })).toThrow(VectorError);
|
|
217
|
+
expect(() => AssertVectors(vectors, { minSize: 1 })).not.toThrow();
|
|
218
|
+
expect(() => AssertVectors(vectors, { minSize: 3 })).toThrow(VectorError);
|
|
219
|
+
expect(() => AssertVectors(vectors, { maxSize: 3 })).not.toThrow();
|
|
220
|
+
expect(() => AssertVectors(vectors, { maxSize: 1 })).toThrow(VectorError);
|
|
221
|
+
});
|
|
222
|
+
it('should use custom exception properties', () => {
|
|
223
|
+
const vectors = [[1, 2], [3, 4, 5]];
|
|
224
|
+
const customException = { message: 'Custom vectors error' };
|
|
225
|
+
expect(() => AssertVectors(vectors, { sameSize: true }, customException)).toThrow('Custom vectors error');
|
|
226
|
+
});
|
|
227
|
+
it('should throw when empty array provided', () => {
|
|
228
|
+
expect(() => AssertVectors([], {})).toThrow(VectorError);
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
describe('edge cases', () => {
|
|
232
|
+
it('should handle single vector correctly', () => {
|
|
233
|
+
expect(() => AssertVectors([[1, 2]])).not.toThrow();
|
|
234
|
+
const vectors = [[1, 2]];
|
|
235
|
+
expect(() => AssertVectors(vectors, { sameSize: true })).not.toThrow();
|
|
236
|
+
});
|
|
237
|
+
it('should handle mixed valid and invalid vectors', () => {
|
|
238
|
+
// @ts-expect-error - second vector contains a string, which is not a valid vector element
|
|
239
|
+
expect(() => AssertVectors([1, 2], [3, 'invalid'])).toThrow(VectorError);
|
|
240
|
+
expect(() => AssertVectors([[1, 2], [3, 'invalid']], {})).toThrow(VectorError);
|
|
241
|
+
expect(() => AssertVectors([[1, 2], [3, 'invalid']], {})).toThrow(VectorError);
|
|
242
|
+
});
|
|
243
|
+
it('should detect args object correctly', () => {
|
|
244
|
+
// This should be treated as individual vectors, not array + args
|
|
245
|
+
// @ts-expect-error - second argument is not a valid options object, should be treated as a vector
|
|
246
|
+
expect(() => AssertVectors([1, 2], { notAnArgsObject: true })).toThrow(VectorError);
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
describe('error messages', () => {
|
|
250
|
+
it('should provide descriptive error for size mismatch', () => {
|
|
251
|
+
expect(() => AssertVectors([[1, 2], [3, 4, 5]])).toThrow('Vectors at index 0 and 1 do not have the same size (2 vs 3)');
|
|
252
|
+
});
|
|
253
|
+
it('should provide descriptive error for no vectors', () => {
|
|
254
|
+
const emptyVectors = [];
|
|
255
|
+
expect(() => AssertVectors(emptyVectors, { sameSize: true })).toThrow('Vectors array is empty');
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
//# sourceMappingURL=asserts.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asserts.spec.js","sourceRoot":"","sources":["../../src/vectors/asserts.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,EACX,YAAY,EACZ,aAAa,EACb,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,aAAa,GACb,MAAM,cAAc,CAAC;AAEtB,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAClC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;QAC5B,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;YACnD,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC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