re-add static Cookie.fromObject() function
This commit is contained in:
parent
ff7aaf3706
commit
3f66e804e5
|
@ -108,6 +108,12 @@ export default class Cookie {
|
|||
if(!this.expiry)
|
||||
this.expiry = null;
|
||||
}
|
||||
static fromObject(obj) {
|
||||
let c = Object.assign(Object.create(this.prototype), obj);
|
||||
if(typeof c.expiry === "string")
|
||||
c.expiry = new Date(c.expiry);
|
||||
return c;
|
||||
}
|
||||
serialize() {
|
||||
return this.name + "=" + this.value;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user