@sindresorhus/is
8.1.0 · 11 May 2026MIT93.8M / weekRepositoryHomepagenpmAtom feed
8.1.0 is the newest release of 8.x.
In short
1 breaking7 new5 fixed
- breaking
Require Node.js 22 faf7003
Release note
Breaking
- breaking
Require Node.js 22 faf7003
New
Add
finiteNumberpredicate 63be5c0Add
nonNegativeNumberpredicate 63be5c0Add
positiveIntegerpredicate 63be5c0Add
negativeIntegerpredicate 54fc094Add
nonNegativeIntegerpredicate 54fc094Add
arrayOfpredicate factory 54fc094Returns a type guard that checks if every item in an array matches the predicate. Useful for composing with other methods.
Add
oneOfpredicate factory 54fc094Returns a type guard that checks if a value is one of the given values. Best used with
as constfor precise type narrowing.
Fixes
Fix
isEmptyObjectandisNonEmptyObjectincorrectly accepting functions and arrays 3b40955Fix
isNumericStringincorrectly accepting strings with surrounding whitespace 47415dcFix
isInRangesilently returningfalsewhen range containsNaN(now throws) ac46b54Fix
isEnumCaseincorrectly accepting numeric enum key names cb4ee0eFix numeric type guards (
isInteger,isEvenInteger,isOddInteger,isSafeInteger,isPositiveNumber,isNegativeNumber,isInfinite,isNan,isValidLength) narrowing the false branch tonever13febb6These now use branded types so that
if (!is.integer(n)) { ... }keepsnasnumberinstead ofnever