Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

socialdb

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

socialdb - npm Package Compare versions

Comparing version 0.3.1 to 0.4.1

16

index.js

@@ -121,2 +121,18 @@ // Start node with DEBUG=socialdb to see debug output

/**
* deleteInvites() removes all invites for an invited id.
* `invitedId` can be any form of identifier, like user id or phone number.
*/
deleteInvites(invitedId) {
return new Promise((resolve, reject) => {
this.client.del(
`${this.namespace}:user:${invitedId}:${STATE_KEY.invited}`,
(err, res) => {
if (err) { reject(err); }
debug(`Deleted all invites for ${invitedId}`);
return resolve(res);
});
});
}
/**
* requested() returns a Promise with a list of requested friends for a given `userId`.

@@ -123,0 +139,0 @@ * Sorted by date of creation (newest to oldest).

2

package.json
{
"name": "socialdb",
"version": "0.3.1",
"version": "0.4.1",
"description": "Redis-backed social graph for Node.js",

@@ -5,0 +5,0 @@ "keywords": [

@@ -88,2 +88,13 @@ const assert = require('assert');

describe('.deleteInvites()', () => {
it('should delete all invites', (done) => {
sd.deleteInvites('some_id').then(() => {
client.zcard('socialdb:user:some_id:invited', (err, count) => {
assert.equal(count, 0);
done();
});
});
});
});
describe('.invited()', () => {

@@ -90,0 +101,0 @@ it('should get a list of 0 invited users', (done) => {

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc