Skip to content
This repository was archived by the owner on Aug 24, 2020. It is now read-only.

Commit 4271409

Browse files
#1: Replace lodash with underscore
1 parent ed0d587 commit 4271409

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"karma-coverage-istanbul-reporter": "^0.2.0",
4545
"karma-jasmine": "~1.1.0",
4646
"karma-jasmine-html-reporter": "^0.2.2",
47-
"lodash": "^4.6.1",
47+
"underscore": "^1.8.3",
4848
"node-watch": "^0.5.2",
4949
"protractor": "~5.1.0",
5050
"raf": "^3.1.0",

src/swing/card.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import _ from 'lodash';
1+
import _ from 'underscore';
2+
23
import Sister from 'sister';
34
import rebound from 'rebound';
45
import vendorPrefix from 'vendor-prefix';

src/swing/stack.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import _ from 'lodash';
1+
import _ from 'underscore';
2+
23
import Sister from 'sister';
34
import rebound from 'rebound';
45

@@ -97,8 +98,8 @@ export const Stack = (config) => {
9798
* @returns {Card|null}
9899
*/
99100
stack.getCard = (element) => {
100-
const group = _.find(index, {
101-
element
101+
const group = _.find(index, (i) => {
102+
return _.isEqual(i, element);
102103
});
103104

104105
if (group) {

src/swing/utilities.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import _ from 'lodash';
1+
import _ from 'underscore';
22

33
/**
44
* Return direct children elements.
@@ -8,8 +8,8 @@ import _ from 'lodash';
88
* @returns {Array}
99
*/
1010
const elementChildren = (element) => {
11-
return _.filter(element.childNodes, {
12-
nodeType: 1
11+
return _.filter(element.childNodes, (elem) => {
12+
return elem.nodeType === 1;
1313
});
1414
};
1515

0 commit comments

Comments
 (0)