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 0.0.2 to 0.0.3

36

computation.js
"use strict";
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

@@ -11,3 +11,3 @@ Object.defineProperty(exports, "__esModule", {

var Computation = (function () {
var Computation = function () {
function Computation(fn) {

@@ -24,13 +24,15 @@ _classCallCheck(this, Computation);

return new Computation(function () {
try {
if (reject === undefined) {
return new Computation(function () {
return resolve(_this.fn());
} catch (e) {
if (reject) {
});
} else {
return new Computation(function () {
try {
return resolve(_this.fn());
} catch (e) {
return reject(e);
} else {
throw e;
}
}
});
});
}
}

@@ -93,15 +95,11 @@ }, {

value: function liftA2(a, b, f) {
try {
return new Computation(function () {
var av = a.fn(),
bv = b.fn();
if (av !== Computation.Pending && bv !== Computation.Pending) {
return new Computation(function () {
return f(av, bv);
});
return f(av, bv);
} else {
return Computation.pending;
return Computation.Pending;
}
} catch (e) {
return Computation.fail(e);
}
});
}

@@ -111,3 +109,3 @@ }]);

return Computation;
})();
}();

@@ -114,0 +112,0 @@ exports.default = Computation;

{
"name": "computation",
"version": "0.0.2",
"version": "0.0.3",
"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