@hpcc-js/util
Advanced tools
Comparing version 0.0.33 to 0.0.34
@@ -289,3 +289,3 @@ (function (global, factory) { | ||
var Cache = (function () { | ||
var Cache = /** @class */ (function () { | ||
function Cache(calcID) { | ||
@@ -312,3 +312,3 @@ this._cache = {}; | ||
if (!retVal) { | ||
return this.set(factory()); | ||
return factory ? this.set(factory()) : null; | ||
} | ||
@@ -319,4 +319,32 @@ return retVal; | ||
}()); | ||
var AsyncCache = /** @class */ (function () { | ||
function AsyncCache(calcID) { | ||
this._cache = {}; | ||
this._calcID = calcID; | ||
} | ||
AsyncCache.hash = function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return hashSum(__assign({}, args)); | ||
}; | ||
AsyncCache.prototype.has = function (espObj) { | ||
return this._calcID(espObj) in this._cache; | ||
}; | ||
AsyncCache.prototype.set = function (espObj, obj) { | ||
this._cache[this._calcID(espObj)] = obj; | ||
return obj; | ||
}; | ||
AsyncCache.prototype.get = function (espObj, factory) { | ||
var retVal = this._cache[this._calcID(espObj)]; | ||
if (!retVal) { | ||
return factory ? this.set(espObj, factory()) : Promise.resolve(null); | ||
} | ||
return retVal; | ||
}; | ||
return AsyncCache; | ||
}()); | ||
var Dictionary = (function () { | ||
var Dictionary = /** @class */ (function () { | ||
function Dictionary(attrs) { | ||
@@ -395,3 +423,3 @@ this.store = {}; | ||
var ATTR_DEFINITION = "definition"; | ||
var GraphItem = (function () { | ||
var GraphItem = /** @class */ (function () { | ||
function GraphItem(graph, parent, id, attrs) { | ||
@@ -434,3 +462,3 @@ this._graph = graph; | ||
}()); | ||
var Subgraph = (function (_super) { | ||
var Subgraph = /** @class */ (function (_super) { | ||
__extends(Subgraph, _super); | ||
@@ -547,3 +575,3 @@ function Subgraph(graph, parent, id, attrs) { | ||
}(GraphItem)); | ||
var Vertex = (function (_super) { | ||
var Vertex = /** @class */ (function (_super) { | ||
__extends(Vertex, _super); | ||
@@ -606,3 +634,3 @@ function Vertex(graph, parent, id, label, attrs) { | ||
}(GraphItem)); | ||
var Edge = (function (_super) { | ||
var Edge = /** @class */ (function (_super) { | ||
__extends(Edge, _super); | ||
@@ -646,3 +674,3 @@ function Edge(graph, parent, id, source, target, attrs) { | ||
}(Subgraph)); | ||
var Graph = (function () { | ||
var Graph = /** @class */ (function () { | ||
function Graph(id, attrs) { | ||
@@ -772,3 +800,3 @@ this._allSubgraphs = new Dictionary(); | ||
*/ | ||
var Stack = (function () { | ||
var Stack = /** @class */ (function () { | ||
function Stack() { | ||
@@ -836,3 +864,3 @@ this.stack = []; | ||
}; | ||
var ConsoleWriter = (function () { | ||
var ConsoleWriter = /** @class */ (function () { | ||
function ConsoleWriter() { | ||
@@ -852,3 +880,3 @@ } | ||
}()); | ||
var Logging = (function () { | ||
var Logging = /** @class */ (function () { | ||
function Logging() { | ||
@@ -939,3 +967,3 @@ this._levelStack = new Stack(); | ||
var logger = Logging.Instance(); | ||
var ScopedLogging = (function () { | ||
var ScopedLogging = /** @class */ (function () { | ||
function ScopedLogging(scopeID) { | ||
@@ -1069,4 +1097,22 @@ this._scopeID = scopeID; | ||
} | ||
/** | ||
* safeStingify - JSONsimilar to .stringify, except ignores circular references. | ||
* Usage: safeStingify(object); | ||
* | ||
* @param obj - any object. | ||
*/ | ||
function safeStringify(obj) { | ||
var cache = []; | ||
return JSON.stringify(obj, function (key, value) { | ||
if (typeof value === "object" && value !== null) { | ||
if (cache.indexOf(value) !== -1) { | ||
return; | ||
} | ||
cache.push(value); | ||
} | ||
return value; | ||
}); | ||
} | ||
var ObserverHandle = (function () { | ||
var ObserverHandle = /** @class */ (function () { | ||
function ObserverHandle(eventTarget, eventID, callback) { | ||
@@ -1085,3 +1131,3 @@ this.eventTarget = eventTarget; | ||
}()); | ||
var Observable = (function () { | ||
var Observable = /** @class */ (function () { | ||
function Observable() { | ||
@@ -1152,3 +1198,3 @@ var events = []; | ||
var XMLNode = (function () { | ||
var XMLNode = /** @class */ (function () { | ||
function XMLNode(name) { | ||
@@ -1180,3 +1226,3 @@ this.name = ""; | ||
}()); | ||
var SAXStackParser = (function () { | ||
var SAXStackParser = /** @class */ (function () { | ||
function SAXStackParser() { | ||
@@ -1241,3 +1287,3 @@ this.stack = new Stack(); | ||
}()); | ||
var XML2JSONParser = (function (_super) { | ||
var XML2JSONParser = /** @class */ (function (_super) { | ||
__extends(XML2JSONParser, _super); | ||
@@ -1277,3 +1323,3 @@ function XML2JSONParser() { | ||
var StateObject = (function () { | ||
var StateObject = /** @class */ (function () { | ||
function StateObject() { | ||
@@ -1425,2 +1471,3 @@ this._espState = {}; | ||
exports.Cache = Cache; | ||
exports.AsyncCache = AsyncCache; | ||
exports.Dictionary = Dictionary; | ||
@@ -1438,2 +1485,3 @@ exports.espTime2Seconds = espTime2Seconds; | ||
exports.deepMixinT = deepMixinT; | ||
exports.safeStringify = safeStringify; | ||
exports.Observable = Observable; | ||
@@ -1440,0 +1488,0 @@ exports.root = root; |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t["@hpcc-js/util"]={})}(this,function(t){"use strict";function e(t,e){function r(){this.constructor=t}g(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function r(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function n(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function o(t){return this instanceof o?(this.v=t,this):new o(t)}function i(t,e){for(;t.length<e;)t="0"+t;return t}function s(t,e){if(0===e.length)return t;for(var r=0;r<e.length;++r)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t<0?-2*t:t}function a(t,e,r){return Object.keys(e).sort().reduce(function(t,n){return u(t,e[n],n,r)},t)}function u(t,e,r,n){var o=s(s(s(t,r),c(e)),typeof e);return null===e?s(o,"null"):void 0===e?s(o,"undefined"):"object"==typeof e?-1!==n.indexOf(e)?s(o,"[Circular]"+r):(n.push(e),a(o,e,n)):s(o,e.toString())}function c(t){return Object.prototype.toString.call(t)}function h(t){return i(u(0,t,"",[]).toString(16),8)}function p(t,e){if(void 0!==t&&void 0!==e){for(var r=0,n=t.split(".");r<n.length;r++){var o=n[r];if(!e.hasOwnProperty(o))return;e=e[o]}return e}}function f(t,e){var r={};for(var n in e){var o=e[n];o instanceof Array||"object"==typeof o&&(o=l(t[n],o)),n in t&&(t[n]===o||n in r&&r[n]===o)||(t[n]=o)}return t}function l(t){void 0===t&&(t={});for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if("object"!=typeof t)throw new Error('Destination "'+t+'" must be an object.');for(var n=0,o=e;n<o.length;n++)f(t,o[n]);return t}function d(t,e){if("string"!=typeof e)return t;if(0===e.length)return t;for(;0===t.indexOf(e);)t=t.substring(1);for(;v(t,e);)t=t.substring(0,t.length-1);return t}function v(t,e,r){var n=t.toString();("number"!=typeof r||!isFinite(r)||Math.floor(r)!==r||r>n.length)&&(r=n.length),r-=e.length;var o=n.lastIndexOf(e,r);return-1!==o&&o===r}var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},y=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},_=function(){function t(t){this._cache={},this._calcID=t}return t.hash=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return h(y({},t))},t.prototype.has=function(t){return this._calcID(t)in this._cache},t.prototype.set=function(t){return this._cache[this._calcID(t)]=t,t},t.prototype.get=function(t,e){var r=this._cache[this._calcID(t)];return r||this.set(e())},t}(),b=function(){function t(t){if(this.store={},t)for(var e in t)this.set(e,t[e])}return t.prototype.set=function(t,e){var r=this.store[t];return this.store[t]=e,r},t.prototype.get=function(t){return this.store[t]},t.prototype.has=function(t){return void 0!==this.store[t]},t.prototype.remove=function(t){delete this.store[t]},t.prototype.keys=function(){var t=[];for(var e in this.store)t.push(e);return t},t.prototype.values=function(){var t=[];for(var e in this.store)t.push(this.store[e]);return t},t}(),w=function(){function t(t,e,r,n){this._graph=t,this._parent=e,this._id=r,this._attrs=new b(n)}return t.prototype.className=function(){return this.constructor.name},t.prototype.id=function(){return this._id},t.prototype.attrs=function(){return this._attrs},t.prototype.parent=function(){return this._parent},t.prototype.hasECLDefinition=function(){return void 0!==this._attrs.get("definition")},t.prototype.getECLDefinition=function(){var t=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(this._attrs.get("definition"));if(t){var e=t[1],r=t[2],n=t[3];return e.replace("/./","/"),{id:this.id(),file:e,line:+r,column:+n}}throw new Error("Bad definition: "+this._attrs.get("definition"))},t}(),E=function(t){function r(e,r,n,o){void 0===o&&(o={});var i=t.call(this,e,r,n,o)||this;return i._subgraphs=new b,i._vertices=new b,i._edges=new b,r&&r.addSubgraph(i),i}return e(r,t),r.prototype.destroy=function(){var t=this;this._parent&&this._parent.removeSubgraph(this),this._edges.values().forEach(function(e){return t._graph.destroyEdge(e)}),this._vertices.values().forEach(function(e){return t._graph.destroyVertex(e)}),this._subgraphs.values().forEach(function(e){return t._graph.destroySubgraph(e)})},r.prototype.remove=function(){this._graph.destroySubgraph(this)},r.prototype.createSubgraph=function(t,e){return this._graph.createSubgraph(this,t,e)},r.prototype.addSubgraph=function(t){if(this._subgraphs.has(t.id()))throw new Error("Subgraph already exists");this._subgraphs.set(t.id(),t)},r.prototype.removeSubgraph=function(t){if(!this._subgraphs.has(t.id()))throw new Error("Subgraph does not exist");this._subgraphs.remove(t.id())},r.prototype.createVertex=function(t,e,r){return this._graph.createVertex(this,t,e,r)},r.prototype.addVertex=function(t){if(this._vertices.has(t.id()))throw new Error("Vertex already exists");this._vertices.set(t.id(),t)},r.prototype.removeVertex=function(t){if(!this._vertices.has(t.id()))throw new Error("Vertex does not exist");this._vertices.remove(t.id())},r.prototype.createEdge=function(t,e,r,n){return this._graph.createEdge(this,t,e,r,n)},r.prototype.addEdge=function(t){if(this._edges.has(t.id()))throw new Error("Edge already exists");this._edges.set(t.id(),t)},r.prototype.removeEdge=function(t){if(!this._edges.has(t.id()))throw new Error("Edge does not exist");this._edges.remove(t.id())},r.prototype.add=function(t){t instanceof r?this.addSubgraph(t):t instanceof m?this.addVertex(t):this.addEdge(t)},r.prototype.subgraphs=function(){return this._subgraphs.values()},r.prototype.vertices=function(){return this._vertices.values()},r.prototype.edges=function(){return this._edges.values()},r.prototype.getNearestDefinition=function(t){if(void 0===t&&(t=!1),this.hasECLDefinition())return this.getECLDefinition();var e=this.vertices();t&&(e=e.reverse());var r=null;return e.some(function(e){return!!(r=e.getNearestDefinition(t))}),r},r}(w),m=function(t){function r(e,r,n,o,i){var s=t.call(this,e,r,n,i)||this;return s.inEdges=[],s.outEdges=[],s._label=o,r.addVertex(s),s}return e(r,t),r.prototype.destroy=function(){var t=this;this._parent&&this._parent.removeVertex(this),this.inEdges.forEach(function(e){return t._graph.destroyEdge(e)}),this.outEdges.forEach(function(e){return t._graph.destroyEdge(e)})},r.prototype.label=function(){return this._label},r.prototype.addInEdge=function(t){this.inEdges.push(t)},r.prototype.removeInEdge=function(t){var e=this.inEdges.indexOf(t);if(e<0)throw new Error("In edge does not exist");this.inEdges.splice(e,1)},r.prototype.addOutEdge=function(t){this.outEdges.push(t)},r.prototype.removeOutEdge=function(t){var e=this.outEdges.indexOf(t);if(e<0)throw new Error("Out edge does not exist");this.outEdges.splice(e,1)},r.prototype.getNearestDefinition=function(t){if(void 0===t&&(t=!0),this.hasECLDefinition())return this.getECLDefinition();var e=null;return this.inEdges.some(function(r){return!!(e=r.getNearestDefinition(t))}),e},r}(w),S=function(t){function r(e,r,n,o,i,s){var a=t.call(this,e,r,n,s)||this;if(!o)throw new Error("Missing source vertex");if(!i)throw new Error("Missing target vertex");return r.addEdge(a),a.source=o,a.source.addOutEdge(a),a.target=i,a.target.addInEdge(a),a}return e(r,t),r.prototype.sourceID=function(){return this.source.id()},r.prototype.targetID=function(){return this.target.id()},r.prototype.destroy=function(){this._parent&&this._parent.removeEdge(this),this.source.removeOutEdge(this),this.target.removeInEdge(this)},r.prototype.getNearestDefinition=function(t){return void 0===t&&(t=!1),this.hasECLDefinition()?this.getECLDefinition():this.source.getNearestDefinition(t)},r}(E),O=function(){function t(t,e){this._allSubgraphs=new b,this._allVertices=new b,this._allEdges=new b,this._attrs=new b,this._root=new E(this,null,t,e),this._allSubgraphs.set(t,this._root)}return t.prototype.className=function(){return"Graph"},t.prototype.id=function(){return this._root.id()},t.prototype.attrs=function(){return this._attrs},t.prototype.parent=function(){return null},t.prototype.remove=function(){},t.prototype.subgraphs=function(){return this._root.subgraphs()},t.prototype.vertices=function(){return this._root.vertices()},t.prototype.edges=function(){return this._root.edges()},t.prototype.createSubgraph=function(t,e,r){if(this._allSubgraphs.has(e))throw new Error("Subgraph already exists");var n=new E(this,this._allSubgraphs.get(t.id()),e,r);return this._allSubgraphs.set(e,n),n},t.prototype.destroySubgraph=function(t){var e=this._allSubgraphs.get(t.id());if(!e)throw new Error("Subgraph does not exist");this._allSubgraphs.remove(e.id()),e.destroy()},t.prototype.createVertex=function(t,e,r,n){if(this._allVertices.has(e))throw new Error("Vertex already exists");var o=new m(this,this._allSubgraphs.get(t.id()),e,r,n);return this._allVertices.set(e,o),o},t.prototype.destroyVertex=function(t){var e=this._allVertices.get(t.id());if(!e)throw new Error("Vertex does not exist");this._allVertices.remove(e.id()),e.destroy()},t.prototype.createEdge=function(t,e,r,n,o){if(this._allEdges.has(e))throw new Error("Edge already exists");var i=new S(this,this._allSubgraphs.get(t.id()),e,this._allVertices.get(r),this._allVertices.get(n),o);return this._allEdges.set(e,i),i},t.prototype.destroyEdge=function(t){var e=this._allEdges.get(t.id());if(!e)throw new Error("Edge does not exist");this._allEdges.remove(e.id()),e.destroy()},t.prototype.allSubgraph=function(t){return this._allSubgraphs.get(t)},t.prototype.allSubgraphs=function(){var t=this;return this._allSubgraphs.values().filter(function(e){return e!==t._root})},t.prototype.allVertex=function(t){return this._allVertices.get(t)},t.prototype.allVertices=function(){return this._allVertices.values()},t.prototype.allEdge=function(t){return this._allEdges.get(t)},t.prototype.allEdges=function(){return this._allEdges.values()},t.prototype.getNearestDefinition=function(t){return void 0===t&&(t=!1),this._root.getNearestDefinition(t)},t.prototype.breakpointLocations=function(t){for(var e=[],r=0,n=this._allVertices.values();r<n.length;r++){var o=n[r];if(o.hasECLDefinition()){var i=o.getECLDefinition();(i&&!t||t===i.file)&&e.push(i)}}return e.sort(function(t,e){return t.line-e.line})},t}(),x=function(){function t(){this.stack=[]}return t.prototype.push=function(t){return this.stack.push(t),t},t.prototype.pop=function(){return this.stack.pop()},t.prototype.top=function(){return this.stack.length?this.stack[this.stack.length-1]:void 0},t.prototype.depth=function(){return this.stack.length},t}(),D=new Function("try{return global;}catch(e){return window;}")(),L=new Function("try{return this===window;}catch(e){return false;}"),I=new Function("try{return this===global;}catch(e){return false;}"),k=new Function("try{return process.env.TRAVIS;}catch(e){return false;}");!function(t){t[t.debug=0]="debug",t[t.info=1]="info",t[t.notice=2]="notice",t[t.warning=3]="warning",t[t.error=4]="error",t[t.critical=5]="critical",t[t.alert=6]="alert",t[t.emergency=7]="emergency"}(t.Level||(t.Level={}));var N={debug:"cyan",info:"green",notice:"grey",warning:"blue",error:"red",critical:"magenta",alert:"magenta",emergency:"magenta"},V=function(){function e(){}return e.prototype.write=function(e,r,n,o){I?console.log("["+e+"] "+t.Level[r].toUpperCase()+" "+n+": "+o):console.log("["+e+"] %c"+t.Level[r].toUpperCase()+"%c "+n+": "+o,"color:"+N[t.Level[r]],"")},e}(),C=function(){function e(){this._levelStack=new x,this._level=t.Level.info,this._filter="",this._writer=new V}return e.Instance=function(){return this._instance||(this._instance=new this)},e.prototype.stringify=function(t){var e=[];return JSON.stringify(t,function(t,r){if("object"==typeof r&&null!==r){if(-1!==e.indexOf(r))return;e.push(r)}return r},2)},e.prototype.writer=function(t){return void 0===t?this._writer:(this._writer=t,this)},e.prototype.log=function(t,e,r){t<this._level||this._filter&&this._filter!==e||("string"!=typeof r&&(r=this.stringify(r)),this._writer.write((new Date).toISOString(),t,e,r))},e.prototype.debug=function(e,r){this.log(t.Level.debug,e,r)},e.prototype.info=function(e,r){this.log(t.Level.info,e,r)},e.prototype.notice=function(e,r){this.log(t.Level.notice,e,r)},e.prototype.warning=function(e,r){this.log(t.Level.warning,e,r)},e.prototype.error=function(e,r){this.log(t.Level.error,e,r)},e.prototype.critical=function(e,r){this.log(t.Level.critical,e,r)},e.prototype.alert=function(e,r){this.log(t.Level.alert,e,r)},e.prototype.emergency=function(e,r){this.log(t.Level.emergency,e,r)},e.prototype.level=function(t){return void 0===t?this._level:(this._level=t,this)},e.prototype.pushLevel=function(t){return this._levelStack.push(this._level),this._level=t,this},e.prototype.popLevel=function(){return this._level=this._levelStack.pop(),this},e.prototype.filter=function(t){return void 0===t?this._filter:(this._filter=t,this)},e}(),j=C.Instance(),M=function(){function t(t){this._scopeID=t}return t.prototype.debug=function(t){j.debug(this._scopeID,t)},t.prototype.info=function(t){j.info(this._scopeID,t)},t.prototype.notice=function(t){j.notice(this._scopeID,t)},t.prototype.warning=function(t){j.warning(this._scopeID,t)},t.prototype.error=function(t){j.error(this._scopeID,t)},t.prototype.critical=function(t){j.critical(this._scopeID,t)},t.prototype.alert=function(t){j.alert(this._scopeID,t)},t.prototype.emergency=function(t){j.emergency(this._scopeID,t)},t.prototype.pushLevel=function(t){return j.pushLevel(t),this},t.prototype.popLevel=function(){return j.popLevel(),this},t}(),P=function(){function t(t,e,r){this.eventTarget=t,this.eventID=e,this.callback=r}return t.prototype.release=function(){this.eventTarget.removeObserver(this.eventID,this.callback)},t.prototype.unwatch=function(){this.release()},t}(),T=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._eventObservers={},this._knownEvents=t}return t.prototype.addObserver=function(t,e){var r=this._eventObservers[t];return r||(r=[],this._eventObservers[t]=r),r.push(e),new P(this,t,e)},t.prototype.removeObserver=function(t,e){var r=this._eventObservers[t];if(r)for(var n=r.length-1;n>=0;--n)r[n]===e&&r.splice(n,1);return this},t.prototype.dispatchEvent=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=this._eventObservers[t];if(n)for(var o=0,i=n;o<i.length;o++)i[o].apply(void 0,e);return this},t.prototype._hasObserver=function(t){var e=this._eventObservers[t];for(var r in e)if(e[r])return!0;return!1},t.prototype.hasObserver=function(t){if(void 0!==t)return this._hasObserver(t);for(var e in this._eventObservers)if(this._hasObserver(e))return!0;return!1},t}(),X=function(){function t(t){this.name="",this.$={},this._children=[],this.content="",this.name=t}return t.prototype.appendAttribute=function(t,e){this.$[t]=e},t.prototype.appendContent=function(t){this.content+=t},t.prototype.appendChild=function(t){this._children.push(t)},t.prototype.children=function(t){return void 0===t?this._children:this._children.filter(function(e){return e.name===t})},t}(),F=function(){function t(){this.stack=new x}return t.prototype.walkDoc=function(t){var e=this._startXMLNode(t);if(t.attributes)for(n=0;n<t.attributes.length;++n){var r=t.attributes.item(n);this.attributes(r.nodeName,r.nodeValue)}if(this.startXMLNode(e),t.childNodes)for(var n=0;n<t.childNodes.length;++n){var o=t.childNodes.item(n);o.nodeType===o.TEXT_NODE?this.characters(o.nodeValue):this.walkDoc(o)}this.endXMLNode(this.stack.pop())},t.prototype._startXMLNode=function(t){var e=new X(t.nodeName);return this.stack.depth()?this.stack.top().appendChild(e):this.root=e,this.stack.push(e)},t.prototype.parse=function(t){var e=(new DOMParser).parseFromString(t,"application/xml");this.startDocument(),this.walkDoc(e),this.endDocument()},t.prototype.startDocument=function(){},t.prototype.endDocument=function(){},t.prototype.startXMLNode=function(t){},t.prototype.endXMLNode=function(t){},t.prototype.attributes=function(t,e){this.stack.top().appendAttribute(t,e)},t.prototype.characters=function(t){this.stack.top().appendContent(t)},t}(),A=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return e(r,t),r.prototype.startXMLNode=function(e){t.prototype.startXMLNode.call(this,e),e.name},r.prototype.endXMLNode=function(e){e.name,t.prototype.endXMLNode.call(this,e)},r}(F),R=function(){function t(){this._espState={},this._espStateCache={},this._events=new T}return t.prototype.clear=function(t){this._espState={},this._espStateCache={},void 0!==t&&this.set(t)},t.prototype.get=function(t,e){return void 0===t?this._espState:this.has(t)?this._espState[t]:e},t.prototype.set=function(t,e,r){return void 0===r&&(r=!1),"string"==typeof t?this.setSingle(t,e,r):this.setAll(t)},t.prototype.setSingle=function(t,e,r){var n=this._espStateCache[t],o=h(e);if(n!==o){this._espStateCache[t]=o;var i=this._espState[t];this._espState[t]=e;var s={id:t,oldValue:i,newValue:e};return r||(this._events.dispatchEvent("propChanged",s),this._events.dispatchEvent("changed",[s])),s}return null},t.prototype.setAll=function(t){var e=[];for(var r in t)if(t.hasOwnProperty(r)){var n=this.setSingle(r,t[r],!0);n&&e.push(n)}if(e.length){for(var o=0,i=e;o<i.length;o++){var s=i[o];this._events.dispatchEvent("propChanged",s)}this._events.dispatchEvent("changed",e)}return e},t.prototype.has=function(t){return void 0!==this._espState[t]},t.prototype.addObserver=function(t,e,r){if(this.isCallback(e)){if("changed"!==t)throw new Error("Invalid eventID: "+t);return this._events.addObserver(t,e)}if("propChanged"!==t)throw new Error("Invalid eventID: "+t);return this._events.addObserver(t,function(t){t.id===e&&r(t)})},t.prototype.on=function(t,e,r){if(this.isCallback(e))switch(t){case"changed":this._events.addObserver(t,e)}else switch(t){case"propChanged":this._events.addObserver(t,function(t){t.id===e&&r(t)})}return this},t.prototype.isCallback=function(t){return"function"==typeof t},t.prototype.hasEventListener=function(){return this._events.hasObserver()},t}();t.find=function(t,e){if(null==t)throw new TypeError('"o" is null or not defined');var r=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var n=arguments[1],o=0;o<r;){var i=t[o];if(e.call(n,i,o,t))return i;o++}},t.compare=function(t,e){for(var r={unchanged:[],removed:[],added:e.slice(0)},n=0,o=t;n<o.length;n++){var i=o[n],s=r.added.indexOf(i);s>=0?(r.unchanged.push(i),r.added.splice(s,1)):r.removed.push(i)}return r},t.Cache=_,t.Dictionary=b,t.espTime2Seconds=function(t){if(!t)return 0;if(!isNaN(Number(t)))return Number(t);var e=t.indexOf("ns");if(-1!==e)return parseFloat(t.substr(0,e))/1e9;var r=t.indexOf("ms");if(-1!==r)return parseFloat(t.substr(0,r))/1e3;var n=t.indexOf("s");if(-1!==n&&-1===t.indexOf("days"))return parseFloat(t.substr(0,n));for(var o=t.split(" days "),i=o.length>1?parseFloat(o[0]):0,s=0,a=(o.length>1?o[1]:o[0]).split(":").reverse(),u=0;u<a.length;++u)s+=parseFloat(a[u])*Math.pow(60,u);return 24*i*60*60+s},t.Graph=O,t.hashSum=h,t.Logging=C,t.logger=j,t.ScopedLogging=M,t.scopedLogger=function(t,e){return void 0===e&&(e=!0),e&&j.filter(t),new M(t)},t.inner=p,t.exists=function(t,e){return void 0!==p(t,e)},t.deepMixin=l,t.deepMixinT=function(t){void 0===t&&(t={});for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return l.apply(void 0,[t].concat(e))},t.Observable=T,t.root=D,t.isBrowser=L,t.isNode=I,t.isTravis=k,t.XMLNode=X,t.SAXStackParser=F,t.xml2json=function(t){var e=new A;return e.parse(t),e.root},t.Stack=x,t.StateObject=R,t.trim=d,t.endsWith=v,t.join=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(t.length&&t[0].length&&"/"===t[0].charAt(0)?"/":"")+t.map(function(t){return d(t,"/")}).join("/")},t.__extends=e,t.__assign=y,t.__rest=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&(r[n[o]]=t[n[o]]);return r},t.__decorate=function(t,e,r,n){var o,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},t.__param=function(t,e){return function(r,n){e(r,n,t)}},t.__metadata=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},t.__awaiter=function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){t.done?o(t.value):new r(function(e){e(t.value)}).then(s,a)}u((n=n.apply(t,e||[])).next())})},t.__generator=function(t,e){function r(t){return function(e){return n([t,e])}}function n(r){if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,i&&(s=i[2&r[0]?"return":r[0]?"throw":"next"])&&!(s=s.call(i,r[1])).done)return s;switch(i=0,s&&(r=[0,s.value]),r[0]){case 0:case 1:s=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,i=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(s=u.trys,!(s=s.length>0&&s[s.length-1])&&(6===r[0]||2===r[0])){u=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){u.label=r[1];break}if(6===r[0]&&u.label<s[1]){u.label=s[1],s=r;break}if(s&&u.label<s[2]){u.label=s[2],u.ops.push(r);break}s[2]&&u.ops.pop(),u.trys.pop();continue}r=e.call(t,u)}catch(t){r=[6,t],i=0}finally{o=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var o,i,s,a,u={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a},t.__exportStar=function(t,e){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])},t.__values=r,t.__read=n,t.__spread=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(n(arguments[e]));return t},t.__await=o,t.__asyncGenerator=function(t,e,r){function n(t){p[t]&&(h[t]=function(e){return new Promise(function(r,n){f.push([t,e,r,n])>1||i(t,e)})})}function i(t,e){try{s(p[t](e))}catch(t){c(f[0][3],t)}}function s(t){t.value instanceof o?Promise.resolve(t.value.v).then(a,u):c(f[0][2],t)}function a(t){i("next",t)}function u(t){i("throw",t)}function c(t,e){t(e),f.shift(),f.length&&i(f[0][0],f[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var h,p=r.apply(t,e||[]),f=[];return h={},n("next"),n("throw"),n("return"),h[Symbol.asyncIterator]=function(){return this},h},t.__asyncDelegator=function(t){function e(e,i){t[e]&&(r[e]=function(r){return(n=!n)?{value:o(t[e](r)),done:"return"===e}:i?i(r):r})}var r,n;return r={},e("next"),e("throw",function(t){throw t}),e("return"),r[Symbol.iterator]=function(){return this},r},t.__asyncValues=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator];return e?e.call(t):"function"==typeof r?r(t):t[Symbol.iterator]()},Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t["@hpcc-js/util"]={})}(this,function(t){"use strict";function e(t,e){function r(){this.constructor=t}g(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function r(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function n(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function o(t){return this instanceof o?(this.v=t,this):new o(t)}function i(t,e){for(;t.length<e;)t="0"+t;return t}function s(t,e){if(0===e.length)return t;for(var r=0;r<e.length;++r)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t<0?-2*t:t}function a(t,e,r){return Object.keys(e).sort().reduce(function(t,n){return u(t,e[n],n,r)},t)}function u(t,e,r,n){var o=s(s(s(t,r),c(e)),typeof e);return null===e?s(o,"null"):void 0===e?s(o,"undefined"):"object"==typeof e?-1!==n.indexOf(e)?s(o,"[Circular]"+r):(n.push(e),a(o,e,n)):s(o,e.toString())}function c(t){return Object.prototype.toString.call(t)}function h(t){return i(u(0,t,"",[]).toString(16),8)}function p(t,e){if(void 0!==t&&void 0!==e){for(var r=0,n=t.split(".");r<n.length;r++){var o=n[r];if(!e.hasOwnProperty(o))return;e=e[o]}return e}}function f(t,e){var r={};for(var n in e){var o=e[n];o instanceof Array||"object"==typeof o&&(o=l(t[n],o)),n in t&&(t[n]===o||n in r&&r[n]===o)||(t[n]=o)}return t}function l(t){void 0===t&&(t={});for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if("object"!=typeof t)throw new Error('Destination "'+t+'" must be an object.');for(var n=0,o=e;n<o.length;n++)f(t,o[n]);return t}function d(t,e){if("string"!=typeof e)return t;if(0===e.length)return t;for(;0===t.indexOf(e);)t=t.substring(1);for(;v(t,e);)t=t.substring(0,t.length-1);return t}function v(t,e,r){var n=t.toString();("number"!=typeof r||!isFinite(r)||Math.floor(r)!==r||r>n.length)&&(r=n.length),r-=e.length;var o=n.lastIndexOf(e,r);return-1!==o&&o===r}var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},y=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},_=function(){function t(t){this._cache={},this._calcID=t}return t.hash=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return h(y({},t))},t.prototype.has=function(t){return this._calcID(t)in this._cache},t.prototype.set=function(t){return this._cache[this._calcID(t)]=t,t},t.prototype.get=function(t,e){var r=this._cache[this._calcID(t)];return r||(e?this.set(e()):null)},t}(),b=function(){function t(t){this._cache={},this._calcID=t}return t.hash=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return h(y({},t))},t.prototype.has=function(t){return this._calcID(t)in this._cache},t.prototype.set=function(t,e){return this._cache[this._calcID(t)]=e,e},t.prototype.get=function(t,e){var r=this._cache[this._calcID(t)];return r||(e?this.set(t,e()):Promise.resolve(null))},t}(),w=function(){function t(t){if(this.store={},t)for(var e in t)this.set(e,t[e])}return t.prototype.set=function(t,e){var r=this.store[t];return this.store[t]=e,r},t.prototype.get=function(t){return this.store[t]},t.prototype.has=function(t){return void 0!==this.store[t]},t.prototype.remove=function(t){delete this.store[t]},t.prototype.keys=function(){var t=[];for(var e in this.store)t.push(e);return t},t.prototype.values=function(){var t=[];for(var e in this.store)t.push(this.store[e]);return t},t}(),E=function(){function t(t,e,r,n){this._graph=t,this._parent=e,this._id=r,this._attrs=new w(n)}return t.prototype.className=function(){return this.constructor.name},t.prototype.id=function(){return this._id},t.prototype.attrs=function(){return this._attrs},t.prototype.parent=function(){return this._parent},t.prototype.hasECLDefinition=function(){return void 0!==this._attrs.get("definition")},t.prototype.getECLDefinition=function(){var t=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(this._attrs.get("definition"));if(t){var e=t[1],r=t[2],n=t[3];return e.replace("/./","/"),{id:this.id(),file:e,line:+r,column:+n}}throw new Error("Bad definition: "+this._attrs.get("definition"))},t}(),m=function(t){function r(e,r,n,o){void 0===o&&(o={});var i=t.call(this,e,r,n,o)||this;return i._subgraphs=new w,i._vertices=new w,i._edges=new w,r&&r.addSubgraph(i),i}return e(r,t),r.prototype.destroy=function(){var t=this;this._parent&&this._parent.removeSubgraph(this),this._edges.values().forEach(function(e){return t._graph.destroyEdge(e)}),this._vertices.values().forEach(function(e){return t._graph.destroyVertex(e)}),this._subgraphs.values().forEach(function(e){return t._graph.destroySubgraph(e)})},r.prototype.remove=function(){this._graph.destroySubgraph(this)},r.prototype.createSubgraph=function(t,e){return this._graph.createSubgraph(this,t,e)},r.prototype.addSubgraph=function(t){if(this._subgraphs.has(t.id()))throw new Error("Subgraph already exists");this._subgraphs.set(t.id(),t)},r.prototype.removeSubgraph=function(t){if(!this._subgraphs.has(t.id()))throw new Error("Subgraph does not exist");this._subgraphs.remove(t.id())},r.prototype.createVertex=function(t,e,r){return this._graph.createVertex(this,t,e,r)},r.prototype.addVertex=function(t){if(this._vertices.has(t.id()))throw new Error("Vertex already exists");this._vertices.set(t.id(),t)},r.prototype.removeVertex=function(t){if(!this._vertices.has(t.id()))throw new Error("Vertex does not exist");this._vertices.remove(t.id())},r.prototype.createEdge=function(t,e,r,n){return this._graph.createEdge(this,t,e,r,n)},r.prototype.addEdge=function(t){if(this._edges.has(t.id()))throw new Error("Edge already exists");this._edges.set(t.id(),t)},r.prototype.removeEdge=function(t){if(!this._edges.has(t.id()))throw new Error("Edge does not exist");this._edges.remove(t.id())},r.prototype.add=function(t){t instanceof r?this.addSubgraph(t):t instanceof S?this.addVertex(t):this.addEdge(t)},r.prototype.subgraphs=function(){return this._subgraphs.values()},r.prototype.vertices=function(){return this._vertices.values()},r.prototype.edges=function(){return this._edges.values()},r.prototype.getNearestDefinition=function(t){if(void 0===t&&(t=!1),this.hasECLDefinition())return this.getECLDefinition();var e=this.vertices();t&&(e=e.reverse());var r=null;return e.some(function(e){return!!(r=e.getNearestDefinition(t))}),r},r}(E),S=function(t){function r(e,r,n,o,i){var s=t.call(this,e,r,n,i)||this;return s.inEdges=[],s.outEdges=[],s._label=o,r.addVertex(s),s}return e(r,t),r.prototype.destroy=function(){var t=this;this._parent&&this._parent.removeVertex(this),this.inEdges.forEach(function(e){return t._graph.destroyEdge(e)}),this.outEdges.forEach(function(e){return t._graph.destroyEdge(e)})},r.prototype.label=function(){return this._label},r.prototype.addInEdge=function(t){this.inEdges.push(t)},r.prototype.removeInEdge=function(t){var e=this.inEdges.indexOf(t);if(e<0)throw new Error("In edge does not exist");this.inEdges.splice(e,1)},r.prototype.addOutEdge=function(t){this.outEdges.push(t)},r.prototype.removeOutEdge=function(t){var e=this.outEdges.indexOf(t);if(e<0)throw new Error("Out edge does not exist");this.outEdges.splice(e,1)},r.prototype.getNearestDefinition=function(t){if(void 0===t&&(t=!0),this.hasECLDefinition())return this.getECLDefinition();var e=null;return this.inEdges.some(function(r){return!!(e=r.getNearestDefinition(t))}),e},r}(E),O=function(t){function r(e,r,n,o,i,s){var a=t.call(this,e,r,n,s)||this;if(!o)throw new Error("Missing source vertex");if(!i)throw new Error("Missing target vertex");return r.addEdge(a),a.source=o,a.source.addOutEdge(a),a.target=i,a.target.addInEdge(a),a}return e(r,t),r.prototype.sourceID=function(){return this.source.id()},r.prototype.targetID=function(){return this.target.id()},r.prototype.destroy=function(){this._parent&&this._parent.removeEdge(this),this.source.removeOutEdge(this),this.target.removeInEdge(this)},r.prototype.getNearestDefinition=function(t){return void 0===t&&(t=!1),this.hasECLDefinition()?this.getECLDefinition():this.source.getNearestDefinition(t)},r}(m),x=function(){function t(t,e){this._allSubgraphs=new w,this._allVertices=new w,this._allEdges=new w,this._attrs=new w,this._root=new m(this,null,t,e),this._allSubgraphs.set(t,this._root)}return t.prototype.className=function(){return"Graph"},t.prototype.id=function(){return this._root.id()},t.prototype.attrs=function(){return this._attrs},t.prototype.parent=function(){return null},t.prototype.remove=function(){},t.prototype.subgraphs=function(){return this._root.subgraphs()},t.prototype.vertices=function(){return this._root.vertices()},t.prototype.edges=function(){return this._root.edges()},t.prototype.createSubgraph=function(t,e,r){if(this._allSubgraphs.has(e))throw new Error("Subgraph already exists");var n=new m(this,this._allSubgraphs.get(t.id()),e,r);return this._allSubgraphs.set(e,n),n},t.prototype.destroySubgraph=function(t){var e=this._allSubgraphs.get(t.id());if(!e)throw new Error("Subgraph does not exist");this._allSubgraphs.remove(e.id()),e.destroy()},t.prototype.createVertex=function(t,e,r,n){if(this._allVertices.has(e))throw new Error("Vertex already exists");var o=new S(this,this._allSubgraphs.get(t.id()),e,r,n);return this._allVertices.set(e,o),o},t.prototype.destroyVertex=function(t){var e=this._allVertices.get(t.id());if(!e)throw new Error("Vertex does not exist");this._allVertices.remove(e.id()),e.destroy()},t.prototype.createEdge=function(t,e,r,n,o){if(this._allEdges.has(e))throw new Error("Edge already exists");var i=new O(this,this._allSubgraphs.get(t.id()),e,this._allVertices.get(r),this._allVertices.get(n),o);return this._allEdges.set(e,i),i},t.prototype.destroyEdge=function(t){var e=this._allEdges.get(t.id());if(!e)throw new Error("Edge does not exist");this._allEdges.remove(e.id()),e.destroy()},t.prototype.allSubgraph=function(t){return this._allSubgraphs.get(t)},t.prototype.allSubgraphs=function(){var t=this;return this._allSubgraphs.values().filter(function(e){return e!==t._root})},t.prototype.allVertex=function(t){return this._allVertices.get(t)},t.prototype.allVertices=function(){return this._allVertices.values()},t.prototype.allEdge=function(t){return this._allEdges.get(t)},t.prototype.allEdges=function(){return this._allEdges.values()},t.prototype.getNearestDefinition=function(t){return void 0===t&&(t=!1),this._root.getNearestDefinition(t)},t.prototype.breakpointLocations=function(t){for(var e=[],r=0,n=this._allVertices.values();r<n.length;r++){var o=n[r];if(o.hasECLDefinition()){var i=o.getECLDefinition();(i&&!t||t===i.file)&&e.push(i)}}return e.sort(function(t,e){return t.line-e.line})},t}(),D=function(){function t(){this.stack=[]}return t.prototype.push=function(t){return this.stack.push(t),t},t.prototype.pop=function(){return this.stack.pop()},t.prototype.top=function(){return this.stack.length?this.stack[this.stack.length-1]:void 0},t.prototype.depth=function(){return this.stack.length},t}(),L=new Function("try{return global;}catch(e){return window;}")(),I=new Function("try{return this===window;}catch(e){return false;}"),k=new Function("try{return this===global;}catch(e){return false;}"),N=new Function("try{return process.env.TRAVIS;}catch(e){return false;}");!function(t){t[t.debug=0]="debug",t[t.info=1]="info",t[t.notice=2]="notice",t[t.warning=3]="warning",t[t.error=4]="error",t[t.critical=5]="critical",t[t.alert=6]="alert",t[t.emergency=7]="emergency"}(t.Level||(t.Level={}));var V={debug:"cyan",info:"green",notice:"grey",warning:"blue",error:"red",critical:"magenta",alert:"magenta",emergency:"magenta"},C=function(){function e(){}return e.prototype.write=function(e,r,n,o){k?console.log("["+e+"] "+t.Level[r].toUpperCase()+" "+n+": "+o):console.log("["+e+"] %c"+t.Level[r].toUpperCase()+"%c "+n+": "+o,"color:"+V[t.Level[r]],"")},e}(),j=function(){function e(){this._levelStack=new D,this._level=t.Level.info,this._filter="",this._writer=new C}return e.Instance=function(){return this._instance||(this._instance=new this)},e.prototype.stringify=function(t){var e=[];return JSON.stringify(t,function(t,r){if("object"==typeof r&&null!==r){if(-1!==e.indexOf(r))return;e.push(r)}return r},2)},e.prototype.writer=function(t){return void 0===t?this._writer:(this._writer=t,this)},e.prototype.log=function(t,e,r){t<this._level||this._filter&&this._filter!==e||("string"!=typeof r&&(r=this.stringify(r)),this._writer.write((new Date).toISOString(),t,e,r))},e.prototype.debug=function(e,r){this.log(t.Level.debug,e,r)},e.prototype.info=function(e,r){this.log(t.Level.info,e,r)},e.prototype.notice=function(e,r){this.log(t.Level.notice,e,r)},e.prototype.warning=function(e,r){this.log(t.Level.warning,e,r)},e.prototype.error=function(e,r){this.log(t.Level.error,e,r)},e.prototype.critical=function(e,r){this.log(t.Level.critical,e,r)},e.prototype.alert=function(e,r){this.log(t.Level.alert,e,r)},e.prototype.emergency=function(e,r){this.log(t.Level.emergency,e,r)},e.prototype.level=function(t){return void 0===t?this._level:(this._level=t,this)},e.prototype.pushLevel=function(t){return this._levelStack.push(this._level),this._level=t,this},e.prototype.popLevel=function(){return this._level=this._levelStack.pop(),this},e.prototype.filter=function(t){return void 0===t?this._filter:(this._filter=t,this)},e}(),M=j.Instance(),P=function(){function t(t){this._scopeID=t}return t.prototype.debug=function(t){M.debug(this._scopeID,t)},t.prototype.info=function(t){M.info(this._scopeID,t)},t.prototype.notice=function(t){M.notice(this._scopeID,t)},t.prototype.warning=function(t){M.warning(this._scopeID,t)},t.prototype.error=function(t){M.error(this._scopeID,t)},t.prototype.critical=function(t){M.critical(this._scopeID,t)},t.prototype.alert=function(t){M.alert(this._scopeID,t)},t.prototype.emergency=function(t){M.emergency(this._scopeID,t)},t.prototype.pushLevel=function(t){return M.pushLevel(t),this},t.prototype.popLevel=function(){return M.popLevel(),this},t}(),T=function(){function t(t,e,r){this.eventTarget=t,this.eventID=e,this.callback=r}return t.prototype.release=function(){this.eventTarget.removeObserver(this.eventID,this.callback)},t.prototype.unwatch=function(){this.release()},t}(),X=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._eventObservers={},this._knownEvents=t}return t.prototype.addObserver=function(t,e){var r=this._eventObservers[t];return r||(r=[],this._eventObservers[t]=r),r.push(e),new T(this,t,e)},t.prototype.removeObserver=function(t,e){var r=this._eventObservers[t];if(r)for(var n=r.length-1;n>=0;--n)r[n]===e&&r.splice(n,1);return this},t.prototype.dispatchEvent=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=this._eventObservers[t];if(n)for(var o=0,i=n;o<i.length;o++)i[o].apply(void 0,e);return this},t.prototype._hasObserver=function(t){var e=this._eventObservers[t];for(var r in e)if(e[r])return!0;return!1},t.prototype.hasObserver=function(t){if(void 0!==t)return this._hasObserver(t);for(var e in this._eventObservers)if(this._hasObserver(e))return!0;return!1},t}(),A=function(){function t(t){this.name="",this.$={},this._children=[],this.content="",this.name=t}return t.prototype.appendAttribute=function(t,e){this.$[t]=e},t.prototype.appendContent=function(t){this.content+=t},t.prototype.appendChild=function(t){this._children.push(t)},t.prototype.children=function(t){return void 0===t?this._children:this._children.filter(function(e){return e.name===t})},t}(),F=function(){function t(){this.stack=new D}return t.prototype.walkDoc=function(t){var e=this._startXMLNode(t);if(t.attributes)for(n=0;n<t.attributes.length;++n){var r=t.attributes.item(n);this.attributes(r.nodeName,r.nodeValue)}if(this.startXMLNode(e),t.childNodes)for(var n=0;n<t.childNodes.length;++n){var o=t.childNodes.item(n);o.nodeType===o.TEXT_NODE?this.characters(o.nodeValue):this.walkDoc(o)}this.endXMLNode(this.stack.pop())},t.prototype._startXMLNode=function(t){var e=new A(t.nodeName);return this.stack.depth()?this.stack.top().appendChild(e):this.root=e,this.stack.push(e)},t.prototype.parse=function(t){var e=(new DOMParser).parseFromString(t,"application/xml");this.startDocument(),this.walkDoc(e),this.endDocument()},t.prototype.startDocument=function(){},t.prototype.endDocument=function(){},t.prototype.startXMLNode=function(t){},t.prototype.endXMLNode=function(t){},t.prototype.attributes=function(t,e){this.stack.top().appendAttribute(t,e)},t.prototype.characters=function(t){this.stack.top().appendContent(t)},t}(),R=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return e(r,t),r.prototype.startXMLNode=function(e){t.prototype.startXMLNode.call(this,e),e.name},r.prototype.endXMLNode=function(e){e.name,t.prototype.endXMLNode.call(this,e)},r}(F),G=function(){function t(){this._espState={},this._espStateCache={},this._events=new X}return t.prototype.clear=function(t){this._espState={},this._espStateCache={},void 0!==t&&this.set(t)},t.prototype.get=function(t,e){return void 0===t?this._espState:this.has(t)?this._espState[t]:e},t.prototype.set=function(t,e,r){return void 0===r&&(r=!1),"string"==typeof t?this.setSingle(t,e,r):this.setAll(t)},t.prototype.setSingle=function(t,e,r){var n=this._espStateCache[t],o=h(e);if(n!==o){this._espStateCache[t]=o;var i=this._espState[t];this._espState[t]=e;var s={id:t,oldValue:i,newValue:e};return r||(this._events.dispatchEvent("propChanged",s),this._events.dispatchEvent("changed",[s])),s}return null},t.prototype.setAll=function(t){var e=[];for(var r in t)if(t.hasOwnProperty(r)){var n=this.setSingle(r,t[r],!0);n&&e.push(n)}if(e.length){for(var o=0,i=e;o<i.length;o++){var s=i[o];this._events.dispatchEvent("propChanged",s)}this._events.dispatchEvent("changed",e)}return e},t.prototype.has=function(t){return void 0!==this._espState[t]},t.prototype.addObserver=function(t,e,r){if(this.isCallback(e)){if("changed"!==t)throw new Error("Invalid eventID: "+t);return this._events.addObserver(t,e)}if("propChanged"!==t)throw new Error("Invalid eventID: "+t);return this._events.addObserver(t,function(t){t.id===e&&r(t)})},t.prototype.on=function(t,e,r){if(this.isCallback(e))switch(t){case"changed":this._events.addObserver(t,e)}else switch(t){case"propChanged":this._events.addObserver(t,function(t){t.id===e&&r(t)})}return this},t.prototype.isCallback=function(t){return"function"==typeof t},t.prototype.hasEventListener=function(){return this._events.hasObserver()},t}();t.find=function(t,e){if(null==t)throw new TypeError('"o" is null or not defined');var r=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var n=arguments[1],o=0;o<r;){var i=t[o];if(e.call(n,i,o,t))return i;o++}},t.compare=function(t,e){for(var r={unchanged:[],removed:[],added:e.slice(0)},n=0,o=t;n<o.length;n++){var i=o[n],s=r.added.indexOf(i);s>=0?(r.unchanged.push(i),r.added.splice(s,1)):r.removed.push(i)}return r},t.Cache=_,t.AsyncCache=b,t.Dictionary=w,t.espTime2Seconds=function(t){if(!t)return 0;if(!isNaN(Number(t)))return Number(t);var e=t.indexOf("ns");if(-1!==e)return parseFloat(t.substr(0,e))/1e9;var r=t.indexOf("ms");if(-1!==r)return parseFloat(t.substr(0,r))/1e3;var n=t.indexOf("s");if(-1!==n&&-1===t.indexOf("days"))return parseFloat(t.substr(0,n));for(var o=t.split(" days "),i=o.length>1?parseFloat(o[0]):0,s=0,a=(o.length>1?o[1]:o[0]).split(":").reverse(),u=0;u<a.length;++u)s+=parseFloat(a[u])*Math.pow(60,u);return 24*i*60*60+s},t.Graph=x,t.hashSum=h,t.Logging=j,t.logger=M,t.ScopedLogging=P,t.scopedLogger=function(t,e){return void 0===e&&(e=!0),e&&M.filter(t),new P(t)},t.inner=p,t.exists=function(t,e){return void 0!==p(t,e)},t.deepMixin=l,t.deepMixinT=function(t){void 0===t&&(t={});for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return l.apply(void 0,[t].concat(e))},t.safeStringify=function(t){var e=[];return JSON.stringify(t,function(t,r){if("object"==typeof r&&null!==r){if(-1!==e.indexOf(r))return;e.push(r)}return r})},t.Observable=X,t.root=L,t.isBrowser=I,t.isNode=k,t.isTravis=N,t.XMLNode=A,t.SAXStackParser=F,t.xml2json=function(t){var e=new R;return e.parse(t),e.root},t.Stack=D,t.StateObject=G,t.trim=d,t.endsWith=v,t.join=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(t.length&&t[0].length&&"/"===t[0].charAt(0)?"/":"")+t.map(function(t){return d(t,"/")}).join("/")},t.__extends=e,t.__assign=y,t.__rest=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&(r[n[o]]=t[n[o]]);return r},t.__decorate=function(t,e,r,n){var o,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},t.__param=function(t,e){return function(r,n){e(r,n,t)}},t.__metadata=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},t.__awaiter=function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){t.done?o(t.value):new r(function(e){e(t.value)}).then(s,a)}u((n=n.apply(t,e||[])).next())})},t.__generator=function(t,e){function r(t){return function(e){return n([t,e])}}function n(r){if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,i&&(s=i[2&r[0]?"return":r[0]?"throw":"next"])&&!(s=s.call(i,r[1])).done)return s;switch(i=0,s&&(r=[0,s.value]),r[0]){case 0:case 1:s=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,i=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(s=u.trys,!(s=s.length>0&&s[s.length-1])&&(6===r[0]||2===r[0])){u=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){u.label=r[1];break}if(6===r[0]&&u.label<s[1]){u.label=s[1],s=r;break}if(s&&u.label<s[2]){u.label=s[2],u.ops.push(r);break}s[2]&&u.ops.pop(),u.trys.pop();continue}r=e.call(t,u)}catch(t){r=[6,t],i=0}finally{o=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var o,i,s,a,u={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a},t.__exportStar=function(t,e){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])},t.__values=r,t.__read=n,t.__spread=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(n(arguments[e]));return t},t.__await=o,t.__asyncGenerator=function(t,e,r){function n(t){p[t]&&(h[t]=function(e){return new Promise(function(r,n){f.push([t,e,r,n])>1||i(t,e)})})}function i(t,e){try{s(p[t](e))}catch(t){c(f[0][3],t)}}function s(t){t.value instanceof o?Promise.resolve(t.value.v).then(a,u):c(f[0][2],t)}function a(t){i("next",t)}function u(t){i("throw",t)}function c(t,e){t(e),f.shift(),f.length&&i(f[0][0],f[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var h,p=r.apply(t,e||[]),f=[];return h={},n("next"),n("throw"),n("return"),h[Symbol.asyncIterator]=function(){return this},h},t.__asyncDelegator=function(t){function e(e,i){t[e]&&(r[e]=function(r){return(n=!n)?{value:o(t[e](r)),done:"return"===e}:i?i(r):r})}var r,n;return r={},e("next"),e("throw",function(t){throw t}),e("return"),r[Symbol.iterator]=function(){return this},r},t.__asyncValues=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator];return e?e.call(t):"function"==typeof r?r(t):t[Symbol.iterator]()},Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=util.min.js.map |
@@ -53,1 +53,2 @@ // Based on: https://tc39.github.io/ecma262/#sec-array.prototype.find | ||
} | ||
//# sourceMappingURL=array.js.map |
@@ -8,3 +8,14 @@ export declare class Cache<I, C> { | ||
set(obj: C): C; | ||
get(espObj: I): C | null; | ||
get(espObj: I, factory: () => C): C; | ||
} | ||
export declare class AsyncCache<I, C> { | ||
private _cache; | ||
private _calcID; | ||
static hash(...args: any[]): string; | ||
constructor(calcID: (espObj: I | C) => string); | ||
has(espObj: I): boolean; | ||
set(espObj: I, obj: Promise<C>): Promise<C>; | ||
get(espObj: I): Promise<C | null>; | ||
get(espObj: I, factory: () => Promise<C>): Promise<C>; | ||
} |
import * as tslib_1 from "tslib"; | ||
import { hashSum } from "./hashSum"; | ||
var Cache = (function () { | ||
var Cache = /** @class */ (function () { | ||
function Cache(calcID) { | ||
@@ -25,3 +25,3 @@ this._cache = {}; | ||
if (!retVal) { | ||
return this.set(factory()); | ||
return factory ? this.set(factory()) : null; | ||
} | ||
@@ -33,1 +33,31 @@ return retVal; | ||
export { Cache }; | ||
var AsyncCache = /** @class */ (function () { | ||
function AsyncCache(calcID) { | ||
this._cache = {}; | ||
this._calcID = calcID; | ||
} | ||
AsyncCache.hash = function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return hashSum(tslib_1.__assign({}, args)); | ||
}; | ||
AsyncCache.prototype.has = function (espObj) { | ||
return this._calcID(espObj) in this._cache; | ||
}; | ||
AsyncCache.prototype.set = function (espObj, obj) { | ||
this._cache[this._calcID(espObj)] = obj; | ||
return obj; | ||
}; | ||
AsyncCache.prototype.get = function (espObj, factory) { | ||
var retVal = this._cache[this._calcID(espObj)]; | ||
if (!retVal) { | ||
return factory ? this.set(espObj, factory()) : Promise.resolve(null); | ||
} | ||
return retVal; | ||
}; | ||
return AsyncCache; | ||
}()); | ||
export { AsyncCache }; | ||
//# sourceMappingURL=cache.js.map |
@@ -1,2 +0,2 @@ | ||
var Dictionary = (function () { | ||
var Dictionary = /** @class */ (function () { | ||
function Dictionary(attrs) { | ||
@@ -41,1 +41,2 @@ this.store = {}; | ||
export { Dictionary }; | ||
//# sourceMappingURL=dictionary.js.map |
@@ -33,1 +33,2 @@ export function espTime2Seconds(duration) { | ||
} | ||
//# sourceMappingURL=esp.js.map |
import * as tslib_1 from "tslib"; | ||
import { Dictionary } from "./dictionary"; | ||
var ATTR_DEFINITION = "definition"; | ||
var GraphItem = (function () { | ||
var GraphItem = /** @class */ (function () { | ||
function GraphItem(graph, parent, id, attrs) { | ||
@@ -42,3 +42,3 @@ this._graph = graph; | ||
}()); | ||
var Subgraph = (function (_super) { | ||
var Subgraph = /** @class */ (function (_super) { | ||
tslib_1.__extends(Subgraph, _super); | ||
@@ -155,3 +155,3 @@ function Subgraph(graph, parent, id, attrs) { | ||
}(GraphItem)); | ||
var Vertex = (function (_super) { | ||
var Vertex = /** @class */ (function (_super) { | ||
tslib_1.__extends(Vertex, _super); | ||
@@ -214,3 +214,3 @@ function Vertex(graph, parent, id, label, attrs) { | ||
}(GraphItem)); | ||
var Edge = (function (_super) { | ||
var Edge = /** @class */ (function (_super) { | ||
tslib_1.__extends(Edge, _super); | ||
@@ -254,3 +254,3 @@ function Edge(graph, parent, id, source, target, attrs) { | ||
}(Subgraph)); | ||
var Graph = (function () { | ||
var Graph = /** @class */ (function () { | ||
function Graph(id, attrs) { | ||
@@ -377,1 +377,2 @@ this._allSubgraphs = new Dictionary(); | ||
export { Graph }; | ||
//# sourceMappingURL=graph.js.map |
@@ -49,1 +49,2 @@ // Ported to TypeScript from: https://github.com/bevacqua/hash-sum | ||
} | ||
//# sourceMappingURL=hashSum.js.map |
@@ -18,1 +18,2 @@ export * from "./array"; | ||
export * from "tslib"; | ||
//# sourceMappingURL=index.js.map |
@@ -24,3 +24,3 @@ import { Stack } from "./stack"; | ||
}; | ||
var ConsoleWriter = (function () { | ||
var ConsoleWriter = /** @class */ (function () { | ||
function ConsoleWriter() { | ||
@@ -40,3 +40,3 @@ } | ||
}()); | ||
var Logging = (function () { | ||
var Logging = /** @class */ (function () { | ||
function Logging() { | ||
@@ -128,3 +128,3 @@ this._levelStack = new Stack(); | ||
export var logger = Logging.Instance(); | ||
var ScopedLogging = (function () { | ||
var ScopedLogging = /** @class */ (function () { | ||
function ScopedLogging(scopeID) { | ||
@@ -175,1 +175,2 @@ this._scopeID = scopeID; | ||
} | ||
//# sourceMappingURL=logging.js.map |
@@ -35,1 +35,8 @@ /** | ||
export declare function deepMixinT<T>(dest?: Partial<T>, ...sources: Array<Partial<T>>): T; | ||
/** | ||
* safeStingify - JSONsimilar to .stringify, except ignores circular references. | ||
* Usage: safeStingify(object); | ||
* | ||
* @param obj - any object. | ||
*/ | ||
export declare function safeStringify(obj: object): string; |
@@ -84,1 +84,20 @@ /** | ||
} | ||
/** | ||
* safeStingify - JSONsimilar to .stringify, except ignores circular references. | ||
* Usage: safeStingify(object); | ||
* | ||
* @param obj - any object. | ||
*/ | ||
export function safeStringify(obj) { | ||
var cache = []; | ||
return JSON.stringify(obj, function (key, value) { | ||
if (typeof value === "object" && value !== null) { | ||
if (cache.indexOf(value) !== -1) { | ||
return; | ||
} | ||
cache.push(value); | ||
} | ||
return value; | ||
}); | ||
} | ||
//# sourceMappingURL=object.js.map |
@@ -1,2 +0,2 @@ | ||
var ObserverHandle = (function () { | ||
var ObserverHandle = /** @class */ (function () { | ||
function ObserverHandle(eventTarget, eventID, callback) { | ||
@@ -15,3 +15,3 @@ this.eventTarget = eventTarget; | ||
}()); | ||
var Observable = (function () { | ||
var Observable = /** @class */ (function () { | ||
function Observable() { | ||
@@ -82,1 +82,2 @@ var events = []; | ||
export { Observable }; | ||
//# sourceMappingURL=observer.js.map |
@@ -5,1 +5,2 @@ export var root = new Function("try{return global;}catch(e){return window;}")(); | ||
export var isTravis = new Function("try{return process.env.TRAVIS;}catch(e){return false;}"); | ||
//# sourceMappingURL=platform.js.map |
import * as tslib_1 from "tslib"; | ||
import { Stack } from "./stack"; | ||
var XMLNode = (function () { | ||
var XMLNode = /** @class */ (function () { | ||
function XMLNode(name) { | ||
@@ -31,3 +31,3 @@ this.name = ""; | ||
export { XMLNode }; | ||
var SAXStackParser = (function () { | ||
var SAXStackParser = /** @class */ (function () { | ||
function SAXStackParser() { | ||
@@ -93,3 +93,3 @@ this.stack = new Stack(); | ||
export { SAXStackParser }; | ||
var XML2JSONParser = (function (_super) { | ||
var XML2JSONParser = /** @class */ (function (_super) { | ||
tslib_1.__extends(XML2JSONParser, _super); | ||
@@ -128,1 +128,2 @@ function XML2JSONParser() { | ||
} | ||
//# sourceMappingURL=saxParser.js.map |
/** | ||
* A generic Stack | ||
*/ | ||
var Stack = (function () { | ||
var Stack = /** @class */ (function () { | ||
function Stack() { | ||
@@ -42,1 +42,2 @@ this.stack = []; | ||
export { Stack }; | ||
//# sourceMappingURL=stack.js.map |
import { hashSum } from "./hashSum"; | ||
import { Observable } from "./observer"; | ||
var StateObject = (function () { | ||
var StateObject = /** @class */ (function () { | ||
function StateObject() { | ||
@@ -113,1 +113,2 @@ this._espState = {}; | ||
export { StateObject }; | ||
//# sourceMappingURL=stateful.js.map |
@@ -23,1 +23,2 @@ export function trim(str, char) { | ||
} | ||
//# sourceMappingURL=string.js.map |
@@ -12,1 +12,2 @@ import { trim } from "./string"; | ||
} | ||
//# sourceMappingURL=url.js.map |
@@ -67,1 +67,2 @@ (function (factory) { | ||
}); | ||
//# sourceMappingURL=array.js.map |
@@ -8,3 +8,14 @@ export declare class Cache<I, C> { | ||
set(obj: C): C; | ||
get(espObj: I): C | null; | ||
get(espObj: I, factory: () => C): C; | ||
} | ||
export declare class AsyncCache<I, C> { | ||
private _cache; | ||
private _calcID; | ||
static hash(...args: any[]): string; | ||
constructor(calcID: (espObj: I | C) => string); | ||
has(espObj: I): boolean; | ||
set(espObj: I, obj: Promise<C>): Promise<C>; | ||
get(espObj: I): Promise<C | null>; | ||
get(espObj: I, factory: () => Promise<C>): Promise<C>; | ||
} |
@@ -14,3 +14,3 @@ (function (factory) { | ||
var hashSum_1 = require("./hashSum"); | ||
var Cache = (function () { | ||
var Cache = /** @class */ (function () { | ||
function Cache(calcID) { | ||
@@ -37,3 +37,3 @@ this._cache = {}; | ||
if (!retVal) { | ||
return this.set(factory()); | ||
return factory ? this.set(factory()) : null; | ||
} | ||
@@ -45,2 +45,32 @@ return retVal; | ||
exports.Cache = Cache; | ||
var AsyncCache = /** @class */ (function () { | ||
function AsyncCache(calcID) { | ||
this._cache = {}; | ||
this._calcID = calcID; | ||
} | ||
AsyncCache.hash = function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return hashSum_1.hashSum(tslib_1.__assign({}, args)); | ||
}; | ||
AsyncCache.prototype.has = function (espObj) { | ||
return this._calcID(espObj) in this._cache; | ||
}; | ||
AsyncCache.prototype.set = function (espObj, obj) { | ||
this._cache[this._calcID(espObj)] = obj; | ||
return obj; | ||
}; | ||
AsyncCache.prototype.get = function (espObj, factory) { | ||
var retVal = this._cache[this._calcID(espObj)]; | ||
if (!retVal) { | ||
return factory ? this.set(espObj, factory()) : Promise.resolve(null); | ||
} | ||
return retVal; | ||
}; | ||
return AsyncCache; | ||
}()); | ||
exports.AsyncCache = AsyncCache; | ||
}); | ||
//# sourceMappingURL=cache.js.map |
@@ -12,3 +12,3 @@ (function (factory) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var Dictionary = (function () { | ||
var Dictionary = /** @class */ (function () { | ||
function Dictionary(attrs) { | ||
@@ -54,1 +54,2 @@ this.store = {}; | ||
}); | ||
//# sourceMappingURL=dictionary.js.map |
@@ -46,1 +46,2 @@ (function (factory) { | ||
}); | ||
//# sourceMappingURL=esp.js.map |
@@ -15,3 +15,3 @@ (function (factory) { | ||
var ATTR_DEFINITION = "definition"; | ||
var GraphItem = (function () { | ||
var GraphItem = /** @class */ (function () { | ||
function GraphItem(graph, parent, id, attrs) { | ||
@@ -54,3 +54,3 @@ this._graph = graph; | ||
}()); | ||
var Subgraph = (function (_super) { | ||
var Subgraph = /** @class */ (function (_super) { | ||
tslib_1.__extends(Subgraph, _super); | ||
@@ -167,3 +167,3 @@ function Subgraph(graph, parent, id, attrs) { | ||
}(GraphItem)); | ||
var Vertex = (function (_super) { | ||
var Vertex = /** @class */ (function (_super) { | ||
tslib_1.__extends(Vertex, _super); | ||
@@ -226,3 +226,3 @@ function Vertex(graph, parent, id, label, attrs) { | ||
}(GraphItem)); | ||
var Edge = (function (_super) { | ||
var Edge = /** @class */ (function (_super) { | ||
tslib_1.__extends(Edge, _super); | ||
@@ -266,3 +266,3 @@ function Edge(graph, parent, id, source, target, attrs) { | ||
}(Subgraph)); | ||
var Graph = (function () { | ||
var Graph = /** @class */ (function () { | ||
function Graph(id, attrs) { | ||
@@ -390,1 +390,2 @@ this._allSubgraphs = new dictionary_1.Dictionary(); | ||
}); | ||
//# sourceMappingURL=graph.js.map |
@@ -62,1 +62,2 @@ // Ported to TypeScript from: https://github.com/bevacqua/hash-sum | ||
}); | ||
//# sourceMappingURL=hashSum.js.map |
@@ -31,1 +31,2 @@ (function (factory) { | ||
}); | ||
//# sourceMappingURL=index.js.map |
@@ -35,3 +35,3 @@ (function (factory) { | ||
}; | ||
var ConsoleWriter = (function () { | ||
var ConsoleWriter = /** @class */ (function () { | ||
function ConsoleWriter() { | ||
@@ -51,3 +51,3 @@ } | ||
}()); | ||
var Logging = (function () { | ||
var Logging = /** @class */ (function () { | ||
function Logging() { | ||
@@ -139,3 +139,3 @@ this._levelStack = new stack_1.Stack(); | ||
exports.logger = Logging.Instance(); | ||
var ScopedLogging = (function () { | ||
var ScopedLogging = /** @class */ (function () { | ||
function ScopedLogging(scopeID) { | ||
@@ -188,1 +188,2 @@ this._scopeID = scopeID; | ||
}); | ||
//# sourceMappingURL=logging.js.map |
@@ -35,1 +35,8 @@ /** | ||
export declare function deepMixinT<T>(dest?: Partial<T>, ...sources: Array<Partial<T>>): T; | ||
/** | ||
* safeStingify - JSONsimilar to .stringify, except ignores circular references. | ||
* Usage: safeStingify(object); | ||
* | ||
* @param obj - any object. | ||
*/ | ||
export declare function safeStringify(obj: object): string; |
@@ -99,2 +99,22 @@ (function (factory) { | ||
exports.deepMixinT = deepMixinT; | ||
/** | ||
* safeStingify - JSONsimilar to .stringify, except ignores circular references. | ||
* Usage: safeStingify(object); | ||
* | ||
* @param obj - any object. | ||
*/ | ||
function safeStringify(obj) { | ||
var cache = []; | ||
return JSON.stringify(obj, function (key, value) { | ||
if (typeof value === "object" && value !== null) { | ||
if (cache.indexOf(value) !== -1) { | ||
return; | ||
} | ||
cache.push(value); | ||
} | ||
return value; | ||
}); | ||
} | ||
exports.safeStringify = safeStringify; | ||
}); | ||
//# sourceMappingURL=object.js.map |
@@ -12,3 +12,3 @@ (function (factory) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ObserverHandle = (function () { | ||
var ObserverHandle = /** @class */ (function () { | ||
function ObserverHandle(eventTarget, eventID, callback) { | ||
@@ -27,3 +27,3 @@ this.eventTarget = eventTarget; | ||
}()); | ||
var Observable = (function () { | ||
var Observable = /** @class */ (function () { | ||
function Observable() { | ||
@@ -95,1 +95,2 @@ var events = []; | ||
}); | ||
//# sourceMappingURL=observer.js.map |
@@ -17,1 +17,2 @@ (function (factory) { | ||
}); | ||
//# sourceMappingURL=platform.js.map |
@@ -14,3 +14,3 @@ (function (factory) { | ||
var stack_1 = require("./stack"); | ||
var XMLNode = (function () { | ||
var XMLNode = /** @class */ (function () { | ||
function XMLNode(name) { | ||
@@ -43,3 +43,3 @@ this.name = ""; | ||
exports.XMLNode = XMLNode; | ||
var SAXStackParser = (function () { | ||
var SAXStackParser = /** @class */ (function () { | ||
function SAXStackParser() { | ||
@@ -105,3 +105,3 @@ this.stack = new stack_1.Stack(); | ||
exports.SAXStackParser = SAXStackParser; | ||
var XML2JSONParser = (function (_super) { | ||
var XML2JSONParser = /** @class */ (function (_super) { | ||
tslib_1.__extends(XML2JSONParser, _super); | ||
@@ -142,1 +142,2 @@ function XML2JSONParser() { | ||
}); | ||
//# sourceMappingURL=saxParser.js.map |
@@ -15,3 +15,3 @@ (function (factory) { | ||
*/ | ||
var Stack = (function () { | ||
var Stack = /** @class */ (function () { | ||
function Stack() { | ||
@@ -55,1 +55,2 @@ this.stack = []; | ||
}); | ||
//# sourceMappingURL=stack.js.map |
@@ -14,3 +14,3 @@ (function (factory) { | ||
var observer_1 = require("./observer"); | ||
var StateObject = (function () { | ||
var StateObject = /** @class */ (function () { | ||
function StateObject() { | ||
@@ -126,1 +126,2 @@ this._espState = {}; | ||
}); | ||
//# sourceMappingURL=stateful.js.map |
@@ -37,1 +37,2 @@ (function (factory) { | ||
}); | ||
//# sourceMappingURL=string.js.map |
@@ -25,1 +25,2 @@ (function (factory) { | ||
}); | ||
//# sourceMappingURL=url.js.map |
{ | ||
"name": "@hpcc-js/util", | ||
"version": "0.0.33", | ||
"version": "0.0.34", | ||
"description": "hpcc-js - Utilities", | ||
@@ -24,6 +24,6 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@hpcc-js/bundle": "^0.0.9", | ||
"@hpcc-js/bundle": "^0.0.10", | ||
"rimraf": "^2.6.1", | ||
"typedoc": "^0.7.1", | ||
"typescript": "^2.4.2" | ||
"typescript": "^2.5.2" | ||
}, | ||
@@ -30,0 +30,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
465653
101
4979