revojs 0.0.50 → 0.0.51

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.
Files changed (2) hide show
  1. package/dist/index.js +8 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -569,8 +569,15 @@ const createRuntime = async () => {
569
569
  const assets = await import("#virtual/assets").then((module) => module.assets);
570
570
  for (const path in assets) radix.insert("GET/" + path, defineRoute({ fetch: async (scope) => {
571
571
  const { response } = useRuntime(scope);
572
+ let content = await assets[path]?.();
573
+ if (content) {
574
+ if (path.endsWith(".png")) {
575
+ const [_, base64] = content.split(",");
576
+ content = Buffer.from(base64, "base64url");
577
+ }
578
+ }
572
579
  response.headers.set("Content-Type", mimeType(path));
573
- return new Response(await assets[path]?.(), response);
580
+ return new Response(content, response);
574
581
  } }));
575
582
  const invoke = (scope, route, index) => {
576
583
  return middlewares.at(index)?.fetch(scope, () => invoke(scope, route, index + 1)) ?? route.fetch(scope);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revojs",
3
- "version": "0.0.50",
3
+ "version": "0.0.51",
4
4
  "type": "module",
5
5
  "repository": "coverbase/revojs",
6
6
  "license": "MIT",