function apiHandler(api, params) {
    if (!api) throw Error('API method required');
    api = api.toLowerCase();

    if (supportedAPI.indexOf(api) === -1) throw Error(`Method ${api} is not supported`);

    //console.log(`Handling API call ${api}`, params);

    switch (api) {
        // TODO: add API implementation
        case 'diagram':
            diagram(params);
            break;
        default:
            console.warn(`No handler defined for ${api}`);
    }
}
/**
    Method that handles all API calls
    */
Method that handles all API calls
Method that handles all API calls
function apiHandler(api, params) {
    if (!api) throw Error('API method required');
    api = api.toLowerCase();
    if (supportedAPI.indexOf(api) === -1) throw Error(`Method ${api} is not supported`);
    switch (api) {
        case 'diagram':
            diagram(params);
            break;
        default:
            console.warn(`No handler defined for ${api}`);
    }
}
function apiHandler ( api , params ) { if ( ! api ) throw Error ( 'API method required' ) ; api = api . toLowerCase ( ) ; if ( supportedAPI . indexOf ( api ) === - 1 ) throw Error ( ` ${ api } ` ) ; switch ( api ) { case 'diagram' : diagram ( params ) ; break ; default : console . warn ( ` ${ api } ` ) ; } }
Method that handles all API calls
Method that handles all API calls
//console.log(`Handling API call ${api}`, params); // TODO: add API implementation