
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Install the module with: npm install assert-is
It modifies is
API by taking one extra argument being either a string or a callback.
If a string is given, then it will be used as the message for the error that will be thrown in case the assertion fails..
If a callback is passed then it will be called in case the assertion fails.
assert.isA
(value, type, message) or assert.isType
(value, type, message)assert.isDefined
(value, message)assert.isEmpty
(value, message)assert.isEqual
(value, other, message)assert.isHosted
(value, host, message)assert.isInstance
(value, constructor, message)assert.isInstanceof
(value, constructor, message) - deprecated, because in ES3 browsers, "instanceof" is a reserved wordassert.isNil
(value, message)assert.isNull
(value, message) - deprecated, because in ES3 browsers, "null" is a reserved wordassert.isUndef
(value, message)assert.isUndefined
(value, message) - deprecated, because in ES3 browsers, "undefined" is a reserved wordisArgs
(value, message)isArray
(value, message)isArraylike
(value, message)isBool
(value, message)assert.isDate
(value, message)assert.isElement
(value, message)assert.isError
(value, message)assert.isFn
(value, message)assert.isNumber
(value, message)assert.isInfinite
(value, message)assert.isDecimal
(value, message)assert.isDivisibleBy
(value, n, message)assert.isInteger
(value, message)assert.isInt
(value, message) - deprecated, because in ES3 browsers, "int" is a reserved wordassert.isMaximum
(value, others, message)assert.isMinimum
(value, others, message)assert.isNan
(value, message)assert.isEven
(value, message)assert.isOdd
(value, message)assert.isGe
(value, other, message)assert.isGt
(value, other, message)assert.isLe
(value, other, message)assert.isLt
(value, other, message)assert.isWithin
(value, start, finish, message)assert.isObject
(value, message)assert.isRegexp
(value, message)assert.isString
(value, message)assert.isBase64
(value, message)assert.isHex
(value, message)assert.isSymbol
(value, message)var assert = require('assert-is');
assert.isDefined({}, 'This is OK.');
assert.isObject("foo", '"foo" is not an object');
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
(Nothing yet)
Copyright (c) 2015 goliatone
Licensed under the MIT license.
FAQs
is mixin for assert
The npm package assert-is receives a total of 4 weekly downloads. As such, assert-is popularity was classified as not popular.
We found that assert-is demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.