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

gnar

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gnar - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

37

index.js

@@ -21,8 +21,11 @@ module.exports = function gnar(api_key, requested_region) {

function url(endpoint) {
return 'https://' + region + '.api.pvp.net/api/lol/' + endpoint + '?api_key=' + key;
function url(endpoint, reg) {
if (!reg) {
reg = region;
}
return 'https://' + reg + '.api.pvp.net/api/lol/' + endpoint + '?api_key=' + key;
}
function get(endpoint) {
return request(url(endpoint));
function get(endpoint, reg) {
return request(url(endpoint, reg));
}

@@ -53,25 +56,27 @@

// the static data api is exposed globally rather than region specific
// so we provide the 'global' region to the get/url call
exports.lol_static_data = {
champion: {
all: function() { return get(api.lol_static_data + 'champion'); },
by_id: function(id) { return get(api.lol_static_data + 'champion/' + id); }
all: function() { return get(api.lol_static_data + 'champion', 'global'); },
by_id: function(id) { return get(api.lol_static_data + 'champion/' + id, 'global'); }
},
item: {
all: function() { return get(api.lol_static_data + 'item'); },
by_id: function(id) { return get(api.lol_static_data + 'item/' + id); }
all: function() { return get(api.lol_static_data + 'item', 'global'); },
by_id: function(id) { return get(api.lol_static_data + 'item/' + id, 'global'); }
},
mastery: {
all: function() { return get(api.lol_static_data + 'mastery'); },
by_id: function(id) { return get(api.lol_static_data + 'mastery/' + id); }
all: function() { return get(api.lol_static_data + 'mastery', 'global'); },
by_id: function(id) { return get(api.lol_static_data + 'mastery/' + id, 'global'); }
},
realm: function() { return get(api.lol_static_data + 'realm'); },
realm: function() { return get(api.lol_static_data + 'realm', 'global'); },
rune: {
all: function() { return get(api.lol_static_data + 'rune'); },
by_id: function(id) { return get(api.lol_static_data + 'rune/' + id); }
all: function() { return get(api.lol_static_data + 'rune', 'global'); },
by_id: function(id) { return get(api.lol_static_data + 'rune/' + id, 'global'); }
},
summoner_spell: {
all: function() { return get(api.lol_static_data + 'summoner-spell'); },
by_id: function(id) { return get(api.lol_static_data + 'summoner-spell/' + id); }
all: function() { return get(api.lol_static_data + 'summoner-spell', 'global'); },
by_id: function(id) { return get(api.lol_static_data + 'summoner-spell/' + id, 'global'); }
},
versions: function() { return get(api.lol_static_data + 'versions'); }
versions: function() { return get(api.lol_static_data + 'versions', 'global'); }
};

@@ -78,0 +83,0 @@

{
"name": "gnar",
"version": "0.0.1",
"version": "0.0.2",
"description": "Stream-based wrapper for the League of Legends API",

@@ -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