Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cachetrax

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cachetrax - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

24

dist/cachetrax.compatible.js

@@ -33,3 +33,3 @@ "use strict";

}
g.CacheTrax = f();
g.Cachetrax = f();
}

@@ -114,2 +114,7 @@ })(function () {

this.Hash = typeof pServiceHash === 'string' ? pServiceHash : "".concat(this.UUID);
// Pull back a few things
this.log = this.fable.log;
this.servicesMap = this.fable.serviceMap;
this.services = this.fable.services;
});

@@ -123,11 +128,2 @@ _defineProperty(FableServiceProviderBase, "isFableService", true);

3: [function (require, module, exports) {
var libNPMModuleWrapper = require('./CacheTrax.js');
if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object' && !window.hasOwnProperty('CacheTrax')) {
window.CacheTrax = libNPMModuleWrapper;
}
module.exports = libNPMModuleWrapper;
}, {
"./CacheTrax.js": 4
}],
4: [function (require, module, exports) {
/**

@@ -341,6 +337,6 @@ * Cache data structure with:

}, {
"./LinkedList.js": 6,
"./LinkedList.js": 5,
"fable-serviceproviderbase": 2
}],
5: [function (require, module, exports) {
4: [function (require, module, exports) {
/**

@@ -373,3 +369,3 @@ * Double Linked List Node

}, {}],
6: [function (require, module, exports) {
5: [function (require, module, exports) {
"use strict";

@@ -563,5 +559,5 @@

}, {
"./LinkedList-Node.js": 5
"./LinkedList-Node.js": 4
}]
}, {}, [3])(3);
});

@@ -1,2 +0,2 @@

"use strict";function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var i,r=_getPrototypeOf(e);if(t){var n=_getPrototypeOf(this).constructor;i=Reflect.construct(r,arguments,n)}else i=r.apply(this,arguments);return _possibleConstructorReturn(this,i)}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_toPropertyKey(r.key),r)}}function _createClass(e,t,i){return t&&_defineProperties(e.prototype,t),i&&_defineProperties(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,i){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}!function(e){if("object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).CacheTrax=e()}}((function(){return function e(t,i,r){function n(s,a){if(!i[s]){if(!t[s]){var h="function"==typeof require&&require;if(!a&&h)return h(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var f=i[s]={exports:{}};t[s][0].call(f.exports,(function(e){return n(t[s][1][e]||e)}),f,f.exports,e,t,i,r)}return i[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)n(r[s]);return n}({1:[function(e,t,i){var r=function(){function e(t,i){_classCallCheck(this,e),this.fable=!1,this.options="object"===_typeof(t)?t:{},this.serviceType="Unknown",this.UUID="CORESVC-".concat(Math.floor(89999*Math.random()+1e4)),this.Hash="string"==typeof i?i:"".concat(this.UUID)}return _createClass(e,[{key:"connectFable",value:function(e){return this.fable=e,!0}}]),e}();_defineProperty(r,"isFableService",!0),t.exports=r},{}],2:[function(e,t,i){var r=_createClass((function e(t,i,r){_classCallCheck(this,e),this.fable=t,this.options="object"===_typeof(i)?i:"object"!==_typeof(t)||t.isFable?{}:t,this.serviceType="Unknown","function"==typeof t.getUUID?this.UUID=t.getUUID():this.UUID="NoFABLESVC-".concat(Math.floor(89999*Math.random()+1e4)),this.Hash="string"==typeof r?r:"".concat(this.UUID)}));_defineProperty(r,"isFableService",!0),t.exports=r,t.exports.CoreServiceProviderBase=e("./Fable-ServiceProviderBase-Preinit.js")},{"./Fable-ServiceProviderBase-Preinit.js":1}],3:[function(e,t,i){var r=e("./CacheTrax.js");"object"!==("undefined"==typeof window?"undefined":_typeof(window))||window.hasOwnProperty("CacheTrax")||(window.CacheTrax=r),t.exports=r},{"./CacheTrax.js":4}],4:[function(e,t,i){var r=e("fable-serviceproviderbase"),n=e("./LinkedList.js"),o=function(e){_inherits(i,e);var t=_createSuper(i);function i(e,r,o){var s;return _classCallCheck(this,i),(s=void 0===e?t.call(this,{}):t.call(this,e,r,o)).serviceType="ObjectCache",s._HashMap={},s._RecordMap={},s._List=new n,s.maxLength=0,s.maxAge=0,_possibleConstructorReturn(s)}return _createClass(i,[{key:"RecordMap",get:function(){return this._RecordMap}},{key:"put",value:function(e,t){if(this._HashMap.hasOwnProperty(t))return this._HashMap[t].Datum=e,this._RecordMap[t]=e,this._HashMap[t].Datum;var i=this._List.push(e,t);return this._HashMap[i.Hash]=i,this._RecordMap[t]=e,this.maxLength>0&&this._List.length>this.maxLength&&(i=this._List.pop(),delete this._RecordMap[i.Hash],delete this._HashMap[i.Hash]),i.Metadata.Created=+new Date,i.Datum}},{key:"read",value:function(e){return!!this._HashMap.hasOwnProperty(e)&&this._HashMap[e].Datum}},{key:"touch",value:function(e){if(!this._HashMap.hasOwnProperty(e))return!1;var t=this._List.remove(this._HashMap[e]);return delete this._RecordMap[e],delete this._HashMap[e],this.put(t.Datum,t.Hash)}},{key:"expire",value:function(e){if(!this._HashMap.hasOwnProperty(e))return!1;var t=this._HashMap[e];return t=this._List.remove(t),delete this._RecordMap[t.Hash],delete this._HashMap[t.Hash],t}},{key:"pruneBasedOnExpiration",value:function(e,t){var i=void 0===t?[]:t;if(this.maxAge<1)return e(i);for(var r=+new Date,n=Object.keys(this._HashMap),o=0;o<n.length;o++)r-this._HashMap[n[o]].Metadata.Created>=this.maxAge&&i.push(this.expire(n[o]));e(i)}},{key:"pruneBasedOnLength",value:function(e,t){var i=void 0===t?[]:t;if(this.maxLength>0)for(;this._List.length>this.maxLength;)i.push(this._List.pop());return e(i)}},{key:"pruneCustom",value:function(e,t,i){for(var r=void 0===i?[]:i,n=Object.keys(this._HashMap),o=0;o<n.length;o++){var s=this._HashMap[n[o]];t(s.Datum,s.Hash,s)&&r.push(this.expire(n[o]))}e(r)}},{key:"prune",value:function(e){var t=this,i=[];if(this._List.length<1)return e(i);this.pruneBasedOnExpiration((function(r){t.pruneBasedOnLength(e,i)}),i)}},{key:"getNode",value:function(e){return!!this._HashMap.hasOwnProperty(e)&&this._HashMap[e]}}]),i}(r);t.exports=o},{"./LinkedList.js":6,"fable-serviceproviderbase":2}],5:[function(e,t,i){var r=_createClass((function e(){_classCallCheck(this,e),this.Hash=!1,this.Datum=!1,this.Metadata={},this.LeftNode=!1,this.RightNode=!1,this.__ISNODE=!0}));t.exports=r},{}],6:[function(e,t,i){var r=e("./LinkedList-Node.js"),n=function(){function e(){_classCallCheck(this,e),this.totalNodes=0,this.length=0,this.head=!1,this.tail=!1}return _createClass(e,[{key:"initializeNode",value:function(e,t){if(void 0===e)return!1;this.totalNodes++;var i=void 0!==t?t:"NODE[".concat(this.totalNodes,"]"),n=new r;return n.Hash=i,n.Datum=e,n}},{key:"append",value:function(e,t){var i=this.initializeNode(e,t);return!!i&&(this.length++,1==this.length?(this.head=i,this.tail=i,i):(this.tail.RightNode=i,i.LeftNode=this.tail,this.tail=i,i))}},{key:"push",value:function(e,t){return this.append(e,t)}},{key:"prepend",value:function(e,t){var i=this.initializeNode(e,t);return!!i&&(this.length++,1==this.length?(this.head=i,this.tail=i,i):(this.head.LeftNode=i,i.RightNode=this.head,this.head=i,i))}},{key:"remove",value:function(e){return void 0!==e&&(!!e.__ISNODE&&(this.length--,this.length<1?(this.head=!1,this.tail=!1,e):e.LeftNode&&e.RightNode?(e.LeftNode.RightNode=e.RightNode,e.RightNode.LeftNode=e.LeftNode,e.RightNode=!1,e.LeftNode=!1,e):e.LeftNode?(e.LeftNode.RightNode=!1,this.tail=e.LeftNode,e.LeftNode=!1,e):(e.RightNode.LeftNode=!1,this.head=e.RightNode,e.RightNode=!1,e)))}},{key:"pop",value:function(){return this.remove(this.head)}},{key:"each",value:function(e,t){var i=this;if(this.length<1)return t();var r=!1;return function n(o){if(o)return t(o);if(r){if(!r.RightNode)return t();r=r.RightNode}else r=i.head;e(r.Datum,r.Hash,n)}()}},{key:"seek",value:function(e){if(!e)return!1;if(this.length<1)return!1;if(e>=this.length)return!1;for(var t=this.head,i=0;i<e;i++)t=t.RightNode;return t}}]),e}();t.exports=n},{"./LinkedList-Node.js":5}]},{},[3])(3)}));
"use strict";function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var i,r=_getPrototypeOf(e);if(t){var n=_getPrototypeOf(this).constructor;i=Reflect.construct(r,arguments,n)}else i=r.apply(this,arguments);return _possibleConstructorReturn(this,i)}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_toPropertyKey(r.key),r)}}function _createClass(e,t,i){return t&&_defineProperties(e.prototype,t),i&&_defineProperties(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,i){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}!function(e){if("object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Cachetrax=e()}}((function(){return function e(t,i,r){function n(s,a){if(!i[s]){if(!t[s]){var h="function"==typeof require&&require;if(!a&&h)return h(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var f=i[s]={exports:{}};t[s][0].call(f.exports,(function(e){return n(t[s][1][e]||e)}),f,f.exports,e,t,i,r)}return i[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)n(r[s]);return n}({1:[function(e,t,i){var r=function(){function e(t,i){_classCallCheck(this,e),this.fable=!1,this.options="object"===_typeof(t)?t:{},this.serviceType="Unknown",this.UUID="CORESVC-".concat(Math.floor(89999*Math.random()+1e4)),this.Hash="string"==typeof i?i:"".concat(this.UUID)}return _createClass(e,[{key:"connectFable",value:function(e){return this.fable=e,!0}}]),e}();_defineProperty(r,"isFableService",!0),t.exports=r},{}],2:[function(e,t,i){var r=_createClass((function e(t,i,r){_classCallCheck(this,e),this.fable=t,this.options="object"===_typeof(i)?i:"object"!==_typeof(t)||t.isFable?{}:t,this.serviceType="Unknown","function"==typeof t.getUUID?this.UUID=t.getUUID():this.UUID="NoFABLESVC-".concat(Math.floor(89999*Math.random()+1e4)),this.Hash="string"==typeof r?r:"".concat(this.UUID),this.log=this.fable.log,this.servicesMap=this.fable.serviceMap,this.services=this.fable.services}));_defineProperty(r,"isFableService",!0),t.exports=r,t.exports.CoreServiceProviderBase=e("./Fable-ServiceProviderBase-Preinit.js")},{"./Fable-ServiceProviderBase-Preinit.js":1}],3:[function(e,t,i){var r=e("fable-serviceproviderbase"),n=e("./LinkedList.js"),o=function(e){_inherits(i,e);var t=_createSuper(i);function i(e,r,o){var s;return _classCallCheck(this,i),(s=void 0===e?t.call(this,{}):t.call(this,e,r,o)).serviceType="ObjectCache",s._HashMap={},s._RecordMap={},s._List=new n,s.maxLength=0,s.maxAge=0,_possibleConstructorReturn(s)}return _createClass(i,[{key:"RecordMap",get:function(){return this._RecordMap}},{key:"put",value:function(e,t){if(this._HashMap.hasOwnProperty(t))return this._HashMap[t].Datum=e,this._RecordMap[t]=e,this._HashMap[t].Datum;var i=this._List.push(e,t);return this._HashMap[i.Hash]=i,this._RecordMap[t]=e,this.maxLength>0&&this._List.length>this.maxLength&&(i=this._List.pop(),delete this._RecordMap[i.Hash],delete this._HashMap[i.Hash]),i.Metadata.Created=+new Date,i.Datum}},{key:"read",value:function(e){return!!this._HashMap.hasOwnProperty(e)&&this._HashMap[e].Datum}},{key:"touch",value:function(e){if(!this._HashMap.hasOwnProperty(e))return!1;var t=this._List.remove(this._HashMap[e]);return delete this._RecordMap[e],delete this._HashMap[e],this.put(t.Datum,t.Hash)}},{key:"expire",value:function(e){if(!this._HashMap.hasOwnProperty(e))return!1;var t=this._HashMap[e];return t=this._List.remove(t),delete this._RecordMap[t.Hash],delete this._HashMap[t.Hash],t}},{key:"pruneBasedOnExpiration",value:function(e,t){var i=void 0===t?[]:t;if(this.maxAge<1)return e(i);for(var r=+new Date,n=Object.keys(this._HashMap),o=0;o<n.length;o++)r-this._HashMap[n[o]].Metadata.Created>=this.maxAge&&i.push(this.expire(n[o]));e(i)}},{key:"pruneBasedOnLength",value:function(e,t){var i=void 0===t?[]:t;if(this.maxLength>0)for(;this._List.length>this.maxLength;)i.push(this._List.pop());return e(i)}},{key:"pruneCustom",value:function(e,t,i){for(var r=void 0===i?[]:i,n=Object.keys(this._HashMap),o=0;o<n.length;o++){var s=this._HashMap[n[o]];t(s.Datum,s.Hash,s)&&r.push(this.expire(n[o]))}e(r)}},{key:"prune",value:function(e){var t=this,i=[];if(this._List.length<1)return e(i);this.pruneBasedOnExpiration((function(r){t.pruneBasedOnLength(e,i)}),i)}},{key:"getNode",value:function(e){return!!this._HashMap.hasOwnProperty(e)&&this._HashMap[e]}}]),i}(r);t.exports=o},{"./LinkedList.js":5,"fable-serviceproviderbase":2}],4:[function(e,t,i){var r=_createClass((function e(){_classCallCheck(this,e),this.Hash=!1,this.Datum=!1,this.Metadata={},this.LeftNode=!1,this.RightNode=!1,this.__ISNODE=!0}));t.exports=r},{}],5:[function(e,t,i){var r=e("./LinkedList-Node.js"),n=function(){function e(){_classCallCheck(this,e),this.totalNodes=0,this.length=0,this.head=!1,this.tail=!1}return _createClass(e,[{key:"initializeNode",value:function(e,t){if(void 0===e)return!1;this.totalNodes++;var i=void 0!==t?t:"NODE[".concat(this.totalNodes,"]"),n=new r;return n.Hash=i,n.Datum=e,n}},{key:"append",value:function(e,t){var i=this.initializeNode(e,t);return!!i&&(this.length++,1==this.length?(this.head=i,this.tail=i,i):(this.tail.RightNode=i,i.LeftNode=this.tail,this.tail=i,i))}},{key:"push",value:function(e,t){return this.append(e,t)}},{key:"prepend",value:function(e,t){var i=this.initializeNode(e,t);return!!i&&(this.length++,1==this.length?(this.head=i,this.tail=i,i):(this.head.LeftNode=i,i.RightNode=this.head,this.head=i,i))}},{key:"remove",value:function(e){return void 0!==e&&(!!e.__ISNODE&&(this.length--,this.length<1?(this.head=!1,this.tail=!1,e):e.LeftNode&&e.RightNode?(e.LeftNode.RightNode=e.RightNode,e.RightNode.LeftNode=e.LeftNode,e.RightNode=!1,e.LeftNode=!1,e):e.LeftNode?(e.LeftNode.RightNode=!1,this.tail=e.LeftNode,e.LeftNode=!1,e):(e.RightNode.LeftNode=!1,this.head=e.RightNode,e.RightNode=!1,e)))}},{key:"pop",value:function(){return this.remove(this.head)}},{key:"each",value:function(e,t){var i=this;if(this.length<1)return t();var r=!1;return function n(o){if(o)return t(o);if(r){if(!r.RightNode)return t();r=r.RightNode}else r=i.head;e(r.Datum,r.Hash,n)}()}},{key:"seek",value:function(e){if(!e)return!1;if(this.length<1)return!1;if(e>=this.length)return!1;for(var t=this.head,i=0;i<e;i++)t=t.RightNode;return t}}]),e}();t.exports=n},{"./LinkedList-Node.js":4}]},{},[3])(3)}));
//# sourceMappingURL=cachetrax.compatible.min.js.map

@@ -22,3 +22,3 @@ "use strict";

}
g.CacheTrax = f();
g.Cachetrax = f();
}

@@ -99,2 +99,7 @@ })(function () {

this.Hash = typeof pServiceHash === 'string' ? pServiceHash : "".concat(this.UUID);
// Pull back a few things
this.log = this.fable.log;
this.servicesMap = this.fable.serviceMap;
this.services = this.fable.services;
}

@@ -109,11 +114,2 @@ }

3: [function (require, module, exports) {
var libNPMModuleWrapper = require('./CacheTrax.js');
if (typeof window === 'object' && !window.hasOwnProperty('CacheTrax')) {
window.CacheTrax = libNPMModuleWrapper;
}
module.exports = libNPMModuleWrapper;
}, {
"./CacheTrax.js": 4
}],
4: [function (require, module, exports) {
/**

@@ -299,6 +295,6 @@ * Cache data structure with:

}, {
"./LinkedList.js": 6,
"./LinkedList.js": 5,
"fable-serviceproviderbase": 2
}],
5: [function (require, module, exports) {
4: [function (require, module, exports) {
/**

@@ -334,3 +330,3 @@ * Double Linked List Node

}, {}],
6: [function (require, module, exports) {
5: [function (require, module, exports) {
"use strict";

@@ -505,5 +501,5 @@

}, {
"./LinkedList-Node.js": 5
"./LinkedList-Node.js": 4
}]
}, {}, [3])(3);
});

@@ -1,2 +0,2 @@

"use strict";function _defineProperty(e,t,i){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==typeof t?t:String(t)}function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).CacheTrax=e()}}((function(){return function e(t,i,s){function r(o,a){if(!i[o]){if(!t[o]){var n="function"==typeof require&&require;if(!a&&n)return n(o,!0);if(h)return h(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var p=i[o]={exports:{}};t[o][0].call(p.exports,(function(e){return r(t[o][1][e]||e)}),p,p.exports,e,t,i,s)}return i[o].exports}for(var h="function"==typeof require&&require,o=0;o<s.length;o++)r(s[o]);return r}({1:[function(e,t,i){class s{constructor(e,t){this.fable=!1,this.options="object"==typeof e?e:{},this.serviceType="Unknown",this.UUID="CORESVC-".concat(Math.floor(89999*Math.random()+1e4)),this.Hash="string"==typeof t?t:"".concat(this.UUID)}connectFable(e){return this.fable=e,!0}}_defineProperty(s,"isFableService",!0),t.exports=s},{}],2:[function(e,t,i){class s{constructor(e,t,i){this.fable=e,this.options="object"==typeof t?t:"object"!=typeof e||e.isFable?{}:e,this.serviceType="Unknown","function"==typeof e.getUUID?this.UUID=e.getUUID():this.UUID="NoFABLESVC-".concat(Math.floor(89999*Math.random()+1e4)),this.Hash="string"==typeof i?i:"".concat(this.UUID)}}_defineProperty(s,"isFableService",!0),t.exports=s,t.exports.CoreServiceProviderBase=e("./Fable-ServiceProviderBase-Preinit.js")},{"./Fable-ServiceProviderBase-Preinit.js":1}],3:[function(e,t,i){var s=e("./CacheTrax.js");"object"!=typeof window||window.hasOwnProperty("CacheTrax")||(window.CacheTrax=s),t.exports=s},{"./CacheTrax.js":4}],4:[function(e,t,i){const s=e("fable-serviceproviderbase"),r=e("./LinkedList.js");t.exports=class extends s{constructor(e,t,i){void 0===e?super({}):super(e,t,i),this.serviceType="ObjectCache",this._HashMap={},this._RecordMap={},this._List=new r,this.maxLength=0,this.maxAge=0}get RecordMap(){return this._RecordMap}put(e,t){if(this._HashMap.hasOwnProperty(t))return this._HashMap[t].Datum=e,this._RecordMap[t]=e,this._HashMap[t].Datum;let i=this._List.push(e,t);return this._HashMap[i.Hash]=i,this._RecordMap[t]=e,this.maxLength>0&&this._List.length>this.maxLength&&(i=this._List.pop(),delete this._RecordMap[i.Hash],delete this._HashMap[i.Hash]),i.Metadata.Created=+new Date,i.Datum}read(e){return!!this._HashMap.hasOwnProperty(e)&&this._HashMap[e].Datum}touch(e){if(!this._HashMap.hasOwnProperty(e))return!1;let t=this._List.remove(this._HashMap[e]);return delete this._RecordMap[e],delete this._HashMap[e],this.put(t.Datum,t.Hash)}expire(e){if(!this._HashMap.hasOwnProperty(e))return!1;let t=this._HashMap[e];return t=this._List.remove(t),delete this._RecordMap[t.Hash],delete this._HashMap[t.Hash],t}pruneBasedOnExpiration(e,t){let i=void 0===t?[]:t;if(this.maxAge<1)return e(i);let s=+new Date,r=Object.keys(this._HashMap);for(let e=0;e<r.length;e++)s-this._HashMap[r[e]].Metadata.Created>=this.maxAge&&i.push(this.expire(r[e]));e(i)}pruneBasedOnLength(e,t){let i=void 0===t?[]:t;if(this.maxLength>0)for(;this._List.length>this.maxLength;)i.push(this._List.pop());return e(i)}pruneCustom(e,t,i){let s=void 0===i?[]:i,r=Object.keys(this._HashMap);for(let e=0;e<r.length;e++){let i=this._HashMap[r[e]];t(i.Datum,i.Hash,i)&&s.push(this.expire(r[e]))}e(s)}prune(e){let t=[];if(this._List.length<1)return e(t);this.pruneBasedOnExpiration((i=>{this.pruneBasedOnLength(e,t)}),t)}getNode(e){return!!this._HashMap.hasOwnProperty(e)&&this._HashMap[e]}}},{"./LinkedList.js":6,"fable-serviceproviderbase":2}],5:[function(e,t,i){t.exports=class{constructor(){this.Hash=!1,this.Datum=!1,this.Metadata={},this.LeftNode=!1,this.RightNode=!1,this.__ISNODE=!0}}},{}],6:[function(e,t,i){const s=e("./LinkedList-Node.js");t.exports=class{constructor(){this.totalNodes=0,this.length=0,this.head=!1,this.tail=!1}initializeNode(e,t){if(void 0===e)return!1;this.totalNodes++;let i=void 0!==t?t:"NODE[".concat(this.totalNodes,"]"),r=new s;return r.Hash=i,r.Datum=e,r}append(e,t){let i=this.initializeNode(e,t);return!!i&&(this.length++,1==this.length?(this.head=i,this.tail=i,i):(this.tail.RightNode=i,i.LeftNode=this.tail,this.tail=i,i))}push(e,t){return this.append(e,t)}prepend(e,t){let i=this.initializeNode(e,t);return!!i&&(this.length++,1==this.length?(this.head=i,this.tail=i,i):(this.head.LeftNode=i,i.RightNode=this.head,this.head=i,i))}remove(e){return void 0!==e&&(!!e.__ISNODE&&(this.length--,this.length<1?(this.head=!1,this.tail=!1,e):e.LeftNode&&e.RightNode?(e.LeftNode.RightNode=e.RightNode,e.RightNode.LeftNode=e.LeftNode,e.RightNode=!1,e.LeftNode=!1,e):e.LeftNode?(e.LeftNode.RightNode=!1,this.tail=e.LeftNode,e.LeftNode=!1,e):(e.RightNode.LeftNode=!1,this.head=e.RightNode,e.RightNode=!1,e)))}pop(){return this.remove(this.head)}each(e,t){if(this.length<1)return t();let i=!1,s=r=>{if(r)return t(r);if(i){if(!i.RightNode)return t();i=i.RightNode}else i=this.head;e(i.Datum,i.Hash,s)};return s()}seek(e){if(!e)return!1;if(this.length<1)return!1;if(e>=this.length)return!1;let t=this.head;for(let i=0;i<e;i++)t=t.RightNode;return t}}},{"./LinkedList-Node.js":5}]},{},[3])(3)}));
"use strict";function _defineProperty(e,t,i){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==typeof t?t:String(t)}function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Cachetrax=e()}}((function(){return function e(t,i,s){function r(o,a){if(!i[o]){if(!t[o]){var n="function"==typeof require&&require;if(!a&&n)return n(o,!0);if(h)return h(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var p=i[o]={exports:{}};t[o][0].call(p.exports,(function(e){return r(t[o][1][e]||e)}),p,p.exports,e,t,i,s)}return i[o].exports}for(var h="function"==typeof require&&require,o=0;o<s.length;o++)r(s[o]);return r}({1:[function(e,t,i){class s{constructor(e,t){this.fable=!1,this.options="object"==typeof e?e:{},this.serviceType="Unknown",this.UUID="CORESVC-".concat(Math.floor(89999*Math.random()+1e4)),this.Hash="string"==typeof t?t:"".concat(this.UUID)}connectFable(e){return this.fable=e,!0}}_defineProperty(s,"isFableService",!0),t.exports=s},{}],2:[function(e,t,i){class s{constructor(e,t,i){this.fable=e,this.options="object"==typeof t?t:"object"!=typeof e||e.isFable?{}:e,this.serviceType="Unknown","function"==typeof e.getUUID?this.UUID=e.getUUID():this.UUID="NoFABLESVC-".concat(Math.floor(89999*Math.random()+1e4)),this.Hash="string"==typeof i?i:"".concat(this.UUID),this.log=this.fable.log,this.servicesMap=this.fable.serviceMap,this.services=this.fable.services}}_defineProperty(s,"isFableService",!0),t.exports=s,t.exports.CoreServiceProviderBase=e("./Fable-ServiceProviderBase-Preinit.js")},{"./Fable-ServiceProviderBase-Preinit.js":1}],3:[function(e,t,i){const s=e("fable-serviceproviderbase"),r=e("./LinkedList.js");t.exports=class extends s{constructor(e,t,i){void 0===e?super({}):super(e,t,i),this.serviceType="ObjectCache",this._HashMap={},this._RecordMap={},this._List=new r,this.maxLength=0,this.maxAge=0}get RecordMap(){return this._RecordMap}put(e,t){if(this._HashMap.hasOwnProperty(t))return this._HashMap[t].Datum=e,this._RecordMap[t]=e,this._HashMap[t].Datum;let i=this._List.push(e,t);return this._HashMap[i.Hash]=i,this._RecordMap[t]=e,this.maxLength>0&&this._List.length>this.maxLength&&(i=this._List.pop(),delete this._RecordMap[i.Hash],delete this._HashMap[i.Hash]),i.Metadata.Created=+new Date,i.Datum}read(e){return!!this._HashMap.hasOwnProperty(e)&&this._HashMap[e].Datum}touch(e){if(!this._HashMap.hasOwnProperty(e))return!1;let t=this._List.remove(this._HashMap[e]);return delete this._RecordMap[e],delete this._HashMap[e],this.put(t.Datum,t.Hash)}expire(e){if(!this._HashMap.hasOwnProperty(e))return!1;let t=this._HashMap[e];return t=this._List.remove(t),delete this._RecordMap[t.Hash],delete this._HashMap[t.Hash],t}pruneBasedOnExpiration(e,t){let i=void 0===t?[]:t;if(this.maxAge<1)return e(i);let s=+new Date,r=Object.keys(this._HashMap);for(let e=0;e<r.length;e++)s-this._HashMap[r[e]].Metadata.Created>=this.maxAge&&i.push(this.expire(r[e]));e(i)}pruneBasedOnLength(e,t){let i=void 0===t?[]:t;if(this.maxLength>0)for(;this._List.length>this.maxLength;)i.push(this._List.pop());return e(i)}pruneCustom(e,t,i){let s=void 0===i?[]:i,r=Object.keys(this._HashMap);for(let e=0;e<r.length;e++){let i=this._HashMap[r[e]];t(i.Datum,i.Hash,i)&&s.push(this.expire(r[e]))}e(s)}prune(e){let t=[];if(this._List.length<1)return e(t);this.pruneBasedOnExpiration((i=>{this.pruneBasedOnLength(e,t)}),t)}getNode(e){return!!this._HashMap.hasOwnProperty(e)&&this._HashMap[e]}}},{"./LinkedList.js":5,"fable-serviceproviderbase":2}],4:[function(e,t,i){t.exports=class{constructor(){this.Hash=!1,this.Datum=!1,this.Metadata={},this.LeftNode=!1,this.RightNode=!1,this.__ISNODE=!0}}},{}],5:[function(e,t,i){const s=e("./LinkedList-Node.js");t.exports=class{constructor(){this.totalNodes=0,this.length=0,this.head=!1,this.tail=!1}initializeNode(e,t){if(void 0===e)return!1;this.totalNodes++;let i=void 0!==t?t:"NODE[".concat(this.totalNodes,"]"),r=new s;return r.Hash=i,r.Datum=e,r}append(e,t){let i=this.initializeNode(e,t);return!!i&&(this.length++,1==this.length?(this.head=i,this.tail=i,i):(this.tail.RightNode=i,i.LeftNode=this.tail,this.tail=i,i))}push(e,t){return this.append(e,t)}prepend(e,t){let i=this.initializeNode(e,t);return!!i&&(this.length++,1==this.length?(this.head=i,this.tail=i,i):(this.head.LeftNode=i,i.RightNode=this.head,this.head=i,i))}remove(e){return void 0!==e&&(!!e.__ISNODE&&(this.length--,this.length<1?(this.head=!1,this.tail=!1,e):e.LeftNode&&e.RightNode?(e.LeftNode.RightNode=e.RightNode,e.RightNode.LeftNode=e.LeftNode,e.RightNode=!1,e.LeftNode=!1,e):e.LeftNode?(e.LeftNode.RightNode=!1,this.tail=e.LeftNode,e.LeftNode=!1,e):(e.RightNode.LeftNode=!1,this.head=e.RightNode,e.RightNode=!1,e)))}pop(){return this.remove(this.head)}each(e,t){if(this.length<1)return t();let i=!1,s=r=>{if(r)return t(r);if(i){if(!i.RightNode)return t();i=i.RightNode}else i=this.head;e(i.Datum,i.Hash,s)};return s()}seek(e){if(!e)return!1;if(this.length<1)return!1;if(e>=this.length)return!1;let t=this.head;for(let i=0;i<e;i++)t=t.RightNode;return t}}},{"./LinkedList-Node.js":4}]},{},[3])(3)}));
//# sourceMappingURL=cachetrax.min.js.map
{
"name": "cachetrax",
"version": "1.0.3",
"description": "Caching Money.",
"main": "source/CacheTrax.js",
"scripts": {
"coverage": "./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha -- -u tdd -R spec",
"test": "./node_modules/mocha/bin/_mocha -u tdd -R spec",
"build": "./node_modules/.bin/gulp build",
"build-compatible": "GULP_CUSTOM_BUILD_TARGET=compatible ./node_modules/.bin/gulp build"
},
"mocha": {
"diff": true,
"extension": [
"js"
"name": "cachetrax",
"version": "1.0.4",
"description": "Caching Money.",
"main": "source/CacheTrax.js",
"scripts": {
"coverage": "./node_modules/.bin/nyc --reporter=lcov --reporter=text-lcov ./node_modules/mocha/bin/_mocha -- -u tdd -R spec",
"test": "./node_modules/.bin/mocha -u tdd -R spec",
"build": "npx quack build",
"start": "node source/CacheTrax.js",
"docker-dev-build": "docker build ./ -f Dockerfile_LUXURYCode -t cachetrax-image:local",
"docker-dev-run": "docker run -it -d --name cachetrax-dev -p 30001:8080 -p 38086:8086 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/cachetrax\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" cachetrax-image:local",
"docker-dev-shell": "docker exec -it cachetrax-dev /bin/bash"
},
"mocha": {
"diff": true,
"extension": [
"js"
],
"package": "./package.json",
"reporter": "spec",
"slow": "75",
"timeout": "5000",
"ui": "tdd",
"watch-files": [
"source/**/*.js",
"test/**/*.js"
],
"watch-ignore": [
"lib/vendor"
]
},
"repository": {
"type": "git",
"url": "https://github.com/stevenvelozo/cachetrax.git"
},
"keywords": [
"cache"
],
"package": "./package.json",
"reporter": "spec",
"slow": "75",
"timeout": "5000",
"ui": "tdd",
"watch-files": [
"source/**/*.js",
"test/**/*.js"
],
"watch-ignore": [
"lib/vendor"
]
},
"repository": {
"type": "git",
"url": "https://github.com/stevenvelozo/cachetrax.git"
},
"keywords": [
"cache"
],
"author": "Steven Velozo <steven@velozo.com> (http://velozo.com/)",
"license": "MIT",
"bugs": {
"url": "https://github.com/stevenvelozo/cachetrax/issues"
},
"homepage": "https://github.com/stevenvelozo/cachetrax",
"devDependencies": {
"@babel/core": "^7.21.5",
"@babel/preset-env": "^7.21.5",
"browserify": "^17.0.0",
"chai": "4.3.7",
"gulp": "^4.0.2",
"gulp-babel": "^8.0.0",
"gulp-env": "^0.4.0",
"gulp-sourcemaps": "^3.0.0",
"gulp-terser": "^2.1.0",
"gulp-util": "^3.0.8",
"mocha": "10.2.0",
"nyc": "^15.1.0",
"vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0"
},
"dependencies": {
"fable-serviceproviderbase": "^3.0.4"
}
"author": "Steven Velozo <steven@velozo.com> (http://velozo.com/)",
"license": "MIT",
"bugs": {
"url": "https://github.com/stevenvelozo/cachetrax/issues"
},
"homepage": "https://github.com/stevenvelozo/cachetrax",
"devDependencies": {
"quackage": "^1.0.14"
},
"dependencies": {
"fable-serviceproviderbase": "^3.0.7"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc