Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
9
test/parseCookie/parseCookie.js
Normal file
9
test/parseCookie/parseCookie.js
Normal file
@ -0,0 +1,9 @@
|
||||
const parseCookie = str =>
|
||||
str
|
||||
.split(';')
|
||||
.map(v => v.split('='))
|
||||
.reduce((acc, v) => {
|
||||
acc[decodeURIComponent(v[0].trim())] = decodeURIComponent(v[1].trim());
|
||||
return acc;
|
||||
}, {
|
||||
module.exports = parseCookie;
|
||||
Reference in New Issue
Block a user