mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-10-30 14:49:14 +00:00
10 lines
264 B
TypeScript
10 lines
264 B
TypeScript
export default function getAriaLabel(str: string) {
|
|
const matches = str.match(/\[aria=(.*)\]/g);
|
|
if (!matches) {
|
|
return '';
|
|
}
|
|
const pre = matches[0];
|
|
const start = pre.indexOf('aria="') + 6;
|
|
return pre.substring(start, pre.indexOf('"]', start));
|
|
}
|