UNPKG

qtail-js

Version:

一个轻量级的用于生成带小尾巴的 qq 昵称的 JavaScript 库

2 lines (1 loc) 1.01 kB
"use strict";var a=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var d=(i,t)=>{for(var e in t)a(i,e,{get:t[e],enumerable:!0})},h=(i,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of u(t))!m.call(i,r)&&r!==e&&a(i,r,{get:()=>t[r],enumerable:!(s=c(t,r))||s.enumerable});return i};var b=i=>h(a({},"__esModule",{value:!0}),i);var y={};d(y,{default:()=>D});module.exports=b(y);var o=i=>i.replace(/(.*?)([!-~]+)$/,"$2$1");var p="2.1.1";var l=[["\u202A","\u202B"],["\u2066","\u2067"]],n=class{static version=p.split(".").map(t=>parseInt(t));nick;tail;compatible;constructor(t,e,s){this.nick=t,this.tail=e,this.compatible=s||!0}update(t,e,s){this.nick=t,this.tail=e,typeof s=="boolean"&&(this.compatible=s)}upd=this.update;generate(){if(!this.nick||!this.tail)throw new Error(":( prams cannot be empty.");let t=this.compatible?l[1]:l[0];return`${this.nick}${t[1]}${o(this.tail)}${t[0]}`}gen=this.generate},D=n;