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
Kirill Ishanov
d8cf99ba89
initial implementation of _.range
2009-12-01 00:44:13 +03:00
Jeremy Ashkenas
80939448a7
fixing broken _.breakLoop test -- implementation was fine, test was out of date.
2009-11-12 21:31:03 -05:00
Jeremy Ashkenas
4f0afda61c
adding OO-style object wrapping (thanks macournoyer) -- now you can to _(array).each();
2009-11-07 12:39:59 -05:00
Jeremy Ashkenas
cb38c6ae63
adding a reduceRight (it's in JS 1.8), and aliasing foldl and foldr
2009-10-30 09:40:19 -04:00
Jeremy Ashkenas
42637b5880
Issue #2 -- each now calls iterator with (value, key, list) when iterating over javascript objects
2009-10-29 10:46:53 -04:00
Jeremy Ashkenas
8e7b8d2dea
started passing in the collection as the third argument to _.each iterators (Issue #1 )
2009-10-29 10:26:16 -04:00