Skip to content

Commit fee39fc

Browse files
committed
Move RFC 6265 related functionality to converter
1 parent 9e45d88 commit fee39fc

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/api.mjs

-4
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ function init (converter, defaultAttributes) {
6060
var parts = cookies[i].split('=')
6161
var value = parts.slice(1).join('=')
6262

63-
if (value[0] === '"') {
64-
value = value.slice(1, -1)
65-
}
66-
6763
try {
6864
var foundKey = decodeURIComponent(parts[0])
6965
jar[foundKey] = converter.read(value, foundKey)

src/converter.mjs

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/* eslint-disable no-var */
22
export default {
33
read: function (value) {
4+
if (value[0] === '"') {
5+
value = value.slice(1, -1)
6+
}
47
return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent)
58
},
69
write: function (value) {

0 commit comments

Comments
 (0)