fix(core): update

This commit is contained in:
2020-07-12 00:44:50 +00:00
parent 24559d1582
commit da5bd43a42
12 changed files with 8595 additions and 673 deletions

View File

@ -60,7 +60,7 @@ export class FastMap<T> {
for (const key of fastMapArg.getKeys()) {
concatedFastmap.addToMap(key, fastMapArg.getByKey(key), {
force: true
force: true,
});
}
@ -75,7 +75,7 @@ export class FastMap<T> {
public addAllFromOther(fastMapArg: FastMap<T>) {
for (const key of fastMapArg.getKeys()) {
this.addToMap(key, fastMapArg.getByKey(key), {
force: true
force: true,
});
}
}

View File

@ -37,7 +37,7 @@ export class InterestMap<DTInterestId, DTInterestFullfillment> {
this.comparisonFunc
);
let interestExists = false;
await this.interestObjectMap.forEach(interestArg => {
await this.interestObjectMap.forEach((interestArg) => {
if (!interestExists && interestArg.comparisonString === newInterest.comparisonString) {
console.log('info', `interest already exists for ${newInterest.comparisonString}`);
interestExists = true;
@ -61,7 +61,7 @@ export class InterestMap<DTInterestId, DTInterestFullfillment> {
* @param objectArg removes an interest from the InterestMap
*/
public removeInterest(interestArg: Interest<DTInterestId, DTInterestFullfillment>) {
const interestToRemove = this.interestObjectMap.findOneAndRemove(interestArg2 => {
const interestToRemove = this.interestObjectMap.findOneAndRemove((interestArg2) => {
return interestArg.comparisonString === interestArg2.comparisonString;
});
}
@ -79,7 +79,7 @@ export class InterestMap<DTInterestId, DTInterestFullfillment> {
* @param comparisonStringArg
*/
public checkInterestByString(comparisonStringArg: string): boolean {
const foundInterest = this.interestObjectMap.find(interest => {
const foundInterest = this.interestObjectMap.find((interest) => {
return interest.comparisonString === comparisonStringArg;
});
if (foundInterest) {
@ -106,7 +106,7 @@ export class InterestMap<DTInterestId, DTInterestFullfillment> {
*/
public findInterest(objectArg: DTInterestId): Interest<DTInterestId, DTInterestFullfillment> {
const comparableString = this.comparisonFunc(objectArg);
const interest = this.interestObjectMap.find(interestArg => {
const interest = this.interestObjectMap.find((interestArg) => {
return interestArg.comparisonString === comparableString;
});
return interest; // if an interest is found, the interest is returned, otherwise interest is null

View File

@ -2,7 +2,7 @@ import * as plugins from './lik.plugins';
import { FastMap } from './lik.fastmap';
export const uni = (prefix: string = 'uni') => {
return `${prefix}xxxxxxxxxxx`.replace(/[xy]/g, c => {
return `${prefix}xxxxxxxxxxx`.replace(/[xy]/g, (c) => {
const r = (Math.random() * 16) | 0;
const v = c === 'x' ? r : (r & 0x3) | 0x8;
return v.toString(16);

View File

@ -4,7 +4,7 @@ import * as plugins from './lik.plugins';
* allows you to easily keep track of a bunch of strings
*/
export type TTriggerFunction = (stringArray?: string[]) => boolean;
export type TTriggerFunction = (stringArray?: string[]) => boolean;
export class Stringmap {
private _stringArray: string[] = [];
@ -111,7 +111,7 @@ export class Stringmap {
* notifies triggers
*/
private notifyTrigger() {
const filteredArray = this._triggerUntilTrueFunctionArray.filter(functionArg => {
const filteredArray = this._triggerUntilTrueFunctionArray.filter((functionArg) => {
return !functionArg();
});
this._triggerUntilTrueFunctionArray = filteredArray;