Commit Graph

63 Commits

Author SHA1 Message Date
Jeremy Ashkenas
62114126d9 Merge pull request #504 from mwilliamson/master
Don't call iterable.toArray in _.toArray if not a function
2012-04-02 12:27:38 -07:00
Jeremy Ashkenas
180b8b0c83 merging #532 -- allow string as iterator on sortBy 2012-04-02 13:46:49 -04:00
Jeremy Ashkenas
d604895018 revisions to #534, sortBy(undefined) 2012-04-02 13:16:58 -04:00
Yi, EungJun
6b8a99ba39 Adding the ability to _.sortBy(list, 'property') 2012-03-31 02:28:22 +09:00
Raymond May Jr
4c2a85f9c5 size enhancement as ternary and _.size(arr) test case 2012-03-20 09:31:50 -05:00
Michael Williamson
c8ec654e6b Don't call iterable.toArray in _.toArray if not a function 2012-03-10 16:00:23 +00:00
Derek Brans
7c7c38decf Test: any and every cast result to boolean. Relates to #478 2012-02-17 11:40:47 -05:00
Brad Dunbar
458e604eee upgrade qunit 2012-01-30 10:31:12 -05:00
Jeremy Ashkenas
3512e7fc5c Fixes #435 -- allows _.max and _.min on arrays of dates without converting them to numbers. 2012-01-24 10:40:20 -05:00
Peter Jihoon Kim
978255b778 added "collect" alias for "map" 2012-01-14 00:57:41 +08:00
fredericksgary
2206092e25 Use _.isFunction so ClojureScript doesn't break underscore
Clojurescript adds a call method to strings, so passing a string to
_.invoke produces the wrong behavior.
2011-12-22 14:38:34 -05:00
Jeremy Ashkenas
3c5686f784 Fixes #403 2011-12-16 12:41:20 -05:00
Jeremy Ashkenas
770f0876b3 re-adding 649f62 2011-12-07 09:35:07 -05:00
Jeremy Ashkenas
9e41927293 rolling back to the previous implementation of 'each' ... cancels out #385 2011-12-06 17:33:43 -05:00
John-David Dalton
d8d1bd0259 Merge https://github.com/documentcloud/underscore into unittests 2011-12-06 01:04:29 -05:00
John-David Dalton
649f629bb1 underscore: Allow _.reduce and _.reduceRight to have an explicitly undefined value. [jddalton] 2011-12-03 22:24:53 -05:00
John-David Dalton
4a5c2ac818 underscore: Add unit tests and cleanup code for for-in issues. [jddalton] 2011-12-03 03:26:50 -05:00
Jeff McGee
aedab9c7dd fixed any() for strings on IE8 2011-11-03 18:47:07 -05:00
Jeremy Ashkenas
96fdf6fbac Adding the ability to _.groupBy(list, 'account_id') 2011-10-21 14:44:38 -04:00
Jeremy Ashkenas
348c93515c Issue #272 ... min and max of empty objects. 2011-10-04 17:23:55 -04:00
Jeremy Ashkenas
921b592cd7 Merge pull request #281 from ryantenney/master
Array Shuffle
2011-10-04 14:11:30 -07:00
Jeremy Ashkenas
7d0e4169a9 shortening module names. 2011-10-04 15:56:32 -04:00
Ryan W Tenney
f4cba513b9 Added function shuffle, with test case. 2011-08-25 21:44:29 +00:00
Jeremy Ashkenas
7eb7b08f71 reverting a non-important change that broke reduceRight in IE. 2011-07-13 12:58:36 -04:00
Jeremy Ashkenas
779a28d59a Merge branch 'underscore.any' of https://github.com/shinuza/underscore 2011-07-13 12:40:08 -04:00
Jeremy Ashkenas
7573ac7751 Unit tests for sparse arrays. 2011-07-13 12:36:27 -04:00
Florian Friesdorf
9ab3ac44bb move underscore test into a div
more comfortable to include underscore with tests in some other project.
2011-06-25 09:09:55 +02:00
Florian Friesdorf
0202f9f79b make toArray return a clone in case of an array
In combination with backbone this makes coll.toArray() return an array
instead of just returning coll.models, enabling
coll.remove(coll.toArray()) whithout failing half way through.
2011-06-21 18:31:40 +02:00
shinuza
40af1652eb Modified any/some test case to demonstrate issue #177
Fixed any/some formatting to be consistent with the rest of underscore.js
2011-05-20 09:13:58 +02:00
Jeremy Ashkenas
057da5bc82 Issue #202 ... fallback method for sparse arrays. 2011-05-11 10:27:52 -04:00
shinuza
899000c217 Hashmap keys are not necessarily ordered. groupBy test may fail if the
expected order is not correct.
Fixing this by checking if the keys are present in the hash so
the order is not deterministic.
2011-05-07 12:03:02 +02:00
Andrei
f8a4b78a86 Adding groupBy. 2011-05-05 14:00:40 -04:00
Jeremy Ashkenas
bf214d2c8d stricter ECMA5 compliance. _.every now requires an iterator to be passed. #160 2011-04-15 17:17:54 -04:00
Aseem Kishore
de50fc4607 Add test case for invoke w/ function reference. 2011-03-25 12:06:10 -07:00
Jeremy Ashkenas
d2d6cfe667 Rework of #68, to use a flag to indexOf, instead of a separate function. 2010-12-17 10:57:12 -05:00
Jeremy Ashkenas
8c2570b0ba Issue #68. Adding _.sortedIndexOf 2010-12-17 10:35:53 -05:00
Ryan W Tenney
cdcf18b79c Improve compliance with Array methods in ES5 when passed a null value. (ES5 Array methods treat null like []) 2010-12-06 23:36:54 -05:00
Jeremy Ashkenas
2d06e1d526 Issue #70 -- implementing each, find, all, any, etc. without the use of a try/catch/throw. Minor speedup + avoids destroying the stack trace. 2010-12-01 11:08:34 -05:00
Jeremy Ashkenas
a08c3dbd6b Merge branch 'fix_reduceRight_initial_value' of http://github.com/mcmire/underscore 2010-11-01 08:42:19 -04:00
Elliot Winkler
f729769d85 Fix reduceRight() so that if you don't pass in an initial value, the last item in the collection is used 2010-10-31 19:03:52 -06:00
Elliot Winkler
c21e7b24c6 Fix reduce() so that if you don't pass in an initial value, the first item in the collection is used 2010-10-31 18:51:30 -06:00
Jeremy Ashkenas
74d282ccc8 fixing mistakenly-aliased contains ... should refer to include. 2010-10-15 17:15:26 -04:00
Jeremy Ashkenas
ef396a9e13 Aliasing _.contains to _.include 2010-07-15 10:18:11 -04:00
Jeremy Ashkenas
9827f87611 (breaking change) moving _.reduce's method signature to that of ECMA5. _.reduce(obj, iterator, memo). Updated tests and docs. 2010-07-15 09:50:55 -04:00
Jeremy Ashkenas
d7acbca2ce reverted _.buildLookup, restoring _.without to it's previous implementation, adding a test for object identity 2010-02-24 12:53:35 -05:00
Mike Frawley
263b1ee92d add #buildLookup method to turn collection in to a fast lookup hash
implement #without in terms of it
add tests and internal docs
2010-02-17 10:12:22 -06:00
Jeremy Ashkenas
5b5ee87c7a Underscore 0.5.8, with collection functions that once again work on NodeLists and HTMLCollections 2010-01-28 00:55:41 -05:00
Jeremy Ashkenas
5c314d206e adding an isArguments checker and enabling iteration (using each) over JS object hashes that have numeric length properties 2009-12-09 13:41:19 -05:00
Jeremy Ashkenas
3eb9c28039 Underscore shouldn't be able to iterate over the letters of a string cross-browser -- indexing into a string isn't supported in IE 2009-12-08 17:31:01 -05:00
Kirill Ishanov
451d9c5d62 implemented 6 more passing tests for range. Now works like python's range 2009-12-01 02:10:56 +03:00