Commit a20791a
Fix Auto Parse TypeError from invalid OpenCV.js column data (#370)
* Initial plan
* Fix Auto Parse TypeError by adding defensive validation to detectColumns
Added validation checks to prevent "Cannot create property on number" error:
- Validate columns array elements before destructuring
- Add safe handling for malformed column data
- Replace destructuring assignment with explicit variable assignments
- Add validation in reduce operation to handle edge cases
Co-authored-by: cubap <1119165+cubap@users.noreply.github.com>
* Add number type validation to column detection
Improve robustness by validating that column array elements are numbers before performing arithmetic operations. This prevents potential runtime errors from non-numeric values.
Co-authored-by: cubap <1119165+cubap@users.noreply.github.com>
* Refactor: Extract isValidColumn helper function
Reduce code duplication by extracting column validation logic into a reusable helper function. This improves maintainability and makes the code more readable.
Co-authored-by: cubap <1119165+cubap@users.noreply.github.com>
* Add JSDoc documentation to isValidColumn helper
Document the validation helper function with JSDoc comments for better code maintainability and developer experience.
Co-authored-by: cubap <1119165+cubap@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: cubap <1119165+cubap@users.noreply.github.com>1 parent c75ee70 commit a20791a
1 file changed
Lines changed: 40 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
24 | 34 | | |
25 | 35 | | |
26 | 36 | | |
| |||
50 | 60 | | |
51 | 61 | | |
52 | 62 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
59 | 83 | | |
| 84 | + | |
| 85 | + | |
60 | 86 | | |
61 | | - | |
62 | | - | |
63 | 87 | | |
64 | 88 | | |
65 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
66 | 97 | | |
67 | 98 | | |
68 | 99 | | |
| |||
0 commit comments