underscore-source 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +2 -2
- data/lib/underscore-source/version.rb +1 -1
- data/vendor/assets/javascripts/underscore.js +3 -3
- metadata +1 -1
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Underscore::Source
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Wrap Underscore in a gem so that we can have bundler manage JavaScript library version dependencies. The version of this gem corresponds to the version of Underscore included.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -18,7 +18,7 @@ Or install it yourself as:
|
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
From your `application.js` use `//= require underscore` or `#= require underscore` if you're using CoffeeScript.
|
|
22
22
|
|
|
23
23
|
## Contributing
|
|
24
24
|
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
root._ = _;
|
|
56
56
|
|
|
57
57
|
// Current version.
|
|
58
|
-
_.VERSION = '1.0.
|
|
58
|
+
_.VERSION = '1.0.3';
|
|
59
59
|
|
|
60
60
|
// ------------------------ Collection Functions: ---------------------------
|
|
61
61
|
|
|
@@ -469,7 +469,7 @@
|
|
|
469
469
|
// Check dates' integer values.
|
|
470
470
|
if (_.isDate(a) && _.isDate(b)) return a.getTime() === b.getTime();
|
|
471
471
|
// Both are NaN?
|
|
472
|
-
if (_.isNaN(a) && _.isNaN(b)) return
|
|
472
|
+
if (_.isNaN(a) && _.isNaN(b)) return false;
|
|
473
473
|
// Compare regular expressions.
|
|
474
474
|
if (_.isRegExp(a) && _.isRegExp(b))
|
|
475
475
|
return a.source === b.source &&
|
|
@@ -491,7 +491,7 @@
|
|
|
491
491
|
|
|
492
492
|
// Is a given array or object empty?
|
|
493
493
|
_.isEmpty = function(obj) {
|
|
494
|
-
if (_.isArray(obj)) return obj.length === 0;
|
|
494
|
+
if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
|
|
495
495
|
for (var key in obj) if (hasOwnProperty.call(obj, key)) return false;
|
|
496
496
|
return true;
|
|
497
497
|
};
|