NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm, #3912 most downloaded on npm
A little library for asserting types and values, with zero dependencies.
Latest stable
11.2.3
Last release 3 years ago
no release in 18 months
Ships unpredictably
gaps range from 3 weeks to 2.8 years
Most releases are documented
notes for 44 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
90 releases · first in 2012
Drag across the ruler to compare, or tap a release to open it.
predicates: make identical work for nested objects
identical work for nested objects (b6ba2728bf4e6b73a97a199739d031e827d42321)predicates: don't throw if args to identical are null
predicates: don't throw if args to like are null
Your coding agent can read these notes before it upgrades. Set up the MCP server →
predicates: implement identical
errors: format true correctly in error messages
true correctly in error messages (51291ef)### Other changes * build: update minified script (99f024b) * docs: tweak comment
docs: add missing link to readme index
api: remove trim option from emptyString and nonEmptyString
lib: shortcut unnecessary iteration for Sets in contains
docs: fix broken description for keyIn predicate
### New features * api: add keyIn predicate (1ff2227) * api: add containsKey predicate (40c28c7) ### Other changes * lib: fix lint errors
assert: return detailed error messages from assertions
docs: link to changes for 9.0.0
lib: support a trim option on emptyString and nonEmptyString
docs: remove stale link from readme
lib: ignore properties in map that have no predicate
### Bug fixes * docs: fix link to change log (9166ecf) ### Other changes * docs: update copyright
api: remove apply and combine functionality with map
docs: add note about typescript definitions to readme
feature: add primitive predicate
fix: perf tweaks for tight loops
feature: return the target value from assertions
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Implement nonEmptyObject. Thanks to [Victor Bakke][gipphe].
nonEmptyObject. Thanks to [Victor Bakke][gipphe].nonEmptyArray. Thanks to [Victor Bakke][gipphe].Nothing published for this version
Rename instance to instanceStrict.
instance to instanceStrict.builtIn and userDefined to form new instance predicate.Eliminated some string duplication.
either modifier removed.Fix broken implementation of maybe.array.of.
maybe.array.of.isMap predicate removed (see builtIn).
isMap predicate removed (see builtIn).error predicate removed (see builtIn).builtIn predicate.userDefined predicate.emptyString predicate.infinity predicate.Implement isMap. Thanks to [Ryan Temple][ryantemple].
isMap. Thanks to [Ryan Temple][ryantemple].* Implement includes.
includes.* Implement equal.
equal.Rename unemptyString => nonEmptyString.
unemptyString => nonEmptyString.error.Nothing published for this version
Fix default error message for function. Thanks to [Paul Jolly][myitcv].
greaterOrEqual.lessOrEqual.inRange.function. Thanks to [Paul Jolly][myitcv].Fix unhandled exception when dereferencing undefined data inside map.
arrayLikeiterablearray.ofarrayLike.ofiterable.ofobject.ofmap.Nothing published for this version
Accept a single predicate in map.
map.hasLength and like.Drop webUrl. (sorry @bahmutov!)
length => hasLength.webUrl. (sorry @bahmutov!)assert, not and maybe into standalone functions as well as modifiers.match for general regex-matching. Possibly of interest to former users of webUrl, gitUrl and email.contains.between.greater.less.zero.emptyArray.error.map.Ensure date predicate returns false for invalid dates.
date predicate returns false for invalid dates.Nothing published for this version
* Add either.
either.Nothing published for this version
Switch defined to undefined for consistency with null.
verify => assert.nulled => null.defined to undefined for consistency with null.webUrl to reject more cases.gitUrl. (sorry @galniv!)email. (sorry @rodrigo!)floatNumber. (sorry @rodrigo!)oddNumber, evenNumber, positiveNumber, negativeNumber, intNumber => odd, even, positive, negative, integer.bool => boolean.every => all.assigned.apply batch operation.Implement bool predicate. Thanks to [Clinton Skakun][clintonskakun].
bool predicate. Thanks to [Clinton Skakun][clintonskakun].Nothing published for this version
Nothing published for this version
Implement email, intNumber and floatNumber predicates. Thanks to [Rodrigo González][rodrigo].
email, intNumber and floatNumber predicates. Thanks to [Rodrigo González][rodrigo].defined and nulled. Thanks to [Alejandro Villanueva][ialex].Nothing published for this version
Implement gitUrl predicate. Thanks to [Gal Niv][galniv].
not modifier.gitUrl predicate. Thanks to [Gal Niv][galniv].Nothing published for this version
Replace check.maybe.verify.xxx with check.verify.maybe.xxx.
check.maybe.verify.xxx with check.verify.maybe.xxx.Predicates exported as check.xxx rather than check.isXxx.
check.xxx rather than check.isXxx.check.verify.xxx rather than check.verifyXxx. Thanks to [Marc-Olivier Ricard][marcolivier].Nothing published for this version
Added isWebUrl and verifyWebUrl. Thanks to [Gleb Bahmutov][gleb].
isWebUrl and verifyWebUrl. Thanks to [Gleb Bahmutov][gleb].Nothing published for this version
One column per quarter.