Commit Graph

78 Commits

Author SHA1 Message Date
Jeremy Ashkenas
b52908f78f Fixes #491 - IE9 / Opera 11 test case. 2012-04-02 15:50:31 -04:00
Jeremy Ashkenas
18ba865009 Merge pull request #524 from octatone/isFinite
New Feature: _.isFinite to compliment _.isNumber and _.isNaN
2012-04-02 12:07:28 -07:00
Jeremy Ashkenas
719cd24aa9 adding an initial implementation of a 'pick' function. #523 2012-04-02 15:01:26 -04:00
Chris Leishman
7c95237845 Add _.restrict(source, *keys)
Return a clone of the source with only the properties named in *keys
(either stings or arrays containing strings).

Especially useful for avoiding mass-assignment vulnerabilities.
2012-03-29 11:54:09 -07:00
Raymond May Jr
4266d91805 test _.isFinite against new Number 2012-03-26 13:00:25 -05:00
Raymond May Jr
bf6cb03519 test against NaN 2012-03-25 14:10:35 -05:00
Raymond May Jr
55b68fdaba formatting 2012-03-25 11:20:57 -05:00
Raymond May Jr
e274235865 _.isFinite fix and tests 2012-03-25 11:08:23 -05:00
Brad Dunbar
458e604eee upgrade qunit 2012-01-30 10:31:12 -05:00
Jeremy Ashkenas
99c17c4a0d reverting an old change -- _.extend should absolutely copy undefined values. 2012-01-23 15:48:35 -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
2c5661ebb3 underscore: Avoid regression and cleanup comments. [jddalton] 2011-12-06 01:16:56 -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
Kit Cambridge
3d1605f241 _.isEqual: Ensure that an egal comparison is performed for number objects and primitives. 2011-10-26 11:35:49 -06:00
Kit Cambridge
a0b3feca85 _.isEqual: Use [[Class]] checking for consistency and performance.
* Objects with different `[[Class]]` names are no longer equivalent.
* String, number, and boolean primitives and their corresponding wrappers (e.g., `"5"` and `new String("5")`) are now equivalent.
* Arrays are now recursively compared by their numeric properties only. All non-numeric properties are ignored.
2011-10-25 22:48:24 -06:00
Jeremy Ashkenas
3c54f79113 fixes #347 2011-10-24 13:19:15 -04:00
Jeremy Ashkenas
58c88ccc59 Merge branch 'betterIsX' of https://github.com/michaelficarra/underscore 2011-10-24 11:16:04 -04:00
Jeremy Ashkenas
7fc616943e Issue #329, special check for the common and magical 'length' property. 2011-10-18 23:26:59 -04:00
Jeremy Ashkenas
e79586515c Issue #329 -- significant change to _.isEqual semantics. 2011-10-18 16:07:23 -04:00
Kevin Malakoff
f2a64227fd Reimplemented _.isEqual tests and patch in a fresh branch. 2011-10-06 15:50:51 +02:00
Michael Ficarra
221161cecc better isXXX checks; the current tests have too many false positives 2011-10-04 22:24:36 -04:00
Jeremy Ashkenas
7d0e4169a9 shortening module names. 2011-10-04 15:56:32 -04:00
Kit Cambridge
7760e6aa52 Merge git://github.com/documentcloud/underscore into isequal 2011-09-05 17:50:45 -06:00
Kit Cambridge
4fa97eb2fa _.isBoolean should return true for boolean object wrappers. 2011-09-05 15:51:09 -06:00
Kit Cambridge
e9faa40108 Add a comprehensive test suite for isEqual. 2011-09-05 12:27:03 -06:00
Michael Ficarra
bf3aa97c36 reverting some changes to isEqual that were a little too aggressive 2011-09-04 19:34:19 -04:00
Michael Ficarra
c7c57ca6ff _.isEqual improvements 2011-07-15 18:15:10 -04:00
Kit Goncharov
a12d0035cb _.isEqual: Ensure commutative equality for dates and RegExps. 2011-07-13 14:24:28 -06:00
Kit Goncharov
365eea6aa7 _.isEqual: Streamline the deep comparison algorithm and remove the dependency on _.keys. 2011-07-13 10:48:16 -06:00
Jeremy Ashkenas
cd236d4c47 Issue #243. _.functions now also returns the names of function defined in the prototype chain. 2011-07-13 11:09:51 -04:00
Kit Goncharov
cf812e77bc _.isEqual: Ensure that 0 and -0 are not equivalent. NaN values should be equal. 2011-07-12 22:17:12 -06:00
Kit Goncharov
5c2c3ce464 Rewrite _.isEqual and add support for comparing cyclic structures. 2011-07-12 19:42:36 -06:00
Dmitry Baranovskiy
42487bf47d Fixed isEqual if second object has isEqual implemented and added isObject method 2011-06-07 09:48:34 +10:00
Jeremy Ashkenas
ea44179d81 Issue #123. _.extend shouldn't copy keys for undefined values. 2011-04-15 17:46:16 -04:00
Jeremy Ashkenas
866cd35236 merging in michaelficarra's issue95 2011-03-20 18:50:56 -04:00
Jeremy Ashkenas
25457982a8 new version of qunit ... fixing up tests. 2011-03-20 18:21:49 -04:00
Kit Goncharov
48abcd84c5 Issue #149: _.keys should throw a TypeError for non-objects. 2011-03-20 10:08:32 -06:00
Michael Ficarra
1f2c9c5fc1 added regression test for issue #95 2011-03-04 10:15:48 -05:00
Jeremy Ashkenas
226b7d9344 Adding _.defaults, Issue #106 2011-02-01 21:19:58 -05:00
Jason Davies
2120b27b22 Fix _.isEquals() for wrapped objects
This caught me out when writing some unit tests that use _.isEquals().
They were all passing even though I knew they shouldn't be, and I
realised I was checking equality with a wrapped object that I'd
forgotten to unwrap.
2010-12-03 13:01:58 +00:00
Jeremy Ashkenas
6b8bb0cacd Better Underscore isType checking, in the presence of Internet Explorer host objects, which are a bit touchy. 2010-12-01 10:25:55 -05:00
Jeremy Ashkenas
9e3e067f50 Initial draft of _.throttle and _.debounce 2010-11-30 11:41:48 -05:00
Jeremy Ashkenas
8fe19f2023 Underscore 1.1.2 2010-10-15 17:21:41 -04:00
Jeremy Ashkenas
5b4b308c91 Fixing template settings 2010-10-07 10:44:49 -04:00
Jeremy Ashkenas
ef396a9e13 Aliasing _.contains to _.include 2010-07-15 10:18:11 -04:00
Jeremy Ashkenas
29e2c832bc Underscore 1.0.4, with _.memoize 2010-06-22 09:21:03 -04:00
Ryan W Tenney
0e8ca3cb97 NaN is never equal to NaN. Fixed in underscore.js and underscore-min.js, updated tests in test/objects.js 2010-06-12 17:10:48 -04:00
Jeremy Ashkenas
79f65b440a Even though it's not really part of the API, making _.isEmpty work with Strings cross-browser. 2010-04-06 13:01:45 -04:00