(errors: string[], path: string, v: Vec3Lit | null)
| 182 | } |
| 183 | |
| 184 | function checkVec3(errors: string[], path: string, v: Vec3Lit | null): void { |
| 185 | if (!v || !Array.isArray(v) || v.length !== 3) { |
| 186 | errors.push(path + ' must be a length-3 number array'); |
| 187 | return; |
| 188 | } |
| 189 | if (typeof v[0] !== 'number' || typeof v[1] !== 'number' || typeof v[2] !== 'number') { |
| 190 | errors.push(path + ' must contain numbers'); |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | // Re-exported for use in loader/saver error formatting. |
| 195 | export function formatValidationErrors(errors: string[]): string { |
no test coverage detected