master
1import { Commit, define, latest } from '#src'
2
3export default define({
4 url: import.meta.url,
5 badges: ['friday-13'] as const,
6 present(data, grant) {
7 const commits: Commit[] = []
8
9 for (const repo of data.repos) {
10 for (const commit of repo.commits) {
11 const data = new Date(commit.committedDate)
12 if (data.getDay() === 5 && data.getDate() === 13) {
13 commits.push(commit)
14 }
15 }
16 }
17
18 if (commits.length > 0) {
19 grant(
20 'friday-13',
21 'I committed on Friday the 13th, One… By One…',
22 ).evidenceCommits(...commits.sort(latest).slice(0, 13))
23 }
24 },
25})