Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

computation

Package Overview
Dependencies
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

computation - npm Package Compare versions

Comparing version 2.0.0-alpha.2 to 2.0.0-alpha.3

8

computation.d.ts

@@ -6,4 +6,4 @@ export default class Computation<T> {

static pure<V>(value: V): Computation<V>;
static fail<V>(e: Error): Computation<V>;
static pending: Computation<any>;
static fail(e: Error): Computation<never>;
static pending: Computation<never>;
then<V>(resolve: (value: T) => V, reject?: (err: Error) => V): Computation<V>;

@@ -13,4 +13,4 @@ fmap<V>(f: (value: T) => V): Computation<V>;

static liftA2<A, B, C>(a: Computation<A>, b: Computation<B>, f: (a: A, b: B) => C): Computation<C>;
get(fallback: T): T;
getf(fallback: () => T): T;
get<A>(fallback: A): T | A;
getf<A>(fallback: () => A): T | A;
}

@@ -55,3 +55,3 @@ "use strict";

return new Computation(() => {
let av = a.fn(), bv = b.fn();
const av = a.fn(), bv = b.fn();
if (av !== Computation.Pending && bv !== Computation.Pending) {

@@ -73,3 +73,3 @@ return f(av, bv);

try {
let result = this.fn();
const result = this.fn();
if (result === Computation.Pending) {

@@ -96,3 +96,3 @@ return fallback();

// rather than a function because it doesn't have to be parametrized.
Computation.pending = new Computation(() => Computation.Pending);
Computation.pending = new Computation((() => Computation.Pending));
exports.default = Computation;
{
"name": "computation",
"version": "2.0.0-alpha.2+439afa9",
"version": "2.0.0-alpha.3+eaa5207",
"description": "A small JavaScript library to express computations",

@@ -5,0 +5,0 @@ "main": "computation.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc