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

Function ge

packages/next/src/compiled/@vercel/og/index.node.js:18030–18059  ·  view source on GitHub ↗
(A, e, t)

Source from the content-addressed store, hash-verified

18028var xt = /* @__PURE__ */ new Map();
18029var RI = 500;
18030function ge(A, e, t) {
18031 let r = `${e}:${t || ""}:${A}`;
18032 if (xt.has(r))
18033 return xt.get(r);
18034 if (!Hn || !On) {
18035 if (!(typeof Intl < "u" && "Segmenter" in Intl))
18036 throw new Error("Intl.Segmenter does not exist, please use import a polyfill.");
18037 Hn = new Intl.Segmenter(t, { granularity: "word" }), On = new Intl.Segmenter(t, { granularity: "grapheme" });
18038 }
18039 let n;
18040 if (e === "grapheme")
18041 n = [...On.segment(A)].map((i) => i.segment);
18042 else {
18043 let i = [...Hn.segment(A)].map((u2) => u2.segment), o = [], a = 0;
18044 for (; a < i.length; ) {
18045 let u2 = i[a];
18046 if (u2 == "\xA0") {
18047 let l2 = a === 0 ? "" : o.pop(), I = a === i.length - 1 ? "" : i[a + 1];
18048 o.push(l2 + "\xA0" + I), a += 2;
18049 } else
18050 o.push(u2), a++;
18051 }
18052 n = o;
18053 }
18054 if (xt.size >= RI) {
18055 let i = xt.keys().next().value;
18056 xt.delete(i);
18057 }
18058 return xt.set(r, n), n;
18059}
18060function H(A, e, t) {
18061 let r = "";
18062 for (let [n, i] of Object.entries(e))

Callers 15

SsFunction · 0.70
u2Function · 0.70
ylFunction · 0.70
ciFunction · 0.70
PAFunction · 0.70
beFunction · 0.70
idFunction · 0.70
fetchingFunction · 0.50
StFunction · 0.50
parseImportSectionFunction · 0.50
parseFuncSectionFunction · 0.50
parseInstructionBlockFunction · 0.50

Calls 9

getMethod · 0.65
pushMethod · 0.65
keysMethod · 0.65
setMethod · 0.65
hasMethod · 0.45
mapMethod · 0.45
popMethod · 0.45
nextMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected