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.
ts-monadable
Advanced tools
A simple set of Monadic structures and typings for TypeScript projects.
npm install ts-monadable
The Maybe
structures can be used to define an optional value. This value may be something or nothing. By wrapping return values in this monad, it forces explicit handling of empty returns.
import * as Monads from 'ts-monadable';
// simple constructor for an example
const func = (name: string, flag: boolean): Monads.Maybe<string> => {
return flag ? Monads.Some(name) : Monads.None();
}
// various monadic methods can then be invoked
func.is('some'); // type-guard
func.unwrap(); // safe-unwrapping (throws on `none` with no alternative)
Similar to the Maybe
structure, Result
structures explicitly define an alternative value for an error. This allows adding failure meta-data to results.
import * as Monads from 'ts-monadable';
// simple constructor for an example
const func = (name: string): Monads.Result<string, string> => {
return name === 'ts-monadable' ? Monads.Okay(name) : Monads.Error("Invalid name given!");
}
FAQs
Simple TypeScript Monads
We found that ts-monadable 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.