Comparing version 1.2.0 to 1.3.0
@@ -303,2 +303,7 @@ 'use strict'; | ||
} | ||
}, { | ||
key: 'lids', | ||
value: function lids() { | ||
return Object.keys(this._objs); | ||
} | ||
}]); | ||
@@ -305,0 +310,0 @@ |
{ | ||
"name": "jseg", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "JavaScript Entity Graph: A super simple, in-memory, JS graph database.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -130,3 +130,7 @@ # JavaScript Entity Graph | ||
### lids() | ||
Returns an array of all lids for all objects in the database. | ||
## Schema | ||
@@ -133,0 +137,0 @@ |
@@ -244,2 +244,6 @@ let baseSchema = { | ||
lids() { | ||
return Object.keys(this._objs); | ||
} | ||
} |
@@ -8,8 +8,14 @@ import * as assert from 'assert'; | ||
let assertEquiv = (actual, expected) => { | ||
//XXX This assumes the children collection come back in insertion order. | ||
//TODO: Treat arrays as sets. | ||
assert.deepStrictEqual(actual, expected); | ||
}; | ||
let check = (lid, expected, options) => { | ||
assert.deepStrictEqual(db.get(lid, options), expected); | ||
assertEquiv(db.get(lid, options), expected); | ||
}; | ||
let checkLookup = (field, value, expected, options) => { | ||
assert.deepStrictEqual(db.lookup(field, value, options), expected); | ||
assertEquiv(db.lookup(field, value, options), expected); | ||
}; | ||
@@ -199,3 +205,2 @@ | ||
//XXX This assumes the children collection come back in insertion order. | ||
check('parent', { | ||
@@ -319,2 +324,4 @@ lid: 'parent', | ||
assertEquiv(db.lids(), ['a', 'x', 'b', 'y']); | ||
db.remove('x', 'mToN', 'a'); | ||
@@ -321,0 +328,0 @@ db.get('x', { |
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
31804
1166
230