MCPcopy
hub / github.com/vercel/next.js / addDetectors

Method addDetectors

packages/next/src/compiled/@vercel/og/index.edge.js:20282–20292  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

20280 this.addDetectors(fontFace);
20281 }
20282 addDetectors(input) {
20283 const regex = /font-family:\s*'(.+?)';.+?unicode-range:\s*(.+?);/gms;
20284 const matches = input.matchAll(regex);
20285 for (const [, _lang, range] of matches) {
20286 const lang = _lang.replaceAll(" ", "+");
20287 if (!this.rangesByLang[lang]) {
20288 this.rangesByLang[lang] = [];
20289 }
20290 this.rangesByLang[lang].push(...convert(range));
20291 }
20292 }
20293};
20294function convert(input) {
20295 return input.split(", ").map((range) => {

Callers 1

loadMethod · 0.45

Calls 3

convertFunction · 0.70
matchAllMethod · 0.65
pushMethod · 0.65

Tested by

no test coverage detected