Skip to content

Commit

Permalink
Remove class-properties from MemoryStore (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangvvo authored Sep 22, 2021
1 parent 4e58dc0 commit 9a7a31f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/memory-store.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { SessionData, SessionStore } from "./types";

export default class MemoryStore implements SessionStore {
store = new Map<string, string>();
store: Map<string, string>;

constructor() {
this.store = new Map();
}

async get(sid: string): Promise<SessionData | null> {
const sess = this.store.get(sid);
Expand Down
4 changes: 3 additions & 1 deletion test/import-test/index.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const assert = require("assert");
const session = require("next-session");
const session = require("next-session").default;
const { expressSession, promisifyStore } = require("next-session/lib/compat");

assert(session);
assert(expressSession);
assert(promisifyStore);

session();
2 changes: 2 additions & 0 deletions test/import-test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ import { expressSession, promisifyStore } from "next-session/lib/compat";
assert(session);
assert(expressSession);
assert(promisifyStore);

session();

0 comments on commit 9a7a31f

Please sign in to comment.