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.14.0 to 0.14.1-alpha1

20

index.js

@@ -8,2 +8,4 @@ "use strict";

var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify"));
var _common = require("@graffy/common");

@@ -33,5 +35,8 @@

source.onerror = function (e) {
end(e);
end(Error('client.sse.transport: ' + e.message));
};
source.addEventListener('graffyerror', function (e) {
end(Error('server:' + e.data));
});
return function () {

@@ -42,2 +47,15 @@ source.close();

});
store.on('write', function (change) {
if (!fetch) throw Error('client.fetch.unavailable');
console.log('Making post');
return fetch(baseUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: (0, _stringify["default"])(change)
}).then(function (res) {
return res.json();
});
});
};

@@ -44,0 +62,0 @@ }

6

package.json

@@ -5,3 +5,3 @@ {

"author": "aravind (https://github.com/aravindet)",
"version": "0.14.0",
"version": "0.14.1-alpha1",
"main": "index.js",

@@ -17,5 +17,5 @@ "source": "src/index.js",

"@babel/runtime-corejs3": "^7.8.4",
"@graffy/common": "0.14.0",
"@graffy/stream": "0.14.0"
"@graffy/common": "0.14.1-alpha1",
"@graffy/stream": "0.14.1-alpha1"
}
}

@@ -23,5 +23,9 @@ import { encodeUrl } from '@graffy/common';

source.onerror = e => {
end(e);
end(Error('client.sse.transport: ' + e.message));
};
source.addEventListener('graffyerror', e => {
end(Error('server:' + e.data));
});
return () => {

@@ -32,3 +36,13 @@ source.close();

});
store.on('write', change => {
if (!fetch) throw Error('client.fetch.unavailable');
console.log('Making post');
return fetch(baseUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(change),
}).then(res => res.json());
});
};
}
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