transit-immutable-js
Advanced tools
Comparing version 0.3.0 to 0.4.0
14
index.js
@@ -37,2 +37,5 @@ var transit = require('transit-js'); | ||
return Immutable.Set(v); | ||
}, | ||
iOS: function(v) { | ||
return Immutable.OrderedSet(v); | ||
} | ||
@@ -122,2 +125,13 @@ } | ||
}), | ||
Immutable.OrderedSet, transit.makeWriteHandler({ | ||
tag: function() { | ||
return "iOS"; | ||
}, | ||
rep: function(v) { | ||
if (predicate) { | ||
v = v.filter(predicate); | ||
} | ||
return v.toArray(); | ||
} | ||
}), | ||
Function, transit.makeWriteHandler({ | ||
@@ -124,0 +138,0 @@ tag: function() { |
{ | ||
"name": "transit-immutable-js", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Transit serialisation for Immutable.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -32,2 +32,4 @@ /* eslint-env mocha */ | ||
"OrderedSets": Immutable.OrderedSet.of(1, 4, 3, 3), | ||
"Ordered Maps": Immutable.OrderedMap() | ||
@@ -140,2 +142,11 @@ .set(2, 'a') | ||
it('can ignore OrderedSet entries', function() { | ||
var input = Immutable.Set.of(1, 2, 3, 3, 'a'); | ||
filter = transit.withFilter(function(val) { | ||
return typeof val === 'number'; | ||
}); | ||
var result = filter.fromJSON(filter.toJSON(input)); | ||
expect(result.includes('a')).to.eql(false); | ||
}); | ||
it('can ignore List entries', function() { | ||
@@ -142,0 +153,0 @@ var input = Immutable.List.of(1, 2, 3, 3, 'a'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13207
267