Commit Graph

404 Commits

Author SHA1 Message Date
Raymond May Jr
e274235865 _.isFinite fix and tests 2012-03-25 11:08:23 -05:00
Raymond May Jr
705eff4826 add _.isFinite - verifies is a number between Inf && -Inf 2012-03-25 10:43:30 -05:00
Brad Dunbar
ebb9db4e8e _.result calls property with the correct context. 2012-03-21 06:33:37 -04:00
Raymond May Jr
4c2a85f9c5 size enhancement as ternary and _.size(arr) test case 2012-03-20 09:31:50 -05:00
Raymond May Jr
5827e4a40a _.size ludicrous speed improvement - formatting 2012-03-19 19:10:59 -05:00
Raymond May Jr
2d3edb88f0 _.size ludicrous speed improvement 2012-03-19 19:08:36 -05:00
Brad Dunbar
33be5c62b8 Make a small documentation change. 2012-03-19 15:45:44 -04:00
Brad Dunbar
9a27b1b083 Clarify documentation for _.result. 2012-03-19 15:07:33 -04:00
brad dunbar
a2a35c10ce Merge pull request #512 from braddunbar/getvalue
Add utility function `result`.
2012-03-19 11:46:26 -07:00
Brad Dunbar
5545a3b68d Dispense with abbreviation. 2012-03-19 14:43:20 -04:00
Brad Dunbar
5c7ccb21ef Rename getValue to result. 2012-03-19 14:33:38 -04:00
Brad Dunbar
d0e7b397c1 Cache property value. 2012-03-19 14:24:59 -04:00
Brad Dunbar
666049ac5d Add utility function getValue. 2012-03-17 13:02:17 -04:00
Brad Dunbar
f5eb4b0915 Clean up _.template.
* Cache regexes.
* Use object properties for lookup instead of switch.
2012-03-17 09:26:39 -04:00
Brad Dunbar
826e743262 Handle \u2028 & \u2029 in _.template. 2012-03-12 19:15:18 -04:00
Brad Dunbar
414fafb1f4 Allow natural multi-line code evaluation in templates.
By escaping `\r`, `\n`, and `\t` earlier, we can unescape
them along with backslashes and single quotes allowing
for the inclusion of single line comments and code without
a terminating semicolon.
2012-03-11 12:39:13 -04:00
Kit Cambridge
8808f7d531 Un-golf _.uniq(). 2012-02-21 10:35:55 -07:00
Kit Cambridge
0285f47f78 _.uniq(): Remove unused previous variable. 2012-02-20 12:36:48 -07:00
Kit Cambridge
c8d4025621 Issue #484: _.uniq() should work with sparse arrays. 2012-02-20 12:21:54 -07:00
Derek Brans
c2a58725be Fix for #478 - any and every should be consistent about casting result to boolean 2012-02-16 16:31:18 -05:00
Michael Ficarra
ff544ae997 _.difference should perform a shallow flatten 2012-02-06 12:24:13 -05:00
Jeremy Ashkenas
5533c12033 Fixes #437 -- add an 'immediate' parameter to _.debounce. 2012-01-30 10:53:46 -05:00
Brad Dunbar
5c6abc4453 short circuit isEmpty for null/undefined 2012-01-30 10:15:04 -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
Jeremy Ashkenas
eeea70c457 Underscore 1.3.1 2012-01-23 17:56:29 -05:00
Jeremy Ashkenas
cdf43ea742 Fixes #429 -- don't escape slash escapes in the body of interpolations... 2012-01-23 17:33:48 -05:00
Jeremy Ashkenas
5ed8b6e6ce using a cached reference to hasOwnProperty (again) 2012-01-23 16:05:56 -05:00
Jeremy Ashkenas
f1ecedf64a Merge pull request #440 from arlolra/has
has
2012-01-23 13:03:56 -08:00
Jeremy Ashkenas
f6a1b97426 Merge branch 'master' of github.com:documentcloud/underscore 2012-01-23 15:48:53 -05:00
Jeremy Ashkenas
99c17c4a0d reverting an old change -- _.extend should absolutely copy undefined values. 2012-01-23 15:48:35 -05:00
Arlo Breault
3898597b12 has 2012-01-18 20:34:54 -08:00
Peter Jihoon Kim
978255b778 added "collect" alias for "map" 2012-01-14 00:57:41 +08:00
Jeremy Ashkenas
dd09162b8c Underscore.js 1.3.0 2012-01-11 11:41:14 -05:00
Jeremy Ashkenas
0d4b1247c4 Removing AMD 'support' from Underscore. 2012-01-11 11:17:40 -05:00
Jeremy Ashkenas
4946c549b2 Underscore.js 1.2.4 2012-01-04 16:17:00 -05:00
Jeremy Ashkenas
69ed6177ab Fixes #411. Partially adding _.templateSettings could break template strings containing the words 'null' or 'undefined'. 2012-01-04 16:00:36 -05:00
Jeremy Ashkenas
62c814d9fe Fixes #408: _.chain(object) as well as _(object).chain() 2011-12-30 15:07:22 -05: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
Bob Remeika
5ca27ffed1 Fixes #409 - Unexpected arguments passed to wrapper function in _.wrap when the first argument of calling the wrapper function is an array 2011-12-20 01:51:51 -08:00
Jeremy Ashkenas
b4a38439ce Merge pull request #401 from Stuk/template_js_fix
Fix escaped chars in Javascript in templates
2011-12-16 10:09:48 -08:00
Jeremy Ashkenas
b27ed66d77 Fixes #397 2011-12-16 12:47:46 -05:00
Jeremy Ashkenas
3c5686f784 Fixes #403 2011-12-16 12:41:20 -05:00
Stuart Knightley
c8ecb47765 Templating fix for when an escaped character is used in Javascript
If an escaped character (e.g. \n) is used in embedded Javascript inside
a template then it gets escaped to \\n. If someone has put an escaped
character in their JS then they probably want it left that way.

This commit replaces \\s with a single \ when inside evaluation tags,
reverting the previous template escaping.
2011-12-08 11:36:20 -08:00
Jeremy Ashkenas
813bb57bf0 Underscore.js 1.2.3 2011-12-07 10:12:08 -05:00
Jeremy Ashkenas
770f0876b3 re-adding 649f62 2011-12-07 09:35:07 -05:00
Jeremy Ashkenas
cf1d69227b adding concat reference 2011-12-07 09:30:55 -05:00
Jeremy Ashkenas
c67eaf672b adding back style and implementation tweaks from #385 2011-12-07 09:29:11 -05:00
Jeremy Ashkenas
9e41927293 rolling back to the previous implementation of 'each' ... cancels out #385 2011-12-06 17:33:43 -05:00
Jeremy Ashkenas
b3290c127a style tweaks. 2011-12-06 14:08:47 -05:00
John-David Dalton
2c5661ebb3 underscore: Avoid regression and cleanup comments. [jddalton] 2011-12-06 01:16:56 -05:00