Socket
Socket
Sign inDemoInstall

cher-db

Package Overview
Dependencies
150
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.5.0 to 0.5.1

36

models/socialContent/index.js

@@ -180,5 +180,8 @@

moderation: socialContentUtils.parseModeration(opts.moderation),
source: opts.source
});
if (opts.source) {
query = query.where({ source: opts.source });
}
if (opts.after) {

@@ -203,9 +206,28 @@ query = query.where(`social_content.fetched_at`, '>', opts.after);

let allContent = yield query.fetchAll();
let tasks = allContent
.map((item) => {
return co(function*() {
return yield SocialContent
const i = yield SocialContent
.where({ id: item.get('id') })
.fetch({ withRelated: ['tags'] });
.fetchAll({ withRelated: ['tags'] });
return i.filter((model) => {
// If we're querying for content with specifie tags, then grab
// the related tags for each item and see if it has the target
// tag attached to it
if (opts.tags) {
return opts.tags.some((targetTag) => {
return model.related('tags')
.some((relatedTag) => {
return (
relatedTag.get('key') === targetTag.key &&
relatedTag.get('value') === targetTag.value
);
});
});
} else {
return true;
}
});
});

@@ -215,3 +237,6 @@ });

return co(function*() {
return yield tasks;
const ret = yield tasks;
return ret.reduce((prev, next) => {
return prev.concat(next);
},[]);
});

@@ -221,3 +246,2 @@

}
});

@@ -224,0 +248,0 @@

2

package.json
{
"name": "cher-db",
"version": "0.5.0",
"version": "0.5.1",
"description": "Data layer for Cher",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -13,3 +13,3 @@ # cher-db

const SocialContent = models.get('SocialContent')
db.destroy() // destros the db connection
db.destroy() // destroys the db connection
})

@@ -16,0 +16,0 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc