Regenerate the contracts' TypeScript: the key parsers name their parameter apart from the parts (issue 1966)

Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i
This commit is contained in:
2026-11-05 21:24:07 +01:00
parent f0ed2d9b12
commit 07ec4b1f31
12 changed files with 390 additions and 390 deletions
@@ -35,12 +35,12 @@ export function conditionsByKeyKey(key: string): string {
}
/** The parts of a key of the form "<key>", or undefined for a key of another form. */
export function parseConditionsByKeyKey(key: string): { key: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const key = rest;
rest = "";
if (rest !== "") return undefined;
export function parseConditionsByKeyKey(_key: string): { key: string } | undefined {
let _rest = _key;
if (_rest === "") return undefined;
const key = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { key };
}
@@ -50,12 +50,12 @@ export function findingsByKeyKey(key: string): string {
}
/** The parts of a key of the form "<key>", or undefined for a key of another form. */
export function parseFindingsByKeyKey(key: string): { key: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const key = rest;
rest = "";
if (rest !== "") return undefined;
export function parseFindingsByKeyKey(_key: string): { key: string } | undefined {
let _rest = _key;
if (_rest === "") return undefined;
const key = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { key };
}
@@ -29,12 +29,12 @@ export function actsByIDKey(id: string): string {
}
/** The parts of a key of the form "<id>", or undefined for a key of another form. */
export function parseActsByIDKey(key: string): { id: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const id = rest;
rest = "";
if (rest !== "") return undefined;
export function parseActsByIDKey(_key: string): { id: string } | undefined {
let _rest = _key;
if (_rest === "") return undefined;
const id = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { id };
}
@@ -44,16 +44,16 @@ export function warrantsByAskerAskKey(asker: string, ask: string): string {
}
/** The parts of a key of the form "<asker>.<ask>", or undefined for a key of another form. */
export function parseWarrantsByAskerAskKey(key: string): { asker: string; ask: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const asker = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
if (rest === "") return undefined;
const ask = rest;
rest = "";
if (rest !== "") return undefined;
export function parseWarrantsByAskerAskKey(_key: string): { asker: string; ask: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const asker = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const ask = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { asker, ask };
}
@@ -29,12 +29,12 @@ export function attemptsByAttemptKey(attempt: string): string {
}
/** The parts of a key of the form "<attempt>", or undefined for a key of another form. */
export function parseAttemptsByAttemptKey(key: string): { attempt: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const attempt = rest;
rest = "";
if (rest !== "") return undefined;
export function parseAttemptsByAttemptKey(_key: string): { attempt: string } | undefined {
let _rest = _key;
if (_rest === "") return undefined;
const attempt = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { attempt };
}
@@ -44,12 +44,12 @@ export function wouldByWouldKey(would: string): string {
}
/** The parts of a key of the form "<would>", or undefined for a key of another form. */
export function parseWouldByWouldKey(key: string): { would: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const would = rest;
rest = "";
if (rest !== "") return undefined;
export function parseWouldByWouldKey(_key: string): { would: string } | undefined {
let _rest = _key;
if (_rest === "") return undefined;
const would = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { would };
}
@@ -24,12 +24,12 @@ export function presenceByNodeKey(node: string): string {
}
/** The parts of a key of the form "<node>", or undefined for a key of another form. */
export function parsePresenceByNodeKey(key: string): { node: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const node = rest;
rest = "";
if (rest !== "") return undefined;
export function parsePresenceByNodeKey(_key: string): { node: string } | undefined {
let _rest = _key;
if (_rest === "") return undefined;
const node = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node };
}
@@ -39,18 +39,18 @@ export function presenceByPartPartInstanceKey(part: string, instance: string): s
}
/** The parts of a key of the form "part.<part>.<instance>", or undefined for a key of another form. */
export function parsePresenceByPartPartInstanceKey(key: string): { part: string; instance: string } | undefined {
let rest = key;
if (!rest.startsWith("part.")) return undefined;
rest = rest.slice(5);
const at1 = rest.indexOf(".");
if (at1 <= 0) return undefined;
const part = rest.slice(0, at1);
rest = rest.slice(at1 + 1);
if (rest === "") return undefined;
const instance = rest;
rest = "";
if (rest !== "") return undefined;
export function parsePresenceByPartPartInstanceKey(_key: string): { part: string; instance: string } | undefined {
let _rest = _key;
if (!_rest.startsWith("part.")) return undefined;
_rest = _rest.slice(5);
const _at1 = _rest.indexOf(".");
if (_at1 <= 0) return undefined;
const part = _rest.slice(0, _at1);
_rest = _rest.slice(_at1 + 1);
if (_rest === "") return undefined;
const instance = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { part, instance };
}
@@ -60,16 +60,16 @@ export function pulseByBucketKeyKey(bucket: string, key: string): string {
}
/** The parts of a key of the form "<bucket>.<key>", or undefined for a key of another form. */
export function parsePulseByBucketKeyKey(key: string): { bucket: string; key: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const bucket = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
if (rest === "") return undefined;
const key = rest;
rest = "";
if (rest !== "") return undefined;
export function parsePulseByBucketKeyKey(_key: string): { bucket: string; key: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const bucket = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const key = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { bucket, key };
}
@@ -79,16 +79,16 @@ export function stuckByBucketKeyKey(bucket: string, key: string): string {
}
/** The parts of a key of the form "<bucket>.<key>", or undefined for a key of another form. */
export function parseStuckByBucketKeyKey(key: string): { bucket: string; key: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const bucket = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
if (rest === "") return undefined;
const key = rest;
rest = "";
if (rest !== "") return undefined;
export function parseStuckByBucketKeyKey(_key: string): { bucket: string; key: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const bucket = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const key = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { bucket, key };
}
@@ -43,14 +43,14 @@ export function enrolmentsByNodeNodeKey(node: string): string {
}
/** The parts of a key of the form "node.<node>", or undefined for a key of another form. */
export function parseEnrolmentsByNodeNodeKey(key: string): { node: string } | undefined {
let rest = key;
if (!rest.startsWith("node.")) return undefined;
rest = rest.slice(5);
if (rest === "") return undefined;
const node = rest;
rest = "";
if (rest !== "") return undefined;
export function parseEnrolmentsByNodeNodeKey(_key: string): { node: string } | undefined {
let _rest = _key;
if (!_rest.startsWith("node.")) return undefined;
_rest = _rest.slice(5);
if (_rest === "") return undefined;
const node = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node };
}
@@ -60,14 +60,14 @@ export function enrolmentsByAddressAddressKey(address: string): string {
}
/** The parts of a key of the form "address.<address>", or undefined for a key of another form. */
export function parseEnrolmentsByAddressAddressKey(key: string): { address: string } | undefined {
let rest = key;
if (!rest.startsWith("address.")) return undefined;
rest = rest.slice(8);
if (rest === "") return undefined;
const address = rest;
rest = "";
if (rest !== "") return undefined;
export function parseEnrolmentsByAddressAddressKey(_key: string): { address: string } | undefined {
let _rest = _key;
if (!_rest.startsWith("address.")) return undefined;
_rest = _rest.slice(8);
if (_rest === "") return undefined;
const address = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { address };
}
@@ -91,11 +91,11 @@ export function signersByKeyKey(): string {
}
/** The parts of a key of the form "key", or undefined for a key of another form. */
export function parseSignersByKeyKey(key: string): { } | undefined {
let rest = key;
if (!rest.startsWith("key")) return undefined;
rest = rest.slice(3);
if (rest !== "") return undefined;
export function parseSignersByKeyKey(_key: string): { } | undefined {
let _rest = _key;
if (!_rest.startsWith("key")) return undefined;
_rest = _rest.slice(3);
if (_rest !== "") return undefined;
return { };
}
@@ -105,11 +105,11 @@ export function signersByAuthorityKey(): string {
}
/** The parts of a key of the form "authority", or undefined for a key of another form. */
export function parseSignersByAuthorityKey(key: string): { } | undefined {
let rest = key;
if (!rest.startsWith("authority")) return undefined;
rest = rest.slice(9);
if (rest !== "") return undefined;
export function parseSignersByAuthorityKey(_key: string): { } | undefined {
let _rest = _key;
if (!_rest.startsWith("authority")) return undefined;
_rest = _rest.slice(9);
if (_rest !== "") return undefined;
return { };
}
@@ -119,12 +119,12 @@ export function nodeLoginsByNodeKey(node: string): string {
}
/** The parts of a key of the form "<node>", or undefined for a key of another form. */
export function parseNodeLoginsByNodeKey(key: string): { node: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const node = rest;
rest = "";
if (rest !== "") return undefined;
export function parseNodeLoginsByNodeKey(_key: string): { node: string } | undefined {
let _rest = _key;
if (_rest === "") return undefined;
const node = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node };
}
@@ -68,16 +68,16 @@ export function asksByAskerIDKey(asker: string, id: string): string {
}
/** The parts of a key of the form "<asker>.<id>", or undefined for a key of another form. */
export function parseAsksByAskerIDKey(key: string): { asker: string; id: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const asker = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
if (rest === "") return undefined;
const id = rest;
rest = "";
if (rest !== "") return undefined;
export function parseAsksByAskerIDKey(_key: string): { asker: string; id: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const asker = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const id = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { asker, id };
}
@@ -43,13 +43,13 @@ export function placementByNodeNodeKey(node: string): string {
}
/** The parts of a key of the form "<node>.node", or undefined for a key of another form. */
export function parsePlacementByNodeNodeKey(key: string): { node: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".node");
if (at0 <= 0) return undefined;
const node = rest.slice(0, at0);
rest = rest.slice(at0 + 5);
if (rest !== "") return undefined;
export function parsePlacementByNodeNodeKey(_key: string): { node: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".node");
if (_at0 <= 0) return undefined;
const node = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 5);
if (_rest !== "") return undefined;
return { node };
}
@@ -59,16 +59,16 @@ export function placementByNodeModuleKey(node: string, module: string): string {
}
/** The parts of a key of the form "<node>.<module>", or undefined for a key of another form. */
export function parsePlacementByNodeModuleKey(key: string): { node: string; module: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const node = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
if (rest === "") return undefined;
const module = rest;
rest = "";
if (rest !== "") return undefined;
export function parsePlacementByNodeModuleKey(_key: string): { node: string; module: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const node = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const module = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, module };
}
@@ -78,12 +78,12 @@ export function proposalsByProposalKey(proposal: string): string {
}
/** The parts of a key of the form "<proposal>", or undefined for a key of another form. */
export function parseProposalsByProposalKey(key: string): { proposal: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const proposal = rest;
rest = "";
if (rest !== "") return undefined;
export function parseProposalsByProposalKey(_key: string): { proposal: string } | undefined {
let _rest = _key;
if (_rest === "") return undefined;
const proposal = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { proposal };
}
@@ -93,16 +93,16 @@ export function candidatesByProposalNodeKey(proposal: string, node: string): str
}
/** The parts of a key of the form "<proposal>.<node>", or undefined for a key of another form. */
export function parseCandidatesByProposalNodeKey(key: string): { proposal: string; node: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const proposal = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
if (rest === "") return undefined;
const node = rest;
rest = "";
if (rest !== "") return undefined;
export function parseCandidatesByProposalNodeKey(_key: string): { proposal: string; node: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const proposal = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const node = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { proposal, node };
}
@@ -112,18 +112,18 @@ export function pulsesByAnswerProposalNodeKey(proposal: string, node: string): s
}
/** The parts of a key of the form "answer.<proposal>.<node>", or undefined for a key of another form. */
export function parsePulsesByAnswerProposalNodeKey(key: string): { proposal: string; node: string } | undefined {
let rest = key;
if (!rest.startsWith("answer.")) return undefined;
rest = rest.slice(7);
const at1 = rest.indexOf(".");
if (at1 <= 0) return undefined;
const proposal = rest.slice(0, at1);
rest = rest.slice(at1 + 1);
if (rest === "") return undefined;
const node = rest;
rest = "";
if (rest !== "") return undefined;
export function parsePulsesByAnswerProposalNodeKey(_key: string): { proposal: string; node: string } | undefined {
let _rest = _key;
if (!_rest.startsWith("answer.")) return undefined;
_rest = _rest.slice(7);
const _at1 = _rest.indexOf(".");
if (_at1 <= 0) return undefined;
const proposal = _rest.slice(0, _at1);
_rest = _rest.slice(_at1 + 1);
if (_rest === "") return undefined;
const node = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { proposal, node };
}
@@ -133,14 +133,14 @@ export function pulsesByAskProposalKey(proposal: string): string {
}
/** The parts of a key of the form "ask.<proposal>", or undefined for a key of another form. */
export function parsePulsesByAskProposalKey(key: string): { proposal: string } | undefined {
let rest = key;
if (!rest.startsWith("ask.")) return undefined;
rest = rest.slice(4);
if (rest === "") return undefined;
const proposal = rest;
rest = "";
if (rest !== "") return undefined;
export function parsePulsesByAskProposalKey(_key: string): { proposal: string } | undefined {
let _rest = _key;
if (!_rest.startsWith("ask.")) return undefined;
_rest = _rest.slice(4);
if (_rest === "") return undefined;
const proposal = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { proposal };
}
@@ -150,12 +150,12 @@ export function seatHoldersBySeatKey(seat: string): string {
}
/** The parts of a key of the form "<seat>", or undefined for a key of another form. */
export function parseSeatHoldersBySeatKey(key: string): { seat: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const seat = rest;
rest = "";
if (rest !== "") return undefined;
export function parseSeatHoldersBySeatKey(_key: string): { seat: string } | undefined {
let _rest = _key;
if (_rest === "") return undefined;
const seat = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { seat };
}
@@ -165,16 +165,16 @@ export function seatHoldersBySeatNodeKey(seat: string, node: string): string {
}
/** The parts of a key of the form "<seat>.<node>", or undefined for a key of another form. */
export function parseSeatHoldersBySeatNodeKey(key: string): { seat: string; node: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const seat = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
if (rest === "") return undefined;
const node = rest;
rest = "";
if (rest !== "") return undefined;
export function parseSeatHoldersBySeatNodeKey(_key: string): { seat: string; node: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const seat = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const node = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { seat, node };
}
+53 -53
View File
@@ -29,18 +29,18 @@ export function wantsByWantNodeModuleKey(node: string, module: string): string {
}
/** The parts of a key of the form "want.<node>.<module>", or undefined for a key of another form. */
export function parseWantsByWantNodeModuleKey(key: string): { node: string; module: string } | undefined {
let rest = key;
if (!rest.startsWith("want.")) return undefined;
rest = rest.slice(5);
const at1 = rest.indexOf(".");
if (at1 <= 0) return undefined;
const node = rest.slice(0, at1);
rest = rest.slice(at1 + 1);
if (rest === "") return undefined;
const module = rest;
rest = "";
if (rest !== "") return undefined;
export function parseWantsByWantNodeModuleKey(_key: string): { node: string; module: string } | undefined {
let _rest = _key;
if (!_rest.startsWith("want.")) return undefined;
_rest = _rest.slice(5);
const _at1 = _rest.indexOf(".");
if (_at1 <= 0) return undefined;
const node = _rest.slice(0, _at1);
_rest = _rest.slice(_at1 + 1);
if (_rest === "") return undefined;
const module = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, module };
}
@@ -50,15 +50,15 @@ export function wantsByWantNodeNodeKey(node: string): string {
}
/** The parts of a key of the form "want.<node>.node", or undefined for a key of another form. */
export function parseWantsByWantNodeNodeKey(key: string): { node: string } | undefined {
let rest = key;
if (!rest.startsWith("want.")) return undefined;
rest = rest.slice(5);
const at1 = rest.indexOf(".node");
if (at1 <= 0) return undefined;
const node = rest.slice(0, at1);
rest = rest.slice(at1 + 5);
if (rest !== "") return undefined;
export function parseWantsByWantNodeNodeKey(_key: string): { node: string } | undefined {
let _rest = _key;
if (!_rest.startsWith("want.")) return undefined;
_rest = _rest.slice(5);
const _at1 = _rest.indexOf(".node");
if (_at1 <= 0) return undefined;
const node = _rest.slice(0, _at1);
_rest = _rest.slice(_at1 + 5);
if (_rest !== "") return undefined;
return { node };
}
@@ -68,18 +68,18 @@ export function wantsByHeldModuleFingerprintKey(module: string, fingerprint: str
}
/** The parts of a key of the form "held.<module>.<fingerprint>", or undefined for a key of another form. */
export function parseWantsByHeldModuleFingerprintKey(key: string): { module: string; fingerprint: string } | undefined {
let rest = key;
if (!rest.startsWith("held.")) return undefined;
rest = rest.slice(5);
const at1 = rest.indexOf(".");
if (at1 <= 0) return undefined;
const module = rest.slice(0, at1);
rest = rest.slice(at1 + 1);
if (rest === "") return undefined;
const fingerprint = rest;
rest = "";
if (rest !== "") return undefined;
export function parseWantsByHeldModuleFingerprintKey(_key: string): { module: string; fingerprint: string } | undefined {
let _rest = _key;
if (!_rest.startsWith("held.")) return undefined;
_rest = _rest.slice(5);
const _at1 = _rest.indexOf(".");
if (_at1 <= 0) return undefined;
const module = _rest.slice(0, _at1);
_rest = _rest.slice(_at1 + 1);
if (_rest === "") return undefined;
const fingerprint = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { module, fingerprint };
}
@@ -89,16 +89,16 @@ export function differencesByNodeModuleKey(node: string, module: string): string
}
/** The parts of a key of the form "<node>.<module>", or undefined for a key of another form. */
export function parseDifferencesByNodeModuleKey(key: string): { node: string; module: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const node = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
if (rest === "") return undefined;
const module = rest;
rest = "";
if (rest !== "") return undefined;
export function parseDifferencesByNodeModuleKey(_key: string): { node: string; module: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const node = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const module = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, module };
}
@@ -108,16 +108,16 @@ export function compositionsByGroupHeadsKey(group: string, heads: string): strin
}
/** The parts of a key of the form "<group>.<heads>", or undefined for a key of another form. */
export function parseCompositionsByGroupHeadsKey(key: string): { group: string; heads: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const group = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
if (rest === "") return undefined;
const heads = rest;
rest = "";
if (rest !== "") return undefined;
export function parseCompositionsByGroupHeadsKey(_key: string): { group: string; heads: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const group = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const heads = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { group, heads };
}
@@ -19,16 +19,16 @@ export function plansByNodeModuleKey(node: string, module: string): string {
}
/** The parts of a key of the form "<node>.<module>", or undefined for a key of another form. */
export function parsePlansByNodeModuleKey(key: string): { node: string; module: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const node = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
if (rest === "") return undefined;
const module = rest;
rest = "";
if (rest !== "") return undefined;
export function parsePlansByNodeModuleKey(_key: string): { node: string; module: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const node = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const module = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, module };
}
@@ -38,20 +38,20 @@ export function provisionsByNodeConsumerProvisionKey(node: string, consumer: str
}
/** The parts of a key of the form "<node>.<consumer>.<provision>", or undefined for a key of another form. */
export function parseProvisionsByNodeConsumerProvisionKey(key: string): { node: string; consumer: string; provision: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const node = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
const at2 = rest.indexOf(".");
if (at2 <= 0) return undefined;
const consumer = rest.slice(0, at2);
rest = rest.slice(at2 + 1);
if (rest === "") return undefined;
const provision = rest;
rest = "";
if (rest !== "") return undefined;
export function parseProvisionsByNodeConsumerProvisionKey(_key: string): { node: string; consumer: string; provision: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const node = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
const _at2 = _rest.indexOf(".");
if (_at2 <= 0) return undefined;
const consumer = _rest.slice(0, _at2);
_rest = _rest.slice(_at2 + 1);
if (_rest === "") return undefined;
const provision = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, consumer, provision };
}
@@ -61,24 +61,24 @@ export function provisionsByNodeConsumerProvisionLocalKey(node: string, consumer
}
/** The parts of a key of the form "<node>.<consumer>.<provision>.<local>", or undefined for a key of another form. */
export function parseProvisionsByNodeConsumerProvisionLocalKey(key: string): { node: string; consumer: string; provision: string; local: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const node = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
const at2 = rest.indexOf(".");
if (at2 <= 0) return undefined;
const consumer = rest.slice(0, at2);
rest = rest.slice(at2 + 1);
const at4 = rest.indexOf(".");
if (at4 <= 0) return undefined;
const provision = rest.slice(0, at4);
rest = rest.slice(at4 + 1);
if (rest === "") return undefined;
const local = rest;
rest = "";
if (rest !== "") return undefined;
export function parseProvisionsByNodeConsumerProvisionLocalKey(_key: string): { node: string; consumer: string; provision: string; local: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const node = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
const _at2 = _rest.indexOf(".");
if (_at2 <= 0) return undefined;
const consumer = _rest.slice(0, _at2);
_rest = _rest.slice(_at2 + 1);
const _at4 = _rest.indexOf(".");
if (_at4 <= 0) return undefined;
const provision = _rest.slice(0, _at4);
_rest = _rest.slice(_at4 + 1);
if (_rest === "") return undefined;
const local = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, consumer, provision, local };
}
+40 -40
View File
@@ -43,20 +43,20 @@ export function resolvedByNodeModuleKeyKey(node: string, module: string, key: st
}
/** The parts of a key of the form "<node>.<module>.<key>", or undefined for a key of another form. */
export function parseResolvedByNodeModuleKeyKey(key: string): { node: string; module: string; key: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const node = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
const at2 = rest.indexOf(".");
if (at2 <= 0) return undefined;
const module = rest.slice(0, at2);
rest = rest.slice(at2 + 1);
if (rest === "") return undefined;
const key = rest;
rest = "";
if (rest !== "") return undefined;
export function parseResolvedByNodeModuleKeyKey(_key: string): { node: string; module: string; key: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const node = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
const _at2 = _rest.indexOf(".");
if (_at2 <= 0) return undefined;
const module = _rest.slice(0, _at2);
_rest = _rest.slice(_at2 + 1);
if (_rest === "") return undefined;
const key = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, module, key };
}
@@ -66,32 +66,32 @@ export function keptByOwnerRepositoryNumberNodeModuleKeyKey(owner: string, repos
}
/** The parts of a key of the form "<owner>.<repository>.<number>.<node>.<module>.<key>", or undefined for a key of another form. */
export function parseKeptByOwnerRepositoryNumberNodeModuleKeyKey(key: string): { owner: string; repository: string; number: string; node: string; module: string; key: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const owner = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
const at2 = rest.indexOf(".");
if (at2 <= 0) return undefined;
const repository = rest.slice(0, at2);
rest = rest.slice(at2 + 1);
const at4 = rest.indexOf(".");
if (at4 <= 0) return undefined;
const number = rest.slice(0, at4);
rest = rest.slice(at4 + 1);
const at6 = rest.indexOf(".");
if (at6 <= 0) return undefined;
const node = rest.slice(0, at6);
rest = rest.slice(at6 + 1);
const at8 = rest.indexOf(".");
if (at8 <= 0) return undefined;
const module = rest.slice(0, at8);
rest = rest.slice(at8 + 1);
if (rest === "") return undefined;
const key = rest;
rest = "";
if (rest !== "") return undefined;
export function parseKeptByOwnerRepositoryNumberNodeModuleKeyKey(_key: string): { owner: string; repository: string; number: string; node: string; module: string; key: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const owner = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
const _at2 = _rest.indexOf(".");
if (_at2 <= 0) return undefined;
const repository = _rest.slice(0, _at2);
_rest = _rest.slice(_at2 + 1);
const _at4 = _rest.indexOf(".");
if (_at4 <= 0) return undefined;
const number = _rest.slice(0, _at4);
_rest = _rest.slice(_at4 + 1);
const _at6 = _rest.indexOf(".");
if (_at6 <= 0) return undefined;
const node = _rest.slice(0, _at6);
_rest = _rest.slice(_at6 + 1);
const _at8 = _rest.indexOf(".");
if (_at8 <= 0) return undefined;
const module = _rest.slice(0, _at8);
_rest = _rest.slice(_at8 + 1);
if (_rest === "") return undefined;
const key = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { owner, repository, number, node, module, key };
}
+66 -66
View File
@@ -60,16 +60,16 @@ export function haveByNodeModuleKey(node: string, module: string): string {
}
/** The parts of a key of the form "<node>.<module>", or undefined for a key of another form. */
export function parseHaveByNodeModuleKey(key: string): { node: string; module: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const node = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
if (rest === "") return undefined;
const module = rest;
rest = "";
if (rest !== "") return undefined;
export function parseHaveByNodeModuleKey(_key: string): { node: string; module: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const node = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const module = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, module };
}
@@ -79,13 +79,13 @@ export function haveByNodeNodeKey(node: string): string {
}
/** The parts of a key of the form "<node>.node", or undefined for a key of another form. */
export function parseHaveByNodeNodeKey(key: string): { node: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".node");
if (at0 <= 0) return undefined;
const node = rest.slice(0, at0);
rest = rest.slice(at0 + 5);
if (rest !== "") return undefined;
export function parseHaveByNodeNodeKey(_key: string): { node: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".node");
if (_at0 <= 0) return undefined;
const node = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 5);
if (_rest !== "") return undefined;
return { node };
}
@@ -95,20 +95,20 @@ export function composedByNodeModuleFingerprintKey(node: string, module: string,
}
/** The parts of a key of the form "<node>.<module>.<fingerprint>", or undefined for a key of another form. */
export function parseComposedByNodeModuleFingerprintKey(key: string): { node: string; module: string; fingerprint: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const node = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
const at2 = rest.indexOf(".");
if (at2 <= 0) return undefined;
const module = rest.slice(0, at2);
rest = rest.slice(at2 + 1);
if (rest === "") return undefined;
const fingerprint = rest;
rest = "";
if (rest !== "") return undefined;
export function parseComposedByNodeModuleFingerprintKey(_key: string): { node: string; module: string; fingerprint: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const node = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
const _at2 = _rest.indexOf(".");
if (_at2 <= 0) return undefined;
const module = _rest.slice(0, _at2);
_rest = _rest.slice(_at2 + 1);
if (_rest === "") return undefined;
const fingerprint = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, module, fingerprint };
}
@@ -118,13 +118,13 @@ export function composedByNodeNodeKey(node: string): string {
}
/** The parts of a key of the form "<node>.node", or undefined for a key of another form. */
export function parseComposedByNodeNodeKey(key: string): { node: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".node");
if (at0 <= 0) return undefined;
const node = rest.slice(0, at0);
rest = rest.slice(at0 + 5);
if (rest !== "") return undefined;
export function parseComposedByNodeNodeKey(_key: string): { node: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".node");
if (_at0 <= 0) return undefined;
const node = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 5);
if (_rest !== "") return undefined;
return { node };
}
@@ -134,16 +134,16 @@ export function dataByNodeModuleKey(node: string, module: string): string {
}
/** The parts of a key of the form "<node>.<module>", or undefined for a key of another form. */
export function parseDataByNodeModuleKey(key: string): { node: string; module: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const node = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
if (rest === "") return undefined;
const module = rest;
rest = "";
if (rest !== "") return undefined;
export function parseDataByNodeModuleKey(_key: string): { node: string; module: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const node = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const module = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, module };
}
@@ -153,12 +153,12 @@ export function packagesByNodeKey(node: string): string {
}
/** The parts of a key of the form "<node>", or undefined for a key of another form. */
export function parsePackagesByNodeKey(key: string): { node: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const node = rest;
rest = "";
if (rest !== "") return undefined;
export function parsePackagesByNodeKey(_key: string): { node: string } | undefined {
let _rest = _key;
if (_rest === "") return undefined;
const node = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node };
}
@@ -168,12 +168,12 @@ export function healthByNodeKey(node: string): string {
}
/** The parts of a key of the form "<node>", or undefined for a key of another form. */
export function parseHealthByNodeKey(key: string): { node: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const node = rest;
rest = "";
if (rest !== "") return undefined;
export function parseHealthByNodeKey(_key: string): { node: string } | undefined {
let _rest = _key;
if (_rest === "") return undefined;
const node = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node };
}
@@ -183,12 +183,12 @@ export function findingsByKeyKey(key: string): string {
}
/** The parts of a key of the form "<key>", or undefined for a key of another form. */
export function parseFindingsByKeyKey(key: string): { key: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const key = rest;
rest = "";
if (rest !== "") return undefined;
export function parseFindingsByKeyKey(_key: string): { key: string } | undefined {
let _rest = _key;
if (_rest === "") return undefined;
const key = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { key };
}