Skip to content

Commit 2c7a12d

Browse files
committed
Do not export Store from compat
1 parent 53ce5dc commit 2c7a12d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/compat.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@ import { EventEmitter } from 'events';
33
import { Store as ExpressStore } from 'express-session';
44
import MemoryStore from './store/memory';
55

6-
export function Store() {
6+
function CompatibleStore() {
77
// @ts-ignore
88
EventEmitter.call(this);
99
}
10-
inherits(Store, EventEmitter);
10+
inherits(CompatibleStore, EventEmitter);
1111

1212
// no-op for compat
1313
function expressSession(options?: any): any {}
1414

15-
expressSession.Store = Store;
15+
expressSession.Store = CompatibleStore;
1616

1717
function CallbackMemoryStore() {}
18-
inherits(CallbackMemoryStore, Store);
18+
inherits(CallbackMemoryStore, CompatibleStore);
19+
1920
CallbackMemoryStore.prototype.get = callbackify(MemoryStore.prototype.get);
2021
CallbackMemoryStore.prototype.set = callbackify(MemoryStore.prototype.set);
2122
CallbackMemoryStore.prototype.destroy = callbackify(

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export { default as withSession } from './withSession';
22
export { default as session } from './connect';
33
export { applySession } from './core';
4-
export { promisifyStore, expressSession, Store } from './compat';
4+
export { promisifyStore, expressSession } from './compat';
55
export { default as MemoryStore } from './store/memory';
66
export { SessionData, SessionCookieData, SessionStore } from './types';

0 commit comments

Comments
 (0)