Skip to content

Commit

Permalink
Merge pull request #808 from leifhanack/lodash4
Browse files Browse the repository at this point in the history
Update lodash dependency to 4.1.0
  • Loading branch information
fb55 committed Feb 1, 2016
2 parents c04ead1 + b12cbe8 commit dbcbe90
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/api/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ exports.removeAttr = function(name) {
};

exports.hasClass = function(className) {
return _.any(this, function(elem) {
return _.some(this, function(elem) {
var attrs = elem.attribs,
clazz = attrs && attrs['class'],
idx = -1,
Expand Down
4 changes: 2 additions & 2 deletions lib/api/manipulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ exports.wrap = function(wrapper) {
var wrapperFn = typeof wrapper === 'function' && wrapper,
lastIdx = this.length - 1;

_.forEach(this, function(el, i) {
_.forEach(this, _.bind(function(el, i) {
var parent = el.parent || el.root,
siblings = parent.children,
dom, index;
Expand All @@ -159,7 +159,7 @@ exports.wrap = function(wrapper) {
// array, so the `dom` array can be inserted without removing any
// additional elements.
uniqueSplice(siblings, index, 0, dom, parent);
}, this);
}, this));

return this;
};
Expand Down
3 changes: 1 addition & 2 deletions lib/api/traversing.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,7 @@ exports.siblings = function(selector) {

var elems = _.filter(
parent ? parent.children() : this.siblingsAndMe(),
function(elem) { return isTag(elem) && !this.is(elem); },
this
_.bind(function(elem) { return isTag(elem) && !this.is(elem); }, this)
);

if (selector !== undefined) {
Expand Down
4 changes: 2 additions & 2 deletions lib/cheerio.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ var Cheerio = module.exports = function(selector, context, root, options) {

// $([dom])
if (Array.isArray(selector)) {
_.forEach(selector, function(elem, idx) {
_.forEach(selector, _.bind(function(elem, idx) {
this[idx] = elem;
}, this);
}, this));
this.length = selector.length;
return this;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"entities": "~1.1.1",
"htmlparser2": "~3.8.1",
"dom-serializer": "~0.1.0",
"lodash": "^3.2.0"
"lodash": "^4.1.0"
},
"devDependencies": {
"benchmark": "~1.0.0",
Expand Down

0 comments on commit dbcbe90

Please sign in to comment.