@subql/apollo-links
Advanced tools
Comparing version 0.5.8-0 to 0.5.8-1
@@ -24,2 +24,3 @@ import { Agreement, OrderType, Plan, ProjectType } from '../types'; | ||
private getRandomStartIndex; | ||
private getNextOrderIndex; | ||
getNextOrderType(): Promise<OrderType | undefined>; | ||
@@ -26,0 +27,0 @@ getNextAgreement(): Promise<Agreement | undefined>; |
@@ -34,2 +34,5 @@ "use strict"; | ||
} | ||
getNextOrderIndex(total, currentIndex) { | ||
return currentIndex < total - 1 ? currentIndex + 1 : 0; | ||
} | ||
async getNextOrderType() { | ||
@@ -52,10 +55,4 @@ var _a, _b; | ||
} | ||
let agreement = this.agreements[this.nextAgreementIndex]; | ||
if (this.nextAgreementIndex < this.agreements.length - 1) { | ||
this.nextAgreementIndex = this.nextAgreementIndex + 1; | ||
agreement = this.agreements[this.nextAgreementIndex]; | ||
} | ||
else { | ||
this.nextAgreementIndex = 0; | ||
} | ||
const agreement = this.agreements[this.nextAgreementIndex]; | ||
this.nextAgreementIndex = this.getNextOrderIndex(this.agreements.length, this.nextAgreementIndex); | ||
return agreement; | ||
@@ -71,10 +68,4 @@ } | ||
} | ||
let plan = this.plans[this.nextPlanIndex]; | ||
if (this.nextPlanIndex < this.plans.length - 1) { | ||
this.nextPlanIndex = this.nextPlanIndex + 1; | ||
plan = this.plans[this.nextPlanIndex]; | ||
} | ||
else { | ||
this.nextPlanIndex = 0; | ||
} | ||
const plan = this.plans[this.nextPlanIndex]; | ||
this.nextPlanIndex = this.getNextOrderIndex(this.plans.length, this.nextPlanIndex); | ||
return plan; | ||
@@ -81,0 +72,0 @@ } |
{ | ||
"name": "@subql/apollo-links", | ||
"version": "0.5.8-0", | ||
"version": "0.5.8-1", | ||
"description": "SubQuery Network - graphql links", | ||
@@ -28,3 +28,3 @@ "main": "dist/index.js", | ||
}, | ||
"stableVersion": "0.5.7" | ||
"stableVersion": "0.5.8-0" | ||
} |
@@ -62,2 +62,6 @@ // Copyright 2020-2022 SubQuery Pte Ltd authors & contributors | ||
private getNextOrderIndex(total: number, currentIndex: number) { | ||
return currentIndex < total - 1 ? currentIndex + 1 : 0; | ||
} | ||
public async getNextOrderType(): Promise<OrderType | undefined> { | ||
@@ -79,9 +83,7 @@ await this._init; | ||
let agreement = this.agreements[this.nextAgreementIndex]; | ||
if (this.nextAgreementIndex < this.agreements.length - 1) { | ||
this.nextAgreementIndex = this.nextAgreementIndex + 1; | ||
agreement = this.agreements[this.nextAgreementIndex]; | ||
} else { | ||
this.nextAgreementIndex = 0; | ||
} | ||
const agreement = this.agreements[this.nextAgreementIndex]; | ||
this.nextAgreementIndex = this.getNextOrderIndex( | ||
this.agreements.length, | ||
this.nextAgreementIndex | ||
); | ||
@@ -100,9 +102,4 @@ return agreement; | ||
let plan = this.plans[this.nextPlanIndex]; | ||
if (this.nextPlanIndex < this.plans.length - 1) { | ||
this.nextPlanIndex = this.nextPlanIndex + 1; | ||
plan = this.plans[this.nextPlanIndex]; | ||
} else { | ||
this.nextPlanIndex = 0; | ||
} | ||
const plan = this.plans[this.nextPlanIndex]; | ||
this.nextPlanIndex = this.getNextOrderIndex(this.plans.length, this.nextPlanIndex); | ||
@@ -109,0 +106,0 @@ return plan; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
150876
1596