fergies-inverted-index
Advanced tools
Comparing version 6.1.0 to 6.2.0
@@ -186,3 +186,7 @@ 'use strict'; | ||
// {gte:..., lte:...} (gte/lte == greater/less than or equal) | ||
const BUCKET = token => parseToken(token).then(token => GET(token).then( | ||
const BUCKET = token => parseToken( | ||
token // TODO: is parseToken needed her? Already called in GET | ||
).then(token => GET( | ||
token | ||
).then( | ||
result => { | ||
@@ -230,3 +234,17 @@ const re = new RegExp('[○' + ops.tokenAppend + ']', 'g'); | ||
const DIST = token => parseToken(token).then(token => Promise.all( | ||
const DISTINCT = (...tokens) => Promise.all( | ||
// if no tokens specified then get everything ('{}') | ||
tokens.length ? tokens.map(DIST) : [DIST({})] | ||
).then( | ||
dist => [ | ||
...dist.flat().reduce( | ||
(acc, cur) => acc.add(JSON.stringify(cur)), | ||
new Set()) | ||
].map(JSON.parse) | ||
); | ||
// TODO should take an array of tokens | ||
const DIST = token => parseToken( | ||
token | ||
).then(token => Promise.all( | ||
token.FIELD.map(field => getRange({ | ||
@@ -247,3 +265,4 @@ gte: field + ':' + token.VALUE.GTE, | ||
BUCKETFILTER: BUCKETFILTER, | ||
DIST: DIST, | ||
// DIST: DIST, | ||
DISTINCT: DISTINCT, | ||
EXPORT: getRange, | ||
@@ -446,3 +465,3 @@ GET: GET, | ||
DELETE: init$1(db, ops).DELETE, | ||
DISTINCT: init(db, ops).DIST, | ||
DISTINCT: init(db, ops).DISTINCT, | ||
EXPORT: init(db, ops).EXPORT, | ||
@@ -449,0 +468,0 @@ FIELDS: init(db, ops).FIELDS, |
@@ -182,3 +182,7 @@ import level from 'level'; | ||
// {gte:..., lte:...} (gte/lte == greater/less than or equal) | ||
const BUCKET = token => parseToken(token).then(token => GET(token).then( | ||
const BUCKET = token => parseToken( | ||
token // TODO: is parseToken needed her? Already called in GET | ||
).then(token => GET( | ||
token | ||
).then( | ||
result => { | ||
@@ -226,3 +230,17 @@ const re = new RegExp('[○' + ops.tokenAppend + ']', 'g'); | ||
const DIST = token => parseToken(token).then(token => Promise.all( | ||
const DISTINCT = (...tokens) => Promise.all( | ||
// if no tokens specified then get everything ('{}') | ||
tokens.length ? tokens.map(DIST) : [DIST({})] | ||
).then( | ||
dist => [ | ||
...dist.flat().reduce( | ||
(acc, cur) => acc.add(JSON.stringify(cur)), | ||
new Set()) | ||
].map(JSON.parse) | ||
); | ||
// TODO should take an array of tokens | ||
const DIST = token => parseToken( | ||
token | ||
).then(token => Promise.all( | ||
token.FIELD.map(field => getRange({ | ||
@@ -243,3 +261,4 @@ gte: field + ':' + token.VALUE.GTE, | ||
BUCKETFILTER: BUCKETFILTER, | ||
DIST: DIST, | ||
// DIST: DIST, | ||
DISTINCT: DISTINCT, | ||
EXPORT: getRange, | ||
@@ -442,3 +461,3 @@ GET: GET, | ||
DELETE: init$1(db, ops).DELETE, | ||
DISTINCT: init(db, ops).DIST, | ||
DISTINCT: init(db, ops).DISTINCT, | ||
EXPORT: init(db, ops).EXPORT, | ||
@@ -445,0 +464,0 @@ FIELDS: init(db, ops).FIELDS, |
{ | ||
"name": "fergies-inverted-index", | ||
"version": "6.1.0", | ||
"version": "6.2.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
38014
916