Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 59e48fb

Browse files
author
Nick Litwin
committed
Update more deprecated lodash methods
1 parent c3d28ef commit 59e48fb

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

app/profile/subtrack/subtrack.controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ import _ from 'lodash'
8585
var mustHaveMetrics = ['rank', 'rating', 'reliability']
8686
// check if rating, rank & reliability are all set
8787
var _filteredObjs = _.filter(vm.subTrackStats, function(k) { return _.indexOf(mustHaveMetrics, k.label) > -1})
88-
if (_.all(_.map(_filteredObjs, 'val'), function(v) { return !v})) {
88+
if (_.every(_.map(_filteredObjs, 'val'), function(v) { return !v})) {
8989
// all false filter em out
9090
_.remove(vm.subTrackStats, function(k) { return _.indexOf(mustHaveMetrics, k.label) > -1})
9191
}

app/services/externalAccounts.service.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ describe('ExternalAccount Service', function() {
9191
service.getAllExternalLinks('test1', 111, false).then(function(data) {
9292
expect(data).to.be.defined
9393
expect(_.map(data, 'provider')).to.include.members(['dribbble', 'github','bitbucket', 'stackoverflow'])
94-
expect(_.all(_.map(data, 'data'))).to.be.truthy
94+
expect(_.every(_.map(data, 'data'))).to.be.truthy
9595
})
9696
$httpBackend.flush()
9797
})
@@ -116,7 +116,7 @@ describe('ExternalAccount Service', function() {
116116
service.getAllExternalLinks('test1', 111, true).then(function(data) {
117117
expect(data).to.be.defined
118118
expect(_.map(data, 'provider')).to.include.members(['dribbble', 'github','bitbucket', 'stackoverflow'])
119-
expect(_.all(_.map(data, 'data'))).to.be.truthy
119+
expect(_.every(_.map(data, 'data'))).to.be.truthy
120120
})
121121
$httpBackend.flush()
122122
})

app/services/introduction.service.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,21 @@ import _ from 'lodash'
4141
var handleInParams = $stateParams.userHandle ? $stateParams.userHandle.toLowerCase() : null
4242
var userIntroJSStats = store.get(userId)
4343

44-
if (!userIntroJSStats.dashboardIntroComplete && _.contains(currentPage, 'dashboard')) {
44+
if (!userIntroJSStats.dashboardIntroComplete && _.includes(currentPage, 'dashboard')) {
4545
userIntroJSStats.dashboardIntroComplete = true
4646
store.set(userId, userIntroJSStats)
4747

4848
return getIntroData(currentPage)
4949
}
5050

51-
if (!userIntroJSStats.profileAboutIntroComplete && _.contains(currentPage, 'profile.about') && userHandle === handleInParams) {
51+
if (!userIntroJSStats.profileAboutIntroComplete && _.includes(currentPage, 'profile.about') && userHandle === handleInParams) {
5252
userIntroJSStats.profileAboutIntroComplete = true
5353
store.set(userId, userIntroJSStats)
5454

5555
return getIntroData(currentPage)
5656
}
5757

58-
if (!userIntroJSStats.profileSubtrackIntroComplete && _.contains(currentPage, 'profile.subtrack') && userHandle === handleInParams && $stateParams.subTrack.toLowerCase() !== 'copilot') {
58+
if (!userIntroJSStats.profileSubtrackIntroComplete && _.includes(currentPage, 'profile.subtrack') && userHandle === handleInParams && $stateParams.subTrack.toLowerCase() !== 'copilot') {
5959
userIntroJSStats.profileSubtrackIntroComplete = true
6060
store.set(userId, userIntroJSStats)
6161

app/settings/edit-profile/edit-profile.controller.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ import _ from 'lodash'
155155

156156
function processData(userInfo) {
157157
vm.tracks = {
158-
DESIGN: _.contains(userInfo.tracks, 'DESIGN'),
159-
DEVELOP: _.contains(userInfo.tracks, 'DEVELOP'),
160-
DATA_SCIENCE: _.contains(userInfo.tracks, 'DATA_SCIENCE')
158+
DESIGN: _.includes(userInfo.tracks, 'DESIGN'),
159+
DEVELOP: _.includes(userInfo.tracks, 'DEVELOP'),
160+
DATA_SCIENCE: _.includes(userInfo.tracks, 'DATA_SCIENCE')
161161
}
162162
}
163163

0 commit comments

Comments
 (0)