|
1 | 1 | import type { VaultError } from "@/errors";
|
| 2 | +import { isNull, isUndefined } from "@/helpers"; |
2 | 3 | import indexPageByDaysTemplate from "@/templates/indexPageByDays.hbs";
|
3 | 4 | import indexPageByLanguagesTemplate from "@/templates/indexPageByLanguages.hbs";
|
4 | 5 | import indexPageByOwnersTemplate from "@/templates/indexPageByOwners.hbs";
|
@@ -98,7 +99,7 @@ export class GithubStarsPluginApi {
|
98 | 99 | }
|
99 | 100 |
|
100 | 101 | const starredCount = Stream.of(repos)
|
101 |
| - .filter((r) => typeof r.unstarredAt === "undefined") |
| 102 | + .filter((r) => isUndefined(r.unstarredAt) || isNull(r.unstarredAt)) |
102 | 103 | .toCount();
|
103 | 104 | const unstarredCount = Stream.of(repos)
|
104 | 105 | .filter((r) => !!r.unstarredAt)
|
@@ -150,7 +151,7 @@ export class GithubStarsPluginApi {
|
150 | 151 | .groupBy((r) => r.mainLanguage)
|
151 | 152 | .sort();
|
152 | 153 | const starredCount = Stream.of(repos)
|
153 |
| - .filter((r) => typeof r.unstarredAt === "undefined") |
| 154 | + .filter((r) => isUndefined(r.unstarredAt) || isNull(r.unstarredAt)) |
154 | 155 | .toCount();
|
155 | 156 | const unstarredCount = Stream.of(repos)
|
156 | 157 | .filter((r) => !!r.unstarredAt)
|
@@ -221,7 +222,7 @@ export class GithubStarsPluginApi {
|
221 | 222 | .groupBy((r) => r.owner.login)
|
222 | 223 | .sort();
|
223 | 224 | const starredCount = Stream.of(repos)
|
224 |
| - .filter((r) => typeof r.unstarredAt === "undefined") |
| 225 | + .filter((r) => isUndefined(r.unstarredAt) || isNull(r.unstarredAt)) |
225 | 226 | .toCount();
|
226 | 227 | const unstarredCount = Stream.of(repos)
|
227 | 228 | .filter((r) => !!r.unstarredAt)
|
|
0 commit comments