chore: suppress type check

This commit is contained in:
Wesley F. Young 2024-08-26 09:09:15 +08:00
parent 7b87b0919b
commit 542c5beb1b

View File

@ -1,6 +1,6 @@
import { OB11MessageData } from '../types'; import { OB11MessageData } from '../types';
const pattern = /\[CQ:(\w+)((,\w+=[^,\]]*)*)\]/; const pattern = /\[CQ:(\w+)((,\w+=[^,\]]*)*)]/;
function unescape(source: string) { function unescape(source: string) {
return String(source) return String(source)
@ -49,14 +49,14 @@ export function encodeCQCode(data: OB11MessageData) {
const CQCodeEscapeText = (text: string) => { const CQCodeEscapeText = (text: string) => {
return text.replace(/&/g, '&') return text.replace(/&/g, '&')
.replace(/\[/g, '[') .replace(/\[/g, '[')
.replace(/\]/g, ']'); .replace(/]/g, ']');
}; };
const CQCodeEscape = (text: string) => { const CQCodeEscape = (text: string) => {
return text.replace(/&/g, '&') return text.replace(/&/g, '&')
.replace(/\[/g, '[') .replace(/\[/g, '[')
.replace(/\]/g, ']') .replace(/]/g, ']')
.replace(/,/g, ','); .replace(/,/g, ',');
}; };
@ -66,7 +66,10 @@ export function encodeCQCode(data: OB11MessageData) {
let result = '[CQ:' + data.type; let result = '[CQ:' + data.type;
for (const name in data.data) { for (const name in data.data) {
const value = data.data[name]; const value =
// eslint-disable-next-line
// @ts-ignore
data.data[name];
if (value === undefined) { if (value === undefined) {
continue; continue;
} }
@ -79,4 +82,4 @@ export function encodeCQCode(data: OB11MessageData) {
} }
result += ']'; result += ']';
return result; return result;
} }