@@ -24,13 +24,13 @@ function getDefs (apis: Apis | null, defs: Record<string, Definitions>): Record<
|
||||
const named: Record<string, Record<string, DefinitionCallNamed>> = {};
|
||||
const all = Object.values(defs);
|
||||
|
||||
for (let j = 0; j < all.length; j++) {
|
||||
for (let j = 0, jcount = all.length; j < jcount; j++) {
|
||||
const set = all[j].runtime;
|
||||
|
||||
if (set) {
|
||||
const sections = Object.entries(set);
|
||||
|
||||
for (let i = 0; i < sections.length; i++) {
|
||||
for (let i = 0, scount = sections.length; i < scount; i++) {
|
||||
const [_section, sec] = sections[i];
|
||||
const sectionHash = blake2AsHex(_section, 64);
|
||||
const api = apis && apis.find(([h]) => h === sectionHash);
|
||||
@@ -40,15 +40,16 @@ function getDefs (apis: Apis | null, defs: Record<string, Definitions>): Record<
|
||||
|
||||
if (ver) {
|
||||
const methods = Object.entries(ver.methods);
|
||||
const mcount = methods.length;
|
||||
|
||||
if (methods.length) {
|
||||
if (mcount) {
|
||||
const section = stringCamelCase(_section);
|
||||
|
||||
if (!named[section]) {
|
||||
named[section] = {};
|
||||
}
|
||||
|
||||
for (let m = 0; m < methods.length; m++) {
|
||||
for (let m = 0; m < mcount; m++) {
|
||||
const [_method, def] = methods[m];
|
||||
const method = stringCamelCase(_method);
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ function splitAlternatives (type: string): string[] {
|
||||
let level = 0;
|
||||
|
||||
// we assume that the string starts with '['
|
||||
for (let i = 1; i < type.length; i++) {
|
||||
for (let i = 1, count = type.length; i < count; i++) {
|
||||
if (level === 0) {
|
||||
switch (type[i]) {
|
||||
case ']':
|
||||
|
||||
Reference in New Issue
Block a user