feat: add isAnyNumberArray - #19
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #19 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 4 7 +3
Branches 1 2 +1
=========================================
+ Hits 4 7 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@lpatiny This should be fast to review. Asking because maybe I'm missing that this is already doable with another library. |
lpatiny
left a comment
There was a problem hiding this comment.
It exists here something similar: https://github.com/mljs/spectra-processing/blob/78dc00dc75c91355a8ecf575ed302c915915c51c/src/x/xCheck.ts#L13-L18
I could also improve to add more option to really enforce all element to be a number of even not allow NaN.
If you prefer a small library you may merge this pr, no issue for me.
| * @param value - Object to check. | ||
| * @returns True if the object is an array of numbers or a typed array. | ||
| */ | ||
| export function isAnyNumberArray(value: unknown): value is AnyNumberArray { |
There was a problem hiding this comment.
|
I'm OK with using |
|
Yes good idea. Just proceed I will do the same when we need for xyCheck, etc. We could have isXArray for example. |
No description provided.