mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-11 23:40:24 +00:00
style: 规范写法
This commit is contained in:
@@ -15,10 +15,12 @@ function from(source: string) {
|
||||
if (!capture) return null;
|
||||
const [, type, attrs] = capture;
|
||||
const data: Record<string, any> = {};
|
||||
attrs && attrs.slice(1).split(',').forEach((str) => {
|
||||
const index = str.indexOf('=');
|
||||
data[str.slice(0, index)] = unescape(str.slice(index + 1));
|
||||
});
|
||||
if (attrs) {
|
||||
attrs.slice(1).split(',').forEach((str) => {
|
||||
const index = str.indexOf('=');
|
||||
data[str.slice(0, index)] = unescape(str.slice(index + 1));
|
||||
});
|
||||
}
|
||||
return { type, data, capture };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user