lib/handler.js
/**
     * Performs an inspection of the specified matrix.
     */
Performs an inspection of the specified matrix.
Performs an inspection of the specified matrix .
performMatrixInspection(varName, maxRows = 100000) {
        let request = {
            code: this._matrixQueryCommand + "(" + varName + ", " + maxRows + ")",
            stop_on_error: false,
            store_history: false
        };
        let con = this._connector;
        return new Promise(function (resolve, reject) {
            con.fetch(request, (response) => {
                let msgType = response.header.msg_type;
                switch (msgType) {
                    case "execute_result":
                        let payload = response.content;
                        let content = payload.data["text/plain"];
                        let content_clean = content.replace(/^'|'$/g, "");
                        content_clean = content_clean.replace(/\\"/g, '"');
                        content_clean = content_clean.replace(/\\'/g, "\\\\'");
                        let modelOptions = JSON.parse(content_clean);
                        let jsonModel = new JSONModel(modelOptions);
                        resolve(jsonModel);
                        break;
                    case "error":
                        console.log(response);
                        reject("Kernel error on 'matrixQuery' call!");
                        break;
                    default:
                        break;
                }
            });
        });
    }
performMatrixInspection ( varName , maxRows = 100000 ) { let request = { code : this . _matrixQueryCommand + "(" + varName + ", " + maxRows + ")" , stop_on_error : false , store_history : false } ; let con = this . _connector ; return new Promise ( function ( resolve , reject ) { con . fetch ( request , ( response ) => { let msgType = response . header . msg_type ; switch ( msgType ) { case "execute_result" : let payload = response . content ; let content = payload . data [ "text/plain" ] ; let content_clean = content . replace ( / ^'|'$ / g , "" ) ; content_clean = content_clean . replace ( / \\" / g , '"' ) ; content_clean = content_clean . replace ( / \\' / g , "\\\\'" ) ; let modelOptions = JSON . parse ( content_clean ) ; let jsonModel = new JSONModel ( modelOptions ) ; resolve ( jsonModel ) ; break ; case "error" : console . log ( response ) ; reject ( "Kernel error on 'matrixQuery' call!" ) ; break ; default : break ; } } ) ; } ) ; }
Performs an inspection of the specified matrix.
Performs an inspection of the specified matrix .