Skip to content

Latest commit

 

History

History
22 lines (12 loc) · 571 Bytes

README.rst

File metadata and controls

22 lines (12 loc) · 571 Bytes

Taiste extensions for underscore.

Contains two functions, bipartite and pluckNested.

bipartite can be used to partition an iterable to two separate parts, one fullfilling a requirement stated by the callback, and others that do not.

var o = [1,2,3,4];
_.bipartite(o, function(item) { return item <= 2; } );

pluckNested can be used as a drop-in replacement for pluck, but it supports nesting:

var o = { foo: { bar: [1,2,3,4] } };
_.pluckNested(o, 'foo.bar');