@vercel/og 0.5.7 → 0.5.9
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.
- package/dist/index.edge.js +4 -6
- package/dist/index.edge.js.map +1 -1
- package/dist/index.node.js +8 -9
- package/dist/index.node.js.map +1 -1
- package/package.json +1 -1
package/dist/index.node.js
CHANGED
|
@@ -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: () =>
|
|
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) ||
|
|
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
|
|
14369
|
+
function _a2(e) {
|
|
14370
14370
|
e = rt(e);
|
|
14371
14371
|
for (let t of Ih)
|
|
14372
14372
|
if (e.startsWith(`${t}(`))
|
|
@@ -18676,6 +18676,7 @@ var Resvg2 = class extends Resvg {
|
|
|
18676
18676
|
import { Readable } from "stream";
|
|
18677
18677
|
import fs from "fs";
|
|
18678
18678
|
import { fileURLToPath } from "url";
|
|
18679
|
+
import { join } from "path";
|
|
18679
18680
|
|
|
18680
18681
|
// src/emoji/index.ts
|
|
18681
18682
|
var U200D = String.fromCharCode(8205);
|
|
@@ -18809,13 +18810,11 @@ async function render(satori2, resvg, opts, defaultFonts, element) {
|
|
|
18809
18810
|
|
|
18810
18811
|
// src/index.node.ts
|
|
18811
18812
|
var satori = Cl.default || Cl;
|
|
18812
|
-
var fontData = fs.readFileSync(fileURLToPath(
|
|
18813
|
-
var yoga_wasm = fs.readFileSync(fileURLToPath(
|
|
18814
|
-
var resvg_wasm = fs.readFileSync(fileURLToPath(
|
|
18813
|
+
var fontData = fs.readFileSync(fileURLToPath(join(import.meta.url, "../noto-sans-v27-latin-regular.ttf")));
|
|
18814
|
+
var yoga_wasm = fs.readFileSync(fileURLToPath(join(import.meta.url, "../yoga.wasm")));
|
|
18815
|
+
var resvg_wasm = fs.readFileSync(fileURLToPath(join(import.meta.url, "../resvg.wasm")));
|
|
18815
18816
|
var initializedResvg = initWasm(resvg_wasm);
|
|
18816
18817
|
var initializedYoga = initYoga(yoga_wasm).then((yoga2) => Ll(yoga2));
|
|
18817
|
-
var _a2, _b2;
|
|
18818
|
-
var isDev = ((_b2 = (_a2 = globalThis == null ? void 0 : globalThis.process) == null ? void 0 : _a2.env) == null ? void 0 : _b2.NODE_ENV) === "development";
|
|
18819
18818
|
var ImageResponse = class {
|
|
18820
18819
|
constructor(element, options = {}) {
|
|
18821
18820
|
if (typeof Response === "undefined" || typeof ReadableStream === "undefined") {
|
|
@@ -18841,7 +18840,7 @@ var ImageResponse = class {
|
|
|
18841
18840
|
return new Response(result, {
|
|
18842
18841
|
headers: {
|
|
18843
18842
|
"content-type": "image/png",
|
|
18844
|
-
"cache-control":
|
|
18843
|
+
"cache-control": process.env.NODE_ENV === "development" ? "no-cache, no-store" : "public, immutable, no-transform, max-age=31536000",
|
|
18845
18844
|
...options.headers
|
|
18846
18845
|
},
|
|
18847
18846
|
status: options.status,
|