Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.