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

Function Ve

packages/next/src/compiled/@vercel/og/index.edge.js:17026–17055  ·  view source on GitHub ↗
(e, t, n)

Source from the content-addressed store, hash-verified

17024var hr = /* @__PURE__ */ new Map();
17025var Oc = 500;
17026function Ve(e, t, n) {
17027 let r = `${t}:${n || ""}:${e}`;
17028 if (hr.has(r))
17029 return hr.get(r);
17030 if (!Ei || !Oi) {
17031 if (!(typeof Intl < "u" && "Segmenter" in Intl))
17032 throw new Error("Intl.Segmenter does not exist, please use import a polyfill.");
17033 Ei = new Intl.Segmenter(n, { granularity: "word" }), Oi = new Intl.Segmenter(n, { granularity: "grapheme" });
17034 }
17035 let i;
17036 if (t === "grapheme")
17037 i = [...Oi.segment(e)].map((o) => o.segment);
17038 else {
17039 let o = [...Ei.segment(e)].map((u2) => u2.segment), s = [], a = 0;
17040 for (; a < o.length; ) {
17041 let u2 = o[a];
17042 if (u2 == "\xA0") {
17043 let f = a === 0 ? "" : s.pop(), l2 = a === o.length - 1 ? "" : o[a + 1];
17044 s.push(f + "\xA0" + l2), a += 2;
17045 } else
17046 s.push(u2), a++;
17047 }
17048 i = s;
17049 }
17050 if (hr.size >= Oc) {
17051 let o = hr.keys().next().value;
17052 hr.delete(o);
17053 }
17054 return hr.set(r, i), i;
17055}
17056function M(e, t, n) {
17057 let r = "";
17058 for (let [i, o] of Object.entries(t))

Callers 15

gaFunction · 0.70
u2Function · 0.70
mdFunction · 0.70
JiFunction · 0.70
UeFunction · 0.70
vtFunction · 0.70
QbFunction · 0.70
StFunction · 0.50
PtFunction · 0.50
MtFunction · 0.50
_getModuleHashInfoMethod · 0.50
libIdentMethod · 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