Spaces:
Build error
Build error
Download lib/hot-score.ts from Jacksuyu/requestsolution: direct link, hf CLI and curl.
- Browser
- Download file 212 Bytes
-
https://huggingface.co/spaces/Jacksuyu/requestsolution/resolve/main/lib/hot-score.ts
- Command line
-
hf download hf://spaces/Jacksuyu/requestsolution/lib/hot-score.ts
-
curl -L -o hot-score.ts https://huggingface.co/spaces/Jacksuyu/requestsolution/resolve/main/lib/hot-score.ts
212 Bytes
| export function hotScore(upvotes: number, createdAt: Date): number { | |
| const ageInHours = | |
| (Date.now() - createdAt.getTime()) / (1000 * 60 * 60); | |
| return Math.log10(Math.max(upvotes, 1)) - ageInHours / 24; | |
| } | |