UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

2 lines 537 B
import{createAdapterLifecycleContext as e}from"../runtime/adapter-lifecycle.mjs";import t from"./get-adapter.mjs";const n=async(n,r={})=>{let i=await t(n),a=e({config:n,env:r.env,runtimeContext:r.runtimeContext});try{await i.lifecycle?.init?.(a)}catch(e){throw await Promise.allSettled([i.lifecycle?.destroy?.(a)]),e}return i},r=async(t,n)=>{t&&await t.lifecycle?.destroy?.(e({config:n.config,env:n.env,runtimeContext:n.runtimeContext}))};export{r as destroyKVAdapter,n as getInitializedKVAdapter}; //# sourceMappingURL=lifecycle.mjs.map