@vercel/og 0.5.7 → 0.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14328,7 +14328,7 @@ var Sa = P((fo) => {
14328
14328
  for (var n in t)
14329
14329
  Object.defineProperty(e, n, { enumerable: true, get: t[n] });
14330
14330
  }
14331
- wh(fo, { normalize: () => rt, url: () => wa, number: () => _h, percentage: () => Ea, length: () => Ca, lineWidth: () => Th, shadow: () => Ah, color: () => Oh, image: () => Ph, gradient: () => _a3, position: () => Rh, familyName: () => Lh, genericName: () => Nh, absoluteSize: () => Wh, relativeSize: () => Uh });
14331
+ wh(fo, { normalize: () => rt, url: () => wa, number: () => _h, percentage: () => Ea, length: () => Ca, lineWidth: () => Th, shadow: () => Ah, color: () => Oh, image: () => Ph, gradient: () => _a2, position: () => Rh, familyName: () => Lh, genericName: () => Nh, absoluteSize: () => Wh, relativeSize: () => Uh });
14332
14332
  var Eh = no(), Ch = ya(), lo = ["min", "max", "clamp", "calc"], Fa = /,(?![^(]*\))/g, mn = /_(?![^(]*\))/g;
14333
14333
  function rt(e, t = true) {
14334
14334
  return e.includes("url(") ? e.split(/(url\(.*?\))/g).filter(Boolean).map((n) => /^url\(.*?\)$/.test(n) ? n : rt(n, false)).join("") : (e = e.replace(/([^\\])_+/g, (n, r) => r + " ".repeat(n.length - 1)).replace(/^_/g, " ").replace(/\\_/g, "_"), t && (e = e.trim()), e = e.replace(/(calc|min|max|clamp)\(.+\)/g, (n) => n.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ")), e);
@@ -14363,10 +14363,10 @@ var Sa = P((fo) => {
14363
14363
  }
14364
14364
  function Ph(e) {
14365
14365
  let t = 0;
14366
- return e.split(Fa).every((r) => (r = rt(r), r.startsWith("var(") ? true : wa(r) || _a3(r) || ["element(", "image(", "cross-fade(", "image-set("].some((i) => r.startsWith(i)) ? (t++, true) : false)) ? t > 0 : false;
14366
+ return e.split(Fa).every((r) => (r = rt(r), r.startsWith("var(") ? true : wa(r) || _a2(r) || ["element(", "image(", "cross-fade(", "image-set("].some((i) => r.startsWith(i)) ? (t++, true) : false)) ? t > 0 : false;
14367
14367
  }
14368
14368
  var Ih = /* @__PURE__ */ new Set(["linear-gradient", "radial-gradient", "repeating-linear-gradient", "repeating-radial-gradient", "conic-gradient"]);
14369
- function _a3(e) {
14369
+ function _a2(e) {
14370
14370
  e = rt(e);
14371
14371
  for (let t of Ih)
14372
14372
  if (e.startsWith(`${t}(`))
@@ -18810,8 +18810,6 @@ async function render(satori, resvg, opts, defaultFonts, element) {
18810
18810
  var initializedResvg = initWasm(resvg_wasm);
18811
18811
  var initializedYoga = initYoga(yoga_wasm).then((yoga2) => Ll(yoga2));
18812
18812
  var fallbackFont = fetch(new URL("./noto-sans-v27-latin-regular.ttf", import.meta.url)).then((res) => res.arrayBuffer());
18813
- var _a2, _b2;
18814
- var isDev = ((_b2 = (_a2 = globalThis == null ? void 0 : globalThis.process) == null ? void 0 : _a2.env) == null ? void 0 : _b2.NODE_ENV) === "development";
18815
18813
  var ImageResponse = class {
18816
18814
  constructor(element, options = {}) {
18817
18815
  const result = new ReadableStream({
@@ -18835,7 +18833,7 @@ var ImageResponse = class {
18835
18833
  return new Response(result, {
18836
18834
  headers: {
18837
18835
  "content-type": "image/png",
18838
- "cache-control": isDev ? "no-cache, no-store" : "public, immutable, no-transform, max-age=31536000",
18836
+ "cache-control": process.env.NODE_ENV === "development" ? "no-cache, no-store" : "public, immutable, no-transform, max-age=31536000",
18839
18837
  ...options.headers
18840
18838
  },
18841
18839
  status: options.status,