reference-map
Advanced tools
Comparing version 1.2.6 to 1.2.7
@@ -18,2 +18,6 @@ module.exports = class ReferanceMap { | ||
add (obj, type) { | ||
if (!(obj !== null && typeof obj === 'object')) { | ||
throw new Error(`invalid object "${obj}"`) | ||
} | ||
let ref = obj[this.intRefProp] | ||
@@ -20,0 +24,0 @@ if (ref === undefined) { |
{ | ||
"name": "reference-map", | ||
"version": "1.2.6", | ||
"version": "1.2.7", | ||
"description": "This is a simple determinstic map that maps POJOs to an integer", | ||
@@ -31,6 +31,6 @@ "main": "index.js", | ||
"coveralls": "^3.0.0", | ||
"nyc": "^11.4.1", | ||
"standard": "^11.0.0", | ||
"nyc": "^11.7.1", | ||
"standard": "^11.0.1", | ||
"tape": "^4.9.0" | ||
} | ||
} |
@@ -76,3 +76,3 @@ const tape = require('tape') | ||
tape('failures', t => { | ||
t.plan(1) | ||
t.plan(2) | ||
const referanceMap = new ReferanceMap() | ||
@@ -84,3 +84,9 @@ const buf = Buffer.from('hello') | ||
t.deepEquals(referanceMap.get(ref), buf) | ||
try { | ||
referanceMap.add(1) | ||
} catch (e) { | ||
t.equal(e.toString(), 'Error: invalid object "1"') | ||
} | ||
t.end() | ||
}) |
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
74324
577