Skip to content

Commit

Permalink
Update lodash dependeny to 4.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
leif.hanack committed Jan 31, 2016
1 parent 8c9b2e0 commit b12cbe8
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
Expand Up @@ -238,7 +238,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
Expand Up @@ -114,7 +114,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 @@ -139,7 +139,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
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
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
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 b12cbe8

Please sign in to comment.