From d907a8a45e2361d1905d5bed247093fe45334737 Mon Sep 17 00:00:00 2001 From: maierson Date: Thu, 15 Dec 2016 14:10:33 +0000 Subject: [PATCH] Re-generate types --- .gitignore | 2 - dist/one.js | 82 ++++++++++++---- dist/one.min.js | 2 +- lib/CacheInstance.d.ts | 24 +++++ lib/CacheInstance.js | 34 +++++++ lib/CacheItem.d.ts | 8 ++ lib/CacheItem.js | 22 +++++ lib/CacheMap.d.ts | 12 +++ lib/CacheMap.js | 52 ++++++++++ lib/CacheNode.d.ts | 11 +++ lib/CacheNode.js | 10 ++ lib/CacheRepo.d.ts | 15 +++ lib/CacheRepo.js | 27 +++++ lib/CacheThread.d.ts | 10 ++ lib/CacheThread.js | 15 +++ lib/cache.d.ts | 21 ++++ lib/cache.js | 99 +++++++++++++++++++ lib/config.d.ts | 8 ++ lib/config.js | 14 +++ lib/evict.d.ts | 4 + lib/evict.js | 167 +++++++++++++++++++++++++++++++ lib/flush.d.ts | 9 ++ lib/flush.js | 166 +++++++++++++++++++++++++++++++ lib/get.d.ts | 9 ++ lib/get.js | 74 ++++++++++++++ lib/index.d.ts | 2 + lib/index.js | 16 +++ lib/interfaces.d.ts | 18 ++++ lib/interfaces.js | 1 + lib/locate.d.ts | 7 ++ lib/locate.js | 56 +++++++++++ lib/path.d.ts | 3 + lib/path.js | 74 ++++++++++++++ lib/print.d.ts | 2 + lib/print.js | 33 +++++++ lib/put.d.ts | 3 + lib/put.js | 31 ++++++ lib/ref.d.ts | 6 ++ lib/ref.js | 126 ++++++++++++++++++++++++ lib/src/CacheInstance.d.ts | 24 +++++ lib/src/CacheItem.d.ts | 8 ++ lib/src/CacheMap.d.ts | 12 +++ lib/src/CacheNode.d.ts | 11 +++ lib/src/CacheRepo.d.ts | 15 +++ lib/src/CacheThread.d.ts | 10 ++ lib/src/cache.d.ts | 21 ++++ lib/src/config.d.ts | 8 ++ lib/src/evict.d.ts | 4 + lib/src/flush.d.ts | 9 ++ lib/src/get.d.ts | 9 ++ lib/src/index.d.ts | 2 + lib/src/interfaces.d.ts | 18 ++++ lib/src/locate.d.ts | 7 ++ lib/src/path.d.ts | 3 + lib/src/print.d.ts | 2 + lib/src/put.d.ts | 3 + lib/src/ref.d.ts | 6 ++ lib/src/util.d.ts | 14 +++ lib/util.d.ts | 14 +++ lib/util.js | 195 +++++++++++++++++++++++++++++++++++++ 60 files changed, 1650 insertions(+), 20 deletions(-) create mode 100644 lib/CacheInstance.d.ts create mode 100644 lib/CacheInstance.js create mode 100644 lib/CacheItem.d.ts create mode 100644 lib/CacheItem.js create mode 100644 lib/CacheMap.d.ts create mode 100644 lib/CacheMap.js create mode 100644 lib/CacheNode.d.ts create mode 100644 lib/CacheNode.js create mode 100644 lib/CacheRepo.d.ts create mode 100644 lib/CacheRepo.js create mode 100644 lib/CacheThread.d.ts create mode 100644 lib/CacheThread.js create mode 100644 lib/cache.d.ts create mode 100644 lib/cache.js create mode 100644 lib/config.d.ts create mode 100644 lib/config.js create mode 100644 lib/evict.d.ts create mode 100644 lib/evict.js create mode 100644 lib/flush.d.ts create mode 100644 lib/flush.js create mode 100644 lib/get.d.ts create mode 100644 lib/get.js create mode 100644 lib/index.d.ts create mode 100644 lib/index.js create mode 100644 lib/interfaces.d.ts create mode 100644 lib/interfaces.js create mode 100644 lib/locate.d.ts create mode 100644 lib/locate.js create mode 100644 lib/path.d.ts create mode 100644 lib/path.js create mode 100644 lib/print.d.ts create mode 100644 lib/print.js create mode 100644 lib/put.d.ts create mode 100644 lib/put.js create mode 100644 lib/ref.d.ts create mode 100644 lib/ref.js create mode 100644 lib/src/CacheInstance.d.ts create mode 100644 lib/src/CacheItem.d.ts create mode 100644 lib/src/CacheMap.d.ts create mode 100644 lib/src/CacheNode.d.ts create mode 100644 lib/src/CacheRepo.d.ts create mode 100644 lib/src/CacheThread.d.ts create mode 100644 lib/src/cache.d.ts create mode 100644 lib/src/config.d.ts create mode 100644 lib/src/evict.d.ts create mode 100644 lib/src/flush.d.ts create mode 100644 lib/src/get.d.ts create mode 100644 lib/src/index.d.ts create mode 100644 lib/src/interfaces.d.ts create mode 100644 lib/src/locate.d.ts create mode 100644 lib/src/path.d.ts create mode 100644 lib/src/print.d.ts create mode 100644 lib/src/put.d.ts create mode 100644 lib/src/ref.d.ts create mode 100644 lib/src/util.d.ts create mode 100644 lib/util.d.ts create mode 100644 lib/util.js diff --git a/.gitignore b/.gitignore index f3f517e..5e1bec7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,2 @@ /node_modules/ -/lib/ -/dist/ .vscode \ No newline at end of file diff --git a/dist/one.js b/dist/one.js index c418676..a4b6c74 100644 --- a/dist/one.js +++ b/dist/one.js @@ -48,9 +48,17 @@ var cache_1 = __webpack_require__(1); exports.getCache = cache_1.getCache; + exports.put = cache_1.put; + exports.get = cache_1.get; + exports.getEdit = cache_1.getEdit; + exports.evict = cache_1.evict; + exports.reset = cache_1.reset; + exports.print = cache_1.print; (function () { if (window) { - window.One = { getCache: cache_1.getCache }; + window.One = { + getCache: cache_1.getCache, put: cache_1.put, get: cache_1.get, getEdit: cache_1.getEdit, evict: cache_1.evict, reset: cache_1.reset, print: cache_1.print + }; } })(); @@ -96,6 +104,24 @@ return exports.instances[instanceName]; } exports.getCache = getCache; + exports.put = function (item) { + getCache().put(item); + }; + exports.get = function (entity, nodeId) { + return getCache().get(entity, nodeId); + }; + exports.getEdit = function (uidOrEntityOrArray, nodeId) { + return getCache().getEdit(uidOrEntityOrArray, nodeId); + }; + exports.evict = function (uidOrEntityOrArray) { + return getCache().evict(uidOrEntityOrArray); + }; + exports.print = function () { + return getCache().print(); + }; + exports.reset = function () { + getCache().reset(); + }; function createCache(name) { var instance = new CacheInstance_1.default(name); var reset = function () { @@ -122,14 +148,6 @@ var print = function () { return print_1.printCache(instance); }; - var refFrom = function (uid) { - var item = get_1.getCachedItem(uid, instance); - return item.mapFrom; - }; - var refTo = function (uid) { - var item = get_1.getCachedItem(uid, instance); - return item.mapTo; - }; var result = { put: put, get: get, @@ -138,13 +156,17 @@ reset: reset, size: size, length: length, - print: print, - refTo: refTo, - refFrom: refFrom + print: print }; - if (cacheTest === false) { - delete result.refTo; - delete result.refFrom; + if (cacheTest === true) { + result.refTo = function (uid) { + var item = get_1.getCachedItem(uid, instance); + return item.mapTo; + }; + result.refFrom = function (uid) { + var item = get_1.getCachedItem(uid, instance); + return item.mapFrom; + }; } return result; } @@ -440,6 +462,10 @@ return mixed_var !== null && typeof mixed_var === 'object'; } exports.isObject = isObject; + function isFunction(item) { + return typeof item === 'function'; + } + exports.isFunction = isFunction; function isArray(value) { if (!value || value === null) { return false; @@ -494,6 +520,22 @@ } exports.hasUid = hasUid; ; + Function.prototype.clone = function (target) { + var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; + var ARGUMENT_NAMES = /([^\s,]+)/g; + function getParamNames(func) { + var fnStr = func.toString().replace(STRIP_COMMENTS, ''); + var result = fnStr.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')).match(ARGUMENT_NAMES); + if (result === null) result = []; + return result; + } + var stringify = this.toString(); + stringify = stringify.replace(new RegExp('_this', 'g'), 'this'); + var body = stringify.match(/function[^{]+\{([\s\S]*)\}$/)[1]; + var paramNames = getParamNames(this); + var func = new Function(paramNames, body); + return func.bind(target); + }; function deepClone(obj, uidReference, freeze) { if (freeze === void 0) { freeze = true; @@ -507,6 +549,7 @@ if (uidReference && hasUid(obj) && obj[cache_1.config.uidName] === uidReference[cache_1.config.uidName]) { return uidReference; } + console.log(obj); var result = objectAssign({}, obj); for (var propName in obj) { var value = obj[propName]; @@ -530,12 +573,15 @@ } else { result[propName] = deepClone(value, uidReference, freeze); } + } else if (isFunction(value)) { + result[propName] = value.clone(result); + console.log(propName, result[propName]); } else { result[propName] = value; } } } - if (freeze === true && !Object.isFrozen(result)) { + if (freeze === true && !Object.isFrozen(result) && typeof result !== 'function') { Object.freeze(result); } return result; @@ -921,6 +967,8 @@ var getEditableObject = function (uidOrEntity, instance) { var realUid = getActualUid(uidOrEntity); var existing = exports.getItem(realUid, instance); + var clone = util_1.deepClone(existing, undefined, false); + console.log(clone); return existing ? util_1.deepClone(existing, undefined, false) : undefined; }; var getActualUid = function (uidOrEntity) { @@ -1362,4 +1410,4 @@ /***/ } /******/ ]); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay9ib290c3RyYXAgNjZiYTdhNjhiOTg2MDU1YWE1NTUiLCJ3ZWJwYWNrOi8vLy4vaW5kZXgudHMiLCJ3ZWJwYWNrOi8vLy4vY2FjaGUudHMiLCJ3ZWJwYWNrOi8vLy4vY29uZmlnLnRzIiwid2VicGFjazovLy8uL3B1dC50cyIsIndlYnBhY2s6Ly8vLi9DYWNoZU1hcC50cyIsIndlYnBhY2s6Ly8vLi4vfi9vYmplY3QtYXNzaWduL2luZGV4LmpzIiwid2VicGFjazovLy8uL2xvY2F0ZS50cyIsIndlYnBhY2s6Ly8vLi91dGlsLnRzIiwid2VicGFjazovLy8uL0NhY2hlTm9kZS50cyIsIndlYnBhY2s6Ly8vLi9yZWYudHMiLCJ3ZWJwYWNrOi8vLy4vZmx1c2gudHMiLCJ3ZWJwYWNrOi8vLy4vZ2V0LnRzIiwid2VicGFjazovLy8uL3BhdGgudHMiLCJ3ZWJwYWNrOi8vLy4vQ2FjaGVJdGVtLnRzIiwid2VicGFjazovLy8uL3ByaW50LnRzIiwid2VicGFjazovLy8uL0NhY2hlSW5zdGFuY2UudHMiLCJ3ZWJwYWNrOi8vLy4vQ2FjaGVSZXBvLnRzIiwid2VicGFjazovLy8uL0NhY2hlVGhyZWFkLnRzIiwid2VicGFjazovLy8uL2V2aWN0LnRzIl0sIm5hbWVzIjpbImNhY2hlXzEiLCJyZXF1aXJlIiwiZXhwb3J0cyIsImdldENhY2hlIiwid2luZG93IiwiT25lIiwiY29uZmlnXzEiLCJwdXRfMSIsInByaW50XzEiLCJDYWNoZUluc3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Ghpcy5wYXRoc1trZXldO1xuICAgICAgICAgICAgICAgIF90aGlzLmxlbmd0aC0tO1xuICAgICAgICAgICAgICAgIHJldHVybiB2YWw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIHRoaXMuaGFzID0gZnVuY3Rpb24gKGtleSkge1xuICAgICAgICAgICAgcmV0dXJuIHR5cGVvZiBfdGhpcy5wYXRoc1trZXldICE9PSAndW5kZWZpbmVkJztcbiAgICAgICAgfTtcbiAgICAgICAgdGhpcy5mb3JFYWNoID0gZnVuY3Rpb24gKGNhbGxiYWNrKSB7XG4gICAgICAgICAgICBmb3IgKHZhciBrZXkgaW4gX3RoaXMucGF0aHMpIHtcbiAgICAgICAgICAgICAgICBpZiAoX3RoaXMucGF0aHMuaGFzT3duUHJvcGVydHkoa2V5KSkge1xuICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayhrZXksIF90aGlzLnBhdGhzW2tleV0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgdGhpcy5jbG9uZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBuZXdJbnN0YW5jZSA9IG9iamVjdEFzc2lnbih7fSwgX3RoaXMucGF0aHMpO1xuICAgICAgICAgICAgdmFyIGNsb25lID0gbmV3IENhY2hlTWFwKCk7XG4gICAgICAgICAgICBjbG9uZS5wYXRocyA9IG5ld0luc3RhbmNlO1xuICAgICAgICAgICAgY2xvbmUubGVuZ3RoID0gX3RoaXMubGVuZ3RoO1xuICAgICAgICAgICAgcmV0dXJuIGNsb25lO1xuICAgICAgICB9O1xuICAgIH1cbiAgICBDYWNoZU1hcC5wcm90b3R5cGUuc2V0ID0gZnVuY3Rpb24gKGtleSwgdmFsdWUpIHtcbiAgICAgICAgaWYgKHR5cGVvZiB0aGlzLnBhdGhzW2tleV0gPT09IFwidW5kZWZpbmVkXCIpIHtcbiAgICAgICAgICAgIHRoaXMubGVuZ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cmVuY2VcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB2YWx1ZS51aWQgPT09IHVpZFJlZmVyZW5jZS51aWRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB2YWx1ZSAhPT0gdWlkUmVmZXJlbmNlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0W3Byb3BOYW1lXSA9IHVpZFJlZmVyZW5jZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0W3Byb3BOYW1lXSA9IGRlZXBDbG9uZSh2YWx1ZSwgdWlkUmVmZXJlbmNlLCBmcmVlemUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHJlc3VsdFtwcm9wTmFtZV0gPSB2YWx1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICBpZiAoZnJlZXplID09PSB0cnVlICYmICFPYmplY3QuaXNGcm96ZW4ocmVzdWx0KSkge1xuICAgICAgICBPYmplY3QuZnJlZXplKHJlc3VsdCk7XG4gICAgfVxuICAgIHJldHVybiByZXN1bHQ7XG59XG5leHBvcnRzLmRlZXBDbG9uZSA9IGRlZXBDbG9uZTtcbmZ1bmN0aW9uIGRlZXBDbG9uZUFycmF5KGFyciwgdWlkUmVmZXJlbmNlLCBmcmVlemUpIHtcbiAgICByZXR1cm4gYXJyLm1hcChmdW5jdGlvbiAoaXRlbSkge1xuICAgICAgICBpZiAoaXNBcnJheShpdGVtKSkge1xuICAgICAgICAgICAgcmV0dXJuIGRlZXBDbG9uZUFycmF5KGl0ZW0sIHVpZFJlZm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gICAgdmFyIHRhcmdldFVpZCA9IHJlZmVyZW5jZVtjYWNoZV8xLmNvbmZpZy51aWROYW1lXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRhcmdldFVpZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZvdW5kID0gdGFyZ2V0VWlkID09IHRvVWlkO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZvdW5kID09PSB0cnVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBhdGg7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmVtb3ZlUmVmRnJvbV9WYWx1ZShpdGVtLmVudGl0eVtjYWNoZV8xLmNvbmZpZy51aWROYW1lXSwgdG9VaWQsIGZsdXNoQXJncyk7XG4gICAgICAgICAgICB9KS5maWx0ZXIoZnVuY3Rpb24gKGl0ZW0pIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaXRlbSAhPT0gbnVsbCAmJiBpdGVtICE9PSB1bmRlZmluZWQ7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGlmICh1cGRhdGVkUGF0aHMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgIGl0ZW0ubWFwVG8uc2V0KHRvVWlkLCB1cGRhdGVkUGF0aHMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgaXRlbS5tYXBUby5kZWxldGUodG9VaWQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG59O1xudmFyIHJlbW92ZVJlZkZyb21fVmFsdWUgPSBmdW5jdGlvbiAocGFyZW50VWlkLCByZWZVaWQsIGZsdXNoQXJncykge1xuICAgIHZhciByZWZJdGVtID0gZmx1c2hfMS5nZXRJdGVtRmx1c2hPckNhY2hlZChyZWZVaWQsIGZsdXNoQX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VfMS5jb25maWcudWlkTmFtZV0pIHtcbiAgICAgICAgICAgICAgICAgICAgZmx1c2hBcmdzLnBhcmVudFVpZCA9IHBhcmVudEVudGl0eVtjYWNoZV8xLmNvbmZpZy51aWROYW1lXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGZsdXNoQXJncy5wYXJlbnRVaWQpIHtcbiAgICAgICAgICAgICAgICAgICAgZmx1c2hBcmdzLnJlZlBhdGggPSBwYXRoXzEuY29uY2F0UHJvcChmbHVzaEFyZ3MucmVmUGF0aCwgcHJvcCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghZmx1c2hBcmdzLnJlZlBhdGgpIHtcbiAgICAgICAgICAgICAgICAgICAgZmx1c2hBcmdzLnJlZlBhdGggPSBwcm9wO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh1dGlsXzEuaXNBcnJheShyZWZFbnRpdHkpKSB7XG4gICAgICAgICAgICAgICAgY2FjaGVBcnJSZWZzKGZsdXNoQXJncyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmICh1dGlsXzEuaXNPYmplY3QocmVmRW50aXR5KSkge1xuICAgICAgICAgICAgICAgIGNhY2hlT2JqUmVmcyhmbHVzaEFyZ3MpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgT2JqZWN0LmZyZWV6ZShyZWZFbnRpdHkpO1xuICAgICAgICB9XG4gICAgfVxufTtcbnZhciBjYWNoZUFyclJlZnMgPSBmdW5jdGlvbiAoZmx1c2hBcmdzKSB7XG4gICAgdmFyIGVudGl0eSA9IGZsdXNoQXJncy5lbnRpdHk7XG4gICAgdmFyIGFycmF5UGF0aCA9IGZsdXNoQXJncy5yZWZQYXRoO1xuICAgIHZhciBhcnJheVVpZDtcbiAgICBpZiAoIWFycmF5VWlkKSB7XG4gICAgICAgIGFycmF5VWlkID0gZmx1c2hBcmdzLn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ICAgdmFyIGNhY2hlTm9kZSA9IGluc3RhbmNlLnJlcG8uZ2V0KGNhY2hlTm9kZUlkKTtcbiAgICAgICAgaWYgKGNhY2hlTm9kZSkge1xuICAgICAgICAgICAgaW5zdGFuY2UucmVwby5kZWxldGUoY2FjaGVOb2RlSWQpO1xuICAgICAgICB9XG4gICAgfSk7XG59O1xuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIC4vZXZpY3QudHMiXSwic291cmNlUm9vdCI6IiJ9 \ No newline at end of file +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay9ib290c3RyYXAgMjBlZWNjYTYyN2IzODA4MTQyZjgiLCJ3ZWJwYWNrOi8vLy4vaW5kZXgudHMiLCJ3ZWJwYWNrOi8vLy4vY2FjaGUudHMiLCJ3ZWJwYWNrOi8vLy4vY29uZmlnLnRzIiwid2VicGFjazovLy8uL3B1dC50cyIsIndlYnBhY2s6Ly8vLi9DYWNoZU1hcC50cyIsIndlYnBhY2s6Ly8vLi4vfi9vYmplY3QtYXNzaWduL2luZGV4LmpzIiwid2VicGFjazovLy8uL2xvY2F0ZS50cyIsIndlYnBhY2s6Ly8vLi91dGlsLnRzIiwid2VicGFjazovLy8uL0NhY2hlTm9kZS50cyIsIndlYnBhY2s6Ly8vLi9yZWYudHMiLCJ3ZWJwYWNrOi8vLy4vZmx1c2gudHMiLCJ3ZWJwYWNrOi8vLy4vZ2V0LnRzIiwid2VicGFjazovLy8uL3BhdGgudHMiLCJ3ZWJwYWNrOi8vLy4vQ2FjaGVJdGVtLnRzIiwid2VicGFjazovLy8uL3ByaW50LnRzIiwid2VicGFjazovLy8uL0NhY2hlSW5zdGFuY2UudHMiLCJ3ZWJwYWNrOi8vLy4vQ2FjaGVSZXBvLnRzIiwid2VicGFjazovLy8uL0NhY2hlVGhyZWFkLnRzIiwid2VicGFjazovLy8uL2V2aWN0LnRzI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HJldHVybiB0eXBlb2YgX3RoaXMucGF0aHNba2V5XSAhPT0gJ3VuZGVmaW5lZCc7XG4gICAgICAgIH07XG4gICAgICAgIHRoaXMuZm9yRWFjaCA9IGZ1bmN0aW9uIChjYWxsYmFjaykge1xuICAgICAgICAgICAgZm9yICh2YXIga2V5IGluIF90aGlzLnBhdGhzKSB7XG4gICAgICAgICAgICAgICAgaWYgKF90aGlzLnBhdGhzLmhhc093blByb3BlcnR5KGtleSkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2soa2V5LCBfdGhpcy5wYXRoc1trZXldKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIHRoaXMuY2xvbmUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgbmV3SW5zdGFuY2UgPSBvYmplY3RBc3NpZ24oe30sIF90aGlzLnBhdGhzKTtcbiAgICAgICAgICAgIHZhciBjbG9uZSA9IG5ldyBDYWNoZU1hcCgpO1xuICAgICAgICAgICAgY2xvbmUucGF0aHMgPSBuZXdJbnN0YW5jZTtcbiAgICAgICAgICAgIGNsb25lLmxlbmd0aCA9IF90aGlzLmxlbmd0aDtcbiAgICAgICAgICAgIHJldHVybiBjbG9uZTtcbiAgICAgICAgfTtcbiAgICB9XG4gICAgQ2FjaGVNYXAucHJvdG90eXBlLnNldCA9IGZ1bmN0aW9uIChrZXksIHZhbHVlKSB7XG4gICAgICAgIGlmICh0eXBlb2YgdGhpcy5wYXRoc1trZXldID09PSBcInVuZGVmaW5lZFwiKSB7XG4gICAgICAgICAgICB0aGlzLmxlbmd0aCsrO1xuICAgICAgICAgICAgdGhpcy5wYXRoc1trZXldID0gdmFsdWU7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnBhdGhzW2tleV0gPSB2YWx1ZTtcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH07XG4gIC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lW2NhY2hlXzEuY29uZmlnLnVpZE5hbWVdKSB7XG4gICAgICAgIHJldHVybiB1aWRSZWZlcmVuY2U7XG4gICAgfVxuICAgIGNvbnNvbGUubG9nKG9iaik7XG4gICAgdmFyIHJlc3VsdCA9IG9iamVjdEFzc2lnbih7fSwgb2JqKTtcbiAgICBmb3IgKHZhciBwcm9wTmFtZSBpbiBvYmopIHtcbiAgICAgICAgdmFyIHZhbHVlID0gb2JqW3Byb3BOYW1lXTtcbiAgICAgICAgaWYgKHZhbHVlKSB7XG4gICAgICAgICAgICBpZiAoaXNBcnJheSh2YWx1ZSkpIHtcbiAgICAgICAgICAgICAgICByZXN1bHRbcHJvcE5hbWVdID0gZGVlcENsb25lQXJyYXkodmFsdWUsIHVpZFJlZmVyZW5jZSwgZnJlZXplKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGlzRGF0ZSh2YWx1ZSkpIHtcbiAgICAgICAgICAgICAgICB2YXIgZGF0ZSA9IG5ldyBEYXRlKHZhbHVlLmdldFRpbWUoKSk7XG4gICAgICAgICAgICAgICAgaWYgKGZyZWV6ZSA9PT0gdHJ1ZSkge1xuICAgICAgICAgICAgICAgICAgICBPYmplY3QuZnJlZXplKGRhdGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXN1bHRbcHJvcE5hbWVdID0gZGF0ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGlzT2JqZWN0KHZhbHVlKSkge1xuICAgICAgICAgICAgICAgIGlmIChoYXNVaWQodmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFtwcm9wTmFtZV0gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHVpZFJlZmVyZW5jZSAmJiBoYXNVaWQodWlkUmVmZXJlbmNlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlICE9PSB1aWRSZWZlcmVuY2VcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB2YWx1ZS51aWQgPT09IHVpZFJlZmVyZW5jZS51aWRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB2YWx1ZSAhPT0gdWlkUmVmZXJlbmNlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0W3Byb3BOYW1lXSA9IHVpZFJlZmVyZW5jZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0W3Byb3BOYW1lXSA9IGRlZXBDbG9uZSh2YWx1ZSwgdWlkUmVmZXJlbmNlLCBmcmVlemUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGlzRnVuY3Rpb24odmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0W3Byb3BOYW1lXSA9IHZhbHVlLmNsb25lKHJlc3VsdCk7XG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2cocHJvcE5hbWUsIHJlc3VsdFtwcm9wTmFtZV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0W3Byb3BOYW1lXSA9IHZhbHVlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICAgIGlmIChmcmVlemUgPT09IHRydWVcbiAgICAgICAgJiYgIU9iamVjdC5pc0Zyb3plbihyZXN1bHQpXG4gICAgICAgICYmIHR5cGVvZiByZXN1bHQgIT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgT2JqZWN0LmZyZWV6ZShyZXN1bHQpO1xuICAgIH1cbiAgICByZXR1cm4gcmV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tYXBUby5mb3JFYWNoKGZ1bmN0aW9uICh0b1VpZCwgcGF0aHMpIHtcbiAgICAgICAgICAgIHZhciB1cGRhdGVkUGF0aHMgPSBwYXRocy5tYXAoZnVuY3Rpb24gKHBhdGgpIHtcbiAgICAgICAgICAgICAgICB2YXIgcmVmZXJlbmNlID0gb3BhdGguZ2V0KGl0ZW0uZW50aXR5LCBwYXRoKTtcbiAgICAgICAgICAgICAgICBpZiAocmVmZXJlbmNlKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB0YXJnZXRVaWQgPSByZWZlcmVuY2VbY2FjaGVfMS5jb25maWcudWlkTmFtZV07XG4gICAgICAgICAgICAgICAgICAgIGlmICh0YXJnZXRVaWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmb3VuZCA9IHRhcmdldFVpZCA9PSB0b1VpZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmb3VuZCA9PT0gdHJ1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwYXRoO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJlbW92ZVJlZkZyb21fVmFsdWUoaXRlbS5lbnRpdHlbY2FjaGVfMS5jb25maWcudWlkTmFtZV0sIHRvVWlkLCBmbHVzaEFyZ3MpO1xuICAgICAgICAgICAgfSkuZmlsdGVyKGZ1bmN0aW9uIChpdGVtKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGl0ZW0gIT09IG51bGwgJiYgaXRlbSAhPT0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBpZiAodXBkYXRlZFBhdGhzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICBpdGVtLm1hcFRvLnNldCh0b1VpZCwgdXBkYXRlZFBhdGhzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGV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cm9wZXJ0eShwcm9wKSkge1xuICAgICAgICAgICAgdmFyIHJlZkVudGl0eSA9IHBhcmVudEVudGl0eVtwcm9wXTtcbiAgICAgICAgICAgIGlmICh1dGlsXzEuaXNPYmplY3QocmVmRW50aXR5KSB8fCB1dGlsXzEuaXNBcnJheShyZWZFbnRpdHkpKSB7XG4gICAgICAgICAgICAgICAgZmx1c2hBcmdzLmVudGl0eSA9IHJlZkVudGl0eTtcbiAgICAgICAgICAgICAgICBpZiAocGFyZW50RW50aXR5W2NhY2hlXzEuY29uZmlnLnVpZE5hbWVdKSB7XG4gICAgICAgICAgICAgICAgICAgIGZsdXNoQXJncy5wYXJlbnRVaWQgPSBwYXJlbnRFbnRpdHlbY2FjaGVfMS5jb25maWcudWlkTmFtZV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChmbHVzaEFyZ3MucGFyZW50VWlkKSB7XG4gICAgICAgICAgICAgICAgICAgIGZsdXNoQXJncy5yZWZQYXRoID0gcGF0aF8xLmNvbmNhdFByb3AoZmx1c2hBcmdzLnJlZlBhdGgsIHByb3ApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIWZsdXNoQXJncy5yZWZQYXRoKSB7XG4gICAgICAgICAgICAgICAgICAgIGZsdXNoQXJncy5yZWZQYXRoID0gcHJvcDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodXRpbF8xLmlzQXJyYXkocmVmRW50aXR5KSkge1xuICAgICAgICAgICAgICAgIGNhY2hlQXJyUmVmcyhmbHVzaEFyZ3MpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAodXRpbF8xLmlzT2JqZWN0KHJlZkVudGl0eSkpIHtcbiAgICAgICAgICAgICAgICBjYWNoZU9ialJlZnMoZmx1c2hBcmdzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIE9iamVjdC5mcmVlemUocmVmRW50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9iaikpIHtcbiAgICAgICAgcmV0dXJuIHZvaWQgMDtcbiAgICB9XG4gICAgaWYgKHV0aWxfMS5pc0VtcHR5KHBhdGgpKSB7XG4gICAgICAgIHJldHVybiBvYmo7XG4gICAgfVxuICAgIGlmICh1dGlsXzEuaXNTdHJpbmcocGF0aCkpIHtcbiAgICAgICAgcmV0dXJuIGRlbChvYmosIHBhdGguc3BsaXQoJy4nKSk7XG4gICAgfVxuICAgIHZhciBjdXJyZW50UGF0aCA9IGdldEtleShwYXRoWzBdKTtcbiAgICB2YXIgb2xkVmFsID0gb2JqW2N1cnJlbnRQYXRoXTtcbiAgICBpZiAocGF0aC5sZW5ndGggPT09IDEpIHtcbiAgICAgICAgaWYgKG9sZFZhbCAhPT0gdm9pZCAwKSB7XG4gICAgICAgICAgICBpZiAodXRpbF8xLmlzQXJyYXkob2JqKSkge1xuICAgICAgICAgICAgICAgIG9iai5zcGxpY2UoY3VycmVudFBhdGgsIDEpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgZGVsZXRlIG9ialtjdXJyZW50UGF0aF07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICAgIGlmIChvYmpbY3VycmVudFBhdGhdICE9PSB2b2lkIDApIHtcbiAgICAgICAgICAgIHJldHVybiBkZWwob2JqW2N1cnJlbnRQYXRoXSwgcGF0aC5zbGljZSgxKSk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIG9iajtcbn1cbmV4cG9ydHMuZGVsID0gZGVsO1xuZnVuY3Rpb24gZ2V0KG9iaiwgcGF0aCwgZGVmYXVsdFZhbHVlKSB7XG4gICAgaWYgKHV0aWxfMS5pc051bWJlcihwYXRoKSkge1xuICAgICAgICBwYXRoID0gW3BhdGhdO1xuICAgIH1cbiAgICBpZiAodXRpbF8xLmlzRW1wdHkocGF0aCkpIHtcbiAgICAgICAgcmV0dXJuIG9i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xuICAgICAgICBvYmouZm9yRWFjaChmdW5jdGlvbiAoaXRlbSkge1xuICAgICAgICAgICAgaWYgKHV0aWxfMS5oYXNVaWQoaXRlbSkpIHtcbiAgICAgICAgICAgICAgICB1aWRBcnJheS5wdXNoKFN0cmluZyhpdGVtW2NhY2hlXzEuY29uZmlnLnVpZE5hbWVdKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGl0ZW0gPT09IFwic3RyaW5nXCIgfHwgdHlwZW9mIGl0ZW0gPT09IFwibnVtYmVyXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgdWlkQXJyYXkucHVzaChTdHJpbmcoaXRlbSkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgICB2YXIgdWlkID0gb2JqO1xuICAgICAgICBpZiAodXRpbF8xLmlzT2JqZWN0KG9iaikpIHtcbiAgICAgICAgICAgIHVpZCA9IG9ialtjYWNoZV8xLmNvbmZpZy51aWROYW1lXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodWlkID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIHJldHVybiB1aWRBcnJheTtcbiAgICAgICAgfVxuICAgICAgICB1aWRBcnJheS5wdXNoKFN0cmluZyh1aWQpKTtcbiAgICB9XG4gICAgcmV0dXJuIHVpZEFycmF5O1xufTtcbmV4cG9ydHMuY2xlYXJOZXh0ID0gZnVuY3Rpb24gKGluc3RhbmNlKSB7XG4gICAgdmFyIHRocmVhZCA9IGluc3RhbmNlLnRocmVhZDtcbiAgICBpZiAodGhyZWFkLmN1cnJlbnQgPCB0aHJlYWQubm9kZXMubGVuZ3RoIC0gMSkge1xuICAgICAgICB2YXIgcmVtb3ZlZE5vZGVzID0gdGhyZWFkLm5vZGVzLnNsaWNlKHRocmVhZC5jdXJyZW50ICsgMSwgdGhyZWFkLm5vZGVzLmxlbmd0aCk7XG4gICAgICAgIHRocmVhZC5ub2RlcyA9IHRocmVhZC5ub2Rlcy5zbGljZSgwLCB0aHJlYWQuY3VycmVudCArIDEpO1xuICAgICAgICB0aHJlYWQuY3VycmVudCA9IHRocmVhZC5ub2Rlcy5sZW5ndGggLSAxO1xuICAgICAgICB0cnVuY2F0ZVRocmVhZHMocmVtb3ZlZE5vZGVzLCBpbnN0YW5jZSk7XG4gICAgfVxufTtcbnZhciB0cnVuY2F0ZVRocmVhZHMgPSBmdW5jdGlvbiAocmVtb3ZlZE5vZGVzLCBpbnN0YW5jZSkge1xuICAgIHJlbW92ZWROb2Rlcy5mb3JFYWNoKGZ1bmN0aW9uIChjYWNoZU5vZGVJZCkge1xuICAgICAgICB2YXIgY2FjaGVOb2RlID0gaW5zdGFuY2UucmVwby5nZXQoY2FjaGVOb2RlSWQpO1xuICAgICAgICBpZiAoY2FjaGVOb2RlKSB7XG4gICAgICAgICAgICBpbnN0YW5jZS5yZXBvLmRlbGV0ZShjYWNoZU5vZGVJZCk7XG4gICAgICAgIH1cbiAgICB9KTtcbn07XG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gLi9ldmljdC50cyJdLCJzb3VyY2VSb290IjoiIn0= \ No newline at end of file diff --git a/dist/one.min.js b/dist/one.min.js index 16b23ac..10a1b2f 100644 --- a/dist/one.min.js +++ b/dist/one.min.js @@ -1 +1 @@ -!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=n(1);e.getCache=r.getCache,function(){window&&(window.One={getCache:r.getCache})}()},function(t,e,n){"use strict";function r(t){l=t}function i(t,n){return void 0===t&&(t="one"),void 0===n&&(n=u.defaultConfig),e.config||e.instances||(e.config=u.configure(n)),e.instances||(e.instances={}),e.instances[t]||(e.instances[t]=a(t)),window&&void 0===window[t]&&(window[t]=e.instances[t]),e.instances[t]}function a(t){var e=new f.default(t),n=function(){e.reset()},r=function(t){return o.putItem(t,e)},i=function(t,n){return d.getItem(t,e,n)},a=function(t,n){return d.getEditItem(t,e,n)},u=function(t){return h.evictItem(t,e)},p=function(){return s.cacheSize(e)},g=function(){return s.cacheLength(e)},m=function(){return c.printCache(e)},v=function(t){var n=d.getCachedItem(t,e);return n.mapFrom},y=function(t){var n=d.getCachedItem(t,e);return n.mapTo},O={put:r,get:i,getEdit:a,evict:u,reset:n,size:p,length:g,print:m,refTo:y,refFrom:v};return l===!1&&(delete O.refTo,delete O.refFrom),O}var u=n(2),o=n(3),c=n(14),f=n(15),s=n(7),d=n(11),h=n(18),l=!1;e.setTesting=r,e.getCache=i},function(t,e){"use strict";function n(t){for(var n in e.defaultConfig)e.defaultConfig.hasOwnProperty(n)&&t.hasOwnProperty(n)&&(e.defaultConfig[n]=t[n]);return e.defaultConfig}e.defaultConfig={uidName:"uid",maxHistoryStates:1e3},e.configure=n},function(t,e,n){"use strict";var r=n(4),i=n(6),a=n(7),u=n(9),o=n(10);e.putItem=function(t,e){if(a.isArray(t)||a.isObject(t)){var n=new r.default,f=new r.default;f.__UPDATED__=!1;var s={entity:t,flushMap:f,evictMap:n,parentUid:null,refPath:"",instance:e};if(o.buildFlushMap(s),u.updatePointers(s),s.flushMap.size()>0&&f.__UPDATED__===!0)return c(s)}return i.getCallStats(!1,e)};var c=function(t){return o.preFlush(t),i.getCallStats(!0,t.instance)}},function(t,e,n){"use strict";var r=n(5),i=function(){function t(){var e=this;this.paths={},this.length=0,this.get=function(t){return e.paths[t]},this.delete=function(t){if("undefined"!=typeof e.paths[t]&&e.length>0){var n=e.paths[t];return delete e.paths[t],e.length--,n}},this.has=function(t){return"undefined"!=typeof e.paths[t]},this.forEach=function(t){for(var n in e.paths)e.paths.hasOwnProperty(n)&&t(n,e.paths[n])},this.clone=function(){var n=r({},e.paths),i=new t;return i.paths=n,i.length=e.length,i}}return t.prototype.set=function(t,e){return"undefined"==typeof this.paths[t]?(this.length++,this.paths[t]=e,!0):(this.paths[t]=e,!1)},t.prototype.size=function(){return this.length},t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e){"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function r(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==r.join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(t){i[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(t){return!1}}var i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;t.exports=r()?Object.assign:function(t,e){for(var r,u,o=n(t),c=1;c=0?i(e,t):void 0}function i(t,e){return e.repo.get(t)}function a(t,e){for(var n,r,i=0,a=t.length-1;i<=a;)if(n=(i+a)/2|0,r=t[n],re))return n;a=n-1}}var u=n(7);e.getCallStats=function(t,n){var r={};return r.success=t,r.nodeId=e.node(n),r.length=o(n),r.name=n.name,r},e.node=function(t,n){if("undefined"==typeof n){var o=r(t);return o?o.id:-1}if(!u.isNumber(n))throw new TypeError("The node id must be a number.");var c=i(n,t);return c?(t.thread.current=a(t.thread.nodes,n),e.getCallStats(!0,t)):e.getCallStats(!1,t)},e.getCurrentNode=r,e.getRepoNode=i;var o=function(t){return t.thread.nodes.length}},function(t,e,n){"use strict";function r(t){return"number"==typeof t||"[object Number]"===y(t)}function i(t){return"string"==typeof t||"[object String]"===y(t)}function a(t){return"[object Array]"!==Object.prototype.toString.call(t)&&(null!==t&&"object"==typeof t)}function u(t){return!(!t||null===t)&&(Array.isArray(t)||t&&"object"==typeof t&&"number"==typeof t.length&&"function"==typeof t.splice&&!t.propertyIsEnumerable("length"))}function o(t){return Object.prototype.toString.call(t)}function c(t){return a(t)&&"[object Date]"===o(t)}function f(t){if(!t)return!0;if(u(t)&&0===t.length)return!0;if(!i(t)){for(var e in t)if(O.call(t,e))return!1;return!0}return!1}function s(t){var e=new g.CacheNode(t.nextNodeKey);return e.id=t.nextNodeKey,t.nextNodeKey+=1,t.repo.add(e),e}function d(t){if(!t)return!1;if(!a(t))return!1;if("undefined"==typeof t[p.config.uidName])return!1;var e=t[p.config.uidName];return 0!==e.length}function h(t,e,n){if(void 0===n&&(n=!0),!t||!a(t)&&!u(t))return t;if(n===!0&&e&&!Object.isFrozen(e)&&Object.freeze(e),e&&d(t)&&t[p.config.uidName]===e[p.config.uidName])return e;var r=v({},t);for(var i in t){var o=t[i];if(o)if(u(o))r[i]=l(o,e,n);else if(c(o)){var f=new Date(o.getTime());n===!0&&Object.freeze(f),r[i]=f}else a(o)?d(o)?(r[i]=o,e&&d(e)&&o!==e&&o.uid===e.uid&&o!==e&&(r[i]=e)):r[i]=h(o,e,n):r[i]=o}return n!==!0||Object.isFrozen(r)||Object.freeze(r),r}function l(t,e,n){return t.map(function(t){return u(t)?l(t,e,n):a(t)?d(t)?e&&t[p.config.uidName]===e[p.config.uidName]?e:t:h(t,e,n):t})}var p=n(1),g=n(8),m=n(6),v=n(5),y=Object.prototype.toString,O=Object.prototype.hasOwnProperty;e.isNumber=r,e.isString=i,e.isObject=a,e.isArray=u,e.isDate=c,e.isEmpty=f,e.getNewCacheNode=s,e.hasUid=d,e.deepClone=h,e.cacheSize=function(t){var e=m.getCurrentNode(t);return e?e.items.size():0},e.cacheLength=function(t){return t.thread.nodes.length}},function(t,e,n){"use strict";var r=n(4),i=function(){function t(t){this.items=new r.default,this.id=t}return t}();e.CacheNode=i},function(t,e,n){"use strict";var r=n(10),i=n(1),a=n(12),u=n(11),o=n(7);e.assignRefToParent=function(t,e){if(e.parentUid){var n=r.getItemFlushOrCached(e.parentUid,e);n&&e.refPath&&c(n,t,e.refPath)}};var c=function(t,e,n){var r=t.entity[i.config.uidName],a=e.entity[i.config.uidName];f(t,a,n),s(e,r,n)},f=function(t,e,n){t.mapTo.has(e)===!1&&t.mapTo.set(e,[]);var r=t.mapTo.get(e);return r.indexOf(n)<0&&r.push(n),t},s=function(t,e,n){t.mapFrom.has(e)===!1&&t.mapFrom.set(e,[]);var r=t.mapFrom.get(e);return r.indexOf(n)<0&&r.push(n),t};e.updatePointers=function(t){t.flushMap.forEach(function(n,r){d(r,t),e.updateRefFroms(r,t)})},e.updateRefFroms=function(t,e){t.mapFrom.forEach(function(n,i){var c=e.flushMap.get(n);if(c||(c=u.getCachedItem(n,e.instance)),c&&i.length>0){var f=i[0],s=a.get(c.entity,f),d=s&&s!==t.entity;if(d===!0){var h={entity:c.entity,flushMap:e.flushMap,instance:e.instance};c=r.ensureItem(h),c.entity=o.deepClone(c.entity,t.entity,!0)}}})},e.updateRefTos=function(t,e){var n=r.getItemFlushOrCached(t,e);d(n,e)};var d=function(t,e){t&&t.mapTo.forEach(function(n,r){var u=r.map(function(r){var u=a.get(t.entity,r);if(u){var o=u[i.config.uidName];if(o){var c=o==n;if(c===!0)return r}}h(t.entity[i.config.uidName],n,e)}).filter(function(t){return null!==t&&void 0!==t});u.length>0?t.mapTo.set(n,u):t.mapTo.delete(n)})},h=function(t,e,n){var i=r.getItemFlushOrCached(e,n);i&&(i=i.clone(),i.mapFrom.has(t)&&(l(i,t,n.refPath),0===i.mapFrom.size()?(n.evictMap.set(e,i),n.flushMap.delete(e)):(n.flushMap.set(e,i),n.evictMap.delete(e))))},l=function(t,e,n){var r=t.mapFrom.get(e),i=r.indexOf(n);r=r.slice(),r.splice(i,1),t.mapFrom.set(e,r),0==r.length&&t.mapFrom.delete(e)}},function(t,e,n){"use strict";var r=n(11),i=n(1),a=n(7),u=n(12),o=n(13),c=n(4),f=n(9);e.buildFlushMap=function(t){a.hasUid(t.entity)?s(t):a.isArray(t.entity)?l(t):h(t)};var s=function(t){t.refPath="",m(t)===!0&&(d(t),h(t),f.updateRefTos(String(t.entity[i.config.uidName]),t))},d=function(t){var n=String(t.entity[i.config.uidName]);t.flushMap.has(n)===!1&&(e.ensureItem(t),t.parentUid=String(n))},h=function(t){var e=t.entity;for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];(a.isObject(r)||a.isArray(r))&&(t.entity=r,e[i.config.uidName]&&(t.parentUid=e[i.config.uidName]),t.parentUid&&(t.refPath=u.concatProp(t.refPath,n)),t.refPath||(t.refPath=n)),a.isArray(r)?l(t):a.isObject(r)&&p(t),Object.freeze(r)}},l=function(t){var e,n=t.entity,r=t.refPath;e||(e=t.parentUid),n.forEach(function(n,i){t.entity=n,t.parentUid=e,(t.refPath||r)&&(t.refPath=r+"."+i),a.isArray(n)?l(t):a.isObject(n)&&p(t)}),Object.freeze(n)},p=function(t){a.hasUid(t.entity)?g(t):h(t)},g=function(t){var n=e.ensureItem(t);f.assignRefToParent(n,t),r.isOnCache(t)!==!0&&e.buildFlushMap(t)},m=function(t){var e=r.getCachedItem(t.entity[i.config.uidName],t.instance);return!e||e.entity!==t.entity};e.getItemFlushOrCached=function(t,e){if(t){t=String(t);var n=e.flushMap.get(t);return n||(n=r.getCachedItem(t,e.instance)),n&&Object.isFrozen(n)&&(n=n.clone()),n}},e.ensureItem=function(t){var e=String(t.entity[i.config.uidName]),n=t.flushMap.get(e);if(n)return n;var a=r.getCachedItem(e,t.instance);return n=new o.default(t.entity,a),t.flushMap.set(e,n),t.flushMap.__UPDATED__=!0,n},e.preFlush=function(t){var n=new c.default,a=r.getCacheCurrentStack(t.instance);a&&a.forEach(function(t,e){n.set(t,e)}),t.flushMap.forEach(function(t,e){var r=e.entity[i.config.uidName];v(e),n.set(String(r),e)}),t.evictMap.size()>0&&t.evictMap.forEach(function(t,e){n.delete(String(t))}),e.flush(n,t.instance)};var v=function(t){Object.freeze(t),Object.freeze(t.entity),Object.freeze(t.mapTo),Object.freeze(t.mapFrom)};e.flush=function(t,e){if(null!==t){Object.freeze(t);var n=a.getNewCacheNode(e);n.items=t,e.thread.nodes.indexOf(n.id)<0&&(e.thread.nodes.push(n.id),e.thread.current+=1)}}},function(t,e,n){"use strict";function r(t){var e=t.thread.nodes[t.thread.current];return e>=0?i(e,t.repo):void 0}function i(t,e){return e.get(t)}var a=n(1),u=n(7);e.getItem=function(t,e,n){if(!t)throw new TypeError("One get(): requires a uid to retrieve an item from the cache.");return u.isArray(t)?t.map(function(t){return o(t,e)}).filter(function(t){return null!==t&&void 0!==t}):o(t,e)};var o=function(t,n){var r=f(t);if(r){var i=e.getCachedItem(r,n);return i?i.entity:void 0}};e.getEditItem=function(t,e,n){return u.isArray(t)?t.map(function(t){return c(t,e)}).filter(function(t){return null!==t&&void 0!==t}):c(t,e)};var c=function(t,n){var r=f(t),i=e.getItem(r,n);return i?u.deepClone(i,void 0,!1):void 0},f=function(t){return"string"==typeof t?t:"number"==typeof t?String(t):u.isObject(t)&&u.hasUid(t)?t[a.config.uidName]:void 0};e.isOnCache=function(t){var n=t.entity[a.config.uidName],r=e.getCachedItem(n,t.instance);return r&&r.entity===t.entity},e.getCachedItem=function(t,e){var n=r(e);return n?n.items.get(String(t)):void 0},e.getCacheCurrentStack=function(t){var e=r(t);return e?e.items:void 0}},function(t,e,n){"use strict";function r(t){var e=parseInt(t);return e.toString()===t?e:t}function i(t,e){if(u.isNumber(e)&&(e=[e]),!u.isEmpty(t)){if(u.isEmpty(e))return t;if(u.isString(e))return i(t,e.split("."));var n=r(e[0]),a=t[n];if(1===e.length)void 0!==a&&(u.isArray(t)?t.splice(n,1):delete t[n]);else if(void 0!==t[n])return i(t[n],e.slice(1));return t}}function a(t,e,n){if(u.isNumber(e)&&(e=[e]),u.isEmpty(e))return t;if(u.isEmpty(t))return n;if(u.isString(e))return a(t,e.split("."),n);var i=r(e[0]);return 1===e.length?void 0===t[i]?n:t[i]:a(t[i],e.slice(1),n)}var u=n(7);e.del=i,e.get=a,e.concatProp=function(t,e){return t=""===t?e:t+"."+e}},function(t,e,n){"use strict";var r=n(4),i=function(){function t(e,n){var i=this;this.clone=function(){return new t(i.entity,i)},this.entity=e,n?(this.mapFrom=n.mapFrom.clone(),this.mapTo=n.mapTo.clone()):(this.mapFrom=new r.default,this.mapTo=new r.default)}return t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e,n){"use strict";var r=n(1);e.printCache=function(t){var e="",n=0,a=t.thread.current,u=t.thread.nodes;return u.map(function(r){var u=t.repo.get(r),o="",c=n+":"+o+"["+i(u.items)+"]\n\n";n===a&&(c="-> "+c),e+=c,n++}),e=e.substring(0,e.length-2),n=0,"\n------ One -------\nSTACK:\n"+e+"\n\nCONFIG:"+JSON.stringify(r.config,null,2)+"\n\nREPO SIZE:"+t.repo.length+"\n===================\n"};var i=function(t){var e="";return t.forEach(function(t,n){var r=JSON.stringify(n,null,2);e+=r+",\n"}),e}},function(t,e,n){"use strict";var r=n(16),i=n(17),a=function(){function t(t){var e=this;this.repo=new r.default,this.thread=new i.default,this.nextNodeKey=0,this.reset=function(){e.repo=new r.default,e.thread=new i.default,e.nextNodeKey=0},this.addNode=function(t){return!!e.repo.add(t)&&(e.thread.addNode(t.id),e.nextNodeKey++,!0)},this.length=function(){return e.thread.nodes.length},this.size=function(){return e.repo.length},this.name=t}return t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=a},function(t,e,n){"use strict";var r=n(4),i=function(){function t(){var t=this;this.items=new r.default,this.length=0,this.get=function(e){return t.items.get(e)},this.add=function(e){return!t.items.has(e.id)&&(t.items.set(e.id,e),t.length++,!0)},this.delete=function(e){t.items.has(e)&&(t.items.delete(e),t.length--)}}return t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e){"use strict";var n=function(){function t(){var t=this;this.current=-1,this.nodes=[],this.addNode=function(e){t.nodes.push(e),t.current++}}return t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=n},function(t,e,n){"use strict";var r=n(7),i=n(1),a=n(11),u=n(4),o=n(12),c=n(10),f=n(6),s=n(9);e.evictItem=function(t,e){var n=m(t);if(0==n.length)return f.getCallStats(!1,e);var r=a.getCacheCurrentStack(e),i=n.some(function(t){return r&&r.has(String(t))});if(!i)return f.getCallStats(!1,e);var o=new u.default;r.forEach(function(t,e){o.set(t,e)});var s=new u.default,l=new u.default,g={flushMap:s,evictMap:l,instance:e},v=[];return n.forEach(function(t){g.entityUid=t,h(g),l.set(t,null),p(n,v,g)}),d(v,s,l,e),s.forEach(function(t,e){o.set(t,e)}),l.forEach(function(t,e){o.delete(t)}),c.flush(o,e),f.getCallStats(!0,e)};var d=function(t,e,n,i){if(t&&t.length>0&&r.cacheSize(i)>0){var a={flushMap:e,evictMap:n,instance:i};c.buildFlushMap(a),a.flushMap.forEach(function(t,e){s.updateRefFroms(e,a)})}},h=function(t){var e=a.getCachedItem(t.entityUid,t.instance);e&&e.mapTo.forEach(function(e,n){var r=c.getItemFlushOrCached(e,t);r&&(l(r,t.entityUid),0===r.mapFrom.size()?(t.entityUid=e,h(t),t.evictMap.set(e,r)):t.flushMap.set(e,r))})},l=function(t,e){var n=t.mapFrom.get(e);n&&(t.mapFrom=t.mapFrom.clone(),t.mapFrom.delete(e))},p=function(t,e,n){var r=c.getItemFlushOrCached(n.entityUid,n);r&&r.mapFrom.forEach(function(r,i){var a=c.getItemFlushOrCached(r,n);if(a){var u=g(a,n.entityUid,n.instance);u===!0&&(n.flushMap.set(r,a),t.indexOf(r)<0&&e.push(a))}})},g=function(t,e,n){var r=t.entity;Object.isFrozen(r)&&(r=a.getEditItem(r[i.config.uidName],n),t.entity=r);var u=t.mapTo.get(e);return u.forEach(function(t){o.del(r,t)}),Object.isFrozen(r)||Object.freeze(r),t.entity=r,t.mapTo=t.mapTo.clone(),t.mapTo.delete(e),!0},m=function(t){var e=[];if(r.isArray(t))t.forEach(function(t){r.hasUid(t)?e.push(String(t[i.config.uidName])):"string"!=typeof t&&"number"!=typeof t||e.push(String(t))});else{var n=t;if(r.isObject(t)&&(n=t[i.config.uidName]),void 0===n)return e;e.push(String(n))}return e};e.clearNext=function(t){var e=t.thread;if(e.current0&&f.__UPDATED__===!0)return c(s)}return i.getCallStats(!1,e)};var c=function(t){return o.preFlush(t),i.getCallStats(!0,t.instance)}},function(t,e,n){"use strict";var r=n(5),i=function(){function t(){var e=this;this.paths={},this.length=0,this.get=function(t){return e.paths[t]},this.delete=function(t){if("undefined"!=typeof e.paths[t]&&e.length>0){var n=e.paths[t];return delete e.paths[t],e.length--,n}},this.has=function(t){return"undefined"!=typeof e.paths[t]},this.forEach=function(t){for(var n in e.paths)e.paths.hasOwnProperty(n)&&t(n,e.paths[n])},this.clone=function(){var n=r({},e.paths),i=new t;return i.paths=n,i.length=e.length,i}}return t.prototype.set=function(t,e){return"undefined"==typeof this.paths[t]?(this.length++,this.paths[t]=e,!0):(this.paths[t]=e,!1)},t.prototype.size=function(){return this.length},t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e){"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function r(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==r.join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(t){i[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(t){return!1}}var i=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;t.exports=r()?Object.assign:function(t,e){for(var r,a,o=n(t),c=1;c=0?i(e,t):void 0}function i(t,e){return e.repo.get(t)}function u(t,e){for(var n,r,i=0,u=t.length-1;i<=u;)if(n=(i+u)/2|0,r=t[n],re))return n;u=n-1}}var a=n(7);e.getCallStats=function(t,n){var r={};return r.success=t,r.nodeId=e.node(n),r.length=o(n),r.name=n.name,r},e.node=function(t,n){if("undefined"==typeof n){var o=r(t);return o?o.id:-1}if(!a.isNumber(n))throw new TypeError("The node id must be a number.");var c=i(n,t);return c?(t.thread.current=u(t.thread.nodes,n),e.getCallStats(!0,t)):e.getCallStats(!1,t)},e.getCurrentNode=r,e.getRepoNode=i;var o=function(t){return t.thread.nodes.length}},function(t,e,n){"use strict";function r(t){return"number"==typeof t||"[object Number]"===O(t)}function i(t){return"string"==typeof t||"[object String]"===O(t)}function u(t){return"[object Array]"!==Object.prototype.toString.call(t)&&(null!==t&&"object"==typeof t)}function a(t){return"function"==typeof t}function o(t){return!(!t||null===t)&&(Array.isArray(t)||t&&"object"==typeof t&&"number"==typeof t.length&&"function"==typeof t.splice&&!t.propertyIsEnumerable("length"))}function c(t){return Object.prototype.toString.call(t)}function f(t){return u(t)&&"[object Date]"===c(t)}function s(t){if(!t)return!0;if(o(t)&&0===t.length)return!0;if(!i(t)){for(var e in t)if(b.call(t,e))return!1;return!0}return!1}function d(t){var e=new v.CacheNode(t.nextNodeKey);return e.id=t.nextNodeKey,t.nextNodeKey+=1,t.repo.add(e),e}function h(t){if(!t)return!1;if(!u(t))return!1;if("undefined"==typeof t[g.config.uidName])return!1;var e=t[g.config.uidName];return 0!==e.length}function l(t,e,n){if(void 0===n&&(n=!0),!t||!u(t)&&!o(t))return t;if(n===!0&&e&&!Object.isFrozen(e)&&Object.freeze(e),e&&h(t)&&t[g.config.uidName]===e[g.config.uidName])return e;console.log(t);var r=y({},t);for(var i in t){var c=t[i];if(c)if(o(c))r[i]=p(c,e,n);else if(f(c)){var s=new Date(c.getTime());n===!0&&Object.freeze(s),r[i]=s}else u(c)?h(c)?(r[i]=c,e&&h(e)&&c!==e&&c.uid===e.uid&&c!==e&&(r[i]=e)):r[i]=l(c,e,n):a(c)?(r[i]=c.clone(r),console.log(i,r[i])):r[i]=c}return n!==!0||Object.isFrozen(r)||"function"==typeof r||Object.freeze(r),r}function p(t,e,n){return t.map(function(t){return o(t)?p(t,e,n):u(t)?h(t)?e&&t[g.config.uidName]===e[g.config.uidName]?e:t:l(t,e,n):t})}var g=n(1),v=n(8),m=n(6),y=n(5),O=Object.prototype.toString,b=Object.prototype.hasOwnProperty;e.isNumber=r,e.isString=i,e.isObject=u,e.isFunction=a,e.isArray=o,e.isDate=f,e.isEmpty=s,e.getNewCacheNode=d,e.hasUid=h,Function.prototype.clone=function(t){function e(t){var e=t.toString().replace(n,""),i=e.slice(e.indexOf("(")+1,e.indexOf(")")).match(r);return null===i&&(i=[]),i}var n=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,r=/([^\s,]+)/g,i=this.toString();i=i.replace(new RegExp("_this","g"),"this");var u=i.match(/function[^{]+\{([\s\S]*)\}$/)[1],a=e(this),o=new Function(a,u);return o.bind(t)},e.deepClone=l,e.cacheSize=function(t){var e=m.getCurrentNode(t);return e?e.items.size():0},e.cacheLength=function(t){return t.thread.nodes.length}},function(t,e,n){"use strict";var r=n(4),i=function(){function t(t){this.items=new r.default,this.id=t}return t}();e.CacheNode=i},function(t,e,n){"use strict";var r=n(10),i=n(1),u=n(12),a=n(11),o=n(7);e.assignRefToParent=function(t,e){if(e.parentUid){var n=r.getItemFlushOrCached(e.parentUid,e);n&&e.refPath&&c(n,t,e.refPath)}};var c=function(t,e,n){var r=t.entity[i.config.uidName],u=e.entity[i.config.uidName];f(t,u,n),s(e,r,n)},f=function(t,e,n){t.mapTo.has(e)===!1&&t.mapTo.set(e,[]);var r=t.mapTo.get(e);return r.indexOf(n)<0&&r.push(n),t},s=function(t,e,n){t.mapFrom.has(e)===!1&&t.mapFrom.set(e,[]);var r=t.mapFrom.get(e);return r.indexOf(n)<0&&r.push(n),t};e.updatePointers=function(t){t.flushMap.forEach(function(n,r){d(r,t),e.updateRefFroms(r,t)})},e.updateRefFroms=function(t,e){t.mapFrom.forEach(function(n,i){var c=e.flushMap.get(n);if(c||(c=a.getCachedItem(n,e.instance)),c&&i.length>0){var f=i[0],s=u.get(c.entity,f),d=s&&s!==t.entity;if(d===!0){var h={entity:c.entity,flushMap:e.flushMap,instance:e.instance};c=r.ensureItem(h),c.entity=o.deepClone(c.entity,t.entity,!0)}}})},e.updateRefTos=function(t,e){var n=r.getItemFlushOrCached(t,e);d(n,e)};var d=function(t,e){t&&t.mapTo.forEach(function(n,r){var a=r.map(function(r){var a=u.get(t.entity,r);if(a){var o=a[i.config.uidName];if(o){var c=o==n;if(c===!0)return r}}h(t.entity[i.config.uidName],n,e)}).filter(function(t){return null!==t&&void 0!==t});a.length>0?t.mapTo.set(n,a):t.mapTo.delete(n)})},h=function(t,e,n){var i=r.getItemFlushOrCached(e,n);i&&(i=i.clone(),i.mapFrom.has(t)&&(l(i,t,n.refPath),0===i.mapFrom.size()?(n.evictMap.set(e,i),n.flushMap.delete(e)):(n.flushMap.set(e,i),n.evictMap.delete(e))))},l=function(t,e,n){var r=t.mapFrom.get(e),i=r.indexOf(n);r=r.slice(),r.splice(i,1),t.mapFrom.set(e,r),0==r.length&&t.mapFrom.delete(e)}},function(t,e,n){"use strict";var r=n(11),i=n(1),u=n(7),a=n(12),o=n(13),c=n(4),f=n(9);e.buildFlushMap=function(t){u.hasUid(t.entity)?s(t):u.isArray(t.entity)?l(t):h(t)};var s=function(t){t.refPath="",v(t)===!0&&(d(t),h(t),f.updateRefTos(String(t.entity[i.config.uidName]),t))},d=function(t){var n=String(t.entity[i.config.uidName]);t.flushMap.has(n)===!1&&(e.ensureItem(t),t.parentUid=String(n))},h=function(t){var e=t.entity;for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];(u.isObject(r)||u.isArray(r))&&(t.entity=r,e[i.config.uidName]&&(t.parentUid=e[i.config.uidName]),t.parentUid&&(t.refPath=a.concatProp(t.refPath,n)),t.refPath||(t.refPath=n)),u.isArray(r)?l(t):u.isObject(r)&&p(t),Object.freeze(r)}},l=function(t){var e,n=t.entity,r=t.refPath;e||(e=t.parentUid),n.forEach(function(n,i){t.entity=n,t.parentUid=e,(t.refPath||r)&&(t.refPath=r+"."+i),u.isArray(n)?l(t):u.isObject(n)&&p(t)}),Object.freeze(n)},p=function(t){u.hasUid(t.entity)?g(t):h(t)},g=function(t){var n=e.ensureItem(t);f.assignRefToParent(n,t),r.isOnCache(t)!==!0&&e.buildFlushMap(t)},v=function(t){var e=r.getCachedItem(t.entity[i.config.uidName],t.instance);return!e||e.entity!==t.entity};e.getItemFlushOrCached=function(t,e){if(t){t=String(t);var n=e.flushMap.get(t);return n||(n=r.getCachedItem(t,e.instance)),n&&Object.isFrozen(n)&&(n=n.clone()),n}},e.ensureItem=function(t){var e=String(t.entity[i.config.uidName]),n=t.flushMap.get(e);if(n)return n;var u=r.getCachedItem(e,t.instance);return n=new o.default(t.entity,u),t.flushMap.set(e,n),t.flushMap.__UPDATED__=!0,n},e.preFlush=function(t){var n=new c.default,u=r.getCacheCurrentStack(t.instance);u&&u.forEach(function(t,e){n.set(t,e)}),t.flushMap.forEach(function(t,e){var r=e.entity[i.config.uidName];m(e),n.set(String(r),e)}),t.evictMap.size()>0&&t.evictMap.forEach(function(t,e){n.delete(String(t))}),e.flush(n,t.instance)};var m=function(t){Object.freeze(t),Object.freeze(t.entity),Object.freeze(t.mapTo),Object.freeze(t.mapFrom)};e.flush=function(t,e){if(null!==t){Object.freeze(t);var n=u.getNewCacheNode(e);n.items=t,e.thread.nodes.indexOf(n.id)<0&&(e.thread.nodes.push(n.id),e.thread.current+=1)}}},function(t,e,n){"use strict";function r(t){var e=t.thread.nodes[t.thread.current];return e>=0?i(e,t.repo):void 0}function i(t,e){return e.get(t)}var u=n(1),a=n(7);e.getItem=function(t,e,n){if(!t)throw new TypeError("One get(): requires a uid to retrieve an item from the cache.");return a.isArray(t)?t.map(function(t){return o(t,e)}).filter(function(t){return null!==t&&void 0!==t}):o(t,e)};var o=function(t,n){var r=f(t);if(r){var i=e.getCachedItem(r,n);return i?i.entity:void 0}};e.getEditItem=function(t,e,n){return a.isArray(t)?t.map(function(t){return c(t,e)}).filter(function(t){return null!==t&&void 0!==t}):c(t,e)};var c=function(t,n){var r=f(t),i=e.getItem(r,n),u=a.deepClone(i,void 0,!1);return console.log(u),i?a.deepClone(i,void 0,!1):void 0},f=function(t){return"string"==typeof t?t:"number"==typeof t?String(t):a.isObject(t)&&a.hasUid(t)?t[u.config.uidName]:void 0};e.isOnCache=function(t){var n=t.entity[u.config.uidName],r=e.getCachedItem(n,t.instance);return r&&r.entity===t.entity},e.getCachedItem=function(t,e){var n=r(e);return n?n.items.get(String(t)):void 0},e.getCacheCurrentStack=function(t){var e=r(t);return e?e.items:void 0}},function(t,e,n){"use strict";function r(t){var e=parseInt(t);return e.toString()===t?e:t}function i(t,e){if(a.isNumber(e)&&(e=[e]),!a.isEmpty(t)){if(a.isEmpty(e))return t;if(a.isString(e))return i(t,e.split("."));var n=r(e[0]),u=t[n];if(1===e.length)void 0!==u&&(a.isArray(t)?t.splice(n,1):delete t[n]);else if(void 0!==t[n])return i(t[n],e.slice(1));return t}}function u(t,e,n){if(a.isNumber(e)&&(e=[e]),a.isEmpty(e))return t;if(a.isEmpty(t))return n;if(a.isString(e))return u(t,e.split("."),n);var i=r(e[0]);return 1===e.length?void 0===t[i]?n:t[i]:u(t[i],e.slice(1),n)}var a=n(7);e.del=i,e.get=u,e.concatProp=function(t,e){return t=""===t?e:t+"."+e}},function(t,e,n){"use strict";var r=n(4),i=function(){function t(e,n){var i=this;this.clone=function(){return new t(i.entity,i)},this.entity=e,n?(this.mapFrom=n.mapFrom.clone(),this.mapTo=n.mapTo.clone()):(this.mapFrom=new r.default,this.mapTo=new r.default)}return t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e,n){"use strict";var r=n(1);e.printCache=function(t){var e="",n=0,u=t.thread.current,a=t.thread.nodes;return a.map(function(r){var a=t.repo.get(r),o="",c=n+":"+o+"["+i(a.items)+"]\n\n";n===u&&(c="-> "+c),e+=c,n++}),e=e.substring(0,e.length-2),n=0,"\n------ One -------\nSTACK:\n"+e+"\n\nCONFIG:"+JSON.stringify(r.config,null,2)+"\n\nREPO SIZE:"+t.repo.length+"\n===================\n"};var i=function(t){var e="";return t.forEach(function(t,n){var r=JSON.stringify(n,null,2);e+=r+",\n"}),e}},function(t,e,n){"use strict";var r=n(16),i=n(17),u=function(){function t(t){var e=this;this.repo=new r.default,this.thread=new i.default,this.nextNodeKey=0,this.reset=function(){e.repo=new r.default,e.thread=new i.default,e.nextNodeKey=0},this.addNode=function(t){return!!e.repo.add(t)&&(e.thread.addNode(t.id),e.nextNodeKey++,!0)},this.length=function(){return e.thread.nodes.length},this.size=function(){return e.repo.length},this.name=t}return t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=u},function(t,e,n){"use strict";var r=n(4),i=function(){function t(){var t=this;this.items=new r.default,this.length=0,this.get=function(e){return t.items.get(e)},this.add=function(e){return!t.items.has(e.id)&&(t.items.set(e.id,e),t.length++,!0)},this.delete=function(e){t.items.has(e)&&(t.items.delete(e),t.length--)}}return t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e){"use strict";var n=function(){function t(){var t=this;this.current=-1,this.nodes=[],this.addNode=function(e){t.nodes.push(e),t.current++}}return t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=n},function(t,e,n){"use strict";var r=n(7),i=n(1),u=n(11),a=n(4),o=n(12),c=n(10),f=n(6),s=n(9);e.evictItem=function(t,e){var n=v(t);if(0==n.length)return f.getCallStats(!1,e);var r=u.getCacheCurrentStack(e),i=n.some(function(t){return r&&r.has(String(t))});if(!i)return f.getCallStats(!1,e);var o=new a.default;r.forEach(function(t,e){o.set(t,e)});var s=new a.default,l=new a.default,g={flushMap:s,evictMap:l,instance:e},m=[];return n.forEach(function(t){g.entityUid=t,h(g),l.set(t,null),p(n,m,g)}),d(m,s,l,e),s.forEach(function(t,e){o.set(t,e)}),l.forEach(function(t,e){o.delete(t)}),c.flush(o,e),f.getCallStats(!0,e)};var d=function(t,e,n,i){if(t&&t.length>0&&r.cacheSize(i)>0){var u={flushMap:e,evictMap:n,instance:i};c.buildFlushMap(u),u.flushMap.forEach(function(t,e){s.updateRefFroms(e,u)})}},h=function(t){var e=u.getCachedItem(t.entityUid,t.instance);e&&e.mapTo.forEach(function(e,n){var r=c.getItemFlushOrCached(e,t);r&&(l(r,t.entityUid),0===r.mapFrom.size()?(t.entityUid=e,h(t),t.evictMap.set(e,r)):t.flushMap.set(e,r))})},l=function(t,e){var n=t.mapFrom.get(e);n&&(t.mapFrom=t.mapFrom.clone(),t.mapFrom.delete(e))},p=function(t,e,n){var r=c.getItemFlushOrCached(n.entityUid,n);r&&r.mapFrom.forEach(function(r,i){var u=c.getItemFlushOrCached(r,n);if(u){var a=g(u,n.entityUid,n.instance);a===!0&&(n.flushMap.set(r,u),t.indexOf(r)<0&&e.push(u))}})},g=function(t,e,n){var r=t.entity;Object.isFrozen(r)&&(r=u.getEditItem(r[i.config.uidName],n),t.entity=r);var a=t.mapTo.get(e);return a.forEach(function(t){o.del(r,t)}),Object.isFrozen(r)||Object.freeze(r),t.entity=r,t.mapTo=t.mapTo.clone(),t.mapTo.delete(e),!0},v=function(t){var e=[];if(r.isArray(t))t.forEach(function(t){r.hasUid(t)?e.push(String(t[i.config.uidName])):"string"!=typeof t&&"number"!=typeof t||e.push(String(t))});else{var n=t;if(r.isObject(t)&&(n=t[i.config.uidName]),void 0===n)return e;e.push(String(n))}return e};e.clearNext=function(t){var e=t.thread;if(e.current void; + addNode: (node: ICacheNode) => boolean; + size: () => number; + length: () => number; +} +export default class CacheInstance implements ICacheInstance { + name: string; + repo: ICacheRepo; + thread: ICacheThread; + nextNodeKey: number; + constructor(name: string); + reset: () => void; + addNode: (node: ICacheNode) => boolean; + length: () => number; + size: () => number; +} diff --git a/lib/CacheInstance.js b/lib/CacheInstance.js new file mode 100644 index 0000000..faedf41 --- /dev/null +++ b/lib/CacheInstance.js @@ -0,0 +1,34 @@ +"use strict"; +var CacheRepo_1 = require("./CacheRepo"); +var CacheThread_1 = require("./CacheThread"); +var CacheInstance = (function () { + function CacheInstance(name) { + var _this = this; + this.repo = new CacheRepo_1.default(); + this.thread = new CacheThread_1.default(); + this.nextNodeKey = 0; + this.reset = function () { + _this.repo = new CacheRepo_1.default(); + _this.thread = new CacheThread_1.default(); + _this.nextNodeKey = 0; + }; + this.addNode = function (node) { + if (_this.repo.add(node)) { + _this.thread.addNode(node.id); + _this.nextNodeKey++; + return true; + } + return false; + }; + this.length = function () { + return _this.thread.nodes.length; + }; + this.size = function () { + return _this.repo.length; + }; + this.name = name; + } + return CacheInstance; +}()); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = CacheInstance; diff --git a/lib/CacheItem.d.ts b/lib/CacheItem.d.ts new file mode 100644 index 0000000..3d640b8 --- /dev/null +++ b/lib/CacheItem.d.ts @@ -0,0 +1,8 @@ +import CacheMap from './CacheMap'; +export default class CacheItem { + entity: {}; + mapTo: CacheMap>; + mapFrom: CacheMap>; + constructor(entity: {}, liveItem?: CacheItem); + clone: () => CacheItem; +} diff --git a/lib/CacheItem.js b/lib/CacheItem.js new file mode 100644 index 0000000..7012627 --- /dev/null +++ b/lib/CacheItem.js @@ -0,0 +1,22 @@ +"use strict"; +var CacheMap_1 = require("./CacheMap"); +var CacheItem = (function () { + function CacheItem(entity, liveItem) { + var _this = this; + this.clone = function () { + return new CacheItem(_this.entity, _this); + }; + this.entity = entity; + if (liveItem) { + this.mapFrom = liveItem.mapFrom.clone(); + this.mapTo = liveItem.mapTo.clone(); + } + else { + this.mapFrom = new CacheMap_1.default(); + this.mapTo = new CacheMap_1.default(); + } + } + return CacheItem; +}()); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = CacheItem; diff --git a/lib/CacheMap.d.ts b/lib/CacheMap.d.ts new file mode 100644 index 0000000..e47cae2 --- /dev/null +++ b/lib/CacheMap.d.ts @@ -0,0 +1,12 @@ +export default class CacheMap { + paths: {}; + length: number; + constructor(); + set(key: string | number, value: T): boolean; + get: (key: any) => T; + delete: (key: any) => boolean; + has: (key: any) => boolean; + forEach: (callback: Function) => void; + clone: () => CacheMap; + size(): number; +} diff --git a/lib/CacheMap.js b/lib/CacheMap.js new file mode 100644 index 0000000..b6e461d --- /dev/null +++ b/lib/CacheMap.js @@ -0,0 +1,52 @@ +"use strict"; +var objectAssign = require('object-assign'); +var CacheMap = (function () { + function CacheMap() { + var _this = this; + this.paths = {}; + this.length = 0; + this.get = function (key) { + return _this.paths[key]; + }; + this.delete = function (key) { + if (typeof _this.paths[key] !== "undefined" && _this.length > 0) { + var val = _this.paths[key]; + delete _this.paths[key]; + _this.length--; + return val; + } + }; + this.has = function (key) { + return typeof _this.paths[key] !== 'undefined'; + }; + this.forEach = function (callback) { + for (var key in _this.paths) { + if (_this.paths.hasOwnProperty(key)) { + callback(key, _this.paths[key]); + } + } + }; + this.clone = function () { + var newInstance = objectAssign({}, _this.paths); + var clone = new CacheMap(); + clone.paths = newInstance; + clone.length = _this.length; + return clone; + }; + } + CacheMap.prototype.set = function (key, value) { + if (typeof this.paths[key] === "undefined") { + this.length++; + this.paths[key] = value; + return true; + } + this.paths[key] = value; + return false; + }; + CacheMap.prototype.size = function () { + return this.length; + }; + return CacheMap; +}()); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = CacheMap; diff --git a/lib/CacheNode.d.ts b/lib/CacheNode.d.ts new file mode 100644 index 0000000..7cf7bea --- /dev/null +++ b/lib/CacheNode.d.ts @@ -0,0 +1,11 @@ +import CacheMap from './CacheMap'; +import CacheItem from './CacheItem'; +export interface ICacheNode { + id: number; + items: CacheMap; +} +export declare class CacheNode implements ICacheNode { + id: number; + items: CacheMap; + constructor(nodeId: number); +} diff --git a/lib/CacheNode.js b/lib/CacheNode.js new file mode 100644 index 0000000..2e26fdb --- /dev/null +++ b/lib/CacheNode.js @@ -0,0 +1,10 @@ +"use strict"; +var CacheMap_1 = require("./CacheMap"); +var CacheNode = (function () { + function CacheNode(nodeId) { + this.items = new CacheMap_1.default(); + this.id = nodeId; + } + return CacheNode; +}()); +exports.CacheNode = CacheNode; diff --git a/lib/CacheRepo.d.ts b/lib/CacheRepo.d.ts new file mode 100644 index 0000000..290438c --- /dev/null +++ b/lib/CacheRepo.d.ts @@ -0,0 +1,15 @@ +import { ICacheNode } from './CacheNode'; +import CacheMap from './CacheMap'; +export interface ICacheRepo { + get: (nodeId: number) => ICacheNode; + length: number; + add: (node: ICacheNode) => boolean; + delete: (nodeId: number) => void; +} +export default class CacheRepo implements ICacheRepo { + items: CacheMap; + length: number; + get: (nodeId: any) => ICacheNode; + add: (node: ICacheNode) => boolean; + delete: (nodeId: number) => void; +} diff --git a/lib/CacheRepo.js b/lib/CacheRepo.js new file mode 100644 index 0000000..f890913 --- /dev/null +++ b/lib/CacheRepo.js @@ -0,0 +1,27 @@ +"use strict"; +var CacheMap_1 = require("./CacheMap"); +var CacheRepo = (function () { + function CacheRepo() { + var _this = this; + this.items = new CacheMap_1.default(); + this.length = 0; + this.get = function (nodeId) { return (_this.items.get(nodeId)); }; + this.add = function (node) { + if (!_this.items.has(node.id)) { + _this.items.set(node.id, node); + _this.length++; + return true; + } + return false; + }; + this.delete = function (nodeId) { + if (_this.items.has(nodeId)) { + _this.items.delete(nodeId); + _this.length--; + } + }; + } + return CacheRepo; +}()); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = CacheRepo; diff --git a/lib/CacheThread.d.ts b/lib/CacheThread.d.ts new file mode 100644 index 0000000..04f2470 --- /dev/null +++ b/lib/CacheThread.d.ts @@ -0,0 +1,10 @@ +export interface ICacheThread { + current: number; + nodes: Array; + addNode: (nodeId: number) => void; +} +export default class CacheThread implements ICacheThread { + current: number; + nodes: Array; + addNode: (nodeId: number) => void; +} diff --git a/lib/CacheThread.js b/lib/CacheThread.js new file mode 100644 index 0000000..74b1c3d --- /dev/null +++ b/lib/CacheThread.js @@ -0,0 +1,15 @@ +"use strict"; +var CacheThread = (function () { + function CacheThread() { + var _this = this; + this.current = -1; + this.nodes = []; + this.addNode = function (nodeId) { + _this.nodes.push(nodeId); + _this.current++; + }; + } + return CacheThread; +}()); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = CacheThread; diff --git a/lib/cache.d.ts b/lib/cache.d.ts new file mode 100644 index 0000000..e9c9975 --- /dev/null +++ b/lib/cache.d.ts @@ -0,0 +1,21 @@ +import { ICacheStats } from './interfaces'; +export declare let instances: any; +export declare let config: any; +export declare function setTesting(testing: boolean): void; +export interface ICache { + put: Function; + get: Function; + getEdit: Function; + evict: Function; + reset: Function; + size: Function; + length: Function; + print: Function; +} +export declare function getCache(instanceName?: string, configuration?: {}): ICache; +export declare const put: (item: {} | {}[]) => void; +export declare const get: (entity: string | number | any[] | {}, nodeId?: number) => any; +export declare const getEdit: (uidOrEntityOrArray: string | number | any[] | {}, nodeId?: number) => any; +export declare const evict: (uidOrEntityOrArray: string | number | any[] | {}) => ICacheStats; +export declare const print: () => string; +export declare const reset: () => void; diff --git a/lib/cache.js b/lib/cache.js new file mode 100644 index 0000000..a7bb181 --- /dev/null +++ b/lib/cache.js @@ -0,0 +1,99 @@ +"use strict"; +var config_1 = require("./config"); +var put_1 = require("./put"); +var print_1 = require("./print"); +var CacheInstance_1 = require("./CacheInstance"); +var util_1 = require("./util"); +var get_1 = require("./get"); +var evict_1 = require("./evict"); +var cacheTest = false; +function setTesting(testing) { + cacheTest = testing; +} +exports.setTesting = setTesting; +function getCache(instanceName, configuration) { + if (instanceName === void 0) { instanceName = "one"; } + if (configuration === void 0) { configuration = config_1.defaultConfig; } + if (!exports.config && !exports.instances) { + exports.config = config_1.configure(configuration); + } + if (!exports.instances) { + exports.instances = {}; + } + if (!exports.instances[instanceName]) { + exports.instances[instanceName] = createCache(instanceName); + } + if (window) { + if (window[instanceName] === undefined) { + window[instanceName] = exports.instances[instanceName]; + } + } + return exports.instances[instanceName]; +} +exports.getCache = getCache; +exports.put = function (item) { + getCache().put(item); +}; +exports.get = function (entity, nodeId) { + return getCache().get(entity, nodeId); +}; +exports.getEdit = function (uidOrEntityOrArray, nodeId) { + return getCache().getEdit(uidOrEntityOrArray, nodeId); +}; +exports.evict = function (uidOrEntityOrArray) { + return getCache().evict(uidOrEntityOrArray); +}; +exports.print = function () { + return getCache().print(); +}; +exports.reset = function () { + getCache().reset(); +}; +function createCache(name) { + var instance = new CacheInstance_1.default(name); + var reset = function () { + instance.reset(); + }; + var put = function (item) { + return put_1.putItem(item, instance); + }; + var get = function (entity, nodeId) { + return get_1.getItem(entity, instance, nodeId); + }; + var getEdit = function (uidOrEntityOrArray, nodeId) { + return get_1.getEditItem(uidOrEntityOrArray, instance, nodeId); + }; + var evict = function (uidOrEntityOrArray) { + return evict_1.evictItem(uidOrEntityOrArray, instance); + }; + var size = function () { + return util_1.cacheSize(instance); + }; + var length = function () { + return util_1.cacheLength(instance); + }; + var print = function () { + return print_1.printCache(instance); + }; + var result = { + put: put, + get: get, + getEdit: getEdit, + evict: evict, + reset: reset, + size: size, + length: length, + print: print, + }; + if (cacheTest === true) { + result.refTo = function (uid) { + var item = get_1.getCachedItem(uid, instance); + return item.mapTo; + }; + result.refFrom = function (uid) { + var item = get_1.getCachedItem(uid, instance); + return item.mapFrom; + }; + } + return result; +} diff --git a/lib/config.d.ts b/lib/config.d.ts new file mode 100644 index 0000000..3a7a64b --- /dev/null +++ b/lib/config.d.ts @@ -0,0 +1,8 @@ +export declare const defaultConfig: { + uidName: string; + maxHistoryStates: number; +}; +export declare function configure(conf: any): { + uidName: string; + maxHistoryStates: number; +}; diff --git a/lib/config.js b/lib/config.js new file mode 100644 index 0000000..7cf1a2b --- /dev/null +++ b/lib/config.js @@ -0,0 +1,14 @@ +"use strict"; +exports.defaultConfig = { + uidName: "uid", + maxHistoryStates: 1000 +}; +function configure(conf) { + for (var p in exports.defaultConfig) { + if (exports.defaultConfig.hasOwnProperty(p) && conf.hasOwnProperty(p)) { + exports.defaultConfig[p] = conf[p]; + } + } + return exports.defaultConfig; +} +exports.configure = configure; diff --git a/lib/evict.d.ts b/lib/evict.d.ts new file mode 100644 index 0000000..aa71304 --- /dev/null +++ b/lib/evict.d.ts @@ -0,0 +1,4 @@ +import { ICacheInstance } from './CacheInstance'; +import { ICacheStats } from './interfaces'; +export declare const evictItem: (obj: any, instance: ICacheInstance) => ICacheStats; +export declare const clearNext: (instance: ICacheInstance) => void; diff --git a/lib/evict.js b/lib/evict.js new file mode 100644 index 0000000..f25f340 --- /dev/null +++ b/lib/evict.js @@ -0,0 +1,167 @@ +"use strict"; +var util_1 = require("./util"); +var cache_1 = require("./cache"); +var get_1 = require("./get"); +var CacheMap_1 = require("./CacheMap"); +var opath = require("./path"); +var flush_1 = require("./flush"); +var locate_1 = require("./locate"); +var ref_1 = require("./ref"); +exports.evictItem = function (obj, instance) { + var uidArray = buildEvictUidArray(obj); + if (uidArray.length == 0) { + return locate_1.getCallStats(false, instance); + } + var currentState = get_1.getCacheCurrentStack(instance); + var found = uidArray.some(function (item) { + return currentState && currentState.has(String(item)); + }); + if (!found) { + return locate_1.getCallStats(false, instance); + } + var tempState = new CacheMap_1.default(); + currentState.forEach(function (key, value) { + tempState.set(key, value); + }); + var flushMap = new CacheMap_1.default(); + var evictMap = new CacheMap_1.default(); + var flushArgs = { + flushMap: flushMap, + evictMap: evictMap, + instance: instance + }; + var parentsChanged = []; + uidArray.forEach(function (uid) { + flushArgs.entityUid = uid; + clearTargetRefFroms(flushArgs); + evictMap.set(uid, null); + clearParentRefTos(uidArray, parentsChanged, flushArgs); + }); + putParentsChanged(parentsChanged, flushMap, evictMap, instance); + flushMap.forEach(function (key, item) { + tempState.set(key, item); + }); + evictMap.forEach(function (key, item) { + tempState.delete(key); + }); + flush_1.flush(tempState, instance); + return locate_1.getCallStats(true, instance); +}; +var putParentsChanged = function (parentsChanged, flushMap, evictMap, instance) { + if (parentsChanged && parentsChanged.length > 0 && util_1.cacheSize(instance) > 0) { + var flushArgs_1 = { + flushMap: flushMap, + evictMap: evictMap, + instance: instance + }; + flush_1.buildFlushMap(flushArgs_1); + flushArgs_1.flushMap.forEach(function (key, item) { + ref_1.updateRefFroms(item, flushArgs_1); + }); + } +}; +var clearTargetRefFroms = function (flushArgs) { + var item = get_1.getCachedItem(flushArgs.entityUid, flushArgs.instance); + if (item) { + item.mapTo.forEach(function (toUid, paths) { + var refItem = flush_1.getItemFlushOrCached(toUid, flushArgs); + if (refItem) { + clearRefFrom(refItem, flushArgs.entityUid); + if (refItem.mapFrom.size() === 0) { + flushArgs.entityUid = toUid; + clearTargetRefFroms(flushArgs); + flushArgs.evictMap.set(toUid, refItem); + } + else { + flushArgs.flushMap.set(toUid, refItem); + } + } + }); + } +}; +var clearRefFrom = function (refItem, parentUid) { + var refsArray = refItem.mapFrom.get(parentUid); + if (!refsArray) { + return; + } + refItem.mapFrom = refItem.mapFrom.clone(); + refItem.mapFrom.delete(parentUid); +}; +var clearParentRefTos = function (uidArray, parentsChanged, flushArgs) { + var item = flush_1.getItemFlushOrCached(flushArgs.entityUid, flushArgs); + if (item) { + item.mapFrom.forEach(function (parentUid, paths) { + var parentItem = flush_1.getItemFlushOrCached(parentUid, flushArgs); + if (parentItem) { + var success = clearRefTo(parentItem, flushArgs.entityUid, flushArgs.instance); + if (success === true) { + flushArgs.flushMap.set(parentUid, parentItem); + if (uidArray.indexOf(parentUid) < 0) { + parentsChanged.push(parentItem); + } + } + } + }); + } +}; +var clearRefTo = function (parentItem, refUid, instance) { + var parent = parentItem.entity; + if (Object.isFrozen(parent)) { + parent = get_1.getEditItem(parent[cache_1.config.uidName], instance); + parentItem.entity = parent; + } + var refPaths = parentItem.mapTo.get(refUid); + refPaths.forEach(function (path) { + opath.del(parent, path); + }); + if (!Object.isFrozen(parent)) { + Object.freeze(parent); + } + parentItem.entity = parent; + parentItem.mapTo = parentItem.mapTo.clone(); + parentItem.mapTo.delete(refUid); + return true; +}; +var buildEvictUidArray = function (obj) { + var uidArray = []; + if (util_1.isArray(obj)) { + obj.forEach(function (item) { + if (util_1.hasUid(item)) { + uidArray.push(String(item[cache_1.config.uidName])); + } + else { + if (typeof item === "string" || typeof item === "number") { + uidArray.push(String(item)); + } + } + }); + } + else { + var uid = obj; + if (util_1.isObject(obj)) { + uid = obj[cache_1.config.uidName]; + } + if (uid === undefined) { + return uidArray; + } + uidArray.push(String(uid)); + } + return uidArray; +}; +exports.clearNext = function (instance) { + var thread = instance.thread; + if (thread.current < thread.nodes.length - 1) { + var removedNodes = thread.nodes.slice(thread.current + 1, thread.nodes.length); + thread.nodes = thread.nodes.slice(0, thread.current + 1); + thread.current = thread.nodes.length - 1; + truncateThreads(removedNodes, instance); + } +}; +var truncateThreads = function (removedNodes, instance) { + removedNodes.forEach(function (cacheNodeId) { + var cacheNode = instance.repo.get(cacheNodeId); + if (cacheNode) { + instance.repo.delete(cacheNodeId); + } + }); +}; diff --git a/lib/flush.d.ts b/lib/flush.d.ts new file mode 100644 index 0000000..fc12ca3 --- /dev/null +++ b/lib/flush.d.ts @@ -0,0 +1,9 @@ +import { ICacheInstance } from './CacheInstance'; +import CacheItem from './CacheItem'; +import { IFlushArgs } from './interfaces'; +import CacheMap from './CacheMap'; +export declare const buildFlushMap: (flushArgs: IFlushArgs) => void; +export declare const getItemFlushOrCached: (uid: string, flushArgs: IFlushArgs) => CacheItem; +export declare const ensureItem: (flushArgs: IFlushArgs) => CacheItem; +export declare const preFlush: (flushArgs: IFlushArgs) => void; +export declare const flush: (temp: CacheMap, instance: ICacheInstance) => void; diff --git a/lib/flush.js b/lib/flush.js new file mode 100644 index 0000000..6c99e1b --- /dev/null +++ b/lib/flush.js @@ -0,0 +1,166 @@ +"use strict"; +var get_1 = require("./get"); +var cache_1 = require("./cache"); +var util_1 = require("./util"); +var path_1 = require("./path"); +var CacheItem_1 = require("./CacheItem"); +var CacheMap_1 = require("./CacheMap"); +var ref_1 = require("./ref"); +exports.buildFlushMap = function (flushArgs) { + if (util_1.hasUid(flushArgs.entity)) { + buildEntityFlushMap(flushArgs); + } + else { + if (util_1.isArray(flushArgs.entity)) { + cacheArrRefs(flushArgs); + } + else { + cacheEntityRefs(flushArgs); + } + } +}; +var buildEntityFlushMap = function (flushArgs) { + flushArgs.refPath = ""; + if (isDirty(flushArgs) === true) { + ensureOnFlushMap(flushArgs); + cacheEntityRefs(flushArgs); + ref_1.updateRefTos(String(flushArgs.entity[cache_1.config.uidName]), flushArgs); + } +}; +var ensureOnFlushMap = function (flushArgs) { + var entityUid = String(flushArgs.entity[cache_1.config.uidName]); + if (flushArgs.flushMap.has(entityUid) === false) { + exports.ensureItem(flushArgs); + flushArgs.parentUid = String(entityUid); + } +}; +var cacheEntityRefs = function (flushArgs) { + var parentEntity = flushArgs.entity; + for (var prop in parentEntity) { + if (parentEntity.hasOwnProperty(prop)) { + var refEntity = parentEntity[prop]; + if (util_1.isObject(refEntity) || util_1.isArray(refEntity)) { + flushArgs.entity = refEntity; + if (parentEntity[cache_1.config.uidName]) { + flushArgs.parentUid = parentEntity[cache_1.config.uidName]; + } + if (flushArgs.parentUid) { + flushArgs.refPath = path_1.concatProp(flushArgs.refPath, prop); + } + if (!flushArgs.refPath) { + flushArgs.refPath = prop; + } + } + if (util_1.isArray(refEntity)) { + cacheArrRefs(flushArgs); + } + else if (util_1.isObject(refEntity)) { + cacheObjRefs(flushArgs); + } + Object.freeze(refEntity); + } + } +}; +var cacheArrRefs = function (flushArgs) { + var entity = flushArgs.entity; + var arrayPath = flushArgs.refPath; + var arrayUid; + if (!arrayUid) { + arrayUid = flushArgs.parentUid; + } + entity.forEach(function (next, index) { + flushArgs.entity = next; + flushArgs.parentUid = arrayUid; + if (flushArgs.refPath || arrayPath) { + flushArgs.refPath = arrayPath + "." + index; + } + if (util_1.isArray(next)) { + cacheArrRefs(flushArgs); + } + else if (util_1.isObject(next)) { + cacheObjRefs(flushArgs); + } + }); + Object.freeze(entity); +}; +var cacheObjRefs = function (flushArgs) { + if (util_1.hasUid(flushArgs.entity)) { + cacheUidObjRefs(flushArgs); + } + else { + cacheEntityRefs(flushArgs); + } +}; +var cacheUidObjRefs = function (flushArgs) { + var refItem = exports.ensureItem(flushArgs); + ref_1.assignRefToParent(refItem, flushArgs); + if (get_1.isOnCache(flushArgs) === true) + return; + exports.buildFlushMap(flushArgs); +}; +var isDirty = function (flushArgs) { + var cachedItem = get_1.getCachedItem(flushArgs.entity[cache_1.config.uidName], flushArgs.instance); + return !cachedItem || cachedItem.entity !== flushArgs.entity; +}; +exports.getItemFlushOrCached = function (uid, flushArgs) { + if (uid) { + uid = String(uid); + var item = flushArgs.flushMap.get(uid); + if (!item) { + item = get_1.getCachedItem(uid, flushArgs.instance); + } + if (item && Object.isFrozen(item)) { + item = item.clone(); + } + return item; + } +}; +exports.ensureItem = function (flushArgs) { + var itemUid = String(flushArgs.entity[cache_1.config.uidName]); + var item = flushArgs.flushMap.get(itemUid); + if (item) { + return item; + } + var live = get_1.getCachedItem(itemUid, flushArgs.instance); + item = new CacheItem_1.default(flushArgs.entity, live); + flushArgs.flushMap.set(itemUid, item); + flushArgs.flushMap['__UPDATED__'] = true; + return item; +}; +exports.preFlush = function (flushArgs) { + var temp = new CacheMap_1.default(); + var currentStack = get_1.getCacheCurrentStack(flushArgs.instance); + if (currentStack) { + currentStack.forEach(function (key, item) { + temp.set(key, item); + }); + } + flushArgs.flushMap.forEach(function (key, item) { + var itemUid = item.entity[cache_1.config.uidName]; + freezeItem(item); + temp.set(String(itemUid), item); + }); + if (flushArgs.evictMap.size() > 0) { + flushArgs.evictMap.forEach(function (key, value) { + temp.delete(String(key)); + }); + } + exports.flush(temp, flushArgs.instance); +}; +var freezeItem = function (item) { + Object.freeze(item); + Object.freeze(item.entity); + Object.freeze(item.mapTo); + Object.freeze(item.mapFrom); +}; +exports.flush = function (temp, instance) { + if (temp !== null) { + Object.freeze(temp); + var cacheNode = util_1.getNewCacheNode(instance); + cacheNode.items = temp; + if (instance.thread.nodes.indexOf(cacheNode.id) < 0) { + instance.thread.nodes.push(cacheNode.id); + instance.thread.current += 1; + } + } +}; diff --git a/lib/get.d.ts b/lib/get.d.ts new file mode 100644 index 0000000..a46ce4f --- /dev/null +++ b/lib/get.d.ts @@ -0,0 +1,9 @@ +import { ICacheInstance } from './CacheInstance'; +import CacheItem from './CacheItem'; +import CacheMap from './CacheMap'; +import { IFlushArgs } from './interfaces'; +export declare const getItem: (entity: string | number | any[] | {}, instance: ICacheInstance, nodeId?: number) => {}; +export declare const getEditItem: (obj: string | number | any[] | {}, instance: ICacheInstance, nodeId?: number) => any; +export declare const isOnCache: (flushArgs: IFlushArgs) => boolean; +export declare const getCachedItem: (uid: string, instance: ICacheInstance) => CacheItem; +export declare const getCacheCurrentStack: (instance: ICacheInstance) => CacheMap; diff --git a/lib/get.js b/lib/get.js new file mode 100644 index 0000000..ed1cae4 --- /dev/null +++ b/lib/get.js @@ -0,0 +1,74 @@ +"use strict"; +var cache_1 = require("./cache"); +var util_1 = require("./util"); +exports.getItem = function (entity, instance, nodeId) { + if (!entity) { + throw new TypeError("One get(): requires a uid to retrieve an item from the cache."); + } + if (util_1.isArray(entity)) { + return entity.map(function (item) { + return getObject(item, instance); + }).filter(function (item) { + return item !== null && item !== undefined; + }); + } + return getObject(entity, instance); +}; +var getObject = function (uidOrEntity, instance) { + var realUid = getActualUid(uidOrEntity); + if (!realUid) { + return; + } + var item = exports.getCachedItem(realUid, instance); + return item ? item.entity : undefined; +}; +exports.getEditItem = function (obj, instance, nodeId) { + if (util_1.isArray(obj)) { + return obj.map(function (item) { + return getEditableObject(item, instance); + }).filter(function (item) { + return item !== null && item !== undefined; + }); + } + return getEditableObject(obj, instance); +}; +var getEditableObject = function (uidOrEntity, instance) { + var realUid = getActualUid(uidOrEntity); + var existing = exports.getItem(realUid, instance); + var clone = util_1.deepClone(existing, undefined, false); + console.log(clone); + return existing ? util_1.deepClone(existing, undefined, false) : undefined; +}; +var getActualUid = function (uidOrEntity) { + if (typeof uidOrEntity === "string") { + return uidOrEntity; + } + else if (typeof uidOrEntity === "number") { + return String(uidOrEntity); + } + else if (util_1.isObject(uidOrEntity)) { + if (util_1.hasUid(uidOrEntity)) { + return uidOrEntity[cache_1.config.uidName]; + } + } +}; +exports.isOnCache = function (flushArgs) { + var uid = flushArgs.entity[cache_1.config.uidName]; + var existingItem = exports.getCachedItem(uid, flushArgs.instance); + return existingItem && existingItem.entity === flushArgs.entity; +}; +exports.getCachedItem = function (uid, instance) { + var currentNode = getCurrentNode(instance); + return currentNode ? currentNode.items.get(String(uid)) : undefined; +}; +function getCurrentNode(instance) { + var currentNodeId = instance.thread.nodes[instance.thread.current]; + return currentNodeId >= 0 ? getRepoNode(currentNodeId, instance.repo) : undefined; +} +function getRepoNode(nodeId, repo) { + return repo.get(nodeId); +} +exports.getCacheCurrentStack = function (instance) { + var currentNode = getCurrentNode(instance); + return currentNode ? currentNode.items : undefined; +}; diff --git a/lib/index.d.ts b/lib/index.d.ts new file mode 100644 index 0000000..4a177b2 --- /dev/null +++ b/lib/index.d.ts @@ -0,0 +1,2 @@ +import { getCache, put, get, getEdit, evict, reset, print } from './cache'; +export { getCache, put, get, getEdit, evict, reset, print }; diff --git a/lib/index.js b/lib/index.js new file mode 100644 index 0000000..c4f34a5 --- /dev/null +++ b/lib/index.js @@ -0,0 +1,16 @@ +"use strict"; +var cache_1 = require("./cache"); +exports.getCache = cache_1.getCache; +exports.put = cache_1.put; +exports.get = cache_1.get; +exports.getEdit = cache_1.getEdit; +exports.evict = cache_1.evict; +exports.reset = cache_1.reset; +exports.print = cache_1.print; +(function () { + if (window) { + window.One = { + getCache: cache_1.getCache, put: cache_1.put, get: cache_1.get, getEdit: cache_1.getEdit, evict: cache_1.evict, reset: cache_1.reset, print: cache_1.print + }; + } +})(); diff --git a/lib/interfaces.d.ts b/lib/interfaces.d.ts new file mode 100644 index 0000000..26bfbb9 --- /dev/null +++ b/lib/interfaces.d.ts @@ -0,0 +1,18 @@ +import CacheMap from './CacheMap'; +import CacheItem from './CacheItem'; +import { ICacheInstance } from './CacheInstance'; +export interface IFlushArgs { + entity?: {} | Array<{}>; + entityUid?: string; + flushMap: CacheMap; + evictMap?: CacheMap; + parentUid?: string; + refPath?: string; + instance: ICacheInstance; +} +export interface ICacheStats { + success: boolean; + nodeId: number; + length: number; + name: string; +} diff --git a/lib/interfaces.js b/lib/interfaces.js new file mode 100644 index 0000000..3918c74 --- /dev/null +++ b/lib/interfaces.js @@ -0,0 +1 @@ +"use strict"; diff --git a/lib/locate.d.ts b/lib/locate.d.ts new file mode 100644 index 0000000..42f650d --- /dev/null +++ b/lib/locate.d.ts @@ -0,0 +1,7 @@ +import { ICacheInstance } from './CacheInstance'; +import { ICacheStats } from './interfaces'; +import { ICacheNode } from './CacheNode'; +export declare const getCallStats: (success: boolean, instance: ICacheInstance) => ICacheStats; +export declare const node: (instance: ICacheInstance, nodeId?: any) => number | ICacheStats; +export declare function getCurrentNode(instance: ICacheInstance): ICacheNode; +export declare function getRepoNode(cacheNodeId: any, instance: ICacheInstance): ICacheNode; diff --git a/lib/locate.js b/lib/locate.js new file mode 100644 index 0000000..992bac1 --- /dev/null +++ b/lib/locate.js @@ -0,0 +1,56 @@ +"use strict"; +var util_1 = require("./util"); +exports.getCallStats = function (success, instance) { + var result = {}; + result.success = success; + result.nodeId = exports.node(instance); + result.length = length(instance); + result.name = instance.name; + return result; +}; +exports.node = function (instance, nodeId) { + if (typeof nodeId === "undefined") { + var currentNode = getCurrentNode(instance); + return currentNode ? currentNode.id : -1; + } + if (!util_1.isNumber(nodeId)) { + throw new TypeError("The node id must be a number."); + } + var cacheNode = getRepoNode(nodeId, instance); + if (!cacheNode) { + return exports.getCallStats(false, instance); + } + instance.thread.current = binaryIndexOf(instance.thread.nodes, nodeId); + return exports.getCallStats(true, instance); +}; +function getCurrentNode(instance) { + var currentNodeId = instance.thread.nodes[instance.thread.current]; + return currentNodeId >= 0 ? getRepoNode(currentNodeId, instance) : undefined; +} +exports.getCurrentNode = getCurrentNode; +function getRepoNode(cacheNodeId, instance) { + return instance.repo.get(cacheNodeId); +} +exports.getRepoNode = getRepoNode; +var length = function (instance) { + return instance.thread.nodes.length; +}; +function binaryIndexOf(array, searchElement) { + var minIndex = 0; + var maxIndex = array.length - 1; + var currentIndex; + var currentElement; + while (minIndex <= maxIndex) { + currentIndex = (minIndex + maxIndex) / 2 | 0; + currentElement = array[currentIndex]; + if (currentElement < searchElement) { + minIndex = currentIndex + 1; + } + else if (currentElement > searchElement) { + maxIndex = currentIndex - 1; + } + else { + return currentIndex; + } + } +} diff --git a/lib/path.d.ts b/lib/path.d.ts new file mode 100644 index 0000000..dde74a0 --- /dev/null +++ b/lib/path.d.ts @@ -0,0 +1,3 @@ +export declare function del(obj: any, path?: any): any; +export declare function get(obj: any, path: any, defaultValue?: any): any; +export declare const concatProp: (propChain: any, prop: any) => any; diff --git a/lib/path.js b/lib/path.js new file mode 100644 index 0000000..f52393e --- /dev/null +++ b/lib/path.js @@ -0,0 +1,74 @@ +"use strict"; +var util_1 = require("./util"); +function getKey(key) { + var intKey = parseInt(key); + if (intKey.toString() === key) { + return intKey; + } + return key; +} +function del(obj, path) { + if (util_1.isNumber(path)) { + path = [path]; + } + if (util_1.isEmpty(obj)) { + return void 0; + } + if (util_1.isEmpty(path)) { + return obj; + } + if (util_1.isString(path)) { + return del(obj, path.split('.')); + } + var currentPath = getKey(path[0]); + var oldVal = obj[currentPath]; + if (path.length === 1) { + if (oldVal !== void 0) { + if (util_1.isArray(obj)) { + obj.splice(currentPath, 1); + } + else { + delete obj[currentPath]; + } + } + } + else { + if (obj[currentPath] !== void 0) { + return del(obj[currentPath], path.slice(1)); + } + } + return obj; +} +exports.del = del; +function get(obj, path, defaultValue) { + if (util_1.isNumber(path)) { + path = [path]; + } + if (util_1.isEmpty(path)) { + return obj; + } + if (util_1.isEmpty(obj)) { + return defaultValue; + } + if (util_1.isString(path)) { + return get(obj, path.split('.'), defaultValue); + } + var currentPath = getKey(path[0]); + if (path.length === 1) { + if (obj[currentPath] === void 0) { + return defaultValue; + } + return obj[currentPath]; + } + return get(obj[currentPath], path.slice(1), defaultValue); +} +exports.get = get; +exports.concatProp = function (propChain, prop) { + if (propChain === "") { + propChain = prop; + } + else { + propChain = propChain + "." + prop; + } + return propChain; +}; diff --git a/lib/print.d.ts b/lib/print.d.ts new file mode 100644 index 0000000..6ac4680 --- /dev/null +++ b/lib/print.d.ts @@ -0,0 +1,2 @@ +import { ICacheInstance } from './CacheInstance'; +export declare const printCache: (instance: ICacheInstance) => string; diff --git a/lib/print.js b/lib/print.js new file mode 100644 index 0000000..aa991a3 --- /dev/null +++ b/lib/print.js @@ -0,0 +1,33 @@ +"use strict"; +var cache_1 = require("./cache"); +exports.printCache = function (instance) { + var result = ""; + var index = 0; + var current = instance.thread.current; + var nodeIndices = instance.thread.nodes; + nodeIndices.map(function (cacheNodeId) { + var cacheNode = instance.repo.get(cacheNodeId); + var streamData = ""; + var state = index + ":" + streamData + "[" + stringifyMap(cacheNode.items) + "]\n\n"; + if (index === current) { + state = "-> " + state; + } + result += state; + index++; + }); + result = result.substring(0, (result.length - 2)); + index = 0; + return "\n------ One -------" + + "\nSTACK:\n" + result + + "\n\nCONFIG:" + JSON.stringify(cache_1.config, null, 2) + + "\n\nREPO SIZE:" + instance.repo.length + + "\n===================\n"; +}; +var stringifyMap = function (map) { + var result = ""; + map.forEach(function (key, item) { + var itemResult = JSON.stringify(item, null, 2); + result += itemResult + ",\n"; + }); + return result; +}; diff --git a/lib/put.d.ts b/lib/put.d.ts new file mode 100644 index 0000000..57bee2d --- /dev/null +++ b/lib/put.d.ts @@ -0,0 +1,3 @@ +import { ICacheInstance } from './CacheInstance'; +import { ICacheStats } from './interfaces'; +export declare const putItem: (entity: {} | {}[], instance: ICacheInstance) => ICacheStats; diff --git a/lib/put.js b/lib/put.js new file mode 100644 index 0000000..1da60f7 --- /dev/null +++ b/lib/put.js @@ -0,0 +1,31 @@ +"use strict"; +var CacheMap_1 = require("./CacheMap"); +var locate_1 = require("./locate"); +var util_1 = require("./util"); +var ref_1 = require("./ref"); +var flush_1 = require("./flush"); +exports.putItem = function (entity, instance) { + if ((util_1.isArray(entity) || util_1.isObject(entity))) { + var evictMap = new CacheMap_1.default(); + var flushMap = new CacheMap_1.default(); + flushMap['__UPDATED__'] = false; + var flushArgs = { + entity: entity, + flushMap: flushMap, + evictMap: evictMap, + parentUid: null, + refPath: "", + instance: instance + }; + flush_1.buildFlushMap(flushArgs); + ref_1.updatePointers(flushArgs); + if (flushArgs.flushMap.size() > 0 && flushMap['__UPDATED__'] === true) { + return commitPut(flushArgs); + } + } + return locate_1.getCallStats(false, instance); +}; +var commitPut = function (flushArgs) { + flush_1.preFlush(flushArgs); + return locate_1.getCallStats(true, flushArgs.instance); +}; diff --git a/lib/ref.d.ts b/lib/ref.d.ts new file mode 100644 index 0000000..e36d0f9 --- /dev/null +++ b/lib/ref.d.ts @@ -0,0 +1,6 @@ +import { IFlushArgs } from './interfaces'; +import CacheItem from './CacheItem'; +export declare const assignRefToParent: (refItem: any, flushArgs: IFlushArgs) => void; +export declare const updatePointers: (flushArgs: IFlushArgs) => void; +export declare const updateRefFroms: (item: CacheItem, flushArgs: IFlushArgs) => void; +export declare const updateRefTos: (entityUid: any, flushArgs: IFlushArgs) => void; diff --git a/lib/ref.js b/lib/ref.js new file mode 100644 index 0000000..83ffab1 --- /dev/null +++ b/lib/ref.js @@ -0,0 +1,126 @@ +"use strict"; +var flush_1 = require("./flush"); +var cache_1 = require("./cache"); +var opath = require("./path"); +var get_1 = require("./get"); +var util_1 = require("./util"); +exports.assignRefToParent = function (refItem, flushArgs) { + if (flushArgs.parentUid) { + var parentItem = flush_1.getItemFlushOrCached(flushArgs.parentUid, flushArgs); + if (parentItem && flushArgs.refPath) { + assignRefs(parentItem, refItem, flushArgs.refPath); + } + } +}; +var assignRefs = function (parentItem, refItem, refPath) { + var parentUid = parentItem.entity[cache_1.config.uidName]; + var refUid = refItem.entity[cache_1.config.uidName]; + addRefTo(parentItem, refUid, refPath); + addRefFrom(refItem, parentUid, refPath); +}; +var addRefTo = function (parentItem, refUid, path) { + if (parentItem.mapTo.has(refUid) === false) { + parentItem.mapTo.set(refUid, []); + } + var refArray = parentItem.mapTo.get(refUid); + if (refArray.indexOf(path) < 0) { + refArray.push(path); + } + return parentItem; +}; +var addRefFrom = function (refItem, parentUid, path) { + if (refItem.mapFrom.has(parentUid) === false) { + refItem.mapFrom.set(parentUid, []); + } + var fromArray = refItem.mapFrom.get(parentUid); + if (fromArray.indexOf(path) < 0) { + fromArray.push(path); + } + return refItem; +}; +exports.updatePointers = function (flushArgs) { + flushArgs.flushMap.forEach(function (key, item) { + updateItemRefTos(item, flushArgs); + exports.updateRefFroms(item, flushArgs); + }); +}; +exports.updateRefFroms = function (item, flushArgs) { + item.mapFrom.forEach(function (parentUid, paths) { + var parentItem = flushArgs.flushMap.get(parentUid); + if (!parentItem) { + parentItem = get_1.getCachedItem(parentUid, flushArgs.instance); + } + if (parentItem && paths.length > 0) { + var firstPath = paths[0]; + var targetRef = opath.get(parentItem.entity, firstPath); + var dirty = (targetRef && targetRef !== item.entity); + if (dirty === true) { + var args = { + entity: parentItem.entity, + flushMap: flushArgs.flushMap, + instance: flushArgs.instance + }; + parentItem = flush_1.ensureItem(args); + parentItem.entity = util_1.deepClone(parentItem.entity, item.entity, true); + } + } + }); +}; +exports.updateRefTos = function (entityUid, flushArgs) { + var item = flush_1.getItemFlushOrCached(entityUid, flushArgs); + updateItemRefTos(item, flushArgs); +}; +var updateItemRefTos = function (item, flushArgs) { + if (item) { + item.mapTo.forEach(function (toUid, paths) { + var updatedPaths = paths.map(function (path) { + var reference = opath.get(item.entity, path); + if (reference) { + var targetUid = reference[cache_1.config.uidName]; + if (targetUid) { + var found = targetUid == toUid; + if (found === true) { + return path; + } + } + } + removeRefFrom_Value(item.entity[cache_1.config.uidName], toUid, flushArgs); + }).filter(function (item) { + return item !== null && item !== undefined; + }); + if (updatedPaths.length > 0) { + item.mapTo.set(toUid, updatedPaths); + } + else { + item.mapTo.delete(toUid); + } + }); + } +}; +var removeRefFrom_Value = function (parentUid, refUid, flushArgs) { + var refItem = flush_1.getItemFlushOrCached(refUid, flushArgs); + if (refItem) { + refItem = refItem.clone(); + if (refItem.mapFrom.has(parentUid)) { + removeRefFrom(refItem, parentUid, flushArgs.refPath); + if (refItem.mapFrom.size() === 0) { + flushArgs.evictMap.set(refUid, refItem); + flushArgs.flushMap.delete(refUid); + } + else { + flushArgs.flushMap.set(refUid, refItem); + flushArgs.evictMap.delete(refUid); + } + } + } +}; +var removeRefFrom = function (item, parentUid, path) { + var refsArray = item.mapFrom.get(parentUid); + var index = refsArray.indexOf(path); + refsArray = refsArray.slice(); + refsArray.splice(index, 1); + item.mapFrom.set(parentUid, refsArray); + if (refsArray.length == 0) { + item.mapFrom.delete(parentUid); + } +}; diff --git a/lib/src/CacheInstance.d.ts b/lib/src/CacheInstance.d.ts new file mode 100644 index 0000000..4021be2 --- /dev/null +++ b/lib/src/CacheInstance.d.ts @@ -0,0 +1,24 @@ +import { ICacheRepo } from './CacheRepo'; +import { ICacheThread } from './CacheThread'; +import { ICacheNode } from './CacheNode'; +export interface ICacheInstance { + name: string; + repo: ICacheRepo; + thread: ICacheThread; + nextNodeKey: number; + reset: () => void; + addNode: (node: ICacheNode) => boolean; + size: () => number; + length: () => number; +} +export default class CacheInstance implements ICacheInstance { + name: string; + repo: ICacheRepo; + thread: ICacheThread; + nextNodeKey: number; + constructor(name: string); + reset: () => void; + addNode: (node: ICacheNode) => boolean; + length: () => number; + size: () => number; +} diff --git a/lib/src/CacheItem.d.ts b/lib/src/CacheItem.d.ts new file mode 100644 index 0000000..3d640b8 --- /dev/null +++ b/lib/src/CacheItem.d.ts @@ -0,0 +1,8 @@ +import CacheMap from './CacheMap'; +export default class CacheItem { + entity: {}; + mapTo: CacheMap>; + mapFrom: CacheMap>; + constructor(entity: {}, liveItem?: CacheItem); + clone: () => CacheItem; +} diff --git a/lib/src/CacheMap.d.ts b/lib/src/CacheMap.d.ts new file mode 100644 index 0000000..e47cae2 --- /dev/null +++ b/lib/src/CacheMap.d.ts @@ -0,0 +1,12 @@ +export default class CacheMap { + paths: {}; + length: number; + constructor(); + set(key: string | number, value: T): boolean; + get: (key: any) => T; + delete: (key: any) => boolean; + has: (key: any) => boolean; + forEach: (callback: Function) => void; + clone: () => CacheMap; + size(): number; +} diff --git a/lib/src/CacheNode.d.ts b/lib/src/CacheNode.d.ts new file mode 100644 index 0000000..7cf7bea --- /dev/null +++ b/lib/src/CacheNode.d.ts @@ -0,0 +1,11 @@ +import CacheMap from './CacheMap'; +import CacheItem from './CacheItem'; +export interface ICacheNode { + id: number; + items: CacheMap; +} +export declare class CacheNode implements ICacheNode { + id: number; + items: CacheMap; + constructor(nodeId: number); +} diff --git a/lib/src/CacheRepo.d.ts b/lib/src/CacheRepo.d.ts new file mode 100644 index 0000000..290438c --- /dev/null +++ b/lib/src/CacheRepo.d.ts @@ -0,0 +1,15 @@ +import { ICacheNode } from './CacheNode'; +import CacheMap from './CacheMap'; +export interface ICacheRepo { + get: (nodeId: number) => ICacheNode; + length: number; + add: (node: ICacheNode) => boolean; + delete: (nodeId: number) => void; +} +export default class CacheRepo implements ICacheRepo { + items: CacheMap; + length: number; + get: (nodeId: any) => ICacheNode; + add: (node: ICacheNode) => boolean; + delete: (nodeId: number) => void; +} diff --git a/lib/src/CacheThread.d.ts b/lib/src/CacheThread.d.ts new file mode 100644 index 0000000..04f2470 --- /dev/null +++ b/lib/src/CacheThread.d.ts @@ -0,0 +1,10 @@ +export interface ICacheThread { + current: number; + nodes: Array; + addNode: (nodeId: number) => void; +} +export default class CacheThread implements ICacheThread { + current: number; + nodes: Array; + addNode: (nodeId: number) => void; +} diff --git a/lib/src/cache.d.ts b/lib/src/cache.d.ts new file mode 100644 index 0000000..e9c9975 --- /dev/null +++ b/lib/src/cache.d.ts @@ -0,0 +1,21 @@ +import { ICacheStats } from './interfaces'; +export declare let instances: any; +export declare let config: any; +export declare function setTesting(testing: boolean): void; +export interface ICache { + put: Function; + get: Function; + getEdit: Function; + evict: Function; + reset: Function; + size: Function; + length: Function; + print: Function; +} +export declare function getCache(instanceName?: string, configuration?: {}): ICache; +export declare const put: (item: {} | {}[]) => void; +export declare const get: (entity: string | number | any[] | {}, nodeId?: number) => any; +export declare const getEdit: (uidOrEntityOrArray: string | number | any[] | {}, nodeId?: number) => any; +export declare const evict: (uidOrEntityOrArray: string | number | any[] | {}) => ICacheStats; +export declare const print: () => string; +export declare const reset: () => void; diff --git a/lib/src/config.d.ts b/lib/src/config.d.ts new file mode 100644 index 0000000..3a7a64b --- /dev/null +++ b/lib/src/config.d.ts @@ -0,0 +1,8 @@ +export declare const defaultConfig: { + uidName: string; + maxHistoryStates: number; +}; +export declare function configure(conf: any): { + uidName: string; + maxHistoryStates: number; +}; diff --git a/lib/src/evict.d.ts b/lib/src/evict.d.ts new file mode 100644 index 0000000..aa71304 --- /dev/null +++ b/lib/src/evict.d.ts @@ -0,0 +1,4 @@ +import { ICacheInstance } from './CacheInstance'; +import { ICacheStats } from './interfaces'; +export declare const evictItem: (obj: any, instance: ICacheInstance) => ICacheStats; +export declare const clearNext: (instance: ICacheInstance) => void; diff --git a/lib/src/flush.d.ts b/lib/src/flush.d.ts new file mode 100644 index 0000000..fc12ca3 --- /dev/null +++ b/lib/src/flush.d.ts @@ -0,0 +1,9 @@ +import { ICacheInstance } from './CacheInstance'; +import CacheItem from './CacheItem'; +import { IFlushArgs } from './interfaces'; +import CacheMap from './CacheMap'; +export declare const buildFlushMap: (flushArgs: IFlushArgs) => void; +export declare const getItemFlushOrCached: (uid: string, flushArgs: IFlushArgs) => CacheItem; +export declare const ensureItem: (flushArgs: IFlushArgs) => CacheItem; +export declare const preFlush: (flushArgs: IFlushArgs) => void; +export declare const flush: (temp: CacheMap, instance: ICacheInstance) => void; diff --git a/lib/src/get.d.ts b/lib/src/get.d.ts new file mode 100644 index 0000000..a46ce4f --- /dev/null +++ b/lib/src/get.d.ts @@ -0,0 +1,9 @@ +import { ICacheInstance } from './CacheInstance'; +import CacheItem from './CacheItem'; +import CacheMap from './CacheMap'; +import { IFlushArgs } from './interfaces'; +export declare const getItem: (entity: string | number | any[] | {}, instance: ICacheInstance, nodeId?: number) => {}; +export declare const getEditItem: (obj: string | number | any[] | {}, instance: ICacheInstance, nodeId?: number) => any; +export declare const isOnCache: (flushArgs: IFlushArgs) => boolean; +export declare const getCachedItem: (uid: string, instance: ICacheInstance) => CacheItem; +export declare const getCacheCurrentStack: (instance: ICacheInstance) => CacheMap; diff --git a/lib/src/index.d.ts b/lib/src/index.d.ts new file mode 100644 index 0000000..4a177b2 --- /dev/null +++ b/lib/src/index.d.ts @@ -0,0 +1,2 @@ +import { getCache, put, get, getEdit, evict, reset, print } from './cache'; +export { getCache, put, get, getEdit, evict, reset, print }; diff --git a/lib/src/interfaces.d.ts b/lib/src/interfaces.d.ts new file mode 100644 index 0000000..26bfbb9 --- /dev/null +++ b/lib/src/interfaces.d.ts @@ -0,0 +1,18 @@ +import CacheMap from './CacheMap'; +import CacheItem from './CacheItem'; +import { ICacheInstance } from './CacheInstance'; +export interface IFlushArgs { + entity?: {} | Array<{}>; + entityUid?: string; + flushMap: CacheMap; + evictMap?: CacheMap; + parentUid?: string; + refPath?: string; + instance: ICacheInstance; +} +export interface ICacheStats { + success: boolean; + nodeId: number; + length: number; + name: string; +} diff --git a/lib/src/locate.d.ts b/lib/src/locate.d.ts new file mode 100644 index 0000000..42f650d --- /dev/null +++ b/lib/src/locate.d.ts @@ -0,0 +1,7 @@ +import { ICacheInstance } from './CacheInstance'; +import { ICacheStats } from './interfaces'; +import { ICacheNode } from './CacheNode'; +export declare const getCallStats: (success: boolean, instance: ICacheInstance) => ICacheStats; +export declare const node: (instance: ICacheInstance, nodeId?: any) => number | ICacheStats; +export declare function getCurrentNode(instance: ICacheInstance): ICacheNode; +export declare function getRepoNode(cacheNodeId: any, instance: ICacheInstance): ICacheNode; diff --git a/lib/src/path.d.ts b/lib/src/path.d.ts new file mode 100644 index 0000000..dde74a0 --- /dev/null +++ b/lib/src/path.d.ts @@ -0,0 +1,3 @@ +export declare function del(obj: any, path?: any): any; +export declare function get(obj: any, path: any, defaultValue?: any): any; +export declare const concatProp: (propChain: any, prop: any) => any; diff --git a/lib/src/print.d.ts b/lib/src/print.d.ts new file mode 100644 index 0000000..6ac4680 --- /dev/null +++ b/lib/src/print.d.ts @@ -0,0 +1,2 @@ +import { ICacheInstance } from './CacheInstance'; +export declare const printCache: (instance: ICacheInstance) => string; diff --git a/lib/src/put.d.ts b/lib/src/put.d.ts new file mode 100644 index 0000000..57bee2d --- /dev/null +++ b/lib/src/put.d.ts @@ -0,0 +1,3 @@ +import { ICacheInstance } from './CacheInstance'; +import { ICacheStats } from './interfaces'; +export declare const putItem: (entity: {} | {}[], instance: ICacheInstance) => ICacheStats; diff --git a/lib/src/ref.d.ts b/lib/src/ref.d.ts new file mode 100644 index 0000000..e36d0f9 --- /dev/null +++ b/lib/src/ref.d.ts @@ -0,0 +1,6 @@ +import { IFlushArgs } from './interfaces'; +import CacheItem from './CacheItem'; +export declare const assignRefToParent: (refItem: any, flushArgs: IFlushArgs) => void; +export declare const updatePointers: (flushArgs: IFlushArgs) => void; +export declare const updateRefFroms: (item: CacheItem, flushArgs: IFlushArgs) => void; +export declare const updateRefTos: (entityUid: any, flushArgs: IFlushArgs) => void; diff --git a/lib/src/util.d.ts b/lib/src/util.d.ts new file mode 100644 index 0000000..4d07681 --- /dev/null +++ b/lib/src/util.d.ts @@ -0,0 +1,14 @@ +import { ICacheInstance } from './CacheInstance'; +import { ICacheNode } from './CacheNode'; +export declare function isNumber(value: any): boolean; +export declare function isString(obj: any): boolean; +export declare function isObject(mixed_var: any): boolean; +export declare function isFunction(item: any): boolean; +export declare function isArray(value: any): boolean; +export declare function isDate(value: any): boolean; +export declare function isEmpty(value: any): boolean; +export declare function getNewCacheNode(instance: ICacheInstance): ICacheNode; +export declare function hasUid(obj: any): boolean; +export declare function deepClone(obj: any, uidReference?: any, freeze?: boolean): any; +export declare const cacheSize: (instance: ICacheInstance) => number; +export declare const cacheLength: (instance: ICacheInstance) => number; diff --git a/lib/util.d.ts b/lib/util.d.ts new file mode 100644 index 0000000..4d07681 --- /dev/null +++ b/lib/util.d.ts @@ -0,0 +1,14 @@ +import { ICacheInstance } from './CacheInstance'; +import { ICacheNode } from './CacheNode'; +export declare function isNumber(value: any): boolean; +export declare function isString(obj: any): boolean; +export declare function isObject(mixed_var: any): boolean; +export declare function isFunction(item: any): boolean; +export declare function isArray(value: any): boolean; +export declare function isDate(value: any): boolean; +export declare function isEmpty(value: any): boolean; +export declare function getNewCacheNode(instance: ICacheInstance): ICacheNode; +export declare function hasUid(obj: any): boolean; +export declare function deepClone(obj: any, uidReference?: any, freeze?: boolean): any; +export declare const cacheSize: (instance: ICacheInstance) => number; +export declare const cacheLength: (instance: ICacheInstance) => number; diff --git a/lib/util.js b/lib/util.js new file mode 100644 index 0000000..21f2435 --- /dev/null +++ b/lib/util.js @@ -0,0 +1,195 @@ +"use strict"; +var cache_1 = require("./cache"); +var CacheNode_1 = require("./CacheNode"); +var locate_1 = require("./locate"); +var objectAssign = require('object-assign'); +var toString = Object.prototype.toString; +var _hasOwnProperty = Object.prototype.hasOwnProperty; +function isNumber(value) { + return typeof value === 'number' || toString(value) === "[object Number]"; +} +exports.isNumber = isNumber; +function isString(obj) { + return typeof obj === 'string' || toString(obj) === "[object String]"; +} +exports.isString = isString; +function isObject(mixed_var) { + if (Object.prototype.toString.call(mixed_var) === '[object Array]') { + return false; + } + return mixed_var !== null && typeof mixed_var === 'object'; +} +exports.isObject = isObject; +function isFunction(item) { + return typeof item === 'function'; +} +exports.isFunction = isFunction; +function isArray(value) { + if (!value || value === null) { + return false; + } + return Array.isArray(value) || (value && typeof value === 'object' + && typeof value.length === 'number' + && typeof value.splice === 'function' + && !(value.propertyIsEnumerable('length'))); +} +exports.isArray = isArray; +function objToStr(o) { + return Object.prototype.toString.call(o); +} +function isDate(value) { + return isObject(value) && objToStr(value) === '[object Date]'; +} +exports.isDate = isDate; +function isEmpty(value) { + if (!value) { + return true; + } + if (isArray(value) && value.length === 0) { + return true; + } + else if (!isString(value)) { + for (var i in value) { + if (_hasOwnProperty.call(value, i)) { + return false; + } + } + return true; + } + return false; +} +exports.isEmpty = isEmpty; +function getNewCacheNode(instance) { + var node = new CacheNode_1.CacheNode(instance.nextNodeKey); + node.id = instance.nextNodeKey; + instance.nextNodeKey += 1; + instance.repo.add(node); + return node; +} +exports.getNewCacheNode = getNewCacheNode; +function hasUid(obj) { + if (!obj) { + return false; + } + if (!isObject(obj)) { + return false; + } + if (typeof obj[cache_1.config.uidName] === "undefined") { + return false; + } + var uid = obj[cache_1.config.uidName]; + return uid.length !== 0; +} +exports.hasUid = hasUid; +; +Function.prototype.clone = function (target) { + var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; + var ARGUMENT_NAMES = /([^\s,]+)/g; + function getParamNames(func) { + var fnStr = func.toString().replace(STRIP_COMMENTS, ''); + var result = fnStr.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')).match(ARGUMENT_NAMES); + if (result === null) + result = []; + return result; + } + var stringify = this.toString(); + stringify = stringify.replace(new RegExp('_this', 'g'), 'this'); + var body = stringify.match(/function[^{]+\{([\s\S]*)\}$/)[1]; + var paramNames = getParamNames(this); + var func = new Function(paramNames, body); + return func.bind(target); +}; +function deepClone(obj, uidReference, freeze) { + if (freeze === void 0) { freeze = true; } + if (!obj + || (!isObject(obj) + && !isArray(obj))) { + return obj; + } + if (freeze === true + && uidReference + && !Object.isFrozen(uidReference)) { + Object.freeze(uidReference); + } + if (uidReference + && hasUid(obj) + && obj[cache_1.config.uidName] === uidReference[cache_1.config.uidName]) { + return uidReference; + } + console.log(obj); + var result = objectAssign({}, obj); + for (var propName in obj) { + var value = obj[propName]; + if (value) { + if (isArray(value)) { + result[propName] = deepCloneArray(value, uidReference, freeze); + } + else if (isDate(value)) { + var date = new Date(value.getTime()); + if (freeze === true) { + Object.freeze(date); + } + result[propName] = date; + } + else if (isObject(value)) { + if (hasUid(value)) { + result[propName] = value; + if (uidReference && hasUid(uidReference)) { + if (value !== uidReference + && value.uid === uidReference.uid + && value !== uidReference) { + result[propName] = uidReference; + } + } + else { + } + } + else { + result[propName] = deepClone(value, uidReference, freeze); + } + } + else if (isFunction(value)) { + result[propName] = value.clone(result); + console.log(propName, result[propName]); + } + else { + result[propName] = value; + } + } + } + if (freeze === true + && !Object.isFrozen(result) + && typeof result !== 'function') { + Object.freeze(result); + } + return result; +} +exports.deepClone = deepClone; +function deepCloneArray(arr, uidReference, freeze) { + return arr.map(function (item) { + if (isArray(item)) { + return deepCloneArray(item, uidReference, freeze); + } + else if (isObject(item)) { + if (hasUid(item)) { + if (uidReference && (item[cache_1.config.uidName] === uidReference[cache_1.config.uidName])) { + return uidReference; + } + return item; + } + else { + return deepClone(item, uidReference, freeze); + } + } + else { + return item; + } + }); +} +exports.cacheSize = function (instance) { + var cacheNode = locate_1.getCurrentNode(instance); + return cacheNode ? cacheNode.items.size() : 0; +}; +exports.cacheLength = function (instance) { + return instance.thread.nodes.length; +};