Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"exports": "./mod.ts",
"lock": false,
"tasks": {
"check": "deno cache --allow-import src/mod.ts",
"check": "deno cache --allow-import mod.ts",
"test": "deno test --allow-import test",
"ok": "deno fmt && deno lint && deno task test && deno task check",
"clean": "git clean -fX out test/cov_profile test/coverage coverage.lcov",
Expand Down
7 changes: 5 additions & 2 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ export class MemorySessionStorage<S> implements StorageAdapter<S> {
this.delete(key);
return undefined;
}
return value.session;
return structuredClone(value.session);
}

readAllKeys(): string[] {
Expand All @@ -707,7 +707,10 @@ export class MemorySessionStorage<S> implements StorageAdapter<S> {
}

write(key: string, value: S) {
this.storage.set(key, addExpiryDate(value, this.timeToLive));
this.storage.set(
key,
addExpiryDate(structuredClone(value), this.timeToLive),
);
}

delete(key: string) {
Expand Down
Loading