connect-mikro-orm
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -19,2 +19,3 @@ /*! | ||
private ttl; | ||
private asJSON; | ||
/** | ||
@@ -26,2 +27,3 @@ * Initializes MikroOrmStore with the given `options`. | ||
ttl: Ttl; | ||
asJSON?: boolean; | ||
}>); | ||
@@ -28,0 +30,0 @@ connect(repository: SqlEntityRepository<ISession>): this; |
@@ -52,11 +52,16 @@ "use strict"; | ||
let json; | ||
try { | ||
json = JSON.stringify(sess); | ||
if (this.asJSON) { | ||
json = sess; | ||
} | ||
catch (er) { | ||
if (er instanceof Error) { | ||
return fn ? fn(er) : undefined; | ||
else { | ||
try { | ||
json = JSON.stringify(sess); | ||
} | ||
else { | ||
return fn ? fn(new Error('serialize error')) : undefined; | ||
catch (er) { | ||
if (er instanceof Error) { | ||
return fn ? fn(er) : undefined; | ||
} | ||
else { | ||
return fn ? fn(new Error('serialize error')) : undefined; | ||
} | ||
} | ||
@@ -157,2 +162,3 @@ } | ||
this.ttl = options.ttl; | ||
this.asJSON = options.asJSON; | ||
} | ||
@@ -159,0 +165,0 @@ connect(repository) { |
{ | ||
"name": "connect-mikro-orm", | ||
"description": "A MikroORM-based session store", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "typings": "dist", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21293
273