component/activity.js
/* 
    Clear activities for a hostname or all activites
*/
Clear activities for a hostname or all activites
Clear activities for a hostname or all activites
async function clear(hostname) {
    if (hostname === undefined) {
        throw new Error("Hostname is undefined.");
    }
    let sessions = await get();
    if (hostname.length > 0) {
        let index = sessions.findIndex(element => element.hostname === hostname);
        sessions.splice(index, 1);
    } else {
        sessions = [];
    }
    await set(sessions);
}
async function clear ( hostname ) { if ( hostname === undefined ) { throw new Error ( "Hostname is undefined." ) ; } let sessions = await get ( ) ; if ( hostname . length > 0 ) { let index = sessions . findIndex ( element => element . hostname === hostname ) ; sessions . splice ( index , 1 ) ; } else { sessions = [ ] ; } await set ( sessions ) ; }
Clear activities for a hostname or all activites
Clear activities for a hostname or all activites