mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
fix
This commit is contained in:
@@ -177,6 +177,43 @@ kit.ready(['collection'], function () {
|
||||
assertSame(x.length, 2, 'length after shift');
|
||||
assertSame(x.last(), 10, 'last after shift');
|
||||
|
||||
xOb = {a: 'a10', b: 'b11'};
|
||||
x = new kit.Collection(xOb);
|
||||
x2 = x.map(function (value, key) {
|
||||
return value + '!';
|
||||
});
|
||||
assertSame(x2.get('a'), 'a10!', 'map object');
|
||||
|
||||
|
||||
xOb = [10, 20, 30];
|
||||
x = new kit.Collection(xOb);
|
||||
x2 = x.map(function (value, key) {
|
||||
return value * 2;
|
||||
});
|
||||
assertSame(x2.last(), 60, 'map array');
|
||||
|
||||
xOb = {a: 'a10', b: 'b11', 10: 101};
|
||||
x = new kit.Collection(xOb);
|
||||
x.set(11, 111);
|
||||
x2 = x.except([10]);
|
||||
assertSame(x2.last(), 111, 'except last+');
|
||||
assertSame(x2.length, 3, 'except length');
|
||||
x3 = x2.except('11');
|
||||
assertSame(x3.last(), 'b11', 'except last+');
|
||||
assertSame(x3.length, 2, 'except length');
|
||||
|
||||
|
||||
xOb = {a: 'a10', b: 'b11', 10: 101};
|
||||
x = new kit.Collection(xOb);
|
||||
x.set(11, 111);
|
||||
x2 = x.only(['a', 'b', '11']);
|
||||
assertSame(x2.last(), 111, 'only last+');
|
||||
assertSame(x2.length, 3, 'only length');
|
||||
x3 = x2.only('11');
|
||||
assertSame(x3.last(), 111, 'only last+');
|
||||
assertSame(x3.length, 1, 'only length');
|
||||
|
||||
x.
|
||||
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user