_.VERSION = '1.5.0';
diff --git a/LICENSE b/LICENSE index 0d8dbe40b..3acf90838 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,5 @@ -Copyright (c) 2009-2013 Jeremy Ashkenas, DocumentCloud +Copyright (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative +Reporters & Editors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/docs/underscore.html b/docs/underscore.html index 8c5ecc7fb..00c07a54a 100644 --- a/docs/underscore.html +++ b/docs/underscore.html @@ -27,10 +27,9 @@
Underscore.js 1.5.0
+ Underscore.js 1.5.1
http://underscorejs.org
-(c) 2009-2011 Jeremy Ashkenas, DocumentCloud Inc.
-(c) 2011-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+(c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
Underscore may be freely distributed under the MIT license.
@@ -237,7 +236,7 @@ Baseline setup
- _.VERSION = '1.5.0';
+ _.VERSION = '1.5.1';
@@ -1204,29 +1203,6 @@ Array Functions
_.zip = function() {
- return _.unzip.apply(_, slice.call(arguments));
- };
-
-
-
-
-
-
-
-
- ¶
-
- The inverse operation to _.zip
. If given an array of pairs it
-returns an array of the paired elements split into two left and
-right element arrays, if given an array of triples it returns a
-three element array and so on. For example, _.unzip
given
-[['a',1],['b',2],['c',3]]
returns the array
-[['a','b','c'],[1,2,3]].
-
-
-
-
- _.unzip = function() {
var length = _.max(_.pluck(arguments, "length").concat(0));
var results = new Array(length);
for (var i = 0; i < length; i++) {
@@ -1238,11 +1214,11 @@ Array Functions
-
+
Converts lists into objects. Pass either a single array of [key, value]
pairs, or two parallel arrays of the same length -- one of keys, and one of
@@ -1267,11 +1243,11 @@
Array Functions
-
+
If the browser doesn't supply us with indexOf (I'm looking at you, MSIE),
we need this function. Return the position of the first occurrence of an
@@ -1302,11 +1278,11 @@
Array Functions
-
+
Delegates to ECMAScript 5's native lastIndexOf
if available.
@@ -1327,11 +1303,11 @@ Array Functions
-
+
Generate an integer Array containing an arithmetic progression. A port of
the native Python range()
function. See
@@ -1362,11 +1338,11 @@
Array Functions
-
+
Function (ahem) Functions
@@ -1375,11 +1351,11 @@ Function (ahem) Functions
-
+
@@ -1387,11 +1363,11 @@ Function (ahem) Functions
-
+
Reusable constructor function for prototype setting.
@@ -1403,11 +1379,11 @@ Function (ahem) Functions
-
+
Create a function bound to a given object (assigning this
, and arguments,
optionally). Delegates to ECMAScript 5's native Function.bind
if
@@ -1435,11 +1411,11 @@
Function (ahem) Functions
-
+
Partially apply a function by creating a version that has had some of its
arguments pre-filled, without changing its dynamic this
context.
@@ -1457,11 +1433,11 @@
Function (ahem) Functions
-
+
Bind all of an object's methods to that object. Useful for ensuring that
all callbacks defined on an object belong to it.
@@ -1479,11 +1455,11 @@
Function (ahem) Functions
-
+
Memoize an expensive function by storing its results.
@@ -1502,11 +1478,11 @@ Function (ahem) Functions
-
+
Delays a function for the given number of milliseconds, and then calls
it with the arguments supplied.
@@ -1522,11 +1498,11 @@
Function (ahem) Functions
-
+
Defers a function, scheduling it to run after the current call stack has
cleared.
@@ -1541,11 +1517,11 @@
Function (ahem) Functions
-
+
Returns a function, that, when invoked, will only be triggered at most once
during a given window of time. Normally, the throttled function will run
@@ -1562,7 +1538,7 @@
Function (ahem) Functions
var previous = 0;
options || (options = {});
var later = function() {
- previous = new Date;
+ previous = options.leading === false ? 0 : new Date;
timeout = null;
result = func.apply(context, args);
};
@@ -1587,11 +1563,11 @@ Function (ahem) Functions
-
+
Returns a function, that, as long as it continues to be invoked, will not
be triggered. The function will be called after it stops being called for
@@ -1621,11 +1597,11 @@
Function (ahem) Functions
-
+
Returns a function that will be executed at most one time, no matter how
often you call it. Useful for lazy initialization.
@@ -1647,11 +1623,11 @@
Function (ahem) Functions
-
+
Returns the first function passed as an argument to the second,
allowing you to adjust arguments, run code before and after, and
@@ -1671,11 +1647,11 @@
Function (ahem) Functions
-
+
Returns a function that is the composition of a list of functions, each
consuming the return value of the function that follows.
@@ -1697,11 +1673,11 @@
Function (ahem) Functions
-
+
Returns a function that will only be executed after being called N times.
@@ -1719,11 +1695,11 @@ Function (ahem) Functions
-
+
Object Functions
@@ -1732,11 +1708,11 @@ Object Functions
-
+
@@ -1744,11 +1720,11 @@ Object Functions
-
+
Retrieve the names of an object's properties.
Delegates to ECMAScript 5's native Object.keys
@@ -1766,11 +1742,11 @@
Object Functions
-
+
Retrieve the values of an object's properties.
@@ -1786,11 +1762,11 @@ Object Functions
-
+
Convert an object into a list of [key, value]
pairs.
@@ -1806,11 +1782,11 @@ Object Functions
-
+
Invert the keys and values of an object. The values must be serializable.
@@ -1826,11 +1802,11 @@ Object Functions
-
+
Return a sorted list of the function names available on the object.
Aliased as methods
@@ -1849,11 +1825,11 @@
Object Functions
-
+
Extend a given object with all the properties in passed-in object(s).
@@ -1874,11 +1850,11 @@ Object Functions
-
+
Return a copy of the object only containing the whitelisted properties.
@@ -1897,11 +1873,11 @@ Object Functions
-
+
Return a copy of the object without the blacklisted properties.
@@ -1920,11 +1896,11 @@ Object Functions
-
+
Fill in a given object with default properties.
@@ -1945,11 +1921,11 @@ Object Functions
-
+
Create a (shallow-cloned) duplicate of an object.
@@ -1964,11 +1940,11 @@ Object Functions
-
+
Invokes interceptor with the obj, and then returns obj.
The primary purpose of this method is to "tap into" a method chain, in
@@ -1985,11 +1961,11 @@
Object Functions
-
+
Internal recursive comparison function for isEqual
.
@@ -2001,11 +1977,11 @@ Object Functions
-
+
Identical objects are equal. 0 === -0
, but they aren't identical.
See the Harmony egal
proposal.
@@ -2018,11 +1994,11 @@
Object Functions
-
+
A strict comparison is necessary because null == undefined
.
@@ -2034,11 +2010,11 @@ Object Functions
-
+
Unwrap any wrapped objects.
@@ -2051,11 +2027,11 @@ Object Functions
-
+
Compare [[Class]]
names.
@@ -2069,11 +2045,11 @@ Object Functions
-
+
Strings, numbers, dates, and booleans are compared by value.
@@ -2085,11 +2061,11 @@ Object Functions
-
+
Primitives and their corresponding object wrappers are equivalent; thus, "5"
is
equivalent to new String("5")
.
@@ -2103,11 +2079,11 @@
Object Functions
-
+
NaN
s are equivalent, but non-reflexive. An egal
comparison is performed for
other numeric values.
@@ -2122,11 +2098,11 @@
Object Functions
-
+
Coerce dates and booleans to numeric primitive values. Dates are compared by their
millisecond representations. Note that invalid dates with millisecond representations
@@ -2140,11 +2116,11 @@
Object Functions
-
+
RegExps are compared by their source patterns and flags.
@@ -2162,11 +2138,11 @@ Object Functions
-
+
Assume equality for cyclic structures. The algorithm for detecting cyclic
structures is adapted from ES 5.1 section 15.12.3, abstract operation JO
.
@@ -2180,11 +2156,11 @@
Object Functions
-
+
Linear search. Performance is inversely proportional to the number of
unique nested structures.
@@ -2198,11 +2174,11 @@
Object Functions
-
+
Objects with different constructors are not equivalent, but Object
s
from different frames are.
@@ -2219,11 +2195,11 @@
Object Functions
-
+
Add the first object to the stack of traversed objects.
@@ -2237,11 +2213,11 @@ Object Functions
-
+
Recursively compare objects and arrays.
@@ -2253,11 +2229,11 @@ Object Functions
-
+
Compare array lengths to determine if a deep comparison is necessary.
@@ -2271,11 +2247,11 @@ Object Functions
-
+
Deep compare the contents, ignoring non-numeric properties.
@@ -2291,11 +2267,11 @@ Object Functions
-
+
Deep compare objects.
@@ -2308,11 +2284,11 @@ Object Functions
-
+
Count the expected number of properties.
@@ -2324,11 +2300,11 @@ Object Functions
-
+
Deep compare each member.
@@ -2342,11 +2318,11 @@ Object Functions
-
+
Ensure that both objects contain the same number of properties.
@@ -2364,11 +2340,11 @@ Object Functions
-
+
Remove the first object from the stack of traversed objects.
@@ -2383,11 +2359,11 @@ Object Functions
-
+
Perform a deep comparison to check if two objects are equal.
@@ -2401,11 +2377,11 @@ Object Functions
-
+
Is a given array, string, or object empty?
An "empty" object has no enumerable own-properties.
@@ -2423,11 +2399,11 @@
Object Functions
-
+
Is a given value a DOM element?
@@ -2441,11 +2417,11 @@ Object Functions
-
+
Is a given value an array?
Delegates to ECMA5's native Array.isArray
@@ -2460,11 +2436,11 @@
Object Functions
-
+
Is a given variable an object?
@@ -2478,11 +2454,11 @@ Object Functions
-
+
Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
@@ -2498,11 +2474,11 @@ Object Functions
-
+
Define a fallback version of the method in browsers (ahem, IE), where
there isn't any inspectable "Arguments" type.
@@ -2519,11 +2495,11 @@
Object Functions
-
+
Optimize isFunction
if appropriate.
@@ -2539,11 +2515,11 @@ Object Functions
-
+
Is a given object a finite number?
@@ -2557,11 +2533,11 @@ Object Functions
-
+
Is the given value NaN
? (NaN is the only number which does not equal itself).
@@ -2575,11 +2551,11 @@ Object Functions
-
+
Is a given value a boolean?
@@ -2593,11 +2569,11 @@ Object Functions
-
+
Is a given value equal to null?
@@ -2611,11 +2587,11 @@ Object Functions
-
+
Is a given variable undefined?
@@ -2629,11 +2605,11 @@ Object Functions
-
+
Shortcut function for checking if an object has a given property directly
on itself (in other words, not on a prototype).
@@ -2648,11 +2624,11 @@
Object Functions
-
+
Utility Functions
@@ -2661,11 +2637,11 @@ Utility Functions
-
+
@@ -2673,11 +2649,11 @@ Utility Functions
-
+
Run Underscore.js in noConflict mode, returning the _
variable to its
previous owner. Returns a reference to the Underscore object.
@@ -2693,11 +2669,11 @@
Utility Functions
-
+
Keep the identity function around for default iterators.
@@ -2711,11 +2687,11 @@ Utility Functions
-
+
Run a function n times.
@@ -2731,11 +2707,11 @@ Utility Functions
-
+
Return a random integer between min and max (inclusive).
@@ -2753,11 +2729,11 @@ Utility Functions
-
+
List of HTML entities for escaping.
@@ -2779,11 +2755,11 @@ Utility Functions
-
+
Regexes containing the keys and values listed immediately above.
@@ -2798,11 +2774,11 @@ Utility Functions
-
+
Functions for escaping and unescaping strings to/from HTML interpolation.
@@ -2821,11 +2797,11 @@ Utility Functions
-
+
If the value of the named property
is a function then invoke it with the
object
as context; otherwise, return it.
@@ -2842,11 +2818,11 @@
Utility Functions
-
+
Add your own custom functions to the Underscore object.
@@ -2867,11 +2843,11 @@ Utility Functions
-
+
Generate a unique integer id (unique within the entire client session).
Useful for temporary DOM ids.
@@ -2888,11 +2864,11 @@
Utility Functions
-
+
By default, Underscore uses ERB-style template delimiters, change the
following template settings to use alternative delimiters.
@@ -2909,11 +2885,11 @@
Utility Functions
-
+
When customizing templateSettings
, if you don't want to define an
interpolation, evaluation or escaping regex, we need one that is
@@ -2927,11 +2903,11 @@
Utility Functions
-
+
Certain characters need to be escaped so that they can be put into a
string literal.
@@ -2954,11 +2930,11 @@
Utility Functions
-
+
JavaScript micro-templating, similar to John Resig's implementation.
Underscore templating handles arbitrary delimiters, preserves whitespace,
@@ -2974,11 +2950,11 @@
Utility Functions
-
+
Combine delimiters into one regular expression via alternation.
@@ -2994,11 +2970,11 @@ Utility Functions
-
+
Compile the template source, escaping string literals appropriately.
@@ -3028,11 +3004,11 @@ Utility Functions
-
+
If a variable is not specified, place data values in local scope.
@@ -3060,11 +3036,11 @@ Utility Functions
-
+
Provide the compiled function source as a convenience for precompilation.
@@ -3079,11 +3055,11 @@ Utility Functions
-
+
Add a "chain" function, which will delegate to the wrapper.
@@ -3097,11 +3073,11 @@ Utility Functions
-
+
OOP
@@ -3110,11 +3086,11 @@ OOP
-
+
If Underscore is called as a function, it returns a wrapped object that
can be used OO-style. This wrapper holds altered versions of all the
@@ -3126,11 +3102,11 @@
OOP
-
+
Helper function to continue chaining intermediate results.
@@ -3144,11 +3120,11 @@ OOP
-
+
Add all of the Underscore functions to the wrapper object.
@@ -3160,11 +3136,11 @@ OOP
-
+
Add all mutator Array functions to the wrapper.
@@ -3184,11 +3160,11 @@ OOP
-
+
Add all accessor Array functions to the wrapper.
@@ -3207,11 +3183,11 @@ OOP
-
+