
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
A simple, useful, but somewhat incorrect implementation of the Maybe monad in Javascript.
A simple, useful, and slightly incorrect implementation of the Maybe monad in Javascript.
For starters, some implementation is about what's useful in JS rather than following laws. For example, id(Maybe.Just(1)) !== Maybe.Just(1).map(id). The value will remain the same, but the referential equality is lost.
Join isn't the typical join either, wherein a doubly wrapped Maybe would be unwrapped to a single layer. It is more the ability to combine two wrapped values together safely.
But hey, the usefulness is real.
More detail to come.
import Maybe from 'jsmaybe';
const a = Maybe.of('test');
const b = a.map(test => `${test} post, please ignore`);
// => Just { 'test post, please ignore' }
const c = b.map(v => v.unsupportedOp());
// => Nothing
const d = Maybe.of('post');
const e = a.join(d, (test, post) => `${test} ${post}`);
// => Just { 'test post' }
e.value('default');
// => 'test post'
c.value('default');
// => 'default'
FAQs
A simple, useful, but somewhat incorrect implementation of the Maybe monad in Javascript.
We found that jsmaybe 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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.