immutable
Advanced tools
Comparing version 3.6.0 to 3.6.1
@@ -197,2 +197,12 @@ ///<reference path='../../../resources/jest.d.ts'/> | ||
it('returns wrapped values for iteration API', () => { | ||
var jsData = [{val: 0}, {val: 1}, {val: 2}]; | ||
var data = Immutable.fromJS(jsData); | ||
var cursor = Cursor.from(data); | ||
cursor.forEach(function (c, i) { | ||
expect(typeof c.deref).toBe('function'); // is a cursor! | ||
expect(c.get('val')).toBe(i); | ||
}); | ||
}); | ||
it('can map over values to get subcursors', () => { | ||
@@ -199,0 +209,0 @@ var data = Immutable.fromJS({a: {v: 1}, b: {v: 2}, c: {v: 3}}); |
@@ -257,3 +257,3 @@ /** | ||
cursor._rootData, | ||
newKeyPath(keyPath, changeKey) | ||
arguments.length > 2 ? newKeyPath(keyPath, changeKey) : keyPath | ||
); | ||
@@ -267,5 +267,5 @@ if (result !== undefined) { | ||
function newKeyPath(head, tail) { | ||
return tail ? Seq(head).concat(tail).toArray() : head; | ||
return Seq(head).concat(tail).toArray(); | ||
} | ||
exports.from = cursorFrom; |
{ | ||
"name": "immutable", | ||
"version": "3.6.0", | ||
"version": "3.6.1", | ||
"description": "Immutable Data Collections", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/facebook/immutable-js", |
318323
7151