Skip to content

Commit

Permalink
fix: type of content var can be object
Browse files Browse the repository at this point in the history
  • Loading branch information
nobkd committed Jun 25, 2023
1 parent 8a58585 commit 5160314
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/server/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export async function parseContent (id: string, content: string, opts: ParseCont
)

// Call hook before parsing the file
const file = { _id: id, body: content.replace(/\r\n|\r/g, '\n') }
const file = { _id: id, body: typeof content === 'string' ? content.replace(/\r\n|\r/g, '\n') : content }
await nitroApp.hooks.callHook('content:file:beforeParse', file)

const result = await transformContent(id, file.body, options)
Expand Down

0 comments on commit 5160314

Please sign in to comment.