chore: filter to query

This commit is contained in:
Cory Dransfeldt 2024-10-13 15:20:54 -07:00
parent ed65bb8127
commit ffea333d55
No known key found for this signature in database
22 changed files with 24 additions and 73 deletions

View file

@ -1,8 +1,5 @@
import sanitizeHtml from 'sanitize-html'
import { shuffleArray } from '../utilities/index.js'
const BASE_URL = 'https://coryd.dev'
export default {
encodeAmp: (string) => {
if (!string) return
@ -12,8 +9,4 @@ export default {
},
formatNumber: (number) => number.toLocaleString('en-US'),
shuffleArray,
sanitizeHtml: (html) => sanitizeHtml(html, {
textFilter: (text) => text.replace(/"/g, '')
}),
absoluteUrl: (url) => (new URL(url, BASE_URL)).toString(),
}

View file

@ -9,7 +9,6 @@ export default {
if (book['status'] === 'finished' && book['year']) return parseInt(book['year']) === parseInt(year)
return ''
}),
sortByPlaysDescending: (data, key) => data.sort((a, b) => b[key] - a[key]),
mediaLinks: (data, type, count = 10) => {
if (!data || !type) return ''