reroute-js 0.45.6 → 0.45.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.
- package/cli/bin.d.ts +1 -1
- package/cli/bin.js +35 -7
- package/cli/bin.js.map +5 -5
- package/cli/index.d.ts +1 -1
- package/cli/index.js +4 -4
- package/cli/index.js.map +1 -1
- package/cli/src/cli.d.ts +1 -1
- package/cli/src/commands/analyze.d.ts +1 -1
- package/cli/src/commands/build.d.ts +1 -1
- package/cli/src/commands/dev.d.ts +1 -1
- package/cli/src/commands/gen.d.ts +1 -1
- package/cli/src/commands/index.d.ts +1 -1
- package/cli/src/commands/init.d.ts +1 -1
- package/cli/src/commands/lib/assets.d.ts +1 -1
- package/cli/src/commands/lib/bundler.d.ts +1 -1
- package/cli/src/commands/lib/command.d.ts +1 -1
- package/cli/src/commands/lib/env.d.ts +1 -1
- package/cli/src/commands/lib/index.d.ts +1 -1
- package/cli/src/commands/lib/log.d.ts +1 -1
- package/cli/src/commands/lib/markdown/availability.d.ts +1 -1
- package/cli/src/commands/lib/markdown/index.d.ts +1 -1
- package/cli/src/commands/lib/markdown/processor.d.ts +1 -1
- package/cli/src/commands/lib/production.d.ts +1 -1
- package/cli/src/commands/lib/server.d.ts +1 -1
- package/cli/src/commands/lib/streaming/analyzer.d.ts +1 -1
- package/cli/src/commands/lib/streaming/suspense.d.ts +1 -1
- package/cli/src/commands/lib/tailwind.d.ts +1 -1
- package/cli/src/commands/lib/terminal-ui.d.ts +1 -1
- package/cli/src/commands/lib/version.d.ts +1 -1
- package/cli/src/commands/og.d.ts +1 -1
- package/cli/src/commands/start.d.ts +1 -1
- package/cli/src/index.d.ts +1 -1
- package/core/index.d.ts +1 -1
- package/core/index.js +31 -3
- package/core/index.js.map +5 -5
- package/core/src/bundler/hash.d.ts +1 -1
- package/core/src/bundler/index.d.ts +1 -1
- package/core/src/config.d.ts +1 -1
- package/core/src/content/discovery.d.ts +1 -1
- package/core/src/content/index.d.ts +1 -1
- package/core/src/content/metadata.d.ts +1 -1
- package/core/src/index.d.ts +1 -1
- package/core/src/llms/extractor.d.ts +1 -1
- package/core/src/llms/formatter.d.ts +1 -1
- package/core/src/llms/full-generator.d.ts +1 -1
- package/core/src/llms/index-generator.d.ts +1 -1
- package/core/src/llms/index.d.ts +1 -1
- package/core/src/og/discovery.d.ts +1 -1
- package/core/src/og/index.d.ts +1 -1
- package/core/src/og/meta.d.ts +1 -1
- package/core/src/og/render.d.ts +1 -1
- package/core/src/og/render.d.ts.map +1 -1
- package/core/src/og/types.d.ts +1 -1
- package/core/src/robots/discovery.d.ts +1 -1
- package/core/src/robots/generator.d.ts +1 -1
- package/core/src/robots/index.d.ts +1 -1
- package/core/src/robots/policies.d.ts +1 -1
- package/core/src/rss/discovery.d.ts +1 -1
- package/core/src/rss/generator.d.ts +1 -1
- package/core/src/rss/index.d.ts +1 -1
- package/core/src/sitemap/discovery.d.ts +1 -1
- package/core/src/sitemap/generator.d.ts +1 -1
- package/core/src/sitemap/index.d.ts +1 -1
- package/core/src/ssr/index.d.ts +1 -1
- package/core/src/ssr/lib/cache.d.ts +12 -3
- package/core/src/ssr/lib/cache.d.ts.map +1 -1
- package/core/src/ssr/lib/collections.d.ts +1 -1
- package/core/src/ssr/lib/compression.d.ts +1 -1
- package/core/src/ssr/lib/compute/content.d.ts +1 -1
- package/core/src/ssr/lib/compute/index.d.ts +1 -1
- package/core/src/ssr/lib/compute/layouts.d.ts +1 -1
- package/core/src/ssr/lib/compute/routes.d.ts +1 -1
- package/core/src/ssr/lib/data.d.ts +1 -1
- package/core/src/ssr/lib/html.d.ts +1 -1
- package/core/src/ssr/lib/imports.d.ts +1 -1
- package/core/src/ssr/lib/index.d.ts +1 -1
- package/core/src/ssr/lib/layouts.d.ts +1 -1
- package/core/src/ssr/lib/metadata.d.ts +1 -1
- package/core/src/ssr/lib/mime.d.ts +1 -1
- package/core/src/ssr/lib/modules.d.ts +1 -1
- package/core/src/ssr/lib/path.d.ts +1 -1
- package/core/src/ssr/lib/preload.d.ts +1 -1
- package/core/src/ssr/lib/scripts/collections.d.ts +1 -1
- package/core/src/ssr/lib/scripts/data.d.ts +1 -1
- package/core/src/ssr/lib/scripts/escape.d.ts +1 -1
- package/core/src/ssr/lib/scripts/feeds.d.ts +1 -1
- package/core/src/ssr/lib/scripts/index.d.ts +1 -1
- package/core/src/ssr/lib/seed.d.ts +1 -1
- package/core/src/ssr/lib/serialize.d.ts +1 -1
- package/core/src/ssr/lib/setup.d.ts +1 -1
- package/core/src/ssr/lib/styles.d.ts +1 -1
- package/core/src/ssr/lib/template.d.ts +1 -1
- package/core/src/ssr/lib/types.d.ts +1 -1
- package/core/src/ssr/render.d.ts +1 -1
- package/core/src/ssr/stream.d.ts +1 -1
- package/elysia/index.d.ts +1 -1
- package/elysia/index.js +41 -5
- package/elysia/index.js.map +6 -6
- package/elysia/src/index.d.ts +1 -1
- package/elysia/src/libs/assets.d.ts +1 -1
- package/elysia/src/libs/cache.d.ts +1 -1
- package/elysia/src/libs/caching.d.ts +1 -1
- package/elysia/src/libs/http.d.ts +1 -1
- package/elysia/src/libs/image.d.ts +1 -1
- package/elysia/src/libs/index.d.ts +1 -1
- package/elysia/src/libs/llms.d.ts +1 -1
- package/elysia/src/libs/response.d.ts +1 -1
- package/elysia/src/libs/serving.d.ts +1 -1
- package/elysia/src/plugin.d.ts +1 -1
- package/elysia/src/routes/artifacts.d.ts +1 -1
- package/elysia/src/routes/content.d.ts +1 -1
- package/elysia/src/routes/image.d.ts +1 -1
- package/elysia/src/routes/index.d.ts +1 -1
- package/elysia/src/routes/internal.d.ts +1 -1
- package/elysia/src/routes/llms.d.ts +1 -1
- package/elysia/src/routes/og.d.ts +1 -1
- package/elysia/src/routes/og.d.ts.map +1 -1
- package/elysia/src/routes/redirects.d.ts +1 -1
- package/elysia/src/routes/robots.d.ts +1 -1
- package/elysia/src/routes/rss.d.ts +1 -1
- package/elysia/src/routes/search.d.ts +1 -1
- package/elysia/src/routes/sitemap.d.ts +1 -1
- package/elysia/src/routes/ssr.d.ts +1 -1
- package/elysia/src/routes/static.d.ts +1 -1
- package/elysia/src/types.d.ts +1 -1
- package/package.json +1 -1
- package/react/index.d.ts +1 -1
- package/react/index.js +2 -2
- package/react/index.js.map +1 -1
- package/react/src/components/ClientOnly.d.ts +1 -1
- package/react/src/components/ContentRoute.d.ts +1 -1
- package/react/src/components/Image.d.ts +1 -1
- package/react/src/components/LazyRoute.d.ts +1 -1
- package/react/src/components/Link.d.ts +1 -1
- package/react/src/components/Markdown.d.ts +1 -1
- package/react/src/components/Outlet.d.ts +1 -1
- package/react/src/components/index.d.ts +1 -1
- package/react/src/hooks/index.d.ts +1 -1
- package/react/src/hooks/useContent.d.ts +1 -1
- package/react/src/hooks/useData.d.ts +1 -1
- package/react/src/hooks/useFeed.d.ts +1 -1
- package/react/src/hooks/useLayoutData.d.ts +1 -1
- package/react/src/hooks/useLlms.d.ts +1 -1
- package/react/src/hooks/useNavigate.d.ts +1 -1
- package/react/src/hooks/useParams.d.ts +1 -1
- package/react/src/hooks/useRouter.d.ts +1 -1
- package/react/src/hooks/useSearch.d.ts +1 -1
- package/react/src/hooks/useSearchParams.d.ts +1 -1
- package/react/src/hooks/useToc.d.ts +1 -1
- package/react/src/index.d.ts +1 -1
- package/react/src/lib/collection.d.ts +1 -1
- package/react/src/lib/content.d.ts +1 -1
- package/react/src/lib/head.d.ts +1 -1
- package/react/src/lib/index.d.ts +1 -1
- package/react/src/lib/lazy-route.d.ts +1 -1
- package/react/src/lib/route-loader.d.ts +1 -1
- package/react/src/providers/ContentProvider.d.ts +1 -1
- package/react/src/providers/RerouteProvider.d.ts +1 -1
- package/react/src/providers/RouterProvider.d.ts +1 -1
- package/react/src/providers/index.d.ts +1 -1
- package/react/src/types/any.d.ts +1 -1
- package/react/src/types/index.d.ts +1 -1
- package/react/src/types/router.d.ts +1 -1
- package/telemetry/react.d.ts +1 -1
- package/telemetry/react.js +2 -2
- package/telemetry/react.js.map +1 -1
- package/telemetry/server.d.ts +1 -1
- package/telemetry/server.js +32 -4
- package/telemetry/server.js.map +5 -5
- package/telemetry/src/react/api.d.ts +1 -1
- package/telemetry/src/react/context.d.ts +1 -1
- package/telemetry/src/react/index.d.ts +1 -1
- package/telemetry/src/react/telemetry.d.ts +1 -1
- package/telemetry/src/server/context.d.ts +1 -1
- package/telemetry/src/server/headers/extractor.d.ts +1 -1
- package/telemetry/src/server/headers/index.d.ts +1 -1
- package/telemetry/src/server/headers/presets.d.ts +1 -1
- package/telemetry/src/server/index.d.ts +1 -1
- package/telemetry/src/server/instrumentation.d.ts +1 -1
- package/telemetry/src/server/plugin.d.ts +1 -1
- package/telemetry/src/server/plugin.d.ts.map +1 -1
- package/telemetry/src/server/sourcemap.d.ts +1 -1
package/core/src/config.d.ts
CHANGED
package/core/src/index.d.ts
CHANGED
package/core/src/llms/index.d.ts
CHANGED
package/core/src/og/index.d.ts
CHANGED
package/core/src/og/meta.d.ts
CHANGED
package/core/src/og/render.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/og/render.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C,KAAK,GAAG,GAAG,GAAG,CAAC;AACf;;GAEG;AAEH,wBAAsB,kBAAkB,CACvC,SAAS,EAAE,GAAG,EACd,KAAK,EAAE,YAAY,EACnB,OAAO,GAAE;IACR,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;CACjB,GACJ,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/og/render.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C,KAAK,GAAG,GAAG,GAAG,CAAC;AACf;;GAEG;AAEH,wBAAsB,kBAAkB,CACvC,SAAS,EAAE,GAAG,EACd,KAAK,EAAE,YAAY,EACnB,OAAO,GAAE;IACR,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;CACjB,GACJ,OAAO,CAAC,MAAM,CAAC,CA8BjB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EACjC,IAAI,EACJ,MAAM,EACN,QAAQ,EAAE,YAAY,GACtB,EAAE,YAAY;;;;;;;;;;gBA+Gd"}
|
package/core/src/og/types.d.ts
CHANGED
package/core/src/rss/index.d.ts
CHANGED
package/core/src/ssr/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* reroute-js v0.45.
|
|
2
|
+
* reroute-js v0.45.8
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 stewones <hi@stewan.io>
|
|
@@ -48,18 +48,27 @@ declare class SSRDataCache {
|
|
|
48
48
|
destroy(): void;
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
|
-
* Simple LRU Cache implementation.
|
|
51
|
+
* Simple LRU Cache implementation with TTL support.
|
|
52
52
|
* Used for caching responses and data across requests.
|
|
53
|
-
*
|
|
53
|
+
* Automatically evicts expired entries to prevent memory leaks.
|
|
54
54
|
*/
|
|
55
55
|
export declare class LRUCache<K, V> {
|
|
56
56
|
private cache;
|
|
57
57
|
private maxSize;
|
|
58
|
+
private cleanupInterval;
|
|
58
59
|
constructor(maxSize?: number);
|
|
59
60
|
get(key: K): V | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Remove all expired entries
|
|
63
|
+
*/
|
|
64
|
+
private cleanup;
|
|
60
65
|
set(key: K, value: V): void;
|
|
61
66
|
has(key: K): boolean;
|
|
62
67
|
clear(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Stop cleanup interval and clear cache (call on shutdown)
|
|
70
|
+
*/
|
|
71
|
+
destroy(): void;
|
|
63
72
|
}
|
|
64
73
|
/**
|
|
65
74
|
* TTL-based cache with automatic expiration and size limits.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/ssr/lib/cache.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,cAAM,YAAY;IACjB,OAAO,CAAC,KAAK,CAA+C;IAC5D,OAAO,CAAC,MAAM,CAAC,eAAe,CAA+B;;IAW7D;;OAEG;IACH,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAalC;;OAEG;IACH,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAUlD;;OAEG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIzB;;OAEG;IACH,KAAK,IAAI,IAAI;IAIb;;OAEG;IACH,OAAO,CAAC,OAAO;IASf;;OAEG;IACH,KAAK,IAAI;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE;IAOzC;;OAEG;IACH,OAAO,IAAI,IAAI;CAOf;AAED;;;;GAIG;AACH,qBAAa,QAAQ,CAAC,CAAC,EAAE,CAAC;IACzB,OAAO,CAAC,KAAK,CAAwB;IACrC,OAAO,CAAC,OAAO,CAAS;
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/ssr/lib/cache.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,cAAM,YAAY;IACjB,OAAO,CAAC,KAAK,CAA+C;IAC5D,OAAO,CAAC,MAAM,CAAC,eAAe,CAA+B;;IAW7D;;OAEG;IACH,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAalC;;OAEG;IACH,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAUlD;;OAEG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIzB;;OAEG;IACH,KAAK,IAAI,IAAI;IAIb;;OAEG;IACH,OAAO,CAAC,OAAO;IASf;;OAEG;IACH,KAAK,IAAI;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE;IAOzC;;OAEG;IACH,OAAO,IAAI,IAAI;CAOf;AAED;;;;GAIG;AACH,qBAAa,QAAQ,CAAC,CAAC,EAAE,CAAC;IACzB,OAAO,CAAC,KAAK,CAAwB;IACrC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,eAAe,CAA+B;gBAE1C,OAAO,SAAM;IAczB,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;IAiB1B;;OAEG;IACH,OAAO,CAAC,OAAO;IAUf,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAW3B,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO;IAIpB,KAAK,IAAI,IAAI;IAIb;;OAEG;IACH,OAAO,IAAI,IAAI;CAOf;AAED;;;GAGG;AACH,qBAAa,QAAQ,CAAC,CAAC,EAAE,CAAC;IACzB,OAAO,CAAC,KAAK,CAA+D;IAC5E,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,eAAe,CAA+B;IACtD,OAAO,CAAC,cAAc,CAAuB;IAC7C,OAAO,CAAC,kBAAkB,CAAK;IAE/B;;;;;OAKG;gBAEF,OAAO,SAAM,EACb,YAAY,SAAU,EACtB,iBAAiB,SAAS,EAC1B,WAAW,CAAC,EAAE,MAAM;IAiBrB;;OAEG;IACH,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;IAY1B;;OAEG;IACH,OAAO,CAAC,YAAY;IAepB;;;;;OAKG;IACH,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAyC3C;;OAEG;IACH,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO;IAIpB;;OAEG;IACH,OAAO,CAAC,cAAc;IAmBtB;;OAEG;IACH,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO;IASvB;;OAEG;IACH,KAAK,IAAI,IAAI;IAKb;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;OAEG;IACH,KAAK,IAAI;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAC3B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;KAClC;IAmBD;;OAEG;IACH,OAAO,CAAC,OAAO;IAYf;;OAEG;IACH,OAAO,IAAI,IAAI;CAOf;AA2BD,QAAA,MAAM,QAAQ,cAAmB,CAAC;AAClC,QAAA,MAAM,WAAW,cAAyB,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC"}
|
package/core/src/ssr/render.d.ts
CHANGED
package/core/src/ssr/stream.d.ts
CHANGED
package/elysia/index.d.ts
CHANGED
package/elysia/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* reroute-js v0.45.
|
|
2
|
+
* reroute-js v0.45.8
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 stewones <hi@stewan.io>
|
|
@@ -451,17 +451,38 @@ class SSRDataCache {
|
|
|
451
451
|
class LRUCache {
|
|
452
452
|
cache = new Map;
|
|
453
453
|
maxSize;
|
|
454
|
+
cleanupInterval = null;
|
|
454
455
|
constructor(maxSize = 100) {
|
|
455
456
|
this.maxSize = maxSize;
|
|
457
|
+
this.cleanupInterval = setInterval(() => {
|
|
458
|
+
this.cleanup();
|
|
459
|
+
}, 60000);
|
|
460
|
+
if (this.cleanupInterval.unref) {
|
|
461
|
+
this.cleanupInterval.unref();
|
|
462
|
+
}
|
|
456
463
|
}
|
|
457
464
|
get(key) {
|
|
458
465
|
const value = this.cache.get(key);
|
|
459
466
|
if (value !== undefined) {
|
|
467
|
+
const entry = value;
|
|
468
|
+
if (entry.exp !== undefined && entry.exp <= Date.now()) {
|
|
469
|
+
this.cache.delete(key);
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
460
472
|
this.cache.delete(key);
|
|
461
473
|
this.cache.set(key, value);
|
|
462
474
|
}
|
|
463
475
|
return value;
|
|
464
476
|
}
|
|
477
|
+
cleanup() {
|
|
478
|
+
const now = Date.now();
|
|
479
|
+
for (const [key, value] of this.cache.entries()) {
|
|
480
|
+
const entry = value;
|
|
481
|
+
if (entry.exp !== undefined && entry.exp <= now) {
|
|
482
|
+
this.cache.delete(key);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
}
|
|
465
486
|
set(key, value) {
|
|
466
487
|
this.cache.delete(key);
|
|
467
488
|
if (this.cache.size >= this.maxSize) {
|
|
@@ -476,6 +497,13 @@ class LRUCache {
|
|
|
476
497
|
clear() {
|
|
477
498
|
this.cache.clear();
|
|
478
499
|
}
|
|
500
|
+
destroy() {
|
|
501
|
+
if (this.cleanupInterval) {
|
|
502
|
+
clearInterval(this.cleanupInterval);
|
|
503
|
+
this.cleanupInterval = null;
|
|
504
|
+
}
|
|
505
|
+
this.clear();
|
|
506
|
+
}
|
|
479
507
|
}
|
|
480
508
|
|
|
481
509
|
class TTLCache {
|
|
@@ -3981,7 +4009,7 @@ async function renderOGImageToPNG(Component, props, options = {}) {
|
|
|
3981
4009
|
const imageResponse = new ImageResponse(element, {
|
|
3982
4010
|
width,
|
|
3983
4011
|
height,
|
|
3984
|
-
fonts: options.fonts
|
|
4012
|
+
fonts: options.fonts?.length && options.fonts.length > 0 ? options.fonts : undefined
|
|
3985
4013
|
});
|
|
3986
4014
|
const arrayBuffer = await imageResponse.arrayBuffer();
|
|
3987
4015
|
return Buffer.from(arrayBuffer);
|
|
@@ -7319,8 +7347,16 @@ function registerOGRoutes(app, options) {
|
|
|
7319
7347
|
ogCache.set(pathname, buffer);
|
|
7320
7348
|
}
|
|
7321
7349
|
function validatePathname(pathname) {
|
|
7322
|
-
|
|
7323
|
-
|
|
7350
|
+
if (pathname.length > 80)
|
|
7351
|
+
return false;
|
|
7352
|
+
if (/(25){5,}/.test(pathname))
|
|
7353
|
+
return false;
|
|
7354
|
+
if (/(.{2})\1{4,}/.test(pathname))
|
|
7355
|
+
return false;
|
|
7356
|
+
const percentCount = (pathname.match(/%/g) || []).length;
|
|
7357
|
+
if (percentCount > 3)
|
|
7358
|
+
return false;
|
|
7359
|
+
return true;
|
|
7324
7360
|
}
|
|
7325
7361
|
async function handleOgGeneration(pathname) {
|
|
7326
7362
|
const existingGeneration = generatingImages.get(pathname);
|
|
@@ -8916,4 +8952,4 @@ export {
|
|
|
8916
8952
|
reroute
|
|
8917
8953
|
};
|
|
8918
8954
|
|
|
8919
|
-
//# debugId=
|
|
8955
|
+
//# debugId=03CB8CE75296216864756E2164756E21
|