chore: update

This commit is contained in:
Anthony Fu 2025-01-14 23:18:06 +08:00
parent 4b85c83812
commit e50a7e43fb
No known key found for this signature in database
GPG Key ID: 179936958CD423FF

View File

@ -86,15 +86,22 @@ export function createNuxt (options: NuxtOptions): Nuxt {
const proxied = onChange(
options,
(keys, value, previousValue, applyData) => {
if (value === previousValue && !applyData) {
(keys, newValue, previousValue, applyData) => {
if (newValue === previousValue && !applyData) {
return
}
let value = applyData?.args ?? newValue
// Make a shallow copy of the value
if (Array.isArray(value)) {
value = [...value]
} else if (typeof value === 'object') {
value = { ...(value as any) }
}
nuxt._debug!.moduleMutationRecords!.push({
module: currentModule,
keys,
target: 'nuxt.options',
value: applyData?.args ?? value,
value,
timestamp: Date.now(),
method: applyData?.name,
})