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.
rtts-assert
Advanced tools
A run-time type assertion library for JavaScript. Designed to be used with Traceur.
All sources are in ES6 format and have the suffix .es6
. They don't depend on any runtime
and can be used by any modern ES6 -> ES5 transpiler.
As a convenience, we provide you with es5build.js
, a script to transpile the sources into es5
using Google Traceur.
License: Apache MIT 2.0
// Asserting APIs:
// - generated by Traceur (based on type annotations)
// - can be also used in tests for instance
assert.type(something, Type);
assert.returnType(returnValue, Type);
assert.argumentTypes(firstArg, Type, secondArg, Type);
// this can be used anywhere in the code
// (useful inside test, when we don't wanna define an interface)
assert(value).is(...)
// Custom type assert:
// - i have a custom type
// - adding an assert methos
assert.define(MyUser, function(value) {
assert(value).is(Type, Type2); // or
assert(value, 'name').is(assert.string);
assert(value, 'contact').is(assert.structure({
email: assert.string,
cell: assert.string
}));
assert(value, 'contacts').is(assert.arrayOf(assert.structure({email: assert.string})));
});
// Define interface (an empty type with assert method)
// - returns an empty class with assert method
var Email = assert.define('IEmail', function(value) {
assert(value).is(String);
if (value.indexOf('@') !== -1) {
assert.fail('has to contain "@"');
}
});
// Predefined types
assert.string
assert.number
assert.boolean
assert.arrayOf(...types)
assert.structure(object)
FAQs
A run-time type assertion library for JavaScript
The npm package rtts-assert receives a total of 4 weekly downloads. As such, rtts-assert popularity was classified as not popular.
We found that rtts-assert demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.