mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-21 16:09:52 +00:00
chore: use logical or assignment (#30992)
This commit is contained in:
parent
62cb4a6ec1
commit
72159e0808
@ -523,7 +523,7 @@ export function tryUseNuxtApp (id?: string): NuxtApp | null {
|
||||
nuxtAppInstance = getCurrentInstance()?.appContext.app.$nuxt
|
||||
}
|
||||
|
||||
nuxtAppInstance = nuxtAppInstance || getNuxtAppCtx(id).tryUse()
|
||||
nuxtAppInstance ||= getNuxtAppCtx(id).tryUse()
|
||||
|
||||
return nuxtAppInstance || null
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ function pageToClientOnly<T extends ComponentOptions> (component: T) {
|
||||
if (isPromise(setupState)) {
|
||||
return Promise.resolve(setupState).then((setupState: any) => {
|
||||
if (typeof setupState !== 'function') {
|
||||
setupState = setupState || {}
|
||||
setupState ||= {}
|
||||
setupState.mounted$ = mounted$
|
||||
return setupState
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ export const ComposableKeysPlugin = (options: ComposableKeysOptions) => createUn
|
||||
const name = node.callee.name
|
||||
if (!name || !keyedFunctions.has(name) || node.arguments.length >= maxLength) { return }
|
||||
|
||||
imports = imports || detectImportNames(script, composableMeta)
|
||||
imports ||= detectImportNames(script, composableMeta)
|
||||
if (imports.has(name)) { return }
|
||||
|
||||
const meta = composableMeta[name]
|
||||
|
Loading…
Reference in New Issue
Block a user