mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
23 lines
667 B
TypeScript
23 lines
667 B
TypeScript
import { redditHot, hackerHot, wilsonScore } from 'decay';
|
|
|
|
const upvotes = 42;
|
|
const downvotes = 12;
|
|
const posted = new Date(2017, 1, 1);
|
|
|
|
let score: number;
|
|
|
|
let redditCalculator = redditHot();
|
|
score = redditCalculator(upvotes, downvotes, posted);
|
|
redditCalculator = redditHot(10000);
|
|
score = redditCalculator(upvotes, downvotes, posted);
|
|
|
|
let hackerCalculator = hackerHot();
|
|
score = hackerCalculator(upvotes, posted);
|
|
hackerCalculator = hackerHot(1.6);
|
|
score = hackerCalculator(upvotes, posted);
|
|
|
|
let wilsonCalculator = wilsonScore();
|
|
score = wilsonCalculator(upvotes, downvotes);
|
|
wilsonCalculator = wilsonScore(1.0);
|
|
score = wilsonCalculator(upvotes, downvotes);
|