Write full types and fix related bugs

Also fixes #4.
This commit is contained in:
Cadence Fish
2020-01-27 03:56:59 +13:00
parent 482bdff3a4
commit 5303ae1d4b
16 changed files with 757 additions and 299 deletions

View File

@@ -5,4 +5,14 @@ function proxyImage(url, width) {
return "/imageproxy?"+params.toString()
}
/**
* @param {import("../types").ExtendedOwner} owner
*/
function proxyExtendedOwner(owner) {
const clone = {...owner}
clone.profile_pic_url = proxyImage(clone.profile_pic_url)
return clone
}
module.exports.proxyImage = proxyImage
module.exports.proxyExtendedOwner = proxyExtendedOwner