export async function levelDefault ( key , value ) { const { db } = global ; try { await db . get ( key ) ; } catch ( err ) { if ( ! err . notFound ) { throw err ; } await db . put ( key , value ) ; } } export async function levelDefaults ( values ) { for ( const [ key , value ] of Object . entries ( values ) ) { await levelDefault ( key , value ) ; } }