Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

switch to lodash

  • Loading branch information...
commit aa0cc40747ed07cd124f200e275c366aeb1f8b73 1 parent e573e85
@fb55 fb55 authored jugglinmike committed
View
2  lib/api/attributes.js
@@ -1,4 +1,4 @@
-var _ = require('underscore'),
+var _ = require('lodash'),
utils = require('../utils'),
isTag = utils.isTag,
domEach = utils.domEach,
View
2  lib/api/css.js
@@ -1,4 +1,4 @@
-var _ = require('underscore');
+var _ = require('lodash');
var toString = Object.prototype.toString;
/**
View
2  lib/api/manipulation.js
@@ -1,4 +1,4 @@
-var _ = require('underscore'),
+var _ = require('lodash'),
parse = require('../parse'),
$ = require('../static'),
updateDOM = parse.update,
View
2  lib/api/traversing.js
@@ -1,4 +1,4 @@
-var _ = require('underscore'),
+var _ = require('lodash'),
select = require('CSSselect'),
utils = require('../utils'),
domEach = utils.domEach,
View
2  lib/cheerio.js
@@ -5,7 +5,7 @@
var path = require('path'),
parse = require('./parse'),
evaluate = parse.evaluate,
- _ = require('underscore');
+ _ = require('lodash');
/*
* The API
View
2  lib/parse.js
@@ -2,7 +2,7 @@
Module Dependencies
*/
var htmlparser = require('htmlparser2'),
- _ = require('underscore'),
+ _ = require('lodash'),
utils = require('./utils'),
decode = utils.decode,
isTag = utils.isTag,
View
2  lib/render.js
@@ -1,7 +1,7 @@
/*
Module dependencies
*/
-var _ = require('underscore');
+var _ = require('lodash');
var utils = require('./utils');
var encode = utils.encode;
View
4 package.json
@@ -21,9 +21,9 @@
},
"dependencies": {
"htmlparser2": "~3.4.0",
- "underscore": "1.5.2",
"entities": "~0.5.0",
- "CSSselect": "~0.4.0"
+ "CSSselect": "~0.4.0",
+ "lodash": "~2.4.1"
},
"devDependencies": {
"mocha": "*",
View
6 test/cheerio.js
@@ -1,5 +1,5 @@
var expect = require('expect.js'),
- _ = require('underscore'),
+ _ = require('lodash'),
$ = require('../'),
fixtures = require('./fixtures'),
fruits = fixtures.fruits,
@@ -148,10 +148,10 @@ describe('cheerio', function() {
var $elems = $('.apple, #fruits', fruits);
expect($elems).to.have.length(2);
- var $apple = _($elems).filter(function(elem) {
+ var $apple = _.filter($elems, function(elem) {
return elem.attribs['class'] === 'apple';
});
- var $fruits = _($elems).filter(function(elem) {
+ var $fruits = _.filter($elems, function(elem) {
return elem.attribs.id === 'fruits';
});
testAppleSelect($apple);
View
2  test/xml.js
@@ -1,5 +1,5 @@
var expect = require('expect.js'),
- _ = require('underscore'),
+ _ = require('lodash'),
cheerio = require('../lib/cheerio');
var xml = function(str, options) {
Please sign in to comment.
Something went wrong with that request. Please try again.