Comparing version 1.3.0 to 1.3.1
@@ -12,3 +12,3 @@ // const short = require('short-uuid'); | ||
this.db = db; | ||
this.id = id || IMap.getID(this.keys, value, size); | ||
this.id = id || this.getID(this.keys, value, size); | ||
this.saved = saved; | ||
@@ -18,4 +18,5 @@ this.loaded = loaded; | ||
static getID (keys=new Map(), value, size) { | ||
getID (keys=new Map(), value, size) { | ||
/* | ||
if (value && ['IArray', 'ISet', 'IMap', 'Record'].includes(value.constructor.name)) { | ||
@@ -27,3 +28,4 @@ value = value.constructor.name + ":" + value.id; | ||
} | ||
*/ | ||
return SHA256( | ||
@@ -33,3 +35,3 @@ JSON.stringify([ | ||
size, | ||
value | ||
this.db.encode(value) | ||
]) | ||
@@ -41,3 +43,3 @@ ).toString('base64'); | ||
const {keys, value, size} = data; | ||
const id = IMap.getID(keys, value, size); | ||
const id = this.getID(keys, value, size); | ||
@@ -44,0 +46,0 @@ return (await this.db.getNode(this.constructor, id)) || new this.constructor( |
{ | ||
"name": "beastdb", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "A persistence database specializing in state space search problems!", | ||
@@ -5,0 +5,0 @@ "main": "lib/db.js", |
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
44950
1034