UNPKG

lol-constants

Version:

League of Legends constants, functions, and types. Provides a plathera of functions to easily convert between ID, Name, and Key for champions, items, summoner spells, and runes.

44 lines (43 loc) 1 kB
export const Positions = { 'TOP': 'TOP', 'JUNGLE': 'JUNGLE', 'MIDDLE': 'MIDDLE', 'BOTTOM': 'BOTTOM', 'UTILITY': 'UTILITY', }; export function isPosition(position) { return typeof position == 'string' && position in Positions; } export const Roles = { 'NONE': 'NONE', 'SOLO': 'SOLO', 'CARRY': 'CARRY', 'SUPPORT': 'SUPPORT', }; export function isRole(role) { return typeof role == 'string' && role in Roles; } export const Lanes = { 'TOP': 'TOP', 'JUNGLE': 'JUNGLE', 'MIDDLE': 'MIDDLE', 'BOTTOM': 'BOTTOM', }; export function isLane(lane) { return typeof lane == 'string' && lane in Lanes; } export const LaneTypes = { 'TOP_LANE': 'TOP_LANE', 'MID_LANE': 'MID_LANE', 'BOT_LANE': 'BOT_LANE', }; export function isLaneType(type) { return typeof type == 'string' && type in LaneTypes; } export const TeamIds = { 100: 100, 200: 200, }; export function isTeamId(id) { return typeof id == 'number' && id in TeamIds; }