UNPKG

@beastmaster23/pokemon-tcg-yajs-sdk

Version:

A modern JavaScript SDK for interacting with the Pokemon Trading Card Game API, providing an intuitive interface for accessing Pokemon TCG card data, set information, and market prices.

34 lines (31 loc) 1.17 kB
/** * Legality class representing the legality status of a card in a specific format * Used to track whether a card is legal, banned, or restricted in various formats */ class Legality { /** * Creates a new Legality instance * @param {Object} data - The legality data from the API * @param {string} data.standard - The legality status for Standard format ('legal', 'banned') or field is not present * @param {string} data.expanded - The legality status for Expanded format ('legal', 'banned') or field is not present * @param {string} data.unlimited - The legality status for Unlimited format ('legal', 'banned') or field is not present */ constructor(data) { if (!data) { this.standard = ''; this.expanded = ''; this.unlimited = ''; return; } if (data.standard) { this.standard = data.standard; } if (data.expanded) { this.expanded = data.expanded; } if (data.unlimited) { this.unlimited = data.unlimited; } } } export default Legality;