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

meddelare-server

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

meddelare-server - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

29

lib/social-buttons-server-middleware.js

@@ -92,3 +92,11 @@ var express = require("express");

function retrieveCount(url, networks) {
function retrieveCount(url, network) {
if (typeof networkCallbacks[network] === "undefined") {
throw new Error("Unknown network");
}
return Promise.promisify(networkCallbacks[network])(url);
}
function retrieveCounts(url, networks) {
// Create an object of callbacks for each of the requested networks It is

@@ -100,5 +108,3 @@ // then passed to the Promise library to executed in parallel All results will

networks.forEach(function(network) {
if (typeof networkCallbacks[network] !== "undefined") {
networksToRequest[network] = Promise.promisify(networkCallbacks[network])(url);
}
networksToRequest[network] = retrieveCount(url, network);
});

@@ -134,3 +140,4 @@

var url,
networks;
networks,
nonExistantNetworks;

@@ -143,2 +150,10 @@ // Check to see if any networks were specified in the query

networks = req.query.networks.split(",");
nonExistantNetworks = networks.filter(function(network) {
return (typeof networkCallbacks[network] === "undefined");
});
if (nonExistantNetworks.length > 0) {
inputErrorAndDie(req, res, next, "Unknown network(s) specified: " + nonExistantNetworks.join());
}
}

@@ -159,3 +174,3 @@

retrieveCount(url, networks)
retrieveCounts(url, networks)
.then(function(results) {

@@ -166,3 +181,3 @@ res.jsonp(results);

.catch(function(err) {
console.error("getCount", "catch", "retrieveCount", err);
console.error("getCount", "catch", "retrieveCounts", err);

@@ -169,0 +184,0 @@ serverErrorAndDie(req, res, next, "There was an unknown error.");

{
"name": "meddelare-server",
"version": "1.1.2",
"version": "1.1.3",
"description": "Install custom social share counters on your website with your own hosted solution, which only makes a single API request and loads minimal or zero assets to display the counters.",

@@ -5,0 +5,0 @@ "homepage": "http://meddelare.com/",

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