1
0
mirror of https://github.com/advplyr/audiobookshelf.git synced 2025-04-16 01:16:24 +02:00
audiobookshelf/client/mixins/apiRequestHelpers.js
2023-11-28 12:11:14 -08:00

13 lines
327 B
JavaScript

export default {
methods: {
buildQuerystring(obj, opts = { includePrefix: false }) {
let querystring = Object
.entries(obj)
.map(([key, val]) => `${encodeURIComponent(key)}=${encodeURIComponent(val)}`)
.join('&')
return (opts.includePrefix ? '?' : '').concat(querystring)
}
}
}