qtail-js
Version:
一个轻量级的用于生成带小尾巴的 qq 昵称的 JavaScript 库
34 lines (33 loc) • 1.19 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var retail_js_1 = require("./libs/retail.js");
var qtail = /** @class */ (function () {
function qtail(nick, tail, compatible) {
this.compatible = false;
this.upd = this.update;
this.gen = this.generate;
if (!nick || !tail)
throw new Error(':( prams cannot be empty.');
this.nick = nick;
this.tail = tail;
this.compatible = compatible || false;
}
qtail.prototype.update = function (nick, tail, compatible) {
if (!nick || !tail)
throw new Error(':( prams cannot be empty.');
this.nick = nick;
this.tail = tail;
this.compatible = compatible || false;
};
qtail.prototype.generate = function () {
var chart = this.compatible ? qtail.UnicodeCtrlChars[1] : qtail.UnicodeCtrlChars[0];
return "".concat(this.nick).concat(chart[1]).concat((0, retail_js_1.default)(this.tail)).concat(chart[0]);
};
qtail.version = [2, 0, 0];
qtail.UnicodeCtrlChars = [
['\u202a', '\u202b'],
['\u2066', '\u2067']
];
return qtail;
}());
exports.default = qtail;