MCPcopy Create free account
hub / github.com/cloudflare/computer / assertLocalName

Function assertLocalName

packages/computer/src/artifacts/scope.ts:38–49  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

36
37/** Validate a local repo name and return it, or throw. */
38export function assertLocalName(name: string): string {
39 if (name.length === 0) {
40 throw new InvalidRepoNameError(name, "must not be empty");
41 }
42 if (!VALID_REPO_NAME.test(name)) {
43 throw new InvalidRepoNameError(name, VALID_REPO_NAME_DESCRIPTION);
44 }
45 if (name.includes(SCOPE_SEPARATOR)) {
46 throw new InvalidRepoNameError(name, `must not contain '${SCOPE_SEPARATOR}'`);
47 }
48 return name;
49}
50
51/** Build the fully-qualified name the binding stores. */
52export function scopedName(sessionId: string, name: string): string {

Callers 2

scope.test.tsFile · 0.85
scopedNameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected