From 4d7defc4255d982e65aed84b69f18281d05907b3 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Wed, 8 Jan 2025 00:09:19 +0100 Subject: [PATCH] fix: make sure serialized options are not modified --- src/core/utils/storage.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/utils/storage.ts b/src/core/utils/storage.ts index 476531e5e5..5e032ba093 100644 --- a/src/core/utils/storage.ts +++ b/src/core/utils/storage.ts @@ -1,13 +1,15 @@ import type { Nitro } from "nitropack/types"; +import { klona } from "klona"; import { createStorage as _createStorage, builtinDrivers } from "unstorage"; export async function createStorage(nitro: Nitro) { const storage = _createStorage(); - const mounts = { + // https://github.com/unjs/unstorage/issues/566 + const mounts = klona({ ...nitro.options.storage, ...nitro.options.devStorage, - }; + }); for (const [path, opts] of Object.entries(mounts)) { if (opts.driver) {