1 line
11 KiB
JSON
1 line
11 KiB
JSON
|
{"id":"../node_modules/@pushrocks/lik/dist/lik.interestmap.js","dependencies":[{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/@pushrocks/lik/ts/lik.interestmap.ts","includedInParent":true,"mtime":499162500000},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/package.json","includedInParent":true,"mtime":1545395695572},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/@pushrocks/lik/package.json","includedInParent":true,"mtime":1545395355371},{"name":"./lik.plugins","loc":{"line":11,"column":24},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/@pushrocks/lik/dist/lik.interestmap.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/@pushrocks/lik/dist/lik.plugins.js"},{"name":"./lik.objectmap","loc":{"line":12,"column":32},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/@pushrocks/lik/dist/lik.interestmap.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/@pushrocks/lik/dist/lik.objectmap.js"},{"name":"./lik.interestmap.interest","loc":{"line":13,"column":43},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/@pushrocks/lik/dist/lik.interestmap.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/@pushrocks/lik/dist/lik.interestmap.interest.js"}],"generated":{"js":"\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst plugins = require(\"./lik.plugins\");\nconst lik_objectmap_1 = require(\"./lik.objectmap\");\nconst lik_interestmap_interest_1 = require(\"./lik.interestmap.interest\");\nclass InterestMap {\n constructor(comparisonFuncArg) {\n /**\n * stores interests that are currently fullfilled by the cache\n */\n this.interestObjectMap = new lik_objectmap_1.Objectmap();\n // tslint:disable-next-line:member-ordering\n this.interestObservable = new plugins.smartrx.ObservableIntake();\n this.comparisonFunc = comparisonFuncArg;\n }\n /**\n * adds an interest to the InterestMap\n * @param objectArg\n */\n addInterest(objectArg) {\n return __awaiter(this, void 0, void 0, function* () {\n const comparisonString = this.comparisonFunc(objectArg);\n let returnInterest;\n const newInterest = new lik_interestmap_interest_1.Interest(this, objectArg, this.comparisonFunc);\n let interestExists = false;\n yield this.interestObjectMap.forEach(interestArg => {\n if (!interestExists && interestArg.comparisonString === newInterest.comparisonString) {\n console.log('info', `interest already exists for ${newInterest.comparisonString}`);\n interestExists = true;\n returnInterest = interestArg;\n returnInterest.renew();\n }\n });\n if (!returnInterest) {\n returnInterest = newInterest;\n this.interestObjectMap.add(returnInterest);\n }\n this.interestObservable.push(returnInterest);\n return returnInterest;\n });\n }\n /**\n * removes an interest from the interest map\n * @param objectArg removes an interest from the InterestMap\n */\n removeInterest(interestArg) {\n const interestToRemove = this.interestObjectMap.findOneAndRemove(interestArg2 => {\n
|