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

@graffy/client

Package Overview
Dependencies
Maintainers
1
Versions
228
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graffy/client - npm Package Compare versions

Comparing version 0.6.0 to 0.7.0

54

bundle.js

@@ -1,52 +0,2 @@

'use strict';
function getPath(query) {
return Object.keys(query).sort().map(function (key) {
return typeof query[key] === 'object' ? key + "(" + getPath(query[key]) + ")" : key;
}).join(',');
}
function GraffyClient(baseUrl) {
return function (store) {
store.onGet(function (_ref) {
var query = _ref.query,
token = _ref.token;
var url = baseUrl + "?include=" + getPath(query);
if (!token) {
if (!fetch) throw Error('client.fetch.unavailable');
return fetch(url).then(function (res) {
return res.json();
});
}
if (!EventSource) throw Error('client.sse.unavailable');
return new Promise(function (resolve, reject) {
var source = new EventSource(url);
var resolved = false;
source.onmessage = function (_ref2) {
var data = _ref2.data;
data = JSON.parse(data);
if (resolved) {
store.pub(data);
} else {
resolve(data);
resolved = true;
}
};
source.onerror = function (e) {
if (!resolved) reject(e);
};
token.onSignal(function () {
source.close();
});
});
});
};
}
module.exports = GraffyClient;
'use strict';function getPath(a){return Object.keys(a).sort().map(function(b){return"object"==typeof a[b]?b+"("+getPath(a[b])+")":b}).join(",")}function GraffyClient(a){return function(b){b.onGet(function(c){var d=c.query,e=c.token,f=a+"?include="+getPath(d);if(!e){if(!fetch)throw Error("client.fetch.unavailable");return fetch(f).then(function(a){return a.json()})}if(!EventSource)throw Error("client.sse.unavailable");return new Promise(function(a,c){var d=new EventSource(f),g=!1;d.onmessage=function(c){var d=c.data;d=JSON.parse(d),g?b.pub(d):(a(d),g=!0)},d.onerror=function(a){g||c(a)},e.onSignal(function(){d.close()})})})}}module.exports=GraffyClient;
//# sourceMappingURL=bundle.js.map

2

package.json
{
"name": "@graffy/client",
"version": "0.6.0",
"version": "0.7.0",
"author": "aravind (github.com/aravindet)",

@@ -5,0 +5,0 @@ "description": "HTTP client library for Graffy",

Sorry, the diff of this file is not supported yet

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