- Remove .claude/skills (symlinks) e a árvore .cursor (rules, hooks, skills) - Adiciona .agents/ com skills (+ references/), rules/, hooks/ e scripts - Adiciona .codex/hooks.json (hook do impeccable) - Corrige referências .cursor → .agents em environment.json, hooks.json e AGENTS.md
30 lines
852 B
JavaScript
30 lines
852 B
JavaScript
const GOOGLE_FONTS_URL_RE = /fonts\.googleapis\.com\/css2?\?[^"'\s)<>]*/gi;
|
|
|
|
function normalizeGoogleFontFamilyParam(value) {
|
|
return String(value || '')
|
|
.split('|')
|
|
.map(part => part.split(':')[0].trim().toLowerCase())
|
|
.filter(Boolean);
|
|
}
|
|
|
|
function extractGoogleFontFamilies(text) {
|
|
const families = [];
|
|
if (!text) return families;
|
|
|
|
GOOGLE_FONTS_URL_RE.lastIndex = 0;
|
|
let urlMatch;
|
|
while ((urlMatch = GOOGLE_FONTS_URL_RE.exec(text)) !== null) {
|
|
const url = urlMatch[0];
|
|
const queryStart = url.indexOf('?');
|
|
if (queryStart === -1) continue;
|
|
|
|
const params = new URLSearchParams(url.slice(queryStart + 1).replace(/&/g, '&'));
|
|
for (const value of params.getAll('family')) {
|
|
families.push(...normalizeGoogleFontFamilyParam(value));
|
|
}
|
|
}
|
|
|
|
return families;
|
|
}
|
|
|
|
export { extractGoogleFontFamilies };
|