Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

Commit

Permalink
fix(compiler): when useStorage returns a Uint8Array, decode it to t…
Browse files Browse the repository at this point in the history
…ext (fixes #33)
  • Loading branch information
L422Y authored Mar 1, 2024
1 parent 8f8ffc5 commit 0d7edaf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/runtime/server/nitro/useCompiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ export async function useCompiler(
verbose = false,
) {
const vueEmailOptions = useRuntimeConfig().public.vueEmail as ModuleOptions
const source = await useStorage(storageKey).getItem(filename)
let source = await useStorage(storageKey).getItem(filename)
if (source instanceof Uint8Array) source = new TextDecoder().decode(source)

Check failure on line 15 in src/runtime/server/nitro/useCompiler.ts

View workflow job for this annotation

GitHub Actions / ci

Expect newline after if
const keys = await useStorage(storageKey).getKeys()
const components: {
name: string
source: string
}[] = []
for (const key of keys) {
const value = await useStorage(storageKey).getItem(key)
let value = await useStorage(storageKey).getItem(key)
if (value instanceof Uint8Array) value = new TextDecoder().decode(value)

Check failure on line 23 in src/runtime/server/nitro/useCompiler.ts

View workflow job for this annotation

GitHub Actions / ci

Expect newline after if

if (value && key.endsWith('.vue')) {
components.push({
Expand Down

0 comments on commit 0d7edaf

Please sign in to comment.