UNPKG

internet-avatar.js

Version:

Library for connecting to Internet Avatar API.

42 lines (41 loc) 1.14 kB
"use strict"; var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Base = void 0; /** * Represents a basic data model. * * @abstract */ var Base = /** @class */ (function () { function Base(client) { this._client = client; } /** * When JSON.stringify is called on this class, this method is called. * We use it to exclude the client property from the output. */ Base.prototype.toJSON = function () { var obj = __assign({}, this); delete obj.client; return obj; }; /** * Returns a string representation of this object. */ Base.prototype.toString = function () { return JSON.stringify(this); }; return Base; }()); exports.Base = Base;