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
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
Jeremy Ashkenas
a82a01ebfc
elaborate underscore initialization so that it works seamlessly on CommonJS, as well as in the browser
2009-10-28 23:53:40 -04:00
Jeremy Ashkenas
4f783846de
merged in kriskowal's CommonJS branch and Dmitry Baranovskiy's optimizations
2009-10-28 23:21:24 -04:00
Jeremy Ashkenas
4a83fcdd26
version 0.2.0 is out, with inject -> reduce, JS standard methodname aliases, a compose(), and a lastIndexOf()
2009-10-28 18:49:50 -04:00
Jeremy Ashkenas
25d3177bd7
further along with the HTML documentation
2009-10-26 21:11:19 -04:00
Jeremy Ashkenas
d229e822e7
added an _.zip()
2009-10-26 09:15:14 -04:00
Jeremy Ashkenas
cf61edffa8
merged some tests
2009-10-26 08:43:10 -04:00
Jeremy Ashkenas
5c46c60b06
finished off the complete test suite for underscore -- let's polish off the corners and provide some docs
2009-10-26 08:40:14 -04:00