Skip to content

Commit 443a16a

Browse files
committed
refactor: used angular.isDefined() instead of typeof !== "undefined"
1 parent 85478d1 commit 443a16a

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

dist/angular-github-api-factory.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
@name: angular-github-api-factory
3-
@version: 0.5.0 (06-01-2016)
3+
@version: 0.5.0 (17-02-2016)
44
@author: Jonathan Hornung
55
@url: https://github.com/JohnnyTheTank/angular-github-api-factory#readme
66
@license: MIT
@@ -76,7 +76,7 @@ angular.module("jtt_github", [])
7676
this.fillDataInObjectByList = function (_object, _params, _list) {
7777

7878
angular.forEach(_list, function (value, key) {
79-
if (typeof _params[value] !== "undefined") {
79+
if (angular.isDefined(_params[value])) {
8080
_object.object[value] = _params[value];
8181
}
8282
});
@@ -92,7 +92,7 @@ angular.module("jtt_github", [])
9292
url: "",
9393
};
9494

95-
if (typeof _params.per_page !== "undefined") {
95+
if (angular.isDefined(_params.per_page)) {
9696
githubSearchData.object.per_page = _params.per_page;
9797
}
9898

@@ -141,7 +141,6 @@ angular.module("jtt_github", [])
141141
githubSearchData.url = this.getApiBaseUrl() + "repos/" + _params.user + "/" + _params.repo + "/events";
142142
break;
143143
}
144-
145144
return githubSearchData;
146145
};
147146
});

dist/angular-github-api-factory.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/angular-github-api-factory.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ angular.module("jtt_github", [])
6969
this.fillDataInObjectByList = function (_object, _params, _list) {
7070

7171
angular.forEach(_list, function (value, key) {
72-
if (typeof _params[value] !== "undefined") {
72+
if (angular.isDefined(_params[value])) {
7373
_object.object[value] = _params[value];
7474
}
7575
});
@@ -85,7 +85,7 @@ angular.module("jtt_github", [])
8585
url: "",
8686
};
8787

88-
if (typeof _params.per_page !== "undefined") {
88+
if (angular.isDefined(_params.per_page)) {
8989
githubSearchData.object.per_page = _params.per_page;
9090
}
9191

@@ -134,7 +134,6 @@ angular.module("jtt_github", [])
134134
githubSearchData.url = this.getApiBaseUrl() + "repos/" + _params.user + "/" + _params.repo + "/events";
135135
break;
136136
}
137-
138137
return githubSearchData;
139138
};
140139
});

0 commit comments

Comments
 (0)