UNPKG

stackexchange-api

Version:
28 lines (27 loc) 1.97 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const BadgeCount_1 = require("./BadgeCount"); /** * The equivalent of [Type shallow_user](https://api.stackexchange.com/docs/types/shallow-user).<br> * This object represents a [[User]], but omits many of the fields found on the full [[User]] object.<br> * This object is mostly analogous to the "user card" found on many pages (like the Question page) on a [Stack Exchange site](https://stackexchange.com/sites). */ class ShallowUser { constructor(shallow_user) { var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q; this.acceptRate = (_b = (_a = shallow_user) === null || _a === void 0 ? void 0 : _a.accept_rate, (_b !== null && _b !== void 0 ? _b : null)); if (typeof ((_c = shallow_user) === null || _c === void 0 ? void 0 : _c.badge_counts) === 'undefined') { this.badgeCounts = null; } else { this.badgeCounts = new BadgeCount_1.BadgeCount(shallow_user.badge_counts); } this.displayName = (_e = (_d = shallow_user) === null || _d === void 0 ? void 0 : _d.display_name, (_e !== null && _e !== void 0 ? _e : null)); this.link = (_g = (_f = shallow_user) === null || _f === void 0 ? void 0 : _f.link, (_g !== null && _g !== void 0 ? _g : null)); this.profileImage = (_j = (_h = shallow_user) === null || _h === void 0 ? void 0 : _h.profile_image, (_j !== null && _j !== void 0 ? _j : null)); this.reputation = (_l = (_k = shallow_user) === null || _k === void 0 ? void 0 : _k.reputation, (_l !== null && _l !== void 0 ? _l : null)); this.userId = (_o = (_m = shallow_user) === null || _m === void 0 ? void 0 : _m.user_id, (_o !== null && _o !== void 0 ? _o : null)); this.userType = (_q = (_p = shallow_user) === null || _p === void 0 ? void 0 : _p.user_type, (_q !== null && _q !== void 0 ? _q : null)); } } exports.ShallowUser = ShallowUser;