Repository navigation
feat(micro-utilities): add validate.io-integer-array to replacements - #1237
Merged
Merged
Conversation
43081j
approved these changes
Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1206
Adds
validate.io-integer-array(~3.2M weekly downloads) to the micro-utilities manifest, with a newsnippet::is-integer-array:This is close to the snippet in the issue, with one change: the array is spread before calling
every.everyskips empty slots, soArray(3).every(Number.isInteger)istrue, but the package returnsfalsefor arrays with holes. Spreading turns holes intoundefined, which keeps that behaviour.I compared it against
validate.io-integer-array@1.0.0on 20,000 random inputs (integers, floats,NaN,±Infinity,-0,1e21, strings, booleans,null, BigInt, nested arrays, sparse arrays and non-array values). Every case matched.The only difference I found is boxed numbers: the package accepts
[new Number(3)], whileNumber.isIntegerrejects it.