I was passing the tags array from this object into search with random: true periodically and noticed order:random was being appended each time. With unauthenticated Danbooru, this quickly leads to hitting the tag limit.
This could be worked around easily by passing in a copy of tags into search, but I'd like to contribute some features, so this seemed like a good place to start.
I changed search to copy the tags array instead of modifying it directly. Other changes were prompted by the typescript compiler and trying to guess what it wanted. This is my very first time doing anything typescript, so if there's something wrong here, that's why.
I was passing the
tags
array from this object intosearch
withrandom: true
periodically and noticedorder:random
was being appended each time. With unauthenticated Danbooru, this quickly leads to hitting the tag limit.This could be worked around easily by passing in a copy of
tags
intosearch
, but I'd like to contribute some features, so this seemed like a good place to start.I changed
search
to copy thetags
array instead of modifying it directly. Other changes were prompted by the typescript compiler and trying to guess what it wanted. This is my very first time doing anything typescript, so if there's something wrong here, that's why.