123456 |
- // Licensed Materials - Property of IBM
- // IBM Cognos Products: hal
- // (C) Copyright IBM Corp. 2003, 2017.
- // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- var U_JsUtils={};U_JsUtils.F_CreateLookupByProperty=function(_hU82,_hKO1){var o={};var _h5Z1=_hU82.length;for(var i=0; i<_h5Z1;++i){var _h8C2=_hU82[i];o[_h8C2[_hKO1]]=_h8C2;}return o;};U_JsUtils.F_CreateReverseLookup=function(_hU82,_hW81){var o=_hW81?[]:{};var _h5Z1=_hU82.length;for(var i=0; i<_h5Z1;++i){o[_hU82[i]]=i;}return o;};U_JsUtils.F_CreateReverseLookupBoolean=function(_hU82,_hW81){var o=_hW81?[]:{};var _h5Z1=_hU82.length;for(var i=0; i<_h5Z1;++i){o[_hU82[i]]=true;}return o;};U_JsUtils.F_CreateReverseLookupByProperty=function(_hU82,_hKO1,_hW81){var o=_hW81?[]:{};var _h5Z1=_hU82.length;for(var i=0; i<_h5Z1;++i){o[_hU82[i][_hKO1]]=i;}return o;};U_JsUtils.F_CreateArrayFromProperties=function(_hU82,_hKO1){var a=[];var _h5Z1=_hU82.length;for(var i=0; i<_h5Z1;++i){a.push(_hU82[i][_hKO1]);}return a;};U_JsUtils.F_PrettyPrintJSON=function(o){return this._hHI(o, "", "", true);};U_JsUtils._hHI=function(o,_hS02,_h331,_h6Z1){var _hP42=[];var _h6E2=" ";if(o==null){_hP42.push(_h331);_hP42.push("null");}else if(o instanceof Array&&o.length==0){_hP42.push(_h331);_hP42.push("[]");}else if(o instanceof Array){var _h7E2="\n";var _hC91=_hS02+_h6E2;var _h2G1=_hS02;if(o.length<=8&&(!o[0]||!(o[0] instanceof Array)&&(typeof o[0]!="object"))){_h7E2=" ";_hC91="";_hS02=_h331;_h2G1="";}else if(!_h6Z1){_hP42.push("\n");}_hP42.push(_hS02);_hP42.push("[");_hP42.push(_h7E2);for(var i=0; i<o.length;++i){if(i>0){_hP42.push(",");_hP42.push(_h7E2);}_hP42.push(this._hHI(o[i], _hC91, _hC91, true));}_hP42.push(_h7E2);_hP42.push(_h2G1);_hP42.push("]");}else{switch(typeof o){case 'object':if(!_h6Z1){_hP42.push("\n");}_hP42.push(_hS02);_hP42.push("{\n");var _hC91=_hS02+_h6E2;var _h082=0;for(var s in o){if(_h082++>0){_hP42.push(",\n");}_hP42.push(_hC91);_hP42.push('"' + s + '":');_hP42.push(this._hHI(o[s], _hC91, ""));}_hP42.push("\n");_hP42.push(_hS02);_hP42.push("}");break;case 'string':_hP42.push(_h331);_hP42.push('"' + this.F_JSONStringEscape(o) + '"');break;default:_hP42.push(_h331);_hP42.push(o);break;}}return _hP42.join("");};U_JsUtils.F_JSONStringEscape=function(s){return s.replace( /\\/g, "\\\\" ).replace( /\"/g, '\\"' ).replace(/\r?\n/g, "\\r\\n");};
|