fergies-inverted-index
Advanced tools
Comparing version 3.0.1 to 4.0.0
@@ -196,3 +196,6 @@ 'use strict'; | ||
) | ||
) | ||
).then(_objects => _ids.map((_id, i) => { | ||
_id._object = _objects[i]; | ||
return _id | ||
})) | ||
} | ||
@@ -362,3 +365,3 @@ } | ||
docs => writer(docs.map((doc, i) => { | ||
if (doc === null) { | ||
if (doc._object === null) { | ||
return { | ||
@@ -368,3 +371,3 @@ _id: _ids[i], status: 'NOT FOUND', mode: 'DELETE' | ||
} | ||
return doc | ||
return doc._object | ||
}), db, 'del') | ||
@@ -397,5 +400,14 @@ ).then( | ||
// _match is nested by default so that AND and OR work correctly under | ||
// the bonnet. Flatten array before presenting to consumer | ||
const flattenMatchArrayInResults = results => results.map(result => { | ||
result._match = result._match.flat(Infinity); | ||
return result | ||
}); | ||
const makeAFii = (db, ops) => ({ | ||
AVAILABLE_FIELDS: init(db, ops).AVAILABLE_FIELDS, | ||
AND: init(db, ops).INTERSECTION, | ||
AND: (...keys) => init(db, ops).INTERSECTION(...keys).then( | ||
flattenMatchArrayInResults | ||
), | ||
BUCKET: init(db, ops).BUCKET, | ||
@@ -408,6 +420,9 @@ BUCKETFILTER: init(db, ops).BUCKETFILTER, | ||
MIN: init$2(db).MIN, | ||
// NOT: idMap(db).SET_DIFFERENCE, | ||
NOT: init(db, ops).SET_SUBTRACTION, | ||
NOT: (...keys) => init(db, ops).SET_SUBTRACTION(...keys).then( | ||
flattenMatchArrayInResults | ||
), | ||
OBJECT: init$1(db).OBJECT, | ||
OR: init(db, ops).UNION, | ||
OR: (...keys) => init(db, ops).UNION(...keys).then( | ||
flattenMatchArrayInResults | ||
), | ||
PUT: init$3(db).PUT, | ||
@@ -414,0 +429,0 @@ SET_SUBTRACTION: init(db, ops).SET_SUBTRACTION, |
@@ -192,3 +192,6 @@ import level from 'level'; | ||
) | ||
) | ||
).then(_objects => _ids.map((_id, i) => { | ||
_id._object = _objects[i]; | ||
return _id | ||
})) | ||
} | ||
@@ -358,3 +361,3 @@ } | ||
docs => writer(docs.map((doc, i) => { | ||
if (doc === null) { | ||
if (doc._object === null) { | ||
return { | ||
@@ -364,3 +367,3 @@ _id: _ids[i], status: 'NOT FOUND', mode: 'DELETE' | ||
} | ||
return doc | ||
return doc._object | ||
}), db, 'del') | ||
@@ -393,5 +396,14 @@ ).then( | ||
// _match is nested by default so that AND and OR work correctly under | ||
// the bonnet. Flatten array before presenting to consumer | ||
const flattenMatchArrayInResults = results => results.map(result => { | ||
result._match = result._match.flat(Infinity); | ||
return result | ||
}); | ||
const makeAFii = (db, ops) => ({ | ||
AVAILABLE_FIELDS: init(db, ops).AVAILABLE_FIELDS, | ||
AND: init(db, ops).INTERSECTION, | ||
AND: (...keys) => init(db, ops).INTERSECTION(...keys).then( | ||
flattenMatchArrayInResults | ||
), | ||
BUCKET: init(db, ops).BUCKET, | ||
@@ -404,6 +416,9 @@ BUCKETFILTER: init(db, ops).BUCKETFILTER, | ||
MIN: init$2(db).MIN, | ||
// NOT: idMap(db).SET_DIFFERENCE, | ||
NOT: init(db, ops).SET_SUBTRACTION, | ||
NOT: (...keys) => init(db, ops).SET_SUBTRACTION(...keys).then( | ||
flattenMatchArrayInResults | ||
), | ||
OBJECT: init$1(db).OBJECT, | ||
OR: init(db, ops).UNION, | ||
OR: (...keys) => init(db, ops).UNION(...keys).then( | ||
flattenMatchArrayInResults | ||
), | ||
PUT: init$3(db).PUT, | ||
@@ -410,0 +425,0 @@ SET_SUBTRACTION: init(db, ops).SET_SUBTRACTION, |
{ | ||
"name": "fergies-inverted-index", | ||
"version": "3.0.1", | ||
"version": "4.0.0", | ||
"description": "An inverted index that allows javascript objects to be easily serialised and retrieved using promises and map-reduce", | ||
@@ -5,0 +5,0 @@ "main": "dist/fergies-inverted-index.cjs.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
34770
832