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.
Because it can always be shorter.
lift.js is a compact monad opinionated javascript library. It implements Just, Maybe, Validation(Valid) and a nice Monad factory. The unit comes with a lift function so you can add functionnality later in code to your monad. It's ment to be flexible and faster to use. It's written with es6 so it's less than 100 lines.
lift.js
can be required directly for es next project or you can use the lift-min.js
for all legacy applications.
npm: upcoming
const justWithLog = Just(5).lift('log',console.log);
justWithValue.log();
// console> 5
The folowing function are available on all monads.
bind(func, args)
const justWithValue = Just(5).bind((value)=> Just(value));
// Just[5]
of(value)
const justWithValue = Just(5).of(6);
// Just[6]
const justWithValue = Just(5).of(Just(6));
// Just[6]
get()
const value = Just(5).get();
//5
map(func)
const justWithValue = Just(7).map(value => value * 2);
// Just[14]
join()
const justWithValue = Just(Just(5)).join()
// Just[5]
toMaybe()
const maybeWithValue = Just(5).toMaybe();
// Maybe[5]
run(func)
Just(5).run(value => console.log(value));
// console> 5
none()
const maybeWithValue = Maybe().none()
// Maybe[]
const maybeWithValue = Maybe().nothing()
// Maybe[]
const maybeWithValue = Maybe()
// Maybe[]
const maybeWithValue = Maybe(undefined)
// Maybe[]
const maybeWithValue = Maybe(null)
// Maybe[]
isNone()
const value = Maybe(5).isNone();
// false
isJust()
const value = Maybe(5).isJust();
// true
orJust()
const maybeWithValue = Maybe().orJust(15);
// Maybe[15]
orElse(monad)
const maybeWithValue = Maybe(5).orElse(Maybe(15));
// Maybe[5]
const maybeWithValue = Maybe().orElse(Just(15));
// Just[5]
Written and maintained by @pore63.
Based on Douglas Crockford MONAD. Special tanks to Monet for the inspiration and a bunch of tests.
FAQs
lift.js is a compact monad opinionated javascript library
The npm package liftjs receives a total of 2 weekly downloads. As such, liftjs popularity was classified as not popular.
We found that liftjs 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’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.