Add explicit chaining support to Lo-Dash. [closes #325]

Former-commit-id: 58d01723ddc40f636af9954e5a9f6370e0c88aac
This commit is contained in:
John-David Dalton
2013-07-28 10:13:56 -07:00
parent c80c59c692
commit cc0c2f1b3c
4 changed files with 93 additions and 93 deletions

View File

@@ -408,6 +408,19 @@
var wrapper = _({ 'a': 0 });
equal(wrapper.chain(), wrapper);
});
test('should enable chaining of methods that return unwrapped values by default', function() {
var array = ['abc'];
ok(_.chain(array).first() instanceof _);
ok(_(array).chain().first() instanceof _);
ok(_.chain(array).isArray() instanceof _);
ok(_(array).chain().isArray() instanceof _);
ok(_.chain(array).first().first() instanceof _);
ok(_(array).chain().first().first() instanceof _);
});
}());
/*--------------------------------------------------------------------------*/