Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 8x 21x 21x 21x 27x 27x 27x 13x 13x 13x 7x 21x | export function filterCookie(cookie: string, filterPredicate: (key: string) => boolean): string {
const newCookie: string[] = []
const parts = cookie.split(';')
parts.forEach((it) => {
const s = it.trim()
const ind = s.indexOf('=')
if (ind !== -1) {
const key = s.substring(0, ind)
const value = s.substring(ind + 1)
if (filterPredicate(key)) {
newCookie.push(`${key}=${value}`)
}
}
})
return newCookie.join('; ').trim()
}
|