tvmaze.js
function querySearch( query, single, embed, callback ) {
    var embd = '';
        if ( single ) {
        for ( var key in embed ) {
            if (  embed.hasOwnProperty(key) ) {
                embd += '&embed[]=' + embed[key];
            }
        }
    }

    var url = apiBaseUrl + ( single ? endpoints['query']['single'] : endpoints['query']['multi'] ) + query + embd;

    fetch(url, function(result) {
        callback(result);
    });
}
function querySearch( query, single, embed, callback ) {
    var embd = '';
        if ( single ) {
        for ( var key in embed ) {
            if (  embed.hasOwnProperty(key) ) {
                embd += '&embed[]=' + embed[key];
            }
        }
    }

    var url = apiBaseUrl + ( single ? endpoints['query']['single'] : endpoints['query']['multi'] ) + query + embd;

    fetch(url, function(result) {
        callback(result);
    });
}
function querySearch ( query , single , embed , callback ) { var embd = '' ; if ( single ) { for ( var key in embed ) { if ( embed . hasOwnProperty ( key ) ) { embd += '&embed[]=' + embed [ key ] ; } } } var url = apiBaseUrl + ( single ? endpoints [ 'query' ] [ 'single' ] : endpoints [ 'query' ] [ 'multi' ] ) + query + embd ; fetch ( url , function ( result ) { callback ( result ) ; } ) ; }
Search by query string

@param query
@param single
@param embed
@param callback
Search by query string