New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lightning-client-utils

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lightning-client-utils - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

46

index.js
var _ = require('lodash');
var request = require('superagent');
var r;

@@ -37,2 +39,46 @@ var utils = {

return retColors;
},
isEditorOrPreview: function() {
var url = document.URL;
return /https?:\/\/[^\/]+\/visualization-types\/*/.test(url);
},
fetchData: function(viz, keys, cb) {
if(this.isEditorOrPreview()) {
setTimeout(function() {
var data = $('#data-editor').next('.CodeMirror').find('.CodeMirror-code span')[0].innerHTML;
var fetchedData = JSON.parse(data);
_.each(keys, function(key) {
fetchedData = fetchedData[key];
});
cb(null, fetchedData);
}, 0);
} else {
var url = viz.$el.parent().find('.permalink').find('a').attr('href');
if(r) {
r.abort();
}
r = request.get(url + '/data/' + keys.join('/'), function(err, res) {
if(err) {
return cb(err)
}
cb(null, (res.body || {}).data);
});
}
}

@@ -39,0 +85,0 @@

2

package.json
{
"name": "lightning-client-utils",
"version": "0.1.1",
"version": "0.2.0",
"description": "utilities for lightning visualizations to be used in the browser",

@@ -5,0 +5,0 @@ "main": "index.js",

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