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

union-type

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

union-type - npm Package Compare versions

Comparing version 0.3.3 to 0.4.0

4

package.json
{
"name": "union-type",
"version": "0.3.3",
"version": "0.4.0",
"description": "Union types for JavaScript",

@@ -10,3 +10,3 @@ "main": "union-type.js",

"dependencies": {
"ramda": "^0.19.1"
"ramda": "^0.23.0"
},

@@ -13,0 +13,0 @@ "devDependencies": {

@@ -16,4 +16,4 @@ # union-type

* [Extracting fields from a union type](#extracting-fields-from-a-union-type)
* [Recursive union types](recursive-union-types)
* [Author & license](author--license)
* [Recursive union types](#recursive-union-types)
* [Author & license](#author--license)

@@ -67,3 +67,3 @@ ## Tutorial

return Maybe.case({
Nothing: () => Maybe.Nothing(),
Nothing: () => Maybe.Nothing,
Just: (v) => Maybe.Just(fn(v))

@@ -73,3 +73,3 @@ }, this);

var just = Maybe.Just(1);
var nothing = Maybe.Nothing();
var nothing = Maybe.Nothing;
nothing.map(add(1)); // => Nothing

@@ -215,3 +215,3 @@ just.map(add(1)); // => Just(2)

advancePlayer(Action.Up(), player);
advancePlayer(Action.Up, player);
```

@@ -307,3 +307,3 @@

var list = List.Cons(1, List.Cons(2, List.Cons(3, List.Nil())));
var list = List.Cons(1, List.Cons(2, List.Cons(3, List.Nil)));
console.log(toString(list)); // => '1 : 2 : 3 : Nil'

@@ -310,0 +310,0 @@ ```

@@ -126,3 +126,3 @@ var assert = require('assert');

return Maybe.case({
Nothing: () => Maybe.Nothing(),
Nothing: () => Maybe.Nothing,
Just: (v) => Maybe.Just(fn(v))

@@ -134,3 +134,3 @@ }, this);

assert.equal(just4[0], 4);
var nothing = Maybe.Nothing();
var nothing = Maybe.Nothing;
var alsoNothing = nothing.map(add(3));

@@ -212,3 +212,3 @@ assert.equal(alsoNothing._name, 'Nothing');

assert.deepEqual(update(Modification.Slice(1, 4), [1, 2, 3, 4, 5]), [2, 3, 4]);
assert.deepEqual(update(Modification.Sort(), [1, 3, 2]), [1, 2, 3]);
assert.deepEqual(update(Modification.Sort, [1, 3, 2]), [1, 2, 3]);
});

@@ -228,3 +228,3 @@ it('partially applied to same action does not affect each other', function() {

it('does not extract fields when matching _', function() {
assert.deepEqual(update(Action.Jump(), Context), Context);
assert.deepEqual(update(Action.Jump, Context), Context);
assert.deepEqual(update(Action.Move(5), Context), Context);

@@ -243,6 +243,6 @@ });

it('can create single element list', function() {
var list = List.Cons(1, List.Nil());
var list = List.Cons(1, List.Nil);
});
it('can get head', function() {
var list = List.Cons(1, List.Cons(2, List.Cons(3, List.Nil())));
var list = List.Cons(1, List.Cons(2, List.Cons(3, List.Nil)));
function head(list) { return list[0]; }

@@ -249,0 +249,0 @@ function tail(list) { return list[1]; }

@@ -77,3 +77,3 @@ var curryN = require('ramda/src/curryN');

}
group[name] = curryN(keys.length, construct);
group[name] = keys.length === 0 ? construct() : curryN(keys.length, construct);
if (keys !== undefined) {

@@ -128,3 +128,3 @@ group[name+'Of'] = function(obj) {

obj.caseOn = caseOn(obj);
obj.prototype = {};

@@ -134,3 +134,3 @@ obj.prototype[Symbol ? Symbol.iterator : '@@iterator'] = createIterator;

obj.prototype.caseOn = function (cases) { return obj.caseOn(cases, this); };
for (key in desc) {

@@ -137,0 +137,0 @@ res = constructor(obj, key, desc[key]);

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