Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@paulpopat/safe-type
Advanced tools
import { Assert, IsObject, IsString, IsType, Checker } from "@paulpopat/safe-type";
function Thing(argument: unknown) {
Assert(argument, IsString);
// We now know this is a string and inference will tell us as much
}
function ThingWithoutException(argument: unknown) {
if (!IsString(argument)) {
console.log("The argument is not a string");
return;
}
// Do something cool
}
// If we want a usable type from a runtime checker then we use IsType
type String = IsType<typeof IsString>;
// If we want to accept a runtime checker as an argument then we have this
function DoSomething<T>(argument: unknown, checker: Checker<T>) {
Assert(argument, checker);
}
DoSomething({ test: "value" }, IsObject({ test: IsString }))
It is as simple as that!
Inference is fully operational, no casting will be required.
Find below a list of all available checkers:
Tools to work with the checkers to allow for type based controls.
FAQs
Typesafety with strong inference
The npm package @paulpopat/safe-type receives a total of 3 weekly downloads. As such, @paulpopat/safe-type popularity was classified as not popular.
We found that @paulpopat/safe-type 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.