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.8.0 to 0.8.1

19

getPath.js

@@ -1,5 +0,20 @@

export default function getPath(query) {
return Object.keys(query).sort().map(function (key) {
"use strict";
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = getPath;
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
var _sort = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/sort"));
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
function getPath(query) {
var _context, _context2;
return (0, _map["default"])(_context = (0, _sort["default"])(_context2 = (0, _keys["default"])(query)).call(_context2)).call(_context, function (key) {
return typeof query[key] === 'object' ? key + "(" + getPath(query[key]) + ")" : key;
}).join(',');
}

21

index.js

@@ -1,8 +0,17 @@

import { makeStream } from '@graffy/common';
import getPath from './getPath';
export default function GraffyClient(baseUrl) {
"use strict";
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = GraffyClient;
var _common = require("@graffy/common");
var _getPath = _interopRequireDefault(require("./getPath"));
function GraffyClient(baseUrl) {
return function (store) {
store.onGet(function (query) {
if (!fetch) throw Error('client.fetch.unavailable');
var url = baseUrl + "?include=" + getPath(query);
var url = baseUrl + "?include=" + (0, _getPath["default"])(query);
return fetch(url).then(function (res) {

@@ -14,6 +23,6 @@ return res.json();

if (!EventSource) throw Error('client.sse.unavailable');
var url = baseUrl + "?include=" + getPath(query);
var url = baseUrl + "?include=" + (0, _getPath["default"])(query);
var source = new EventSource(url);
var _makeStream = makeStream(function () {
var _makeStream = (0, _common.makeStream)(function () {
source.close();

@@ -20,0 +29,0 @@ }),

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

"author": "aravind (https://github.com/aravindet)",
"version": "0.8.0",
"version": "0.8.1",
"repository": {

@@ -13,4 +13,4 @@ "type": "git",

"dependencies": {
"@graffy/common": "0.8.0"
"@graffy/common": "0.8.1"
}
}
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