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 432df75997
commit df6d8e1c3b
8 changed files with 298 additions and 298 deletions
@@ -52,20 +52,20 @@ export function holdsBySeatNameDigestKey(seat: string, name: string, digest: str
}
/** The parts of a key of the form "<seat>.<name>.<digest>", or undefined for a key of another form. */
export function parseHoldsBySeatNameDigestKey(key: string): { seat: string; name: string; digest: 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);
const at2 = rest.indexOf(".");
if (at2 <= 0) return undefined;
const name = rest.slice(0, at2);
rest = rest.slice(at2 + 1);
if (rest === "") return undefined;
const digest = rest;
rest = "";
if (rest !== "") return undefined;
export function parseHoldsBySeatNameDigestKey(_key: string): { seat: string; name: string; digest: 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);
const _at2 = _rest.indexOf(".");
if (_at2 <= 0) return undefined;
const name = _rest.slice(0, _at2);
_rest = _rest.slice(_at2 + 1);
if (_rest === "") return undefined;
const digest = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { seat, name, digest };
}
@@ -75,12 +75,12 @@ export function windowsByCallerKey(caller: string): string {
}
/** The parts of a key of the form "<caller>", or undefined for a key of another form. */
export function parseWindowsByCallerKey(key: string): { caller: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const caller = rest;
rest = "";
if (rest !== "") return undefined;
export function parseWindowsByCallerKey(_key: string): { caller: string } | undefined {
let _rest = _key;
if (_rest === "") return undefined;
const caller = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { caller };
}
+51 -51
View File
@@ -45,12 +45,12 @@ export function manifestsByDigestKey(digest: string): string {
}
/** The parts of a key of the form "<digest>", or undefined for a key of another form. */
export function parseManifestsByDigestKey(key: string): { digest: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const digest = rest;
rest = "";
if (rest !== "") return undefined;
export function parseManifestsByDigestKey(_key: string): { digest: string } | undefined {
let _rest = _key;
if (_rest === "") return undefined;
const digest = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { digest };
}
@@ -60,12 +60,12 @@ export function modulesByModuleKey(module: string): string {
}
/** The parts of a key of the form "<module>", or undefined for a key of another form. */
export function parseModulesByModuleKey(key: string): { module: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const module = rest;
rest = "";
if (rest !== "") return undefined;
export function parseModulesByModuleKey(_key: string): { module: string } | undefined {
let _rest = _key;
if (_rest === "") return undefined;
const module = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { module };
}
@@ -75,12 +75,12 @@ export function candidatesByGroupKey(group: string): string {
}
/** The parts of a key of the form "<group>", or undefined for a key of another form. */
export function parseCandidatesByGroupKey(key: string): { group: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const group = rest;
rest = "";
if (rest !== "") return undefined;
export function parseCandidatesByGroupKey(_key: string): { group: string } | undefined {
let _rest = _key;
if (_rest === "") return undefined;
const group = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { group };
}
@@ -90,12 +90,12 @@ export function verdictsByDigestKey(digest: string): string {
}
/** The parts of a key of the form "<digest>", or undefined for a key of another form. */
export function parseVerdictsByDigestKey(key: string): { digest: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const digest = rest;
rest = "";
if (rest !== "") return undefined;
export function parseVerdictsByDigestKey(_key: string): { digest: string } | undefined {
let _rest = _key;
if (_rest === "") return undefined;
const digest = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { digest };
}
@@ -105,11 +105,11 @@ export function predefinedByListKey(): string {
}
/** The parts of a key of the form "list", or undefined for a key of another form. */
export function parsePredefinedByListKey(key: string): { } | undefined {
let rest = key;
if (!rest.startsWith("list")) return undefined;
rest = rest.slice(4);
if (rest !== "") return undefined;
export function parsePredefinedByListKey(_key: string): { } | undefined {
let _rest = _key;
if (!_rest.startsWith("list")) return undefined;
_rest = _rest.slice(4);
if (_rest !== "") return undefined;
return { };
}
@@ -119,12 +119,12 @@ export function configCandidatesByPullKey(pull: string): string {
}
/** The parts of a key of the form "<pull>", or undefined for a key of another form. */
export function parseConfigCandidatesByPullKey(key: string): { pull: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const pull = rest;
rest = "";
if (rest !== "") return undefined;
export function parseConfigCandidatesByPullKey(_key: string): { pull: string } | undefined {
let _rest = _key;
if (_rest === "") return undefined;
const pull = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { pull };
}
@@ -134,12 +134,12 @@ export function packagesByModuleKey(module: string): string {
}
/** The parts of a key of the form "<module>", or undefined for a key of another form. */
export function parsePackagesByModuleKey(key: string): { module: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const module = rest;
rest = "";
if (rest !== "") return undefined;
export function parsePackagesByModuleKey(_key: string): { module: string } | undefined {
let _rest = _key;
if (_rest === "") return undefined;
const module = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { module };
}
@@ -149,16 +149,16 @@ export function packagesByPackageSeriesKey(packagePart: string, series: string):
}
/** The parts of a key of the form "<package>.<series>", or undefined for a key of another form. */
export function parsePackagesByPackageSeriesKey(key: string): { packagePart: string; series: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const packagePart = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
if (rest === "") return undefined;
const series = rest;
rest = "";
if (rest !== "") return undefined;
export function parsePackagesByPackageSeriesKey(_key: string): { packagePart: string; series: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const packagePart = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const series = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { packagePart, series };
}
+47 -47
View File
@@ -35,11 +35,11 @@ export function sourceByMainKey(): string {
}
/** The parts of a key of the form "main", or undefined for a key of another form. */
export function parseSourceByMainKey(key: string): { } | undefined {
let rest = key;
if (!rest.startsWith("main")) return undefined;
rest = rest.slice(4);
if (rest !== "") return undefined;
export function parseSourceByMainKey(_key: string): { } | undefined {
let _rest = _key;
if (!_rest.startsWith("main")) return undefined;
_rest = _rest.slice(4);
if (_rest !== "") return undefined;
return { };
}
@@ -49,12 +49,12 @@ export function mergesByGroupKey(group: string): string {
}
/** The parts of a key of the form "<group>", or undefined for a key of another form. */
export function parseMergesByGroupKey(key: string): { group: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const group = rest;
rest = "";
if (rest !== "") return undefined;
export function parseMergesByGroupKey(_key: string): { group: string } | undefined {
let _rest = _key;
if (_rest === "") return undefined;
const group = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { group };
}
@@ -64,18 +64,18 @@ export function asksByMergeGroupHeadsKey(group: string, heads: string): string {
}
/** The parts of a key of the form "merge.<group>.<heads>", or undefined for a key of another form. */
export function parseAsksByMergeGroupHeadsKey(key: string): { group: string; heads: string } | undefined {
let rest = key;
if (!rest.startsWith("merge.")) return undefined;
rest = rest.slice(6);
const at1 = rest.indexOf(".");
if (at1 <= 0) return undefined;
const group = rest.slice(0, at1);
rest = rest.slice(at1 + 1);
if (rest === "") return undefined;
const heads = rest;
rest = "";
if (rest !== "") return undefined;
export function parseAsksByMergeGroupHeadsKey(_key: string): { group: string; heads: string } | undefined {
let _rest = _key;
if (!_rest.startsWith("merge.")) return undefined;
_rest = _rest.slice(6);
const _at1 = _rest.indexOf(".");
if (_at1 <= 0) return undefined;
const group = _rest.slice(0, _at1);
_rest = _rest.slice(_at1 + 1);
if (_rest === "") return undefined;
const heads = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { group, heads };
}
@@ -85,24 +85,24 @@ export function owedByRepositoryNumberHeadActKey(repository: string, number: str
}
/** The parts of a key of the form "<repository>.<number>.<head>.<act>", or undefined for a key of another form. */
export function parseOwedByRepositoryNumberHeadActKey(key: string): { repository: string; number: string; head: string; act: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const repository = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
const at2 = rest.indexOf(".");
if (at2 <= 0) return undefined;
const number = rest.slice(0, at2);
rest = rest.slice(at2 + 1);
const at4 = rest.indexOf(".");
if (at4 <= 0) return undefined;
const head = rest.slice(0, at4);
rest = rest.slice(at4 + 1);
if (rest === "") return undefined;
const act = rest;
rest = "";
if (rest !== "") return undefined;
export function parseOwedByRepositoryNumberHeadActKey(_key: string): { repository: string; number: string; head: string; act: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const repository = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
const _at2 = _rest.indexOf(".");
if (_at2 <= 0) return undefined;
const number = _rest.slice(0, _at2);
_rest = _rest.slice(_at2 + 1);
const _at4 = _rest.indexOf(".");
if (_at4 <= 0) return undefined;
const head = _rest.slice(0, _at4);
_rest = _rest.slice(_at4 + 1);
if (_rest === "") return undefined;
const act = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { repository, number, head, act };
}
@@ -112,12 +112,12 @@ export function turnsByRepositoryKey(repository: string): string {
}
/** The parts of a key of the form "<repository>", or undefined for a key of another form. */
export function parseTurnsByRepositoryKey(key: string): { repository: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const repository = rest;
rest = "";
if (rest !== "") return undefined;
export function parseTurnsByRepositoryKey(_key: string): { repository: string } | undefined {
let _rest = _key;
if (_rest === "") return undefined;
const repository = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { repository };
}
@@ -41,16 +41,16 @@ export function verdictsByGroupHeadsKey(group: string, heads: string): string {
}
/** The parts of a key of the form "<group>.<heads>", or undefined for a key of another form. */
export function parseVerdictsByGroupHeadsKey(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 parseVerdictsByGroupHeadsKey(_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 };
}
@@ -60,16 +60,16 @@ export function keptByLevelDigestKey(level: string, digest: string): string {
}
/** The parts of a key of the form "<level>.<digest>", or undefined for a key of another form. */
export function parseKeptByLevelDigestKey(key: string): { level: string; digest: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const level = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
if (rest === "") return undefined;
const digest = rest;
rest = "";
if (rest !== "") return undefined;
export function parseKeptByLevelDigestKey(_key: string): { level: string; digest: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const level = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const digest = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { level, digest };
}
@@ -79,24 +79,24 @@ export function owedByRepositoryNumberHeadActKey(repository: string, number: str
}
/** The parts of a key of the form "<repository>.<number>.<head>.<act>", or undefined for a key of another form. */
export function parseOwedByRepositoryNumberHeadActKey(key: string): { repository: string; number: string; head: string; act: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const repository = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
const at2 = rest.indexOf(".");
if (at2 <= 0) return undefined;
const number = rest.slice(0, at2);
rest = rest.slice(at2 + 1);
const at4 = rest.indexOf(".");
if (at4 <= 0) return undefined;
const head = rest.slice(0, at4);
rest = rest.slice(at4 + 1);
if (rest === "") return undefined;
const act = rest;
rest = "";
if (rest !== "") return undefined;
export function parseOwedByRepositoryNumberHeadActKey(_key: string): { repository: string; number: string; head: string; act: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const repository = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
const _at2 = _rest.indexOf(".");
if (_at2 <= 0) return undefined;
const number = _rest.slice(0, _at2);
_rest = _rest.slice(_at2 + 1);
const _at4 = _rest.indexOf(".");
if (_at4 <= 0) return undefined;
const head = _rest.slice(0, _at4);
_rest = _rest.slice(_at4 + 1);
if (_rest === "") return undefined;
const act = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { repository, number, head, act };
}
@@ -106,20 +106,20 @@ export function previewsByRepositoryHeadTrunkKey(repository: string, head: strin
}
/** The parts of a key of the form "<repository>.<head>.<trunk>", or undefined for a key of another form. */
export function parsePreviewsByRepositoryHeadTrunkKey(key: string): { repository: string; head: string; trunk: string } | undefined {
let rest = key;
const at0 = rest.indexOf(".");
if (at0 <= 0) return undefined;
const repository = rest.slice(0, at0);
rest = rest.slice(at0 + 1);
const at2 = rest.indexOf(".");
if (at2 <= 0) return undefined;
const head = rest.slice(0, at2);
rest = rest.slice(at2 + 1);
if (rest === "") return undefined;
const trunk = rest;
rest = "";
if (rest !== "") return undefined;
export function parsePreviewsByRepositoryHeadTrunkKey(_key: string): { repository: string; head: string; trunk: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const repository = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
const _at2 = _rest.indexOf(".");
if (_at2 <= 0) return undefined;
const head = _rest.slice(0, _at2);
_rest = _rest.slice(_at2 + 1);
if (_rest === "") return undefined;
const trunk = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { repository, head, trunk };
}
+36 -36
View File
@@ -36,16 +36,16 @@ export function stepsByNodeIDKey(node: string, id: string): string {
}
/** The parts of a key of the form "<node>.<id>", or undefined for a key of another form. */
export function parseStepsByNodeIDKey(key: string): { node: string; id: 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 id = rest;
rest = "";
if (rest !== "") return undefined;
export function parseStepsByNodeIDKey(_key: string): { node: string; id: 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 id = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, id };
}
@@ -55,14 +55,14 @@ export function pausesByPausedNodeKey(node: string): string {
}
/** The parts of a key of the form "paused.<node>", or undefined for a key of another form. */
export function parsePausesByPausedNodeKey(key: string): { node: string } | undefined {
let rest = key;
if (!rest.startsWith("paused.")) return undefined;
rest = rest.slice(7);
if (rest === "") return undefined;
const node = rest;
rest = "";
if (rest !== "") return undefined;
export function parsePausesByPausedNodeKey(_key: string): { node: string } | undefined {
let _rest = _key;
if (!_rest.startsWith("paused.")) return undefined;
_rest = _rest.slice(7);
if (_rest === "") return undefined;
const node = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node };
}
@@ -72,14 +72,14 @@ export function pausesByCapacityNodeKey(node: string): string {
}
/** The parts of a key of the form "capacity.<node>", or undefined for a key of another form. */
export function parsePausesByCapacityNodeKey(key: string): { node: string } | undefined {
let rest = key;
if (!rest.startsWith("capacity.")) return undefined;
rest = rest.slice(9);
if (rest === "") return undefined;
const node = rest;
rest = "";
if (rest !== "") return undefined;
export function parsePausesByCapacityNodeKey(_key: string): { node: string } | undefined {
let _rest = _key;
if (!_rest.startsWith("capacity.")) return undefined;
_rest = _rest.slice(9);
if (_rest === "") return undefined;
const node = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node };
}
@@ -89,16 +89,16 @@ export function toolchainsByNodeLanguageKey(node: string, language: string): str
}
/** The parts of a key of the form "<node>.<language>", or undefined for a key of another form. */
export function parseToolchainsByNodeLanguageKey(key: string): { node: string; language: 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 language = rest;
rest = "";
if (rest !== "") return undefined;
export function parseToolchainsByNodeLanguageKey(_key: string): { node: string; language: 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 language = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, language };
}
+36 -36
View File
@@ -36,16 +36,16 @@ export function stepsByNodeIDKey(node: string, id: string): string {
}
/** The parts of a key of the form "<node>.<id>", or undefined for a key of another form. */
export function parseStepsByNodeIDKey(key: string): { node: string; id: 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 id = rest;
rest = "";
if (rest !== "") return undefined;
export function parseStepsByNodeIDKey(_key: string): { node: string; id: 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 id = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, id };
}
@@ -55,14 +55,14 @@ export function pausesByPausedNodeKey(node: string): string {
}
/** The parts of a key of the form "paused.<node>", or undefined for a key of another form. */
export function parsePausesByPausedNodeKey(key: string): { node: string } | undefined {
let rest = key;
if (!rest.startsWith("paused.")) return undefined;
rest = rest.slice(7);
if (rest === "") return undefined;
const node = rest;
rest = "";
if (rest !== "") return undefined;
export function parsePausesByPausedNodeKey(_key: string): { node: string } | undefined {
let _rest = _key;
if (!_rest.startsWith("paused.")) return undefined;
_rest = _rest.slice(7);
if (_rest === "") return undefined;
const node = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node };
}
@@ -72,14 +72,14 @@ export function pausesByCapacityNodeKey(node: string): string {
}
/** The parts of a key of the form "capacity.<node>", or undefined for a key of another form. */
export function parsePausesByCapacityNodeKey(key: string): { node: string } | undefined {
let rest = key;
if (!rest.startsWith("capacity.")) return undefined;
rest = rest.slice(9);
if (rest === "") return undefined;
const node = rest;
rest = "";
if (rest !== "") return undefined;
export function parsePausesByCapacityNodeKey(_key: string): { node: string } | undefined {
let _rest = _key;
if (!_rest.startsWith("capacity.")) return undefined;
_rest = _rest.slice(9);
if (_rest === "") return undefined;
const node = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node };
}
@@ -89,16 +89,16 @@ export function toolchainsByNodeLanguageKey(node: string, language: string): str
}
/** The parts of a key of the form "<node>.<language>", or undefined for a key of another form. */
export function parseToolchainsByNodeLanguageKey(key: string): { node: string; language: 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 language = rest;
rest = "";
if (rest !== "") return undefined;
export function parseToolchainsByNodeLanguageKey(_key: string): { node: string; language: 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 language = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, language };
}
+36 -36
View File
@@ -36,16 +36,16 @@ export function stepsByNodeIDKey(node: string, id: string): string {
}
/** The parts of a key of the form "<node>.<id>", or undefined for a key of another form. */
export function parseStepsByNodeIDKey(key: string): { node: string; id: 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 id = rest;
rest = "";
if (rest !== "") return undefined;
export function parseStepsByNodeIDKey(_key: string): { node: string; id: 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 id = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, id };
}
@@ -55,14 +55,14 @@ export function pausesByPausedNodeKey(node: string): string {
}
/** The parts of a key of the form "paused.<node>", or undefined for a key of another form. */
export function parsePausesByPausedNodeKey(key: string): { node: string } | undefined {
let rest = key;
if (!rest.startsWith("paused.")) return undefined;
rest = rest.slice(7);
if (rest === "") return undefined;
const node = rest;
rest = "";
if (rest !== "") return undefined;
export function parsePausesByPausedNodeKey(_key: string): { node: string } | undefined {
let _rest = _key;
if (!_rest.startsWith("paused.")) return undefined;
_rest = _rest.slice(7);
if (_rest === "") return undefined;
const node = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node };
}
@@ -72,14 +72,14 @@ export function pausesByCapacityNodeKey(node: string): string {
}
/** The parts of a key of the form "capacity.<node>", or undefined for a key of another form. */
export function parsePausesByCapacityNodeKey(key: string): { node: string } | undefined {
let rest = key;
if (!rest.startsWith("capacity.")) return undefined;
rest = rest.slice(9);
if (rest === "") return undefined;
const node = rest;
rest = "";
if (rest !== "") return undefined;
export function parsePausesByCapacityNodeKey(_key: string): { node: string } | undefined {
let _rest = _key;
if (!_rest.startsWith("capacity.")) return undefined;
_rest = _rest.slice(9);
if (_rest === "") return undefined;
const node = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node };
}
@@ -89,16 +89,16 @@ export function toolchainsByNodeLanguageKey(node: string, language: string): str
}
/** The parts of a key of the form "<node>.<language>", or undefined for a key of another form. */
export function parseToolchainsByNodeLanguageKey(key: string): { node: string; language: 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 language = rest;
rest = "";
if (rest !== "") return undefined;
export function parseToolchainsByNodeLanguageKey(_key: string): { node: string; language: 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 language = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, language };
}
@@ -50,20 +50,20 @@ export function holdsBySeatNameDigestKey(seat: string, name: string, digest: str
}
/** The parts of a key of the form "<seat>.<name>.<digest>", or undefined for a key of another form. */
export function parseHoldsBySeatNameDigestKey(key: string): { seat: string; name: string; digest: 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);
const at2 = rest.indexOf(".");
if (at2 <= 0) return undefined;
const name = rest.slice(0, at2);
rest = rest.slice(at2 + 1);
if (rest === "") return undefined;
const digest = rest;
rest = "";
if (rest !== "") return undefined;
export function parseHoldsBySeatNameDigestKey(_key: string): { seat: string; name: string; digest: 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);
const _at2 = _rest.indexOf(".");
if (_at2 <= 0) return undefined;
const name = _rest.slice(0, _at2);
_rest = _rest.slice(_at2 + 1);
if (_rest === "") return undefined;
const digest = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { seat, name, digest };
}
@@ -73,12 +73,12 @@ export function windowsByCallerKey(caller: string): string {
}
/** The parts of a key of the form "<caller>", or undefined for a key of another form. */
export function parseWindowsByCallerKey(key: string): { caller: string } | undefined {
let rest = key;
if (rest === "") return undefined;
const caller = rest;
rest = "";
if (rest !== "") return undefined;
export function parseWindowsByCallerKey(_key: string): { caller: string } | undefined {
let _rest = _key;
if (_rest === "") return undefined;
const caller = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { caller };
}