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:
@@ -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 };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user